{-# 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.GetProfile
(
getProfile
, GetProfile
, gpProfileARN
, getProfileResponse
, GetProfileResponse
, gprsProfile
, gprsResponseStatus
) 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
newtype GetProfile = GetProfile'
{ _gpProfileARN :: Maybe Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getProfile
:: GetProfile
getProfile = GetProfile' {_gpProfileARN = Nothing}
gpProfileARN :: Lens' GetProfile (Maybe Text)
gpProfileARN = lens _gpProfileARN (\ s a -> s{_gpProfileARN = a})
instance AWSRequest GetProfile where
type Rs GetProfile = GetProfileResponse
request = postJSON alexaBusiness
response
= receiveJSON
(\ s h x ->
GetProfileResponse' <$>
(x .?> "Profile") <*> (pure (fromEnum s)))
instance Hashable GetProfile where
instance NFData GetProfile where
instance ToHeaders GetProfile where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AlexaForBusiness.GetProfile" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetProfile where
toJSON GetProfile'{..}
= object
(catMaybes [("ProfileArn" .=) <$> _gpProfileARN])
instance ToPath GetProfile where
toPath = const "/"
instance ToQuery GetProfile where
toQuery = const mempty
data GetProfileResponse = GetProfileResponse'
{ _gprsProfile :: !(Maybe Profile)
, _gprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getProfileResponse
:: Int
-> GetProfileResponse
getProfileResponse pResponseStatus_ =
GetProfileResponse'
{_gprsProfile = Nothing, _gprsResponseStatus = pResponseStatus_}
gprsProfile :: Lens' GetProfileResponse (Maybe Profile)
gprsProfile = lens _gprsProfile (\ s a -> s{_gprsProfile = a})
gprsResponseStatus :: Lens' GetProfileResponse Int
gprsResponseStatus = lens _gprsResponseStatus (\ s a -> s{_gprsResponseStatus = a})
instance NFData GetProfileResponse where