{-# 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.ECS.DiscoverPollEndpoint
(
discoverPollEndpoint
, DiscoverPollEndpoint
, dpeCluster
, dpeContainerInstance
, discoverPollEndpointResponse
, DiscoverPollEndpointResponse
, dpersTelemetryEndpoint
, dpersEndpoint
, dpersResponseStatus
) where
import Network.AWS.ECS.Types
import Network.AWS.ECS.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DiscoverPollEndpoint = DiscoverPollEndpoint'
{ _dpeCluster :: !(Maybe Text)
, _dpeContainerInstance :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
discoverPollEndpoint
:: DiscoverPollEndpoint
discoverPollEndpoint =
DiscoverPollEndpoint'
{ _dpeCluster = Nothing
, _dpeContainerInstance = Nothing
}
dpeCluster :: Lens' DiscoverPollEndpoint (Maybe Text)
dpeCluster = lens _dpeCluster (\ s a -> s{_dpeCluster = a});
dpeContainerInstance :: Lens' DiscoverPollEndpoint (Maybe Text)
dpeContainerInstance = lens _dpeContainerInstance (\ s a -> s{_dpeContainerInstance = a});
instance AWSRequest DiscoverPollEndpoint where
type Rs DiscoverPollEndpoint =
DiscoverPollEndpointResponse
request = postJSON ecs
response
= receiveJSON
(\ s h x ->
DiscoverPollEndpointResponse' <$>
(x .?> "telemetryEndpoint") <*> (x .?> "endpoint")
<*> (pure (fromEnum s)))
instance Hashable DiscoverPollEndpoint
instance NFData DiscoverPollEndpoint
instance ToHeaders DiscoverPollEndpoint where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonEC2ContainerServiceV20141113.DiscoverPollEndpoint"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DiscoverPollEndpoint where
toJSON DiscoverPollEndpoint'{..}
= object
(catMaybes
[("cluster" .=) <$> _dpeCluster,
("containerInstance" .=) <$> _dpeContainerInstance])
instance ToPath DiscoverPollEndpoint where
toPath = const "/"
instance ToQuery DiscoverPollEndpoint where
toQuery = const mempty
data DiscoverPollEndpointResponse = DiscoverPollEndpointResponse'
{ _dpersTelemetryEndpoint :: !(Maybe Text)
, _dpersEndpoint :: !(Maybe Text)
, _dpersResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
discoverPollEndpointResponse
:: Int
-> DiscoverPollEndpointResponse
discoverPollEndpointResponse pResponseStatus_ =
DiscoverPollEndpointResponse'
{ _dpersTelemetryEndpoint = Nothing
, _dpersEndpoint = Nothing
, _dpersResponseStatus = pResponseStatus_
}
dpersTelemetryEndpoint :: Lens' DiscoverPollEndpointResponse (Maybe Text)
dpersTelemetryEndpoint = lens _dpersTelemetryEndpoint (\ s a -> s{_dpersTelemetryEndpoint = a});
dpersEndpoint :: Lens' DiscoverPollEndpointResponse (Maybe Text)
dpersEndpoint = lens _dpersEndpoint (\ s a -> s{_dpersEndpoint = a});
dpersResponseStatus :: Lens' DiscoverPollEndpointResponse Int
dpersResponseStatus = lens _dpersResponseStatus (\ s a -> s{_dpersResponseStatus = a});
instance NFData DiscoverPollEndpointResponse