{-# 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.AssociateDeviceWithRoom
(
associateDeviceWithRoom
, AssociateDeviceWithRoom
, adwrDeviceARN
, adwrRoomARN
, associateDeviceWithRoomResponse
, AssociateDeviceWithRoomResponse
, adwrrsResponseStatus
) 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 AssociateDeviceWithRoom = AssociateDeviceWithRoom'
{ _adwrDeviceARN :: !(Maybe Text)
, _adwrRoomARN :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateDeviceWithRoom
:: AssociateDeviceWithRoom
associateDeviceWithRoom =
AssociateDeviceWithRoom' {_adwrDeviceARN = Nothing, _adwrRoomARN = Nothing}
adwrDeviceARN :: Lens' AssociateDeviceWithRoom (Maybe Text)
adwrDeviceARN = lens _adwrDeviceARN (\ s a -> s{_adwrDeviceARN = a})
adwrRoomARN :: Lens' AssociateDeviceWithRoom (Maybe Text)
adwrRoomARN = lens _adwrRoomARN (\ s a -> s{_adwrRoomARN = a})
instance AWSRequest AssociateDeviceWithRoom where
type Rs AssociateDeviceWithRoom =
AssociateDeviceWithRoomResponse
request = postJSON alexaBusiness
response
= receiveEmpty
(\ s h x ->
AssociateDeviceWithRoomResponse' <$>
(pure (fromEnum s)))
instance Hashable AssociateDeviceWithRoom where
instance NFData AssociateDeviceWithRoom where
instance ToHeaders AssociateDeviceWithRoom where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AlexaForBusiness.AssociateDeviceWithRoom" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AssociateDeviceWithRoom where
toJSON AssociateDeviceWithRoom'{..}
= object
(catMaybes
[("DeviceArn" .=) <$> _adwrDeviceARN,
("RoomArn" .=) <$> _adwrRoomARN])
instance ToPath AssociateDeviceWithRoom where
toPath = const "/"
instance ToQuery AssociateDeviceWithRoom where
toQuery = const mempty
newtype AssociateDeviceWithRoomResponse = AssociateDeviceWithRoomResponse'
{ _adwrrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
associateDeviceWithRoomResponse
:: Int
-> AssociateDeviceWithRoomResponse
associateDeviceWithRoomResponse pResponseStatus_ =
AssociateDeviceWithRoomResponse' {_adwrrsResponseStatus = pResponseStatus_}
adwrrsResponseStatus :: Lens' AssociateDeviceWithRoomResponse Int
adwrrsResponseStatus = lens _adwrrsResponseStatus (\ s a -> s{_adwrrsResponseStatus = a})
instance NFData AssociateDeviceWithRoomResponse where