{-# 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.CodePipeline.CreateCustomActionType
(
createCustomActionType
, CreateCustomActionType
, ccatSettings
, ccatConfigurationProperties
, ccatCategory
, ccatProvider
, ccatVersion
, ccatInputArtifactDetails
, ccatOutputArtifactDetails
, createCustomActionTypeResponse
, CreateCustomActionTypeResponse
, ccatrsResponseStatus
, ccatrsActionType
) where
import Network.AWS.CodePipeline.Types
import Network.AWS.CodePipeline.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateCustomActionType = CreateCustomActionType'
{ _ccatSettings :: !(Maybe ActionTypeSettings)
, _ccatConfigurationProperties :: !(Maybe [ActionConfigurationProperty])
, _ccatCategory :: !ActionCategory
, _ccatProvider :: !Text
, _ccatVersion :: !Text
, _ccatInputArtifactDetails :: !ArtifactDetails
, _ccatOutputArtifactDetails :: !ArtifactDetails
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createCustomActionType
:: ActionCategory
-> Text
-> Text
-> ArtifactDetails
-> ArtifactDetails
-> CreateCustomActionType
createCustomActionType pCategory_ pProvider_ pVersion_ pInputArtifactDetails_ pOutputArtifactDetails_ =
CreateCustomActionType'
{ _ccatSettings = Nothing
, _ccatConfigurationProperties = Nothing
, _ccatCategory = pCategory_
, _ccatProvider = pProvider_
, _ccatVersion = pVersion_
, _ccatInputArtifactDetails = pInputArtifactDetails_
, _ccatOutputArtifactDetails = pOutputArtifactDetails_
}
ccatSettings :: Lens' CreateCustomActionType (Maybe ActionTypeSettings)
ccatSettings = lens _ccatSettings (\ s a -> s{_ccatSettings = a});
ccatConfigurationProperties :: Lens' CreateCustomActionType [ActionConfigurationProperty]
ccatConfigurationProperties = lens _ccatConfigurationProperties (\ s a -> s{_ccatConfigurationProperties = a}) . _Default . _Coerce;
ccatCategory :: Lens' CreateCustomActionType ActionCategory
ccatCategory = lens _ccatCategory (\ s a -> s{_ccatCategory = a});
ccatProvider :: Lens' CreateCustomActionType Text
ccatProvider = lens _ccatProvider (\ s a -> s{_ccatProvider = a});
ccatVersion :: Lens' CreateCustomActionType Text
ccatVersion = lens _ccatVersion (\ s a -> s{_ccatVersion = a});
ccatInputArtifactDetails :: Lens' CreateCustomActionType ArtifactDetails
ccatInputArtifactDetails = lens _ccatInputArtifactDetails (\ s a -> s{_ccatInputArtifactDetails = a});
ccatOutputArtifactDetails :: Lens' CreateCustomActionType ArtifactDetails
ccatOutputArtifactDetails = lens _ccatOutputArtifactDetails (\ s a -> s{_ccatOutputArtifactDetails = a});
instance AWSRequest CreateCustomActionType where
type Rs CreateCustomActionType =
CreateCustomActionTypeResponse
request = postJSON codePipeline
response
= receiveJSON
(\ s h x ->
CreateCustomActionTypeResponse' <$>
(pure (fromEnum s)) <*> (x .:> "actionType"))
instance Hashable CreateCustomActionType
instance NFData CreateCustomActionType
instance ToHeaders CreateCustomActionType where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodePipeline_20150709.CreateCustomActionType" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateCustomActionType where
toJSON CreateCustomActionType'{..}
= object
(catMaybes
[("settings" .=) <$> _ccatSettings,
("configurationProperties" .=) <$>
_ccatConfigurationProperties,
Just ("category" .= _ccatCategory),
Just ("provider" .= _ccatProvider),
Just ("version" .= _ccatVersion),
Just
("inputArtifactDetails" .=
_ccatInputArtifactDetails),
Just
("outputArtifactDetails" .=
_ccatOutputArtifactDetails)])
instance ToPath CreateCustomActionType where
toPath = const "/"
instance ToQuery CreateCustomActionType where
toQuery = const mempty
data CreateCustomActionTypeResponse = CreateCustomActionTypeResponse'
{ _ccatrsResponseStatus :: !Int
, _ccatrsActionType :: !ActionType
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createCustomActionTypeResponse
:: Int
-> ActionType
-> CreateCustomActionTypeResponse
createCustomActionTypeResponse pResponseStatus_ pActionType_ =
CreateCustomActionTypeResponse'
{ _ccatrsResponseStatus = pResponseStatus_
, _ccatrsActionType = pActionType_
}
ccatrsResponseStatus :: Lens' CreateCustomActionTypeResponse Int
ccatrsResponseStatus = lens _ccatrsResponseStatus (\ s a -> s{_ccatrsResponseStatus = a});
ccatrsActionType :: Lens' CreateCustomActionTypeResponse ActionType
ccatrsActionType = lens _ccatrsActionType (\ s a -> s{_ccatrsActionType = a});
instance NFData CreateCustomActionTypeResponse