{-# 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.XRay.PutTelemetryRecords
(
putTelemetryRecords
, PutTelemetryRecords
, ptrHostname
, ptrEC2InstanceId
, ptrResourceARN
, ptrTelemetryRecords
, putTelemetryRecordsResponse
, PutTelemetryRecordsResponse
, ptrrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.XRay.Types
import Network.AWS.XRay.Types.Product
data PutTelemetryRecords = PutTelemetryRecords'
{ _ptrHostname :: !(Maybe Text)
, _ptrEC2InstanceId :: !(Maybe Text)
, _ptrResourceARN :: !(Maybe Text)
, _ptrTelemetryRecords :: ![TelemetryRecord]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putTelemetryRecords
:: PutTelemetryRecords
putTelemetryRecords =
PutTelemetryRecords'
{ _ptrHostname = Nothing
, _ptrEC2InstanceId = Nothing
, _ptrResourceARN = Nothing
, _ptrTelemetryRecords = mempty
}
ptrHostname :: Lens' PutTelemetryRecords (Maybe Text)
ptrHostname = lens _ptrHostname (\ s a -> s{_ptrHostname = a})
ptrEC2InstanceId :: Lens' PutTelemetryRecords (Maybe Text)
ptrEC2InstanceId = lens _ptrEC2InstanceId (\ s a -> s{_ptrEC2InstanceId = a})
ptrResourceARN :: Lens' PutTelemetryRecords (Maybe Text)
ptrResourceARN = lens _ptrResourceARN (\ s a -> s{_ptrResourceARN = a})
ptrTelemetryRecords :: Lens' PutTelemetryRecords [TelemetryRecord]
ptrTelemetryRecords = lens _ptrTelemetryRecords (\ s a -> s{_ptrTelemetryRecords = a}) . _Coerce
instance AWSRequest PutTelemetryRecords where
type Rs PutTelemetryRecords =
PutTelemetryRecordsResponse
request = postJSON xRay
response
= receiveEmpty
(\ s h x ->
PutTelemetryRecordsResponse' <$> (pure (fromEnum s)))
instance Hashable PutTelemetryRecords where
instance NFData PutTelemetryRecords where
instance ToHeaders PutTelemetryRecords where
toHeaders = const mempty
instance ToJSON PutTelemetryRecords where
toJSON PutTelemetryRecords'{..}
= object
(catMaybes
[("Hostname" .=) <$> _ptrHostname,
("EC2InstanceId" .=) <$> _ptrEC2InstanceId,
("ResourceARN" .=) <$> _ptrResourceARN,
Just ("TelemetryRecords" .= _ptrTelemetryRecords)])
instance ToPath PutTelemetryRecords where
toPath = const "/TelemetryRecords"
instance ToQuery PutTelemetryRecords where
toQuery = const mempty
newtype PutTelemetryRecordsResponse = PutTelemetryRecordsResponse'
{ _ptrrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putTelemetryRecordsResponse
:: Int
-> PutTelemetryRecordsResponse
putTelemetryRecordsResponse pResponseStatus_ =
PutTelemetryRecordsResponse' {_ptrrsResponseStatus = pResponseStatus_}
ptrrsResponseStatus :: Lens' PutTelemetryRecordsResponse Int
ptrrsResponseStatus = lens _ptrrsResponseStatus (\ s a -> s{_ptrrsResponseStatus = a})
instance NFData PutTelemetryRecordsResponse where