{-# 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.Pinpoint.GetApp
(
getApp
, GetApp
, gaApplicationId
, getAppResponse
, GetAppResponse
, garsResponseStatus
, garsApplicationResponse
) where
import Network.AWS.Lens
import Network.AWS.Pinpoint.Types
import Network.AWS.Pinpoint.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetApp = GetApp'
{ _gaApplicationId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getApp
:: Text
-> GetApp
getApp pApplicationId_ = GetApp' {_gaApplicationId = pApplicationId_}
gaApplicationId :: Lens' GetApp Text
gaApplicationId = lens _gaApplicationId (\ s a -> s{_gaApplicationId = a})
instance AWSRequest GetApp where
type Rs GetApp = GetAppResponse
request = get pinpoint
response
= receiveJSON
(\ s h x ->
GetAppResponse' <$>
(pure (fromEnum s)) <*> (eitherParseJSON x))
instance Hashable GetApp where
instance NFData GetApp where
instance ToHeaders GetApp where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetApp where
toPath GetApp'{..}
= mconcat ["/v1/apps/", toBS _gaApplicationId]
instance ToQuery GetApp where
toQuery = const mempty
data GetAppResponse = GetAppResponse'
{ _garsResponseStatus :: !Int
, _garsApplicationResponse :: !ApplicationResponse
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getAppResponse
:: Int
-> ApplicationResponse
-> GetAppResponse
getAppResponse pResponseStatus_ pApplicationResponse_ =
GetAppResponse'
{ _garsResponseStatus = pResponseStatus_
, _garsApplicationResponse = pApplicationResponse_
}
garsResponseStatus :: Lens' GetAppResponse Int
garsResponseStatus = lens _garsResponseStatus (\ s a -> s{_garsResponseStatus = a})
garsApplicationResponse :: Lens' GetAppResponse ApplicationResponse
garsApplicationResponse = lens _garsApplicationResponse (\ s a -> s{_garsApplicationResponse = a})
instance NFData GetAppResponse where