module Network.AWS.Greengrass.GetCoreDefinitionVersion
(
getCoreDefinitionVersion
, GetCoreDefinitionVersion
, gcdvCoreDefinitionId
, gcdvCoreDefinitionVersionId
, getCoreDefinitionVersionResponse
, GetCoreDefinitionVersionResponse
, gcdvrsDefinition
, gcdvrsARN
, gcdvrsCreationTimestamp
, gcdvrsVersion
, gcdvrsId
, gcdvrsResponseStatus
) 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 GetCoreDefinitionVersion = GetCoreDefinitionVersion'
{ _gcdvCoreDefinitionId :: !Text
, _gcdvCoreDefinitionVersionId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getCoreDefinitionVersion
:: Text
-> Text
-> GetCoreDefinitionVersion
getCoreDefinitionVersion pCoreDefinitionId_ pCoreDefinitionVersionId_ =
GetCoreDefinitionVersion'
{ _gcdvCoreDefinitionId = pCoreDefinitionId_
, _gcdvCoreDefinitionVersionId = pCoreDefinitionVersionId_
}
gcdvCoreDefinitionId :: Lens' GetCoreDefinitionVersion Text
gcdvCoreDefinitionId = lens _gcdvCoreDefinitionId (\ s a -> s{_gcdvCoreDefinitionId = a});
gcdvCoreDefinitionVersionId :: Lens' GetCoreDefinitionVersion Text
gcdvCoreDefinitionVersionId = lens _gcdvCoreDefinitionVersionId (\ s a -> s{_gcdvCoreDefinitionVersionId = a});
instance AWSRequest GetCoreDefinitionVersion where
type Rs GetCoreDefinitionVersion =
GetCoreDefinitionVersionResponse
request = get greengrass
response
= receiveJSON
(\ s h x ->
GetCoreDefinitionVersionResponse' <$>
(x .?> "Definition") <*> (x .?> "Arn") <*>
(x .?> "CreationTimestamp")
<*> (x .?> "Version")
<*> (x .?> "Id")
<*> (pure (fromEnum s)))
instance Hashable GetCoreDefinitionVersion where
instance NFData GetCoreDefinitionVersion where
instance ToHeaders GetCoreDefinitionVersion where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetCoreDefinitionVersion where
toPath GetCoreDefinitionVersion'{..}
= mconcat
["/greengrass/definition/cores/",
toBS _gcdvCoreDefinitionId, "/versions/",
toBS _gcdvCoreDefinitionVersionId]
instance ToQuery GetCoreDefinitionVersion where
toQuery = const mempty
data GetCoreDefinitionVersionResponse = GetCoreDefinitionVersionResponse'
{ _gcdvrsDefinition :: !(Maybe CoreDefinitionVersion)
, _gcdvrsARN :: !(Maybe Text)
, _gcdvrsCreationTimestamp :: !(Maybe Text)
, _gcdvrsVersion :: !(Maybe Text)
, _gcdvrsId :: !(Maybe Text)
, _gcdvrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getCoreDefinitionVersionResponse
:: Int
-> GetCoreDefinitionVersionResponse
getCoreDefinitionVersionResponse pResponseStatus_ =
GetCoreDefinitionVersionResponse'
{ _gcdvrsDefinition = Nothing
, _gcdvrsARN = Nothing
, _gcdvrsCreationTimestamp = Nothing
, _gcdvrsVersion = Nothing
, _gcdvrsId = Nothing
, _gcdvrsResponseStatus = pResponseStatus_
}
gcdvrsDefinition :: Lens' GetCoreDefinitionVersionResponse (Maybe CoreDefinitionVersion)
gcdvrsDefinition = lens _gcdvrsDefinition (\ s a -> s{_gcdvrsDefinition = a});
gcdvrsARN :: Lens' GetCoreDefinitionVersionResponse (Maybe Text)
gcdvrsARN = lens _gcdvrsARN (\ s a -> s{_gcdvrsARN = a});
gcdvrsCreationTimestamp :: Lens' GetCoreDefinitionVersionResponse (Maybe Text)
gcdvrsCreationTimestamp = lens _gcdvrsCreationTimestamp (\ s a -> s{_gcdvrsCreationTimestamp = a});
gcdvrsVersion :: Lens' GetCoreDefinitionVersionResponse (Maybe Text)
gcdvrsVersion = lens _gcdvrsVersion (\ s a -> s{_gcdvrsVersion = a});
gcdvrsId :: Lens' GetCoreDefinitionVersionResponse (Maybe Text)
gcdvrsId = lens _gcdvrsId (\ s a -> s{_gcdvrsId = a});
gcdvrsResponseStatus :: Lens' GetCoreDefinitionVersionResponse Int
gcdvrsResponseStatus = lens _gcdvrsResponseStatus (\ s a -> s{_gcdvrsResponseStatus = a});
instance NFData GetCoreDefinitionVersionResponse
where