{-# 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.AlexaBusiness.StartDeviceSync
(
startDeviceSync
, StartDeviceSync
, sdsDeviceARN
, sdsRoomARN
, sdsFeatures
, startDeviceSyncResponse
, StartDeviceSyncResponse
, sdsrsResponseStatus
) where
import Network.AWS.AlexaBusiness.Types
import Network.AWS.AlexaBusiness.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data StartDeviceSync = StartDeviceSync'
{ _sdsDeviceARN :: !(Maybe Text)
, _sdsRoomARN :: !(Maybe Text)
, _sdsFeatures :: ![Feature]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startDeviceSync
:: StartDeviceSync
startDeviceSync =
StartDeviceSync'
{_sdsDeviceARN = Nothing, _sdsRoomARN = Nothing, _sdsFeatures = mempty}
sdsDeviceARN :: Lens' StartDeviceSync (Maybe Text)
sdsDeviceARN = lens _sdsDeviceARN (\ s a -> s{_sdsDeviceARN = a})
sdsRoomARN :: Lens' StartDeviceSync (Maybe Text)
sdsRoomARN = lens _sdsRoomARN (\ s a -> s{_sdsRoomARN = a})
sdsFeatures :: Lens' StartDeviceSync [Feature]
sdsFeatures = lens _sdsFeatures (\ s a -> s{_sdsFeatures = a}) . _Coerce
instance AWSRequest StartDeviceSync where
type Rs StartDeviceSync = StartDeviceSyncResponse
request = postJSON alexaBusiness
response
= receiveEmpty
(\ s h x ->
StartDeviceSyncResponse' <$> (pure (fromEnum s)))
instance Hashable StartDeviceSync where
instance NFData StartDeviceSync where
instance ToHeaders StartDeviceSync where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AlexaForBusiness.StartDeviceSync" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartDeviceSync where
toJSON StartDeviceSync'{..}
= object
(catMaybes
[("DeviceArn" .=) <$> _sdsDeviceARN,
("RoomArn" .=) <$> _sdsRoomARN,
Just ("Features" .= _sdsFeatures)])
instance ToPath StartDeviceSync where
toPath = const "/"
instance ToQuery StartDeviceSync where
toQuery = const mempty
newtype StartDeviceSyncResponse = StartDeviceSyncResponse'
{ _sdsrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startDeviceSyncResponse
:: Int
-> StartDeviceSyncResponse
startDeviceSyncResponse pResponseStatus_ =
StartDeviceSyncResponse' {_sdsrsResponseStatus = pResponseStatus_}
sdsrsResponseStatus :: Lens' StartDeviceSyncResponse Int
sdsrsResponseStatus = lens _sdsrsResponseStatus (\ s a -> s{_sdsrsResponseStatus = a})
instance NFData StartDeviceSyncResponse where