{-# 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.SES.GetIdentityMailFromDomainAttributes
    (
    
      getIdentityMailFromDomainAttributes
    , GetIdentityMailFromDomainAttributes
    
    , gimfdaIdentities
    
    , getIdentityMailFromDomainAttributesResponse
    , GetIdentityMailFromDomainAttributesResponse
    
    , gimfdarsResponseStatus
    , gimfdarsMailFromDomainAttributes
    ) where
import           Network.AWS.Lens
import           Network.AWS.Prelude
import           Network.AWS.Request
import           Network.AWS.Response
import           Network.AWS.SES.Types
import           Network.AWS.SES.Types.Product
newtype GetIdentityMailFromDomainAttributes = GetIdentityMailFromDomainAttributes'
    { _gimfdaIdentities :: [Text]
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
getIdentityMailFromDomainAttributes
    :: GetIdentityMailFromDomainAttributes
getIdentityMailFromDomainAttributes =
    GetIdentityMailFromDomainAttributes'
    { _gimfdaIdentities = mempty
    }
gimfdaIdentities :: Lens' GetIdentityMailFromDomainAttributes [Text]
gimfdaIdentities = lens _gimfdaIdentities (\ s a -> s{_gimfdaIdentities = a}) . _Coerce;
instance AWSRequest
         GetIdentityMailFromDomainAttributes where
        type Rs GetIdentityMailFromDomainAttributes =
             GetIdentityMailFromDomainAttributesResponse
        request = postQuery ses
        response
          = receiveXMLWrapper
              "GetIdentityMailFromDomainAttributesResult"
              (\ s h x ->
                 GetIdentityMailFromDomainAttributesResponse' <$>
                   (pure (fromEnum s)) <*>
                     (x .@? "MailFromDomainAttributes" .!@ mempty >>=
                        parseXMLMap "entry" "key" "value"))
instance Hashable GetIdentityMailFromDomainAttributes
instance NFData GetIdentityMailFromDomainAttributes
instance ToHeaders
         GetIdentityMailFromDomainAttributes where
        toHeaders = const mempty
instance ToPath GetIdentityMailFromDomainAttributes
         where
        toPath = const "/"
instance ToQuery GetIdentityMailFromDomainAttributes
         where
        toQuery GetIdentityMailFromDomainAttributes'{..}
          = mconcat
              ["Action" =:
                 ("GetIdentityMailFromDomainAttributes" ::
                    ByteString),
               "Version" =: ("2010-12-01" :: ByteString),
               "Identities" =:
                 toQueryList "member" _gimfdaIdentities]
data GetIdentityMailFromDomainAttributesResponse = GetIdentityMailFromDomainAttributesResponse'
    { _gimfdarsResponseStatus           :: !Int
    , _gimfdarsMailFromDomainAttributes :: !(Map Text IdentityMailFromDomainAttributes)
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
getIdentityMailFromDomainAttributesResponse
    :: Int 
    -> GetIdentityMailFromDomainAttributesResponse
getIdentityMailFromDomainAttributesResponse pResponseStatus_ =
    GetIdentityMailFromDomainAttributesResponse'
    { _gimfdarsResponseStatus = pResponseStatus_
    , _gimfdarsMailFromDomainAttributes = mempty
    }
gimfdarsResponseStatus :: Lens' GetIdentityMailFromDomainAttributesResponse Int
gimfdarsResponseStatus = lens _gimfdarsResponseStatus (\ s a -> s{_gimfdarsResponseStatus = a});
gimfdarsMailFromDomainAttributes :: Lens' GetIdentityMailFromDomainAttributesResponse (HashMap Text IdentityMailFromDomainAttributes)
gimfdarsMailFromDomainAttributes = lens _gimfdarsMailFromDomainAttributes (\ s a -> s{_gimfdarsMailFromDomainAttributes = a}) . _Map;
instance NFData
         GetIdentityMailFromDomainAttributesResponse