{-# 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.GetFunctionDefinitionVersion
(
getFunctionDefinitionVersion
, GetFunctionDefinitionVersion
, gfdvFunctionDefinitionId
, gfdvFunctionDefinitionVersionId
, getFunctionDefinitionVersionResponse
, GetFunctionDefinitionVersionResponse
, gfdvrsDefinition
, gfdvrsARN
, gfdvrsCreationTimestamp
, gfdvrsVersion
, gfdvrsId
, gfdvrsResponseStatus
) 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 GetFunctionDefinitionVersion = GetFunctionDefinitionVersion'
{ _gfdvFunctionDefinitionId :: !Text
, _gfdvFunctionDefinitionVersionId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getFunctionDefinitionVersion
:: Text
-> Text
-> GetFunctionDefinitionVersion
getFunctionDefinitionVersion pFunctionDefinitionId_ pFunctionDefinitionVersionId_ =
GetFunctionDefinitionVersion'
{ _gfdvFunctionDefinitionId = pFunctionDefinitionId_
, _gfdvFunctionDefinitionVersionId = pFunctionDefinitionVersionId_
}
gfdvFunctionDefinitionId :: Lens' GetFunctionDefinitionVersion Text
gfdvFunctionDefinitionId = lens _gfdvFunctionDefinitionId (\ s a -> s{_gfdvFunctionDefinitionId = a})
gfdvFunctionDefinitionVersionId :: Lens' GetFunctionDefinitionVersion Text
gfdvFunctionDefinitionVersionId = lens _gfdvFunctionDefinitionVersionId (\ s a -> s{_gfdvFunctionDefinitionVersionId = a})
instance AWSRequest GetFunctionDefinitionVersion
where
type Rs GetFunctionDefinitionVersion =
GetFunctionDefinitionVersionResponse
request = get greengrass
response
= receiveJSON
(\ s h x ->
GetFunctionDefinitionVersionResponse' <$>
(x .?> "Definition") <*> (x .?> "Arn") <*>
(x .?> "CreationTimestamp")
<*> (x .?> "Version")
<*> (x .?> "Id")
<*> (pure (fromEnum s)))
instance Hashable GetFunctionDefinitionVersion where
instance NFData GetFunctionDefinitionVersion where
instance ToHeaders GetFunctionDefinitionVersion where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetFunctionDefinitionVersion where
toPath GetFunctionDefinitionVersion'{..}
= mconcat
["/greengrass/definition/functions/",
toBS _gfdvFunctionDefinitionId, "/versions/",
toBS _gfdvFunctionDefinitionVersionId]
instance ToQuery GetFunctionDefinitionVersion where
toQuery = const mempty
data GetFunctionDefinitionVersionResponse = GetFunctionDefinitionVersionResponse'
{ _gfdvrsDefinition :: !(Maybe FunctionDefinitionVersion)
, _gfdvrsARN :: !(Maybe Text)
, _gfdvrsCreationTimestamp :: !(Maybe Text)
, _gfdvrsVersion :: !(Maybe Text)
, _gfdvrsId :: !(Maybe Text)
, _gfdvrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getFunctionDefinitionVersionResponse
:: Int
-> GetFunctionDefinitionVersionResponse
getFunctionDefinitionVersionResponse pResponseStatus_ =
GetFunctionDefinitionVersionResponse'
{ _gfdvrsDefinition = Nothing
, _gfdvrsARN = Nothing
, _gfdvrsCreationTimestamp = Nothing
, _gfdvrsVersion = Nothing
, _gfdvrsId = Nothing
, _gfdvrsResponseStatus = pResponseStatus_
}
gfdvrsDefinition :: Lens' GetFunctionDefinitionVersionResponse (Maybe FunctionDefinitionVersion)
gfdvrsDefinition = lens _gfdvrsDefinition (\ s a -> s{_gfdvrsDefinition = a})
gfdvrsARN :: Lens' GetFunctionDefinitionVersionResponse (Maybe Text)
gfdvrsARN = lens _gfdvrsARN (\ s a -> s{_gfdvrsARN = a})
gfdvrsCreationTimestamp :: Lens' GetFunctionDefinitionVersionResponse (Maybe Text)
gfdvrsCreationTimestamp = lens _gfdvrsCreationTimestamp (\ s a -> s{_gfdvrsCreationTimestamp = a})
gfdvrsVersion :: Lens' GetFunctionDefinitionVersionResponse (Maybe Text)
gfdvrsVersion = lens _gfdvrsVersion (\ s a -> s{_gfdvrsVersion = a})
gfdvrsId :: Lens' GetFunctionDefinitionVersionResponse (Maybe Text)
gfdvrsId = lens _gfdvrsId (\ s a -> s{_gfdvrsId = a})
gfdvrsResponseStatus :: Lens' GetFunctionDefinitionVersionResponse Int
gfdvrsResponseStatus = lens _gfdvrsResponseStatus (\ s a -> s{_gfdvrsResponseStatus = a})
instance NFData GetFunctionDefinitionVersionResponse
where