{-# 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.IoT.GetOTAUpdate
(
getOTAUpdate
, GetOTAUpdate
, gotauOtaUpdateId
, getOTAUpdateResponse
, GetOTAUpdateResponse
, gotaursOtaUpdateInfo
, gotaursResponseStatus
) where
import Network.AWS.IoT.Types
import Network.AWS.IoT.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetOTAUpdate = GetOTAUpdate'
{ _gotauOtaUpdateId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getOTAUpdate
:: Text
-> GetOTAUpdate
getOTAUpdate pOtaUpdateId_ = GetOTAUpdate' {_gotauOtaUpdateId = pOtaUpdateId_}
gotauOtaUpdateId :: Lens' GetOTAUpdate Text
gotauOtaUpdateId = lens _gotauOtaUpdateId (\ s a -> s{_gotauOtaUpdateId = a})
instance AWSRequest GetOTAUpdate where
type Rs GetOTAUpdate = GetOTAUpdateResponse
request = get ioT
response
= receiveJSON
(\ s h x ->
GetOTAUpdateResponse' <$>
(x .?> "otaUpdateInfo") <*> (pure (fromEnum s)))
instance Hashable GetOTAUpdate where
instance NFData GetOTAUpdate where
instance ToHeaders GetOTAUpdate where
toHeaders = const mempty
instance ToPath GetOTAUpdate where
toPath GetOTAUpdate'{..}
= mconcat ["/otaUpdates/", toBS _gotauOtaUpdateId]
instance ToQuery GetOTAUpdate where
toQuery = const mempty
data GetOTAUpdateResponse = GetOTAUpdateResponse'
{ _gotaursOtaUpdateInfo :: !(Maybe OTAUpdateInfo)
, _gotaursResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getOTAUpdateResponse
:: Int
-> GetOTAUpdateResponse
getOTAUpdateResponse pResponseStatus_ =
GetOTAUpdateResponse'
{_gotaursOtaUpdateInfo = Nothing, _gotaursResponseStatus = pResponseStatus_}
gotaursOtaUpdateInfo :: Lens' GetOTAUpdateResponse (Maybe OTAUpdateInfo)
gotaursOtaUpdateInfo = lens _gotaursOtaUpdateInfo (\ s a -> s{_gotaursOtaUpdateInfo = a})
gotaursResponseStatus :: Lens' GetOTAUpdateResponse Int
gotaursResponseStatus = lens _gotaursResponseStatus (\ s a -> s{_gotaursResponseStatus = a})
instance NFData GetOTAUpdateResponse where