{-# 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.Support.ResolveCase
(
resolveCase
, ResolveCase
, rcCaseId
, resolveCaseResponse
, ResolveCaseResponse
, rcrsInitialCaseStatus
, rcrsFinalCaseStatus
, rcrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Support.Types
import Network.AWS.Support.Types.Product
newtype ResolveCase = ResolveCase'
{ _rcCaseId :: Maybe Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
resolveCase
:: ResolveCase
resolveCase = ResolveCase' {_rcCaseId = Nothing}
rcCaseId :: Lens' ResolveCase (Maybe Text)
rcCaseId = lens _rcCaseId (\ s a -> s{_rcCaseId = a})
instance AWSRequest ResolveCase where
type Rs ResolveCase = ResolveCaseResponse
request = postJSON support
response
= receiveJSON
(\ s h x ->
ResolveCaseResponse' <$>
(x .?> "initialCaseStatus") <*>
(x .?> "finalCaseStatus")
<*> (pure (fromEnum s)))
instance Hashable ResolveCase where
instance NFData ResolveCase where
instance ToHeaders ResolveCase where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSSupport_20130415.ResolveCase" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ResolveCase where
toJSON ResolveCase'{..}
= object (catMaybes [("caseId" .=) <$> _rcCaseId])
instance ToPath ResolveCase where
toPath = const "/"
instance ToQuery ResolveCase where
toQuery = const mempty
data ResolveCaseResponse = ResolveCaseResponse'
{ _rcrsInitialCaseStatus :: !(Maybe Text)
, _rcrsFinalCaseStatus :: !(Maybe Text)
, _rcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
resolveCaseResponse
:: Int
-> ResolveCaseResponse
resolveCaseResponse pResponseStatus_ =
ResolveCaseResponse'
{ _rcrsInitialCaseStatus = Nothing
, _rcrsFinalCaseStatus = Nothing
, _rcrsResponseStatus = pResponseStatus_
}
rcrsInitialCaseStatus :: Lens' ResolveCaseResponse (Maybe Text)
rcrsInitialCaseStatus = lens _rcrsInitialCaseStatus (\ s a -> s{_rcrsInitialCaseStatus = a})
rcrsFinalCaseStatus :: Lens' ResolveCaseResponse (Maybe Text)
rcrsFinalCaseStatus = lens _rcrsFinalCaseStatus (\ s a -> s{_rcrsFinalCaseStatus = a})
rcrsResponseStatus :: Lens' ResolveCaseResponse Int
rcrsResponseStatus = lens _rcrsResponseStatus (\ s a -> s{_rcrsResponseStatus = a})
instance NFData ResolveCaseResponse where