{-# 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.CloudSearch.DescribeIndexFields
(
describeIndexFields
, DescribeIndexFields
, difDeployed
, difFieldNames
, difDomainName
, describeIndexFieldsResponse
, DescribeIndexFieldsResponse
, difsrsResponseStatus
, difsrsIndexFields
) where
import Network.AWS.CloudSearch.Types
import Network.AWS.CloudSearch.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeIndexFields = DescribeIndexFields'
{ _difDeployed :: !(Maybe Bool)
, _difFieldNames :: !(Maybe [Text])
, _difDomainName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeIndexFields
:: Text
-> DescribeIndexFields
describeIndexFields pDomainName_ =
DescribeIndexFields'
{ _difDeployed = Nothing
, _difFieldNames = Nothing
, _difDomainName = pDomainName_
}
difDeployed :: Lens' DescribeIndexFields (Maybe Bool)
difDeployed = lens _difDeployed (\ s a -> s{_difDeployed = a})
difFieldNames :: Lens' DescribeIndexFields [Text]
difFieldNames = lens _difFieldNames (\ s a -> s{_difFieldNames = a}) . _Default . _Coerce
difDomainName :: Lens' DescribeIndexFields Text
difDomainName = lens _difDomainName (\ s a -> s{_difDomainName = a})
instance AWSRequest DescribeIndexFields where
type Rs DescribeIndexFields =
DescribeIndexFieldsResponse
request = postQuery cloudSearch
response
= receiveXMLWrapper "DescribeIndexFieldsResult"
(\ s h x ->
DescribeIndexFieldsResponse' <$>
(pure (fromEnum s)) <*>
(x .@? "IndexFields" .!@ mempty >>=
parseXMLList "member"))
instance Hashable DescribeIndexFields where
instance NFData DescribeIndexFields where
instance ToHeaders DescribeIndexFields where
toHeaders = const mempty
instance ToPath DescribeIndexFields where
toPath = const "/"
instance ToQuery DescribeIndexFields where
toQuery DescribeIndexFields'{..}
= mconcat
["Action" =: ("DescribeIndexFields" :: ByteString),
"Version" =: ("2013-01-01" :: ByteString),
"Deployed" =: _difDeployed,
"FieldNames" =:
toQuery (toQueryList "member" <$> _difFieldNames),
"DomainName" =: _difDomainName]
data DescribeIndexFieldsResponse = DescribeIndexFieldsResponse'
{ _difsrsResponseStatus :: !Int
, _difsrsIndexFields :: ![IndexFieldStatus]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeIndexFieldsResponse
:: Int
-> DescribeIndexFieldsResponse
describeIndexFieldsResponse pResponseStatus_ =
DescribeIndexFieldsResponse'
{_difsrsResponseStatus = pResponseStatus_, _difsrsIndexFields = mempty}
difsrsResponseStatus :: Lens' DescribeIndexFieldsResponse Int
difsrsResponseStatus = lens _difsrsResponseStatus (\ s a -> s{_difsrsResponseStatus = a})
difsrsIndexFields :: Lens' DescribeIndexFieldsResponse [IndexFieldStatus]
difsrsIndexFields = lens _difsrsIndexFields (\ s a -> s{_difsrsIndexFields = a}) . _Coerce
instance NFData DescribeIndexFieldsResponse where