{-# 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.MarketplaceAnalytics.StartSupportDataExport
(
startSupportDataExport
, StartSupportDataExport
, ssdeCustomerDefinedValues
, ssdeDestinationS3Prefix
, ssdeDataSetType
, ssdeFromDate
, ssdeRoleNameARN
, ssdeDestinationS3BucketName
, ssdeSnsTopicARN
, startSupportDataExportResponse
, StartSupportDataExportResponse
, ssdersDataSetRequestId
, ssdersResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.MarketplaceAnalytics.Types
import Network.AWS.MarketplaceAnalytics.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data StartSupportDataExport = StartSupportDataExport'
{ _ssdeCustomerDefinedValues :: !(Maybe (Map Text Text))
, _ssdeDestinationS3Prefix :: !(Maybe Text)
, _ssdeDataSetType :: !SupportDataSetType
, _ssdeFromDate :: !POSIX
, _ssdeRoleNameARN :: !Text
, _ssdeDestinationS3BucketName :: !Text
, _ssdeSnsTopicARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
startSupportDataExport
:: SupportDataSetType
-> UTCTime
-> Text
-> Text
-> Text
-> StartSupportDataExport
startSupportDataExport pDataSetType_ pFromDate_ pRoleNameARN_ pDestinationS3BucketName_ pSnsTopicARN_ =
StartSupportDataExport'
{ _ssdeCustomerDefinedValues = Nothing
, _ssdeDestinationS3Prefix = Nothing
, _ssdeDataSetType = pDataSetType_
, _ssdeFromDate = _Time # pFromDate_
, _ssdeRoleNameARN = pRoleNameARN_
, _ssdeDestinationS3BucketName = pDestinationS3BucketName_
, _ssdeSnsTopicARN = pSnsTopicARN_
}
ssdeCustomerDefinedValues :: Lens' StartSupportDataExport (HashMap Text Text)
ssdeCustomerDefinedValues = lens _ssdeCustomerDefinedValues (\ s a -> s{_ssdeCustomerDefinedValues = a}) . _Default . _Map;
ssdeDestinationS3Prefix :: Lens' StartSupportDataExport (Maybe Text)
ssdeDestinationS3Prefix = lens _ssdeDestinationS3Prefix (\ s a -> s{_ssdeDestinationS3Prefix = a});
ssdeDataSetType :: Lens' StartSupportDataExport SupportDataSetType
ssdeDataSetType = lens _ssdeDataSetType (\ s a -> s{_ssdeDataSetType = a});
ssdeFromDate :: Lens' StartSupportDataExport UTCTime
ssdeFromDate = lens _ssdeFromDate (\ s a -> s{_ssdeFromDate = a}) . _Time;
ssdeRoleNameARN :: Lens' StartSupportDataExport Text
ssdeRoleNameARN = lens _ssdeRoleNameARN (\ s a -> s{_ssdeRoleNameARN = a});
ssdeDestinationS3BucketName :: Lens' StartSupportDataExport Text
ssdeDestinationS3BucketName = lens _ssdeDestinationS3BucketName (\ s a -> s{_ssdeDestinationS3BucketName = a});
ssdeSnsTopicARN :: Lens' StartSupportDataExport Text
ssdeSnsTopicARN = lens _ssdeSnsTopicARN (\ s a -> s{_ssdeSnsTopicARN = a});
instance AWSRequest StartSupportDataExport where
type Rs StartSupportDataExport =
StartSupportDataExportResponse
request = postJSON marketplaceAnalytics
response
= receiveJSON
(\ s h x ->
StartSupportDataExportResponse' <$>
(x .?> "dataSetRequestId") <*> (pure (fromEnum s)))
instance Hashable StartSupportDataExport
instance NFData StartSupportDataExport
instance ToHeaders StartSupportDataExport where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("MarketplaceCommerceAnalytics20150701.StartSupportDataExport"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartSupportDataExport where
toJSON StartSupportDataExport'{..}
= object
(catMaybes
[("customerDefinedValues" .=) <$>
_ssdeCustomerDefinedValues,
("destinationS3Prefix" .=) <$>
_ssdeDestinationS3Prefix,
Just ("dataSetType" .= _ssdeDataSetType),
Just ("fromDate" .= _ssdeFromDate),
Just ("roleNameArn" .= _ssdeRoleNameARN),
Just
("destinationS3BucketName" .=
_ssdeDestinationS3BucketName),
Just ("snsTopicArn" .= _ssdeSnsTopicARN)])
instance ToPath StartSupportDataExport where
toPath = const "/"
instance ToQuery StartSupportDataExport where
toQuery = const mempty
data StartSupportDataExportResponse = StartSupportDataExportResponse'
{ _ssdersDataSetRequestId :: !(Maybe Text)
, _ssdersResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
startSupportDataExportResponse
:: Int
-> StartSupportDataExportResponse
startSupportDataExportResponse pResponseStatus_ =
StartSupportDataExportResponse'
{ _ssdersDataSetRequestId = Nothing
, _ssdersResponseStatus = pResponseStatus_
}
ssdersDataSetRequestId :: Lens' StartSupportDataExportResponse (Maybe Text)
ssdersDataSetRequestId = lens _ssdersDataSetRequestId (\ s a -> s{_ssdersDataSetRequestId = a});
ssdersResponseStatus :: Lens' StartSupportDataExportResponse Int
ssdersResponseStatus = lens _ssdersResponseStatus (\ s a -> s{_ssdersResponseStatus = a});
instance NFData StartSupportDataExportResponse