{-# 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.OverridePullRequestApprovalRules
(
OverridePullRequestApprovalRules (..),
newOverridePullRequestApprovalRules,
overridePullRequestApprovalRules_pullRequestId,
overridePullRequestApprovalRules_revisionId,
overridePullRequestApprovalRules_overrideStatus,
OverridePullRequestApprovalRulesResponse (..),
newOverridePullRequestApprovalRulesResponse,
)
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 OverridePullRequestApprovalRules = OverridePullRequestApprovalRules'
{
OverridePullRequestApprovalRules -> Text
pullRequestId :: Prelude.Text,
OverridePullRequestApprovalRules -> Text
revisionId :: Prelude.Text,
OverridePullRequestApprovalRules -> OverrideStatus
overrideStatus :: OverrideStatus
}
deriving (OverridePullRequestApprovalRules
-> OverridePullRequestApprovalRules -> Bool
(OverridePullRequestApprovalRules
-> OverridePullRequestApprovalRules -> Bool)
-> (OverridePullRequestApprovalRules
-> OverridePullRequestApprovalRules -> Bool)
-> Eq OverridePullRequestApprovalRules
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OverridePullRequestApprovalRules
-> OverridePullRequestApprovalRules -> Bool
$c/= :: OverridePullRequestApprovalRules
-> OverridePullRequestApprovalRules -> Bool
== :: OverridePullRequestApprovalRules
-> OverridePullRequestApprovalRules -> Bool
$c== :: OverridePullRequestApprovalRules
-> OverridePullRequestApprovalRules -> Bool
Prelude.Eq, ReadPrec [OverridePullRequestApprovalRules]
ReadPrec OverridePullRequestApprovalRules
Int -> ReadS OverridePullRequestApprovalRules
ReadS [OverridePullRequestApprovalRules]
(Int -> ReadS OverridePullRequestApprovalRules)
-> ReadS [OverridePullRequestApprovalRules]
-> ReadPrec OverridePullRequestApprovalRules
-> ReadPrec [OverridePullRequestApprovalRules]
-> Read OverridePullRequestApprovalRules
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OverridePullRequestApprovalRules]
$creadListPrec :: ReadPrec [OverridePullRequestApprovalRules]
readPrec :: ReadPrec OverridePullRequestApprovalRules
$creadPrec :: ReadPrec OverridePullRequestApprovalRules
readList :: ReadS [OverridePullRequestApprovalRules]
$creadList :: ReadS [OverridePullRequestApprovalRules]
readsPrec :: Int -> ReadS OverridePullRequestApprovalRules
$creadsPrec :: Int -> ReadS OverridePullRequestApprovalRules
Prelude.Read, Int -> OverridePullRequestApprovalRules -> ShowS
[OverridePullRequestApprovalRules] -> ShowS
OverridePullRequestApprovalRules -> String
(Int -> OverridePullRequestApprovalRules -> ShowS)
-> (OverridePullRequestApprovalRules -> String)
-> ([OverridePullRequestApprovalRules] -> ShowS)
-> Show OverridePullRequestApprovalRules
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OverridePullRequestApprovalRules] -> ShowS
$cshowList :: [OverridePullRequestApprovalRules] -> ShowS
show :: OverridePullRequestApprovalRules -> String
$cshow :: OverridePullRequestApprovalRules -> String
showsPrec :: Int -> OverridePullRequestApprovalRules -> ShowS
$cshowsPrec :: Int -> OverridePullRequestApprovalRules -> ShowS
Prelude.Show, (forall x.
OverridePullRequestApprovalRules
-> Rep OverridePullRequestApprovalRules x)
-> (forall x.
Rep OverridePullRequestApprovalRules x
-> OverridePullRequestApprovalRules)
-> Generic OverridePullRequestApprovalRules
forall x.
Rep OverridePullRequestApprovalRules x
-> OverridePullRequestApprovalRules
forall x.
OverridePullRequestApprovalRules
-> Rep OverridePullRequestApprovalRules x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OverridePullRequestApprovalRules x
-> OverridePullRequestApprovalRules
$cfrom :: forall x.
OverridePullRequestApprovalRules
-> Rep OverridePullRequestApprovalRules x
Prelude.Generic)
newOverridePullRequestApprovalRules ::
Prelude.Text ->
Prelude.Text ->
OverrideStatus ->
OverridePullRequestApprovalRules
newOverridePullRequestApprovalRules :: Text -> Text -> OverrideStatus -> OverridePullRequestApprovalRules
newOverridePullRequestApprovalRules
Text
pPullRequestId_
Text
pRevisionId_
OverrideStatus
pOverrideStatus_ =
OverridePullRequestApprovalRules' :: Text -> Text -> OverrideStatus -> OverridePullRequestApprovalRules
OverridePullRequestApprovalRules'
{ $sel:pullRequestId:OverridePullRequestApprovalRules' :: Text
pullRequestId =
Text
pPullRequestId_,
$sel:revisionId:OverridePullRequestApprovalRules' :: Text
revisionId = Text
pRevisionId_,
$sel:overrideStatus:OverridePullRequestApprovalRules' :: OverrideStatus
overrideStatus = OverrideStatus
pOverrideStatus_
}
overridePullRequestApprovalRules_pullRequestId :: Lens.Lens' OverridePullRequestApprovalRules Prelude.Text
overridePullRequestApprovalRules_pullRequestId :: (Text -> f Text)
-> OverridePullRequestApprovalRules
-> f OverridePullRequestApprovalRules
overridePullRequestApprovalRules_pullRequestId = (OverridePullRequestApprovalRules -> Text)
-> (OverridePullRequestApprovalRules
-> Text -> OverridePullRequestApprovalRules)
-> Lens
OverridePullRequestApprovalRules
OverridePullRequestApprovalRules
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OverridePullRequestApprovalRules' {Text
pullRequestId :: Text
$sel:pullRequestId:OverridePullRequestApprovalRules' :: OverridePullRequestApprovalRules -> Text
pullRequestId} -> Text
pullRequestId) (\s :: OverridePullRequestApprovalRules
s@OverridePullRequestApprovalRules' {} Text
a -> OverridePullRequestApprovalRules
s {$sel:pullRequestId:OverridePullRequestApprovalRules' :: Text
pullRequestId = Text
a} :: OverridePullRequestApprovalRules)
overridePullRequestApprovalRules_revisionId :: Lens.Lens' OverridePullRequestApprovalRules Prelude.Text
overridePullRequestApprovalRules_revisionId :: (Text -> f Text)
-> OverridePullRequestApprovalRules
-> f OverridePullRequestApprovalRules
overridePullRequestApprovalRules_revisionId = (OverridePullRequestApprovalRules -> Text)
-> (OverridePullRequestApprovalRules
-> Text -> OverridePullRequestApprovalRules)
-> Lens
OverridePullRequestApprovalRules
OverridePullRequestApprovalRules
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OverridePullRequestApprovalRules' {Text
revisionId :: Text
$sel:revisionId:OverridePullRequestApprovalRules' :: OverridePullRequestApprovalRules -> Text
revisionId} -> Text
revisionId) (\s :: OverridePullRequestApprovalRules
s@OverridePullRequestApprovalRules' {} Text
a -> OverridePullRequestApprovalRules
s {$sel:revisionId:OverridePullRequestApprovalRules' :: Text
revisionId = Text
a} :: OverridePullRequestApprovalRules)
overridePullRequestApprovalRules_overrideStatus :: Lens.Lens' OverridePullRequestApprovalRules OverrideStatus
overridePullRequestApprovalRules_overrideStatus :: (OverrideStatus -> f OverrideStatus)
-> OverridePullRequestApprovalRules
-> f OverridePullRequestApprovalRules
overridePullRequestApprovalRules_overrideStatus = (OverridePullRequestApprovalRules -> OverrideStatus)
-> (OverridePullRequestApprovalRules
-> OverrideStatus -> OverridePullRequestApprovalRules)
-> Lens
OverridePullRequestApprovalRules
OverridePullRequestApprovalRules
OverrideStatus
OverrideStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OverridePullRequestApprovalRules' {OverrideStatus
overrideStatus :: OverrideStatus
$sel:overrideStatus:OverridePullRequestApprovalRules' :: OverridePullRequestApprovalRules -> OverrideStatus
overrideStatus} -> OverrideStatus
overrideStatus) (\s :: OverridePullRequestApprovalRules
s@OverridePullRequestApprovalRules' {} OverrideStatus
a -> OverridePullRequestApprovalRules
s {$sel:overrideStatus:OverridePullRequestApprovalRules' :: OverrideStatus
overrideStatus = OverrideStatus
a} :: OverridePullRequestApprovalRules)
instance
Core.AWSRequest
OverridePullRequestApprovalRules
where
type
AWSResponse OverridePullRequestApprovalRules =
OverridePullRequestApprovalRulesResponse
request :: OverridePullRequestApprovalRules
-> Request OverridePullRequestApprovalRules
request = Service
-> OverridePullRequestApprovalRules
-> Request OverridePullRequestApprovalRules
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy OverridePullRequestApprovalRules
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse OverridePullRequestApprovalRules)))
response =
AWSResponse OverridePullRequestApprovalRules
-> Logger
-> Service
-> Proxy OverridePullRequestApprovalRules
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse OverridePullRequestApprovalRules)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse OverridePullRequestApprovalRules
OverridePullRequestApprovalRulesResponse
OverridePullRequestApprovalRulesResponse'
instance
Prelude.Hashable
OverridePullRequestApprovalRules
instance
Prelude.NFData
OverridePullRequestApprovalRules
instance
Core.ToHeaders
OverridePullRequestApprovalRules
where
toHeaders :: OverridePullRequestApprovalRules -> [Header]
toHeaders =
[Header] -> OverridePullRequestApprovalRules -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"CodeCommit_20150413.OverridePullRequestApprovalRules" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON OverridePullRequestApprovalRules where
toJSON :: OverridePullRequestApprovalRules -> Value
toJSON OverridePullRequestApprovalRules' {Text
OverrideStatus
overrideStatus :: OverrideStatus
revisionId :: Text
pullRequestId :: Text
$sel:overrideStatus:OverridePullRequestApprovalRules' :: OverridePullRequestApprovalRules -> OverrideStatus
$sel:revisionId:OverridePullRequestApprovalRules' :: OverridePullRequestApprovalRules -> Text
$sel:pullRequestId:OverridePullRequestApprovalRules' :: OverridePullRequestApprovalRules -> 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
"pullRequestId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
pullRequestId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"revisionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
revisionId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"overrideStatus" Text -> OverrideStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= OverrideStatus
overrideStatus)
]
)
instance Core.ToPath OverridePullRequestApprovalRules where
toPath :: OverridePullRequestApprovalRules -> ByteString
toPath = ByteString -> OverridePullRequestApprovalRules -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
OverridePullRequestApprovalRules
where
toQuery :: OverridePullRequestApprovalRules -> QueryString
toQuery = QueryString -> OverridePullRequestApprovalRules -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data OverridePullRequestApprovalRulesResponse = OverridePullRequestApprovalRulesResponse'
{
}
deriving (OverridePullRequestApprovalRulesResponse
-> OverridePullRequestApprovalRulesResponse -> Bool
(OverridePullRequestApprovalRulesResponse
-> OverridePullRequestApprovalRulesResponse -> Bool)
-> (OverridePullRequestApprovalRulesResponse
-> OverridePullRequestApprovalRulesResponse -> Bool)
-> Eq OverridePullRequestApprovalRulesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OverridePullRequestApprovalRulesResponse
-> OverridePullRequestApprovalRulesResponse -> Bool
$c/= :: OverridePullRequestApprovalRulesResponse
-> OverridePullRequestApprovalRulesResponse -> Bool
== :: OverridePullRequestApprovalRulesResponse
-> OverridePullRequestApprovalRulesResponse -> Bool
$c== :: OverridePullRequestApprovalRulesResponse
-> OverridePullRequestApprovalRulesResponse -> Bool
Prelude.Eq, ReadPrec [OverridePullRequestApprovalRulesResponse]
ReadPrec OverridePullRequestApprovalRulesResponse
Int -> ReadS OverridePullRequestApprovalRulesResponse
ReadS [OverridePullRequestApprovalRulesResponse]
(Int -> ReadS OverridePullRequestApprovalRulesResponse)
-> ReadS [OverridePullRequestApprovalRulesResponse]
-> ReadPrec OverridePullRequestApprovalRulesResponse
-> ReadPrec [OverridePullRequestApprovalRulesResponse]
-> Read OverridePullRequestApprovalRulesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OverridePullRequestApprovalRulesResponse]
$creadListPrec :: ReadPrec [OverridePullRequestApprovalRulesResponse]
readPrec :: ReadPrec OverridePullRequestApprovalRulesResponse
$creadPrec :: ReadPrec OverridePullRequestApprovalRulesResponse
readList :: ReadS [OverridePullRequestApprovalRulesResponse]
$creadList :: ReadS [OverridePullRequestApprovalRulesResponse]
readsPrec :: Int -> ReadS OverridePullRequestApprovalRulesResponse
$creadsPrec :: Int -> ReadS OverridePullRequestApprovalRulesResponse
Prelude.Read, Int -> OverridePullRequestApprovalRulesResponse -> ShowS
[OverridePullRequestApprovalRulesResponse] -> ShowS
OverridePullRequestApprovalRulesResponse -> String
(Int -> OverridePullRequestApprovalRulesResponse -> ShowS)
-> (OverridePullRequestApprovalRulesResponse -> String)
-> ([OverridePullRequestApprovalRulesResponse] -> ShowS)
-> Show OverridePullRequestApprovalRulesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OverridePullRequestApprovalRulesResponse] -> ShowS
$cshowList :: [OverridePullRequestApprovalRulesResponse] -> ShowS
show :: OverridePullRequestApprovalRulesResponse -> String
$cshow :: OverridePullRequestApprovalRulesResponse -> String
showsPrec :: Int -> OverridePullRequestApprovalRulesResponse -> ShowS
$cshowsPrec :: Int -> OverridePullRequestApprovalRulesResponse -> ShowS
Prelude.Show, (forall x.
OverridePullRequestApprovalRulesResponse
-> Rep OverridePullRequestApprovalRulesResponse x)
-> (forall x.
Rep OverridePullRequestApprovalRulesResponse x
-> OverridePullRequestApprovalRulesResponse)
-> Generic OverridePullRequestApprovalRulesResponse
forall x.
Rep OverridePullRequestApprovalRulesResponse x
-> OverridePullRequestApprovalRulesResponse
forall x.
OverridePullRequestApprovalRulesResponse
-> Rep OverridePullRequestApprovalRulesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OverridePullRequestApprovalRulesResponse x
-> OverridePullRequestApprovalRulesResponse
$cfrom :: forall x.
OverridePullRequestApprovalRulesResponse
-> Rep OverridePullRequestApprovalRulesResponse x
Prelude.Generic)
newOverridePullRequestApprovalRulesResponse ::
OverridePullRequestApprovalRulesResponse
newOverridePullRequestApprovalRulesResponse :: OverridePullRequestApprovalRulesResponse
newOverridePullRequestApprovalRulesResponse =
OverridePullRequestApprovalRulesResponse
OverridePullRequestApprovalRulesResponse'
instance
Prelude.NFData
OverridePullRequestApprovalRulesResponse