{-# 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.AppSync.GetIntrospectionSchema
(
getIntrospectionSchema
, GetIntrospectionSchema
, gisApiId
, gisFormat
, getIntrospectionSchemaResponse
, GetIntrospectionSchemaResponse
, gisrsSchema
, gisrsResponseStatus
) where
import Network.AWS.AppSync.Types
import Network.AWS.AppSync.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data GetIntrospectionSchema = GetIntrospectionSchema'
{ _gisApiId :: !Text
, _gisFormat :: !OutputType
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getIntrospectionSchema
:: Text
-> OutputType
-> GetIntrospectionSchema
getIntrospectionSchema pApiId_ pFormat_ =
GetIntrospectionSchema' {_gisApiId = pApiId_, _gisFormat = pFormat_}
gisApiId :: Lens' GetIntrospectionSchema Text
gisApiId = lens _gisApiId (\ s a -> s{_gisApiId = a})
gisFormat :: Lens' GetIntrospectionSchema OutputType
gisFormat = lens _gisFormat (\ s a -> s{_gisFormat = a})
instance AWSRequest GetIntrospectionSchema where
type Rs GetIntrospectionSchema =
GetIntrospectionSchemaResponse
request = get appSync
response
= receiveBytes
(\ s h x ->
GetIntrospectionSchemaResponse' <$>
(pure (Just x)) <*> (pure (fromEnum s)))
instance Hashable GetIntrospectionSchema where
instance NFData GetIntrospectionSchema where
instance ToHeaders GetIntrospectionSchema where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetIntrospectionSchema where
toPath GetIntrospectionSchema'{..}
= mconcat ["/v1/apis/", toBS _gisApiId, "/schema"]
instance ToQuery GetIntrospectionSchema where
toQuery GetIntrospectionSchema'{..}
= mconcat ["format" =: _gisFormat]
data GetIntrospectionSchemaResponse = GetIntrospectionSchemaResponse'
{ _gisrsSchema :: !(Maybe ByteString)
, _gisrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getIntrospectionSchemaResponse
:: Int
-> GetIntrospectionSchemaResponse
getIntrospectionSchemaResponse pResponseStatus_ =
GetIntrospectionSchemaResponse'
{_gisrsSchema = Nothing, _gisrsResponseStatus = pResponseStatus_}
gisrsSchema :: Lens' GetIntrospectionSchemaResponse (Maybe ByteString)
gisrsSchema = lens _gisrsSchema (\ s a -> s{_gisrsSchema = a})
gisrsResponseStatus :: Lens' GetIntrospectionSchemaResponse Int
gisrsResponseStatus = lens _gisrsResponseStatus (\ s a -> s{_gisrsResponseStatus = a})
instance NFData GetIntrospectionSchemaResponse where