{-# 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.UpdateGraphqlAPI
(
updateGraphqlAPI
, UpdateGraphqlAPI
, ugaOpenIdConnectConfig
, ugaUserPoolConfig
, ugaAuthenticationType
, ugaLogConfig
, ugaApiId
, ugaName
, updateGraphqlAPIResponse
, UpdateGraphqlAPIResponse
, ugarsGraphqlAPI
, ugarsResponseStatus
) 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 UpdateGraphqlAPI = UpdateGraphqlAPI'
{ _ugaOpenIdConnectConfig :: !(Maybe OpenIdConnectConfig)
, _ugaUserPoolConfig :: !(Maybe UserPoolConfig)
, _ugaAuthenticationType :: !(Maybe AuthenticationType)
, _ugaLogConfig :: !(Maybe LogConfig)
, _ugaApiId :: !Text
, _ugaName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateGraphqlAPI
:: Text
-> Text
-> UpdateGraphqlAPI
updateGraphqlAPI pApiId_ pName_ =
UpdateGraphqlAPI'
{ _ugaOpenIdConnectConfig = Nothing
, _ugaUserPoolConfig = Nothing
, _ugaAuthenticationType = Nothing
, _ugaLogConfig = Nothing
, _ugaApiId = pApiId_
, _ugaName = pName_
}
ugaOpenIdConnectConfig :: Lens' UpdateGraphqlAPI (Maybe OpenIdConnectConfig)
ugaOpenIdConnectConfig = lens _ugaOpenIdConnectConfig (\ s a -> s{_ugaOpenIdConnectConfig = a})
ugaUserPoolConfig :: Lens' UpdateGraphqlAPI (Maybe UserPoolConfig)
ugaUserPoolConfig = lens _ugaUserPoolConfig (\ s a -> s{_ugaUserPoolConfig = a})
ugaAuthenticationType :: Lens' UpdateGraphqlAPI (Maybe AuthenticationType)
ugaAuthenticationType = lens _ugaAuthenticationType (\ s a -> s{_ugaAuthenticationType = a})
ugaLogConfig :: Lens' UpdateGraphqlAPI (Maybe LogConfig)
ugaLogConfig = lens _ugaLogConfig (\ s a -> s{_ugaLogConfig = a})
ugaApiId :: Lens' UpdateGraphqlAPI Text
ugaApiId = lens _ugaApiId (\ s a -> s{_ugaApiId = a})
ugaName :: Lens' UpdateGraphqlAPI Text
ugaName = lens _ugaName (\ s a -> s{_ugaName = a})
instance AWSRequest UpdateGraphqlAPI where
type Rs UpdateGraphqlAPI = UpdateGraphqlAPIResponse
request = postJSON appSync
response
= receiveJSON
(\ s h x ->
UpdateGraphqlAPIResponse' <$>
(x .?> "graphqlApi") <*> (pure (fromEnum s)))
instance Hashable UpdateGraphqlAPI where
instance NFData UpdateGraphqlAPI where
instance ToHeaders UpdateGraphqlAPI where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateGraphqlAPI where
toJSON UpdateGraphqlAPI'{..}
= object
(catMaybes
[("openIDConnectConfig" .=) <$>
_ugaOpenIdConnectConfig,
("userPoolConfig" .=) <$> _ugaUserPoolConfig,
("authenticationType" .=) <$> _ugaAuthenticationType,
("logConfig" .=) <$> _ugaLogConfig,
Just ("name" .= _ugaName)])
instance ToPath UpdateGraphqlAPI where
toPath UpdateGraphqlAPI'{..}
= mconcat ["/v1/apis/", toBS _ugaApiId]
instance ToQuery UpdateGraphqlAPI where
toQuery = const mempty
data UpdateGraphqlAPIResponse = UpdateGraphqlAPIResponse'
{ _ugarsGraphqlAPI :: !(Maybe GraphqlAPI)
, _ugarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateGraphqlAPIResponse
:: Int
-> UpdateGraphqlAPIResponse
updateGraphqlAPIResponse pResponseStatus_ =
UpdateGraphqlAPIResponse'
{_ugarsGraphqlAPI = Nothing, _ugarsResponseStatus = pResponseStatus_}
ugarsGraphqlAPI :: Lens' UpdateGraphqlAPIResponse (Maybe GraphqlAPI)
ugarsGraphqlAPI = lens _ugarsGraphqlAPI (\ s a -> s{_ugarsGraphqlAPI = a})
ugarsResponseStatus :: Lens' UpdateGraphqlAPIResponse Int
ugarsResponseStatus = lens _ugarsResponseStatus (\ s a -> s{_ugarsResponseStatus = a})
instance NFData UpdateGraphqlAPIResponse where