{-# 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.Shield.GetSubscriptionState
(
getSubscriptionState
, GetSubscriptionState
, getSubscriptionStateResponse
, GetSubscriptionStateResponse
, gssrsResponseStatus
, gssrsSubscriptionState
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Shield.Types
import Network.AWS.Shield.Types.Product
data GetSubscriptionState =
GetSubscriptionState'
deriving (Eq, Read, Show, Data, Typeable, Generic)
getSubscriptionState
:: GetSubscriptionState
getSubscriptionState = GetSubscriptionState'
instance AWSRequest GetSubscriptionState where
type Rs GetSubscriptionState =
GetSubscriptionStateResponse
request = postJSON shield
response
= receiveJSON
(\ s h x ->
GetSubscriptionStateResponse' <$>
(pure (fromEnum s)) <*> (x .:> "SubscriptionState"))
instance Hashable GetSubscriptionState where
instance NFData GetSubscriptionState where
instance ToHeaders GetSubscriptionState where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSShield_20160616.GetSubscriptionState" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetSubscriptionState where
toJSON = const (Object mempty)
instance ToPath GetSubscriptionState where
toPath = const "/"
instance ToQuery GetSubscriptionState where
toQuery = const mempty
data GetSubscriptionStateResponse = GetSubscriptionStateResponse'
{ _gssrsResponseStatus :: !Int
, _gssrsSubscriptionState :: !SubscriptionState
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSubscriptionStateResponse
:: Int
-> SubscriptionState
-> GetSubscriptionStateResponse
getSubscriptionStateResponse pResponseStatus_ pSubscriptionState_ =
GetSubscriptionStateResponse'
{ _gssrsResponseStatus = pResponseStatus_
, _gssrsSubscriptionState = pSubscriptionState_
}
gssrsResponseStatus :: Lens' GetSubscriptionStateResponse Int
gssrsResponseStatus = lens _gssrsResponseStatus (\ s a -> s{_gssrsResponseStatus = a})
gssrsSubscriptionState :: Lens' GetSubscriptionStateResponse SubscriptionState
gssrsSubscriptionState = lens _gssrsSubscriptionState (\ s a -> s{_gssrsSubscriptionState = a})
instance NFData GetSubscriptionStateResponse where