{-# 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.ECR.DeleteRepositoryPolicy
(
deleteRepositoryPolicy
, DeleteRepositoryPolicy
, drpRegistryId
, drpRepositoryName
, deleteRepositoryPolicyResponse
, DeleteRepositoryPolicyResponse
, drprsRegistryId
, drprsRepositoryName
, drprsPolicyText
, drprsResponseStatus
) where
import Network.AWS.ECR.Types
import Network.AWS.ECR.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DeleteRepositoryPolicy = DeleteRepositoryPolicy'
{ _drpRegistryId :: !(Maybe Text)
, _drpRepositoryName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteRepositoryPolicy
:: Text
-> DeleteRepositoryPolicy
deleteRepositoryPolicy pRepositoryName_ =
DeleteRepositoryPolicy'
{ _drpRegistryId = Nothing
, _drpRepositoryName = pRepositoryName_
}
drpRegistryId :: Lens' DeleteRepositoryPolicy (Maybe Text)
drpRegistryId = lens _drpRegistryId (\ s a -> s{_drpRegistryId = a});
drpRepositoryName :: Lens' DeleteRepositoryPolicy Text
drpRepositoryName = lens _drpRepositoryName (\ s a -> s{_drpRepositoryName = a});
instance AWSRequest DeleteRepositoryPolicy where
type Rs DeleteRepositoryPolicy =
DeleteRepositoryPolicyResponse
request = postJSON ecr
response
= receiveJSON
(\ s h x ->
DeleteRepositoryPolicyResponse' <$>
(x .?> "registryId") <*> (x .?> "repositoryName") <*>
(x .?> "policyText")
<*> (pure (fromEnum s)))
instance Hashable DeleteRepositoryPolicy
instance NFData DeleteRepositoryPolicy
instance ToHeaders DeleteRepositoryPolicy where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonEC2ContainerRegistry_V20150921.DeleteRepositoryPolicy"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteRepositoryPolicy where
toJSON DeleteRepositoryPolicy'{..}
= object
(catMaybes
[("registryId" .=) <$> _drpRegistryId,
Just ("repositoryName" .= _drpRepositoryName)])
instance ToPath DeleteRepositoryPolicy where
toPath = const "/"
instance ToQuery DeleteRepositoryPolicy where
toQuery = const mempty
data DeleteRepositoryPolicyResponse = DeleteRepositoryPolicyResponse'
{ _drprsRegistryId :: !(Maybe Text)
, _drprsRepositoryName :: !(Maybe Text)
, _drprsPolicyText :: !(Maybe Text)
, _drprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteRepositoryPolicyResponse
:: Int
-> DeleteRepositoryPolicyResponse
deleteRepositoryPolicyResponse pResponseStatus_ =
DeleteRepositoryPolicyResponse'
{ _drprsRegistryId = Nothing
, _drprsRepositoryName = Nothing
, _drprsPolicyText = Nothing
, _drprsResponseStatus = pResponseStatus_
}
drprsRegistryId :: Lens' DeleteRepositoryPolicyResponse (Maybe Text)
drprsRegistryId = lens _drprsRegistryId (\ s a -> s{_drprsRegistryId = a});
drprsRepositoryName :: Lens' DeleteRepositoryPolicyResponse (Maybe Text)
drprsRepositoryName = lens _drprsRepositoryName (\ s a -> s{_drprsRepositoryName = a});
drprsPolicyText :: Lens' DeleteRepositoryPolicyResponse (Maybe Text)
drprsPolicyText = lens _drprsPolicyText (\ s a -> s{_drprsPolicyText = a});
drprsResponseStatus :: Lens' DeleteRepositoryPolicyResponse Int
drprsResponseStatus = lens _drprsResponseStatus (\ s a -> s{_drprsResponseStatus = a});
instance NFData DeleteRepositoryPolicyResponse