{-# 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.CloudDirectory.GetSchemaAsJSON
(
getSchemaAsJSON
, GetSchemaAsJSON
, gsajSchemaARN
, getSchemaAsJSONResponse
, GetSchemaAsJSONResponse
, gsajrsDocument
, gsajrsName
, gsajrsResponseStatus
) where
import Network.AWS.CloudDirectory.Types
import Network.AWS.CloudDirectory.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetSchemaAsJSON = GetSchemaAsJSON'
{ _gsajSchemaARN :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSchemaAsJSON
:: Text
-> GetSchemaAsJSON
getSchemaAsJSON pSchemaARN_ = GetSchemaAsJSON' {_gsajSchemaARN = pSchemaARN_}
gsajSchemaARN :: Lens' GetSchemaAsJSON Text
gsajSchemaARN = lens _gsajSchemaARN (\ s a -> s{_gsajSchemaARN = a})
instance AWSRequest GetSchemaAsJSON where
type Rs GetSchemaAsJSON = GetSchemaAsJSONResponse
request = postJSON cloudDirectory
response
= receiveJSON
(\ s h x ->
GetSchemaAsJSONResponse' <$>
(x .?> "Document") <*> (x .?> "Name") <*>
(pure (fromEnum s)))
instance Hashable GetSchemaAsJSON where
instance NFData GetSchemaAsJSON where
instance ToHeaders GetSchemaAsJSON where
toHeaders GetSchemaAsJSON'{..}
= mconcat ["x-amz-data-partition" =# _gsajSchemaARN]
instance ToJSON GetSchemaAsJSON where
toJSON = const (Object mempty)
instance ToPath GetSchemaAsJSON where
toPath
= const
"/amazonclouddirectory/2017-01-11/schema/json"
instance ToQuery GetSchemaAsJSON where
toQuery = const mempty
data GetSchemaAsJSONResponse = GetSchemaAsJSONResponse'
{ _gsajrsDocument :: !(Maybe Text)
, _gsajrsName :: !(Maybe Text)
, _gsajrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getSchemaAsJSONResponse
:: Int
-> GetSchemaAsJSONResponse
getSchemaAsJSONResponse pResponseStatus_ =
GetSchemaAsJSONResponse'
{ _gsajrsDocument = Nothing
, _gsajrsName = Nothing
, _gsajrsResponseStatus = pResponseStatus_
}
gsajrsDocument :: Lens' GetSchemaAsJSONResponse (Maybe Text)
gsajrsDocument = lens _gsajrsDocument (\ s a -> s{_gsajrsDocument = a})
gsajrsName :: Lens' GetSchemaAsJSONResponse (Maybe Text)
gsajrsName = lens _gsajrsName (\ s a -> s{_gsajrsName = a})
gsajrsResponseStatus :: Lens' GetSchemaAsJSONResponse Int
gsajrsResponseStatus = lens _gsajrsResponseStatus (\ s a -> s{_gsajrsResponseStatus = a})
instance NFData GetSchemaAsJSONResponse where