{-# 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.DescribeAddress
(
describeAddress
, DescribeAddress
, daAddressId
, describeAddressResponse
, DescribeAddressResponse
, darsAddress
, darsResponseStatus
) 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 DescribeAddress = DescribeAddress'
{ _daAddressId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeAddress
:: Text
-> DescribeAddress
describeAddress pAddressId_ = DescribeAddress' {_daAddressId = pAddressId_}
daAddressId :: Lens' DescribeAddress Text
daAddressId = lens _daAddressId (\ s a -> s{_daAddressId = a})
instance AWSRequest DescribeAddress where
type Rs DescribeAddress = DescribeAddressResponse
request = postJSON snowball
response
= receiveJSON
(\ s h x ->
DescribeAddressResponse' <$>
(x .?> "Address") <*> (pure (fromEnum s)))
instance Hashable DescribeAddress where
instance NFData DescribeAddress where
instance ToHeaders DescribeAddress where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSIESnowballJobManagementService.DescribeAddress"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeAddress where
toJSON DescribeAddress'{..}
= object
(catMaybes [Just ("AddressId" .= _daAddressId)])
instance ToPath DescribeAddress where
toPath = const "/"
instance ToQuery DescribeAddress where
toQuery = const mempty
data DescribeAddressResponse = DescribeAddressResponse'
{ _darsAddress :: !(Maybe Address)
, _darsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeAddressResponse
:: Int
-> DescribeAddressResponse
describeAddressResponse pResponseStatus_ =
DescribeAddressResponse'
{_darsAddress = Nothing, _darsResponseStatus = pResponseStatus_}
darsAddress :: Lens' DescribeAddressResponse (Maybe Address)
darsAddress = lens _darsAddress (\ s a -> s{_darsAddress = a})
darsResponseStatus :: Lens' DescribeAddressResponse Int
darsResponseStatus = lens _darsResponseStatus (\ s a -> s{_darsResponseStatus = a})
instance NFData DescribeAddressResponse where