{-# 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.RegisterContainerInstance
(
registerContainerInstance
, RegisterContainerInstance
, rciInstanceIdentityDocumentSignature
, rciCluster
, rciInstanceIdentityDocument
, rciContainerInstanceARN
, rciVersionInfo
, rciAttributes
, rciTotalResources
, registerContainerInstanceResponse
, RegisterContainerInstanceResponse
, rcirsContainerInstance
, rcirsResponseStatus
) 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 RegisterContainerInstance = RegisterContainerInstance'
{ _rciInstanceIdentityDocumentSignature :: !(Maybe Text)
, _rciCluster :: !(Maybe Text)
, _rciInstanceIdentityDocument :: !(Maybe Text)
, _rciContainerInstanceARN :: !(Maybe Text)
, _rciVersionInfo :: !(Maybe VersionInfo)
, _rciAttributes :: !(Maybe [Attribute])
, _rciTotalResources :: !(Maybe [Resource])
} deriving (Eq,Read,Show,Data,Typeable,Generic)
registerContainerInstance
:: RegisterContainerInstance
registerContainerInstance =
RegisterContainerInstance'
{ _rciInstanceIdentityDocumentSignature = Nothing
, _rciCluster = Nothing
, _rciInstanceIdentityDocument = Nothing
, _rciContainerInstanceARN = Nothing
, _rciVersionInfo = Nothing
, _rciAttributes = Nothing
, _rciTotalResources = Nothing
}
rciInstanceIdentityDocumentSignature :: Lens' RegisterContainerInstance (Maybe Text)
rciInstanceIdentityDocumentSignature = lens _rciInstanceIdentityDocumentSignature (\ s a -> s{_rciInstanceIdentityDocumentSignature = a});
rciCluster :: Lens' RegisterContainerInstance (Maybe Text)
rciCluster = lens _rciCluster (\ s a -> s{_rciCluster = a});
rciInstanceIdentityDocument :: Lens' RegisterContainerInstance (Maybe Text)
rciInstanceIdentityDocument = lens _rciInstanceIdentityDocument (\ s a -> s{_rciInstanceIdentityDocument = a});
rciContainerInstanceARN :: Lens' RegisterContainerInstance (Maybe Text)
rciContainerInstanceARN = lens _rciContainerInstanceARN (\ s a -> s{_rciContainerInstanceARN = a});
rciVersionInfo :: Lens' RegisterContainerInstance (Maybe VersionInfo)
rciVersionInfo = lens _rciVersionInfo (\ s a -> s{_rciVersionInfo = a});
rciAttributes :: Lens' RegisterContainerInstance [Attribute]
rciAttributes = lens _rciAttributes (\ s a -> s{_rciAttributes = a}) . _Default . _Coerce;
rciTotalResources :: Lens' RegisterContainerInstance [Resource]
rciTotalResources = lens _rciTotalResources (\ s a -> s{_rciTotalResources = a}) . _Default . _Coerce;
instance AWSRequest RegisterContainerInstance where
type Rs RegisterContainerInstance =
RegisterContainerInstanceResponse
request = postJSON ecs
response
= receiveJSON
(\ s h x ->
RegisterContainerInstanceResponse' <$>
(x .?> "containerInstance") <*> (pure (fromEnum s)))
instance Hashable RegisterContainerInstance
instance NFData RegisterContainerInstance
instance ToHeaders RegisterContainerInstance where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonEC2ContainerServiceV20141113.RegisterContainerInstance"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RegisterContainerInstance where
toJSON RegisterContainerInstance'{..}
= object
(catMaybes
[("instanceIdentityDocumentSignature" .=) <$>
_rciInstanceIdentityDocumentSignature,
("cluster" .=) <$> _rciCluster,
("instanceIdentityDocument" .=) <$>
_rciInstanceIdentityDocument,
("containerInstanceArn" .=) <$>
_rciContainerInstanceARN,
("versionInfo" .=) <$> _rciVersionInfo,
("attributes" .=) <$> _rciAttributes,
("totalResources" .=) <$> _rciTotalResources])
instance ToPath RegisterContainerInstance where
toPath = const "/"
instance ToQuery RegisterContainerInstance where
toQuery = const mempty
data RegisterContainerInstanceResponse = RegisterContainerInstanceResponse'
{ _rcirsContainerInstance :: !(Maybe ContainerInstance)
, _rcirsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
registerContainerInstanceResponse
:: Int
-> RegisterContainerInstanceResponse
registerContainerInstanceResponse pResponseStatus_ =
RegisterContainerInstanceResponse'
{ _rcirsContainerInstance = Nothing
, _rcirsResponseStatus = pResponseStatus_
}
rcirsContainerInstance :: Lens' RegisterContainerInstanceResponse (Maybe ContainerInstance)
rcirsContainerInstance = lens _rcirsContainerInstance (\ s a -> s{_rcirsContainerInstance = a});
rcirsResponseStatus :: Lens' RegisterContainerInstanceResponse Int
rcirsResponseStatus = lens _rcirsResponseStatus (\ s a -> s{_rcirsResponseStatus = a});
instance NFData RegisterContainerInstanceResponse