module Network.AWS.Greengrass.GetGroup
(
getGroup
, GetGroup
, ggGroupId
, getGroupResponse
, GetGroupResponse
, ggrsLatestVersionARN
, ggrsARN
, ggrsName
, ggrsCreationTimestamp
, ggrsId
, ggrsLatestVersion
, ggrsLastUpdatedTimestamp
, ggrsResponseStatus
) where
import Network.AWS.Greengrass.Types
import Network.AWS.Greengrass.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetGroup = GetGroup'
{ _ggGroupId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getGroup
:: Text
-> GetGroup
getGroup pGroupId_ = GetGroup' {_ggGroupId = pGroupId_}
ggGroupId :: Lens' GetGroup Text
ggGroupId = lens _ggGroupId (\ s a -> s{_ggGroupId = a});
instance AWSRequest GetGroup where
type Rs GetGroup = GetGroupResponse
request = get greengrass
response
= receiveJSON
(\ s h x ->
GetGroupResponse' <$>
(x .?> "LatestVersionArn") <*> (x .?> "Arn") <*>
(x .?> "Name")
<*> (x .?> "CreationTimestamp")
<*> (x .?> "Id")
<*> (x .?> "LatestVersion")
<*> (x .?> "LastUpdatedTimestamp")
<*> (pure (fromEnum s)))
instance Hashable GetGroup where
instance NFData GetGroup where
instance ToHeaders GetGroup where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetGroup where
toPath GetGroup'{..}
= mconcat ["/greengrass/groups/", toBS _ggGroupId]
instance ToQuery GetGroup where
toQuery = const mempty
data GetGroupResponse = GetGroupResponse'
{ _ggrsLatestVersionARN :: !(Maybe Text)
, _ggrsARN :: !(Maybe Text)
, _ggrsName :: !(Maybe Text)
, _ggrsCreationTimestamp :: !(Maybe Text)
, _ggrsId :: !(Maybe Text)
, _ggrsLatestVersion :: !(Maybe Text)
, _ggrsLastUpdatedTimestamp :: !(Maybe Text)
, _ggrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getGroupResponse
:: Int
-> GetGroupResponse
getGroupResponse pResponseStatus_ =
GetGroupResponse'
{ _ggrsLatestVersionARN = Nothing
, _ggrsARN = Nothing
, _ggrsName = Nothing
, _ggrsCreationTimestamp = Nothing
, _ggrsId = Nothing
, _ggrsLatestVersion = Nothing
, _ggrsLastUpdatedTimestamp = Nothing
, _ggrsResponseStatus = pResponseStatus_
}
ggrsLatestVersionARN :: Lens' GetGroupResponse (Maybe Text)
ggrsLatestVersionARN = lens _ggrsLatestVersionARN (\ s a -> s{_ggrsLatestVersionARN = a});
ggrsARN :: Lens' GetGroupResponse (Maybe Text)
ggrsARN = lens _ggrsARN (\ s a -> s{_ggrsARN = a});
ggrsName :: Lens' GetGroupResponse (Maybe Text)
ggrsName = lens _ggrsName (\ s a -> s{_ggrsName = a});
ggrsCreationTimestamp :: Lens' GetGroupResponse (Maybe Text)
ggrsCreationTimestamp = lens _ggrsCreationTimestamp (\ s a -> s{_ggrsCreationTimestamp = a});
ggrsId :: Lens' GetGroupResponse (Maybe Text)
ggrsId = lens _ggrsId (\ s a -> s{_ggrsId = a});
ggrsLatestVersion :: Lens' GetGroupResponse (Maybe Text)
ggrsLatestVersion = lens _ggrsLatestVersion (\ s a -> s{_ggrsLatestVersion = a});
ggrsLastUpdatedTimestamp :: Lens' GetGroupResponse (Maybe Text)
ggrsLastUpdatedTimestamp = lens _ggrsLastUpdatedTimestamp (\ s a -> s{_ggrsLastUpdatedTimestamp = a});
ggrsResponseStatus :: Lens' GetGroupResponse Int
ggrsResponseStatus = lens _ggrsResponseStatus (\ s a -> s{_ggrsResponseStatus = a});
instance NFData GetGroupResponse where