module Network.AWS.ElasticSearch.DescribeElasticsearchDomains
(
describeElasticsearchDomains
, DescribeElasticsearchDomains
, dedDomainNames
, describeElasticsearchDomainsResponse
, DescribeElasticsearchDomainsResponse
, drsResponseStatus
, drsDomainStatusList
) where
import Network.AWS.ElasticSearch.Types
import Network.AWS.ElasticSearch.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DescribeElasticsearchDomains = DescribeElasticsearchDomains'
{ _dedDomainNames :: [Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeElasticsearchDomains
:: DescribeElasticsearchDomains
describeElasticsearchDomains =
DescribeElasticsearchDomains' {_dedDomainNames = mempty}
dedDomainNames :: Lens' DescribeElasticsearchDomains [Text]
dedDomainNames = lens _dedDomainNames (\ s a -> s{_dedDomainNames = a}) . _Coerce;
instance AWSRequest DescribeElasticsearchDomains
where
type Rs DescribeElasticsearchDomains =
DescribeElasticsearchDomainsResponse
request = postJSON elasticSearch
response
= receiveJSON
(\ s h x ->
DescribeElasticsearchDomainsResponse' <$>
(pure (fromEnum s)) <*>
(x .?> "DomainStatusList" .!@ mempty))
instance Hashable DescribeElasticsearchDomains where
instance NFData DescribeElasticsearchDomains where
instance ToHeaders DescribeElasticsearchDomains where
toHeaders = const mempty
instance ToJSON DescribeElasticsearchDomains where
toJSON DescribeElasticsearchDomains'{..}
= object
(catMaybes [Just ("DomainNames" .= _dedDomainNames)])
instance ToPath DescribeElasticsearchDomains where
toPath = const "/2015-01-01/es/domain-info"
instance ToQuery DescribeElasticsearchDomains where
toQuery = const mempty
data DescribeElasticsearchDomainsResponse = DescribeElasticsearchDomainsResponse'
{ _drsResponseStatus :: !Int
, _drsDomainStatusList :: ![ElasticsearchDomainStatus]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeElasticsearchDomainsResponse
:: Int
-> DescribeElasticsearchDomainsResponse
describeElasticsearchDomainsResponse pResponseStatus_ =
DescribeElasticsearchDomainsResponse'
{_drsResponseStatus = pResponseStatus_, _drsDomainStatusList = mempty}
drsResponseStatus :: Lens' DescribeElasticsearchDomainsResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a});
drsDomainStatusList :: Lens' DescribeElasticsearchDomainsResponse [ElasticsearchDomainStatus]
drsDomainStatusList = lens _drsDomainStatusList (\ s a -> s{_drsDomainStatusList = a}) . _Coerce;
instance NFData DescribeElasticsearchDomainsResponse
where