{-# 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.Snowball.GetJobUnlockCode
(
getJobUnlockCode
, GetJobUnlockCode
, gjucJobId
, getJobUnlockCodeResponse
, GetJobUnlockCodeResponse
, gjucrsUnlockCode
, gjucrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Snowball.Types
import Network.AWS.Snowball.Types.Product
newtype GetJobUnlockCode = GetJobUnlockCode'
{ _gjucJobId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getJobUnlockCode
:: Text
-> GetJobUnlockCode
getJobUnlockCode pJobId_ = GetJobUnlockCode' {_gjucJobId = pJobId_}
gjucJobId :: Lens' GetJobUnlockCode Text
gjucJobId = lens _gjucJobId (\ s a -> s{_gjucJobId = a})
instance AWSRequest GetJobUnlockCode where
type Rs GetJobUnlockCode = GetJobUnlockCodeResponse
request = postJSON snowball
response
= receiveJSON
(\ s h x ->
GetJobUnlockCodeResponse' <$>
(x .?> "UnlockCode") <*> (pure (fromEnum s)))
instance Hashable GetJobUnlockCode where
instance NFData GetJobUnlockCode where
instance ToHeaders GetJobUnlockCode where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSIESnowballJobManagementService.GetJobUnlockCode"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetJobUnlockCode where
toJSON GetJobUnlockCode'{..}
= object (catMaybes [Just ("JobId" .= _gjucJobId)])
instance ToPath GetJobUnlockCode where
toPath = const "/"
instance ToQuery GetJobUnlockCode where
toQuery = const mempty
data GetJobUnlockCodeResponse = GetJobUnlockCodeResponse'
{ _gjucrsUnlockCode :: !(Maybe Text)
, _gjucrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getJobUnlockCodeResponse
:: Int
-> GetJobUnlockCodeResponse
getJobUnlockCodeResponse pResponseStatus_ =
GetJobUnlockCodeResponse'
{_gjucrsUnlockCode = Nothing, _gjucrsResponseStatus = pResponseStatus_}
gjucrsUnlockCode :: Lens' GetJobUnlockCodeResponse (Maybe Text)
gjucrsUnlockCode = lens _gjucrsUnlockCode (\ s a -> s{_gjucrsUnlockCode = a})
gjucrsResponseStatus :: Lens' GetJobUnlockCodeResponse Int
gjucrsResponseStatus = lens _gjucrsResponseStatus (\ s a -> s{_gjucrsResponseStatus = a})
instance NFData GetJobUnlockCodeResponse where