module Network.AWS.Glue.GetPlan
(
getPlan
, GetPlan
, gpSinks
, gpLocation
, gpMapping
, gpSource
, getPlanResponse
, GetPlanResponse
, gpprsPythonScript
, gpprsResponseStatus
) where
import Network.AWS.Glue.Types
import Network.AWS.Glue.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data GetPlan = GetPlan'
{ _gpSinks :: !(Maybe [CatalogEntry])
, _gpLocation :: !(Maybe Location)
, _gpMapping :: ![MappingEntry]
, _gpSource :: !CatalogEntry
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getPlan
:: CatalogEntry
-> GetPlan
getPlan pSource_ =
GetPlan'
{ _gpSinks = Nothing
, _gpLocation = Nothing
, _gpMapping = mempty
, _gpSource = pSource_
}
gpSinks :: Lens' GetPlan [CatalogEntry]
gpSinks = lens _gpSinks (\ s a -> s{_gpSinks = a}) . _Default . _Coerce;
gpLocation :: Lens' GetPlan (Maybe Location)
gpLocation = lens _gpLocation (\ s a -> s{_gpLocation = a});
gpMapping :: Lens' GetPlan [MappingEntry]
gpMapping = lens _gpMapping (\ s a -> s{_gpMapping = a}) . _Coerce;
gpSource :: Lens' GetPlan CatalogEntry
gpSource = lens _gpSource (\ s a -> s{_gpSource = a});
instance AWSRequest GetPlan where
type Rs GetPlan = GetPlanResponse
request = postJSON glue
response
= receiveJSON
(\ s h x ->
GetPlanResponse' <$>
(x .?> "PythonScript") <*> (pure (fromEnum s)))
instance Hashable GetPlan where
instance NFData GetPlan where
instance ToHeaders GetPlan where
toHeaders
= const
(mconcat
["X-Amz-Target" =# ("AWSGlue.GetPlan" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetPlan where
toJSON GetPlan'{..}
= object
(catMaybes
[("Sinks" .=) <$> _gpSinks,
("Location" .=) <$> _gpLocation,
Just ("Mapping" .= _gpMapping),
Just ("Source" .= _gpSource)])
instance ToPath GetPlan where
toPath = const "/"
instance ToQuery GetPlan where
toQuery = const mempty
data GetPlanResponse = GetPlanResponse'
{ _gpprsPythonScript :: !(Maybe Text)
, _gpprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getPlanResponse
:: Int
-> GetPlanResponse
getPlanResponse pResponseStatus_ =
GetPlanResponse'
{_gpprsPythonScript = Nothing, _gpprsResponseStatus = pResponseStatus_}
gpprsPythonScript :: Lens' GetPlanResponse (Maybe Text)
gpprsPythonScript = lens _gpprsPythonScript (\ s a -> s{_gpprsPythonScript = a});
gpprsResponseStatus :: Lens' GetPlanResponse Int
gpprsResponseStatus = lens _gpprsResponseStatus (\ s a -> s{_gpprsResponseStatus = a});
instance NFData GetPlanResponse where