{-# 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.GetSkillGroup
(
getSkillGroup
, GetSkillGroup
, gsgSkillGroupARN
, getSkillGroupResponse
, GetSkillGroupResponse
, gsgrsSkillGroup
, gsgrsResponseStatus
) 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 GetSkillGroup = GetSkillGroup'
{ _gsgSkillGroupARN :: Maybe Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSkillGroup
:: GetSkillGroup
getSkillGroup = GetSkillGroup' {_gsgSkillGroupARN = Nothing}
gsgSkillGroupARN :: Lens' GetSkillGroup (Maybe Text)
gsgSkillGroupARN = lens _gsgSkillGroupARN (\ s a -> s{_gsgSkillGroupARN = a})
instance AWSRequest GetSkillGroup where
type Rs GetSkillGroup = GetSkillGroupResponse
request = postJSON alexaBusiness
response
= receiveJSON
(\ s h x ->
GetSkillGroupResponse' <$>
(x .?> "SkillGroup") <*> (pure (fromEnum s)))
instance Hashable GetSkillGroup where
instance NFData GetSkillGroup where
instance ToHeaders GetSkillGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AlexaForBusiness.GetSkillGroup" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetSkillGroup where
toJSON GetSkillGroup'{..}
= object
(catMaybes
[("SkillGroupArn" .=) <$> _gsgSkillGroupARN])
instance ToPath GetSkillGroup where
toPath = const "/"
instance ToQuery GetSkillGroup where
toQuery = const mempty
data GetSkillGroupResponse = GetSkillGroupResponse'
{ _gsgrsSkillGroup :: !(Maybe SkillGroup)
, _gsgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSkillGroupResponse
:: Int
-> GetSkillGroupResponse
getSkillGroupResponse pResponseStatus_ =
GetSkillGroupResponse'
{_gsgrsSkillGroup = Nothing, _gsgrsResponseStatus = pResponseStatus_}
gsgrsSkillGroup :: Lens' GetSkillGroupResponse (Maybe SkillGroup)
gsgrsSkillGroup = lens _gsgrsSkillGroup (\ s a -> s{_gsgrsSkillGroup = a})
gsgrsResponseStatus :: Lens' GetSkillGroupResponse Int
gsgrsResponseStatus = lens _gsgrsResponseStatus (\ s a -> s{_gsgrsResponseStatus = a})
instance NFData GetSkillGroupResponse where