{-# 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.Greengrass.GetDeviceDefinitionVersion
(
getDeviceDefinitionVersion
, GetDeviceDefinitionVersion
, gddvDeviceDefinitionVersionId
, gddvDeviceDefinitionId
, getDeviceDefinitionVersionResponse
, GetDeviceDefinitionVersionResponse
, gddvrsDefinition
, gddvrsARN
, gddvrsCreationTimestamp
, gddvrsVersion
, gddvrsId
, gddvrsResponseStatus
) 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
data GetDeviceDefinitionVersion = GetDeviceDefinitionVersion'
{ _gddvDeviceDefinitionVersionId :: !Text
, _gddvDeviceDefinitionId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDeviceDefinitionVersion
:: Text
-> Text
-> GetDeviceDefinitionVersion
getDeviceDefinitionVersion pDeviceDefinitionVersionId_ pDeviceDefinitionId_ =
GetDeviceDefinitionVersion'
{ _gddvDeviceDefinitionVersionId = pDeviceDefinitionVersionId_
, _gddvDeviceDefinitionId = pDeviceDefinitionId_
}
gddvDeviceDefinitionVersionId :: Lens' GetDeviceDefinitionVersion Text
gddvDeviceDefinitionVersionId = lens _gddvDeviceDefinitionVersionId (\ s a -> s{_gddvDeviceDefinitionVersionId = a})
gddvDeviceDefinitionId :: Lens' GetDeviceDefinitionVersion Text
gddvDeviceDefinitionId = lens _gddvDeviceDefinitionId (\ s a -> s{_gddvDeviceDefinitionId = a})
instance AWSRequest GetDeviceDefinitionVersion where
type Rs GetDeviceDefinitionVersion =
GetDeviceDefinitionVersionResponse
request = get greengrass
response
= receiveJSON
(\ s h x ->
GetDeviceDefinitionVersionResponse' <$>
(x .?> "Definition") <*> (x .?> "Arn") <*>
(x .?> "CreationTimestamp")
<*> (x .?> "Version")
<*> (x .?> "Id")
<*> (pure (fromEnum s)))
instance Hashable GetDeviceDefinitionVersion where
instance NFData GetDeviceDefinitionVersion where
instance ToHeaders GetDeviceDefinitionVersion where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetDeviceDefinitionVersion where
toPath GetDeviceDefinitionVersion'{..}
= mconcat
["/greengrass/definition/devices/",
toBS _gddvDeviceDefinitionId, "/versions/",
toBS _gddvDeviceDefinitionVersionId]
instance ToQuery GetDeviceDefinitionVersion where
toQuery = const mempty
data GetDeviceDefinitionVersionResponse = GetDeviceDefinitionVersionResponse'
{ _gddvrsDefinition :: !(Maybe DeviceDefinitionVersion)
, _gddvrsARN :: !(Maybe Text)
, _gddvrsCreationTimestamp :: !(Maybe Text)
, _gddvrsVersion :: !(Maybe Text)
, _gddvrsId :: !(Maybe Text)
, _gddvrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDeviceDefinitionVersionResponse
:: Int
-> GetDeviceDefinitionVersionResponse
getDeviceDefinitionVersionResponse pResponseStatus_ =
GetDeviceDefinitionVersionResponse'
{ _gddvrsDefinition = Nothing
, _gddvrsARN = Nothing
, _gddvrsCreationTimestamp = Nothing
, _gddvrsVersion = Nothing
, _gddvrsId = Nothing
, _gddvrsResponseStatus = pResponseStatus_
}
gddvrsDefinition :: Lens' GetDeviceDefinitionVersionResponse (Maybe DeviceDefinitionVersion)
gddvrsDefinition = lens _gddvrsDefinition (\ s a -> s{_gddvrsDefinition = a})
gddvrsARN :: Lens' GetDeviceDefinitionVersionResponse (Maybe Text)
gddvrsARN = lens _gddvrsARN (\ s a -> s{_gddvrsARN = a})
gddvrsCreationTimestamp :: Lens' GetDeviceDefinitionVersionResponse (Maybe Text)
gddvrsCreationTimestamp = lens _gddvrsCreationTimestamp (\ s a -> s{_gddvrsCreationTimestamp = a})
gddvrsVersion :: Lens' GetDeviceDefinitionVersionResponse (Maybe Text)
gddvrsVersion = lens _gddvrsVersion (\ s a -> s{_gddvrsVersion = a})
gddvrsId :: Lens' GetDeviceDefinitionVersionResponse (Maybe Text)
gddvrsId = lens _gddvrsId (\ s a -> s{_gddvrsId = a})
gddvrsResponseStatus :: Lens' GetDeviceDefinitionVersionResponse Int
gddvrsResponseStatus = lens _gddvrsResponseStatus (\ s a -> s{_gddvrsResponseStatus = a})
instance NFData GetDeviceDefinitionVersionResponse
where