{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CodeCommit.DeleteApprovalRuleTemplate
(
DeleteApprovalRuleTemplate (..),
newDeleteApprovalRuleTemplate,
deleteApprovalRuleTemplate_approvalRuleTemplateName,
DeleteApprovalRuleTemplateResponse (..),
newDeleteApprovalRuleTemplateResponse,
deleteApprovalRuleTemplateResponse_httpStatus,
deleteApprovalRuleTemplateResponse_approvalRuleTemplateId,
)
where
import Amazonka.CodeCommit.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteApprovalRuleTemplate = DeleteApprovalRuleTemplate'
{
DeleteApprovalRuleTemplate -> Text
approvalRuleTemplateName :: Prelude.Text
}
deriving (DeleteApprovalRuleTemplate -> DeleteApprovalRuleTemplate -> Bool
(DeleteApprovalRuleTemplate -> DeleteApprovalRuleTemplate -> Bool)
-> (DeleteApprovalRuleTemplate
-> DeleteApprovalRuleTemplate -> Bool)
-> Eq DeleteApprovalRuleTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteApprovalRuleTemplate -> DeleteApprovalRuleTemplate -> Bool
$c/= :: DeleteApprovalRuleTemplate -> DeleteApprovalRuleTemplate -> Bool
== :: DeleteApprovalRuleTemplate -> DeleteApprovalRuleTemplate -> Bool
$c== :: DeleteApprovalRuleTemplate -> DeleteApprovalRuleTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteApprovalRuleTemplate]
ReadPrec DeleteApprovalRuleTemplate
Int -> ReadS DeleteApprovalRuleTemplate
ReadS [DeleteApprovalRuleTemplate]
(Int -> ReadS DeleteApprovalRuleTemplate)
-> ReadS [DeleteApprovalRuleTemplate]
-> ReadPrec DeleteApprovalRuleTemplate
-> ReadPrec [DeleteApprovalRuleTemplate]
-> Read DeleteApprovalRuleTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteApprovalRuleTemplate]
$creadListPrec :: ReadPrec [DeleteApprovalRuleTemplate]
readPrec :: ReadPrec DeleteApprovalRuleTemplate
$creadPrec :: ReadPrec DeleteApprovalRuleTemplate
readList :: ReadS [DeleteApprovalRuleTemplate]
$creadList :: ReadS [DeleteApprovalRuleTemplate]
readsPrec :: Int -> ReadS DeleteApprovalRuleTemplate
$creadsPrec :: Int -> ReadS DeleteApprovalRuleTemplate
Prelude.Read, Int -> DeleteApprovalRuleTemplate -> ShowS
[DeleteApprovalRuleTemplate] -> ShowS
DeleteApprovalRuleTemplate -> String
(Int -> DeleteApprovalRuleTemplate -> ShowS)
-> (DeleteApprovalRuleTemplate -> String)
-> ([DeleteApprovalRuleTemplate] -> ShowS)
-> Show DeleteApprovalRuleTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteApprovalRuleTemplate] -> ShowS
$cshowList :: [DeleteApprovalRuleTemplate] -> ShowS
show :: DeleteApprovalRuleTemplate -> String
$cshow :: DeleteApprovalRuleTemplate -> String
showsPrec :: Int -> DeleteApprovalRuleTemplate -> ShowS
$cshowsPrec :: Int -> DeleteApprovalRuleTemplate -> ShowS
Prelude.Show, (forall x.
DeleteApprovalRuleTemplate -> Rep DeleteApprovalRuleTemplate x)
-> (forall x.
Rep DeleteApprovalRuleTemplate x -> DeleteApprovalRuleTemplate)
-> Generic DeleteApprovalRuleTemplate
forall x.
Rep DeleteApprovalRuleTemplate x -> DeleteApprovalRuleTemplate
forall x.
DeleteApprovalRuleTemplate -> Rep DeleteApprovalRuleTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteApprovalRuleTemplate x -> DeleteApprovalRuleTemplate
$cfrom :: forall x.
DeleteApprovalRuleTemplate -> Rep DeleteApprovalRuleTemplate x
Prelude.Generic)
newDeleteApprovalRuleTemplate ::
Prelude.Text ->
DeleteApprovalRuleTemplate
newDeleteApprovalRuleTemplate :: Text -> DeleteApprovalRuleTemplate
newDeleteApprovalRuleTemplate
Text
pApprovalRuleTemplateName_ =
DeleteApprovalRuleTemplate' :: Text -> DeleteApprovalRuleTemplate
DeleteApprovalRuleTemplate'
{ $sel:approvalRuleTemplateName:DeleteApprovalRuleTemplate' :: Text
approvalRuleTemplateName =
Text
pApprovalRuleTemplateName_
}
deleteApprovalRuleTemplate_approvalRuleTemplateName :: Lens.Lens' DeleteApprovalRuleTemplate Prelude.Text
deleteApprovalRuleTemplate_approvalRuleTemplateName :: (Text -> f Text)
-> DeleteApprovalRuleTemplate -> f DeleteApprovalRuleTemplate
deleteApprovalRuleTemplate_approvalRuleTemplateName = (DeleteApprovalRuleTemplate -> Text)
-> (DeleteApprovalRuleTemplate
-> Text -> DeleteApprovalRuleTemplate)
-> Lens
DeleteApprovalRuleTemplate DeleteApprovalRuleTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApprovalRuleTemplate' {Text
approvalRuleTemplateName :: Text
$sel:approvalRuleTemplateName:DeleteApprovalRuleTemplate' :: DeleteApprovalRuleTemplate -> Text
approvalRuleTemplateName} -> Text
approvalRuleTemplateName) (\s :: DeleteApprovalRuleTemplate
s@DeleteApprovalRuleTemplate' {} Text
a -> DeleteApprovalRuleTemplate
s {$sel:approvalRuleTemplateName:DeleteApprovalRuleTemplate' :: Text
approvalRuleTemplateName = Text
a} :: DeleteApprovalRuleTemplate)
instance Core.AWSRequest DeleteApprovalRuleTemplate where
type
AWSResponse DeleteApprovalRuleTemplate =
DeleteApprovalRuleTemplateResponse
request :: DeleteApprovalRuleTemplate -> Request DeleteApprovalRuleTemplate
request = Service
-> DeleteApprovalRuleTemplate -> Request DeleteApprovalRuleTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteApprovalRuleTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteApprovalRuleTemplate)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteApprovalRuleTemplate))
-> Logger
-> Service
-> Proxy DeleteApprovalRuleTemplate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteApprovalRuleTemplate)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> Text -> DeleteApprovalRuleTemplateResponse
DeleteApprovalRuleTemplateResponse'
(Int -> Text -> DeleteApprovalRuleTemplateResponse)
-> Either String Int
-> Either String (Text -> DeleteApprovalRuleTemplateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either String (Text -> DeleteApprovalRuleTemplateResponse)
-> Either String Text
-> Either String DeleteApprovalRuleTemplateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"approvalRuleTemplateId")
)
instance Prelude.Hashable DeleteApprovalRuleTemplate
instance Prelude.NFData DeleteApprovalRuleTemplate
instance Core.ToHeaders DeleteApprovalRuleTemplate where
toHeaders :: DeleteApprovalRuleTemplate -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteApprovalRuleTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CodeCommit_20150413.DeleteApprovalRuleTemplate" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteApprovalRuleTemplate where
toJSON :: DeleteApprovalRuleTemplate -> Value
toJSON DeleteApprovalRuleTemplate' {Text
approvalRuleTemplateName :: Text
$sel:approvalRuleTemplateName:DeleteApprovalRuleTemplate' :: DeleteApprovalRuleTemplate -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"approvalRuleTemplateName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
approvalRuleTemplateName
)
]
)
instance Core.ToPath DeleteApprovalRuleTemplate where
toPath :: DeleteApprovalRuleTemplate -> ByteString
toPath = ByteString -> DeleteApprovalRuleTemplate -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteApprovalRuleTemplate where
toQuery :: DeleteApprovalRuleTemplate -> QueryString
toQuery = QueryString -> DeleteApprovalRuleTemplate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteApprovalRuleTemplateResponse = DeleteApprovalRuleTemplateResponse'
{
DeleteApprovalRuleTemplateResponse -> Int
httpStatus :: Prelude.Int,
DeleteApprovalRuleTemplateResponse -> Text
approvalRuleTemplateId :: Prelude.Text
}
deriving (DeleteApprovalRuleTemplateResponse
-> DeleteApprovalRuleTemplateResponse -> Bool
(DeleteApprovalRuleTemplateResponse
-> DeleteApprovalRuleTemplateResponse -> Bool)
-> (DeleteApprovalRuleTemplateResponse
-> DeleteApprovalRuleTemplateResponse -> Bool)
-> Eq DeleteApprovalRuleTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteApprovalRuleTemplateResponse
-> DeleteApprovalRuleTemplateResponse -> Bool
$c/= :: DeleteApprovalRuleTemplateResponse
-> DeleteApprovalRuleTemplateResponse -> Bool
== :: DeleteApprovalRuleTemplateResponse
-> DeleteApprovalRuleTemplateResponse -> Bool
$c== :: DeleteApprovalRuleTemplateResponse
-> DeleteApprovalRuleTemplateResponse -> Bool
Prelude.Eq, ReadPrec [DeleteApprovalRuleTemplateResponse]
ReadPrec DeleteApprovalRuleTemplateResponse
Int -> ReadS DeleteApprovalRuleTemplateResponse
ReadS [DeleteApprovalRuleTemplateResponse]
(Int -> ReadS DeleteApprovalRuleTemplateResponse)
-> ReadS [DeleteApprovalRuleTemplateResponse]
-> ReadPrec DeleteApprovalRuleTemplateResponse
-> ReadPrec [DeleteApprovalRuleTemplateResponse]
-> Read DeleteApprovalRuleTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteApprovalRuleTemplateResponse]
$creadListPrec :: ReadPrec [DeleteApprovalRuleTemplateResponse]
readPrec :: ReadPrec DeleteApprovalRuleTemplateResponse
$creadPrec :: ReadPrec DeleteApprovalRuleTemplateResponse
readList :: ReadS [DeleteApprovalRuleTemplateResponse]
$creadList :: ReadS [DeleteApprovalRuleTemplateResponse]
readsPrec :: Int -> ReadS DeleteApprovalRuleTemplateResponse
$creadsPrec :: Int -> ReadS DeleteApprovalRuleTemplateResponse
Prelude.Read, Int -> DeleteApprovalRuleTemplateResponse -> ShowS
[DeleteApprovalRuleTemplateResponse] -> ShowS
DeleteApprovalRuleTemplateResponse -> String
(Int -> DeleteApprovalRuleTemplateResponse -> ShowS)
-> (DeleteApprovalRuleTemplateResponse -> String)
-> ([DeleteApprovalRuleTemplateResponse] -> ShowS)
-> Show DeleteApprovalRuleTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteApprovalRuleTemplateResponse] -> ShowS
$cshowList :: [DeleteApprovalRuleTemplateResponse] -> ShowS
show :: DeleteApprovalRuleTemplateResponse -> String
$cshow :: DeleteApprovalRuleTemplateResponse -> String
showsPrec :: Int -> DeleteApprovalRuleTemplateResponse -> ShowS
$cshowsPrec :: Int -> DeleteApprovalRuleTemplateResponse -> ShowS
Prelude.Show, (forall x.
DeleteApprovalRuleTemplateResponse
-> Rep DeleteApprovalRuleTemplateResponse x)
-> (forall x.
Rep DeleteApprovalRuleTemplateResponse x
-> DeleteApprovalRuleTemplateResponse)
-> Generic DeleteApprovalRuleTemplateResponse
forall x.
Rep DeleteApprovalRuleTemplateResponse x
-> DeleteApprovalRuleTemplateResponse
forall x.
DeleteApprovalRuleTemplateResponse
-> Rep DeleteApprovalRuleTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteApprovalRuleTemplateResponse x
-> DeleteApprovalRuleTemplateResponse
$cfrom :: forall x.
DeleteApprovalRuleTemplateResponse
-> Rep DeleteApprovalRuleTemplateResponse x
Prelude.Generic)
newDeleteApprovalRuleTemplateResponse ::
Prelude.Int ->
Prelude.Text ->
DeleteApprovalRuleTemplateResponse
newDeleteApprovalRuleTemplateResponse :: Int -> Text -> DeleteApprovalRuleTemplateResponse
newDeleteApprovalRuleTemplateResponse
Int
pHttpStatus_
Text
pApprovalRuleTemplateId_ =
DeleteApprovalRuleTemplateResponse' :: Int -> Text -> DeleteApprovalRuleTemplateResponse
DeleteApprovalRuleTemplateResponse'
{ $sel:httpStatus:DeleteApprovalRuleTemplateResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:approvalRuleTemplateId:DeleteApprovalRuleTemplateResponse' :: Text
approvalRuleTemplateId =
Text
pApprovalRuleTemplateId_
}
deleteApprovalRuleTemplateResponse_httpStatus :: Lens.Lens' DeleteApprovalRuleTemplateResponse Prelude.Int
deleteApprovalRuleTemplateResponse_httpStatus :: (Int -> f Int)
-> DeleteApprovalRuleTemplateResponse
-> f DeleteApprovalRuleTemplateResponse
deleteApprovalRuleTemplateResponse_httpStatus = (DeleteApprovalRuleTemplateResponse -> Int)
-> (DeleteApprovalRuleTemplateResponse
-> Int -> DeleteApprovalRuleTemplateResponse)
-> Lens
DeleteApprovalRuleTemplateResponse
DeleteApprovalRuleTemplateResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApprovalRuleTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteApprovalRuleTemplateResponse' :: DeleteApprovalRuleTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteApprovalRuleTemplateResponse
s@DeleteApprovalRuleTemplateResponse' {} Int
a -> DeleteApprovalRuleTemplateResponse
s {$sel:httpStatus:DeleteApprovalRuleTemplateResponse' :: Int
httpStatus = Int
a} :: DeleteApprovalRuleTemplateResponse)
deleteApprovalRuleTemplateResponse_approvalRuleTemplateId :: Lens.Lens' DeleteApprovalRuleTemplateResponse Prelude.Text
deleteApprovalRuleTemplateResponse_approvalRuleTemplateId :: (Text -> f Text)
-> DeleteApprovalRuleTemplateResponse
-> f DeleteApprovalRuleTemplateResponse
deleteApprovalRuleTemplateResponse_approvalRuleTemplateId = (DeleteApprovalRuleTemplateResponse -> Text)
-> (DeleteApprovalRuleTemplateResponse
-> Text -> DeleteApprovalRuleTemplateResponse)
-> Lens
DeleteApprovalRuleTemplateResponse
DeleteApprovalRuleTemplateResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApprovalRuleTemplateResponse' {Text
approvalRuleTemplateId :: Text
$sel:approvalRuleTemplateId:DeleteApprovalRuleTemplateResponse' :: DeleteApprovalRuleTemplateResponse -> Text
approvalRuleTemplateId} -> Text
approvalRuleTemplateId) (\s :: DeleteApprovalRuleTemplateResponse
s@DeleteApprovalRuleTemplateResponse' {} Text
a -> DeleteApprovalRuleTemplateResponse
s {$sel:approvalRuleTemplateId:DeleteApprovalRuleTemplateResponse' :: Text
approvalRuleTemplateId = Text
a} :: DeleteApprovalRuleTemplateResponse)
instance
Prelude.NFData
DeleteApprovalRuleTemplateResponse