{-# 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.ListGraphqlAPIs
(
listGraphqlAPIs
, ListGraphqlAPIs
, lgaNextToken
, lgaMaxResults
, listGraphqlAPIsResponse
, ListGraphqlAPIsResponse
, lgarsNextToken
, lgarsGraphqlAPIs
, lgarsResponseStatus
) 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 ListGraphqlAPIs = ListGraphqlAPIs'
{ _lgaNextToken :: !(Maybe Text)
, _lgaMaxResults :: !(Maybe Nat)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listGraphqlAPIs
:: ListGraphqlAPIs
listGraphqlAPIs =
ListGraphqlAPIs' {_lgaNextToken = Nothing, _lgaMaxResults = Nothing}
lgaNextToken :: Lens' ListGraphqlAPIs (Maybe Text)
lgaNextToken = lens _lgaNextToken (\ s a -> s{_lgaNextToken = a})
lgaMaxResults :: Lens' ListGraphqlAPIs (Maybe Natural)
lgaMaxResults = lens _lgaMaxResults (\ s a -> s{_lgaMaxResults = a}) . mapping _Nat
instance AWSRequest ListGraphqlAPIs where
type Rs ListGraphqlAPIs = ListGraphqlAPIsResponse
request = get appSync
response
= receiveJSON
(\ s h x ->
ListGraphqlAPIsResponse' <$>
(x .?> "nextToken") <*>
(x .?> "graphqlApis" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable ListGraphqlAPIs where
instance NFData ListGraphqlAPIs where
instance ToHeaders ListGraphqlAPIs where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath ListGraphqlAPIs where
toPath = const "/v1/apis"
instance ToQuery ListGraphqlAPIs where
toQuery ListGraphqlAPIs'{..}
= mconcat
["nextToken" =: _lgaNextToken,
"maxResults" =: _lgaMaxResults]
data ListGraphqlAPIsResponse = ListGraphqlAPIsResponse'
{ _lgarsNextToken :: !(Maybe Text)
, _lgarsGraphqlAPIs :: !(Maybe [GraphqlAPI])
, _lgarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listGraphqlAPIsResponse
:: Int
-> ListGraphqlAPIsResponse
listGraphqlAPIsResponse pResponseStatus_ =
ListGraphqlAPIsResponse'
{ _lgarsNextToken = Nothing
, _lgarsGraphqlAPIs = Nothing
, _lgarsResponseStatus = pResponseStatus_
}
lgarsNextToken :: Lens' ListGraphqlAPIsResponse (Maybe Text)
lgarsNextToken = lens _lgarsNextToken (\ s a -> s{_lgarsNextToken = a})
lgarsGraphqlAPIs :: Lens' ListGraphqlAPIsResponse [GraphqlAPI]
lgarsGraphqlAPIs = lens _lgarsGraphqlAPIs (\ s a -> s{_lgarsGraphqlAPIs = a}) . _Default . _Coerce
lgarsResponseStatus :: Lens' ListGraphqlAPIsResponse Int
lgarsResponseStatus = lens _lgarsResponseStatus (\ s a -> s{_lgarsResponseStatus = a})
instance NFData ListGraphqlAPIsResponse where