{-# 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.DescribeCluster
(
describeCluster
, DescribeCluster
, dcClusterId
, describeClusterResponse
, DescribeClusterResponse
, dcrsClusterMetadata
, dcrsResponseStatus
) 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 DescribeCluster = DescribeCluster'
{ _dcClusterId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeCluster
:: Text
-> DescribeCluster
describeCluster pClusterId_ = DescribeCluster' {_dcClusterId = pClusterId_}
dcClusterId :: Lens' DescribeCluster Text
dcClusterId = lens _dcClusterId (\ s a -> s{_dcClusterId = a})
instance AWSRequest DescribeCluster where
type Rs DescribeCluster = DescribeClusterResponse
request = postJSON snowball
response
= receiveJSON
(\ s h x ->
DescribeClusterResponse' <$>
(x .?> "ClusterMetadata") <*> (pure (fromEnum s)))
instance Hashable DescribeCluster where
instance NFData DescribeCluster where
instance ToHeaders DescribeCluster where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSIESnowballJobManagementService.DescribeCluster"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeCluster where
toJSON DescribeCluster'{..}
= object
(catMaybes [Just ("ClusterId" .= _dcClusterId)])
instance ToPath DescribeCluster where
toPath = const "/"
instance ToQuery DescribeCluster where
toQuery = const mempty
data DescribeClusterResponse = DescribeClusterResponse'
{ _dcrsClusterMetadata :: !(Maybe ClusterMetadata)
, _dcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeClusterResponse
:: Int
-> DescribeClusterResponse
describeClusterResponse pResponseStatus_ =
DescribeClusterResponse'
{_dcrsClusterMetadata = Nothing, _dcrsResponseStatus = pResponseStatus_}
dcrsClusterMetadata :: Lens' DescribeClusterResponse (Maybe ClusterMetadata)
dcrsClusterMetadata = lens _dcrsClusterMetadata (\ s a -> s{_dcrsClusterMetadata = a})
dcrsResponseStatus :: Lens' DescribeClusterResponse Int
dcrsResponseStatus = lens _dcrsResponseStatus (\ s a -> s{_dcrsResponseStatus = a})
instance NFData DescribeClusterResponse where