module Network.AWS.ECS.DiscoverPollEndpoint
(
discoverPollEndpoint
, DiscoverPollEndpoint
, dpeCluster
, dpeContainerInstance
, discoverPollEndpointResponse
, DiscoverPollEndpointResponse
, dpersTelemetryEndpoint
, dpersEndpoint
, dpersStatus
) where
import Network.AWS.ECS.Types
import Network.AWS.ECS.Types.Product
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 Sv DiscoverPollEndpoint = ECS
type Rs DiscoverPollEndpoint =
DiscoverPollEndpointResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
DiscoverPollEndpointResponse' <$>
(x .?> "telemetryEndpoint") <*> (x .?> "endpoint")
<*> (pure (fromEnum s)))
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
["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)
, _dpersStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
discoverPollEndpointResponse
:: Int
-> DiscoverPollEndpointResponse
discoverPollEndpointResponse pStatus_ =
DiscoverPollEndpointResponse'
{ _dpersTelemetryEndpoint = Nothing
, _dpersEndpoint = Nothing
, _dpersStatus = pStatus_
}
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});
dpersStatus :: Lens' DiscoverPollEndpointResponse Int
dpersStatus = lens _dpersStatus (\ s a -> s{_dpersStatus = a});