{-# 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.CodePipeline.AcknowledgeThirdPartyJob
(
AcknowledgeThirdPartyJob (..),
newAcknowledgeThirdPartyJob,
acknowledgeThirdPartyJob_jobId,
acknowledgeThirdPartyJob_nonce,
acknowledgeThirdPartyJob_clientToken,
AcknowledgeThirdPartyJobResponse (..),
newAcknowledgeThirdPartyJobResponse,
acknowledgeThirdPartyJobResponse_status,
acknowledgeThirdPartyJobResponse_httpStatus,
)
where
import Amazonka.CodePipeline.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 AcknowledgeThirdPartyJob = AcknowledgeThirdPartyJob'
{
AcknowledgeThirdPartyJob -> Text
jobId :: Prelude.Text,
AcknowledgeThirdPartyJob -> Text
nonce :: Prelude.Text,
AcknowledgeThirdPartyJob -> Text
clientToken :: Prelude.Text
}
deriving (AcknowledgeThirdPartyJob -> AcknowledgeThirdPartyJob -> Bool
(AcknowledgeThirdPartyJob -> AcknowledgeThirdPartyJob -> Bool)
-> (AcknowledgeThirdPartyJob -> AcknowledgeThirdPartyJob -> Bool)
-> Eq AcknowledgeThirdPartyJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcknowledgeThirdPartyJob -> AcknowledgeThirdPartyJob -> Bool
$c/= :: AcknowledgeThirdPartyJob -> AcknowledgeThirdPartyJob -> Bool
== :: AcknowledgeThirdPartyJob -> AcknowledgeThirdPartyJob -> Bool
$c== :: AcknowledgeThirdPartyJob -> AcknowledgeThirdPartyJob -> Bool
Prelude.Eq, ReadPrec [AcknowledgeThirdPartyJob]
ReadPrec AcknowledgeThirdPartyJob
Int -> ReadS AcknowledgeThirdPartyJob
ReadS [AcknowledgeThirdPartyJob]
(Int -> ReadS AcknowledgeThirdPartyJob)
-> ReadS [AcknowledgeThirdPartyJob]
-> ReadPrec AcknowledgeThirdPartyJob
-> ReadPrec [AcknowledgeThirdPartyJob]
-> Read AcknowledgeThirdPartyJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcknowledgeThirdPartyJob]
$creadListPrec :: ReadPrec [AcknowledgeThirdPartyJob]
readPrec :: ReadPrec AcknowledgeThirdPartyJob
$creadPrec :: ReadPrec AcknowledgeThirdPartyJob
readList :: ReadS [AcknowledgeThirdPartyJob]
$creadList :: ReadS [AcknowledgeThirdPartyJob]
readsPrec :: Int -> ReadS AcknowledgeThirdPartyJob
$creadsPrec :: Int -> ReadS AcknowledgeThirdPartyJob
Prelude.Read, Int -> AcknowledgeThirdPartyJob -> ShowS
[AcknowledgeThirdPartyJob] -> ShowS
AcknowledgeThirdPartyJob -> String
(Int -> AcknowledgeThirdPartyJob -> ShowS)
-> (AcknowledgeThirdPartyJob -> String)
-> ([AcknowledgeThirdPartyJob] -> ShowS)
-> Show AcknowledgeThirdPartyJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcknowledgeThirdPartyJob] -> ShowS
$cshowList :: [AcknowledgeThirdPartyJob] -> ShowS
show :: AcknowledgeThirdPartyJob -> String
$cshow :: AcknowledgeThirdPartyJob -> String
showsPrec :: Int -> AcknowledgeThirdPartyJob -> ShowS
$cshowsPrec :: Int -> AcknowledgeThirdPartyJob -> ShowS
Prelude.Show, (forall x.
AcknowledgeThirdPartyJob -> Rep AcknowledgeThirdPartyJob x)
-> (forall x.
Rep AcknowledgeThirdPartyJob x -> AcknowledgeThirdPartyJob)
-> Generic AcknowledgeThirdPartyJob
forall x.
Rep AcknowledgeThirdPartyJob x -> AcknowledgeThirdPartyJob
forall x.
AcknowledgeThirdPartyJob -> Rep AcknowledgeThirdPartyJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AcknowledgeThirdPartyJob x -> AcknowledgeThirdPartyJob
$cfrom :: forall x.
AcknowledgeThirdPartyJob -> Rep AcknowledgeThirdPartyJob x
Prelude.Generic)
newAcknowledgeThirdPartyJob ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
AcknowledgeThirdPartyJob
newAcknowledgeThirdPartyJob :: Text -> Text -> Text -> AcknowledgeThirdPartyJob
newAcknowledgeThirdPartyJob
Text
pJobId_
Text
pNonce_
Text
pClientToken_ =
AcknowledgeThirdPartyJob' :: Text -> Text -> Text -> AcknowledgeThirdPartyJob
AcknowledgeThirdPartyJob'
{ $sel:jobId:AcknowledgeThirdPartyJob' :: Text
jobId = Text
pJobId_,
$sel:nonce:AcknowledgeThirdPartyJob' :: Text
nonce = Text
pNonce_,
$sel:clientToken:AcknowledgeThirdPartyJob' :: Text
clientToken = Text
pClientToken_
}
acknowledgeThirdPartyJob_jobId :: Lens.Lens' AcknowledgeThirdPartyJob Prelude.Text
acknowledgeThirdPartyJob_jobId :: (Text -> f Text)
-> AcknowledgeThirdPartyJob -> f AcknowledgeThirdPartyJob
acknowledgeThirdPartyJob_jobId = (AcknowledgeThirdPartyJob -> Text)
-> (AcknowledgeThirdPartyJob -> Text -> AcknowledgeThirdPartyJob)
-> Lens AcknowledgeThirdPartyJob AcknowledgeThirdPartyJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcknowledgeThirdPartyJob' {Text
jobId :: Text
$sel:jobId:AcknowledgeThirdPartyJob' :: AcknowledgeThirdPartyJob -> Text
jobId} -> Text
jobId) (\s :: AcknowledgeThirdPartyJob
s@AcknowledgeThirdPartyJob' {} Text
a -> AcknowledgeThirdPartyJob
s {$sel:jobId:AcknowledgeThirdPartyJob' :: Text
jobId = Text
a} :: AcknowledgeThirdPartyJob)
acknowledgeThirdPartyJob_nonce :: Lens.Lens' AcknowledgeThirdPartyJob Prelude.Text
acknowledgeThirdPartyJob_nonce :: (Text -> f Text)
-> AcknowledgeThirdPartyJob -> f AcknowledgeThirdPartyJob
acknowledgeThirdPartyJob_nonce = (AcknowledgeThirdPartyJob -> Text)
-> (AcknowledgeThirdPartyJob -> Text -> AcknowledgeThirdPartyJob)
-> Lens AcknowledgeThirdPartyJob AcknowledgeThirdPartyJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcknowledgeThirdPartyJob' {Text
nonce :: Text
$sel:nonce:AcknowledgeThirdPartyJob' :: AcknowledgeThirdPartyJob -> Text
nonce} -> Text
nonce) (\s :: AcknowledgeThirdPartyJob
s@AcknowledgeThirdPartyJob' {} Text
a -> AcknowledgeThirdPartyJob
s {$sel:nonce:AcknowledgeThirdPartyJob' :: Text
nonce = Text
a} :: AcknowledgeThirdPartyJob)
acknowledgeThirdPartyJob_clientToken :: Lens.Lens' AcknowledgeThirdPartyJob Prelude.Text
acknowledgeThirdPartyJob_clientToken :: (Text -> f Text)
-> AcknowledgeThirdPartyJob -> f AcknowledgeThirdPartyJob
acknowledgeThirdPartyJob_clientToken = (AcknowledgeThirdPartyJob -> Text)
-> (AcknowledgeThirdPartyJob -> Text -> AcknowledgeThirdPartyJob)
-> Lens AcknowledgeThirdPartyJob AcknowledgeThirdPartyJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcknowledgeThirdPartyJob' {Text
clientToken :: Text
$sel:clientToken:AcknowledgeThirdPartyJob' :: AcknowledgeThirdPartyJob -> Text
clientToken} -> Text
clientToken) (\s :: AcknowledgeThirdPartyJob
s@AcknowledgeThirdPartyJob' {} Text
a -> AcknowledgeThirdPartyJob
s {$sel:clientToken:AcknowledgeThirdPartyJob' :: Text
clientToken = Text
a} :: AcknowledgeThirdPartyJob)
instance Core.AWSRequest AcknowledgeThirdPartyJob where
type
AWSResponse AcknowledgeThirdPartyJob =
AcknowledgeThirdPartyJobResponse
request :: AcknowledgeThirdPartyJob -> Request AcknowledgeThirdPartyJob
request = Service
-> AcknowledgeThirdPartyJob -> Request AcknowledgeThirdPartyJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AcknowledgeThirdPartyJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AcknowledgeThirdPartyJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse AcknowledgeThirdPartyJob))
-> Logger
-> Service
-> Proxy AcknowledgeThirdPartyJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AcknowledgeThirdPartyJob)))
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 ->
Maybe JobStatus -> Int -> AcknowledgeThirdPartyJobResponse
AcknowledgeThirdPartyJobResponse'
(Maybe JobStatus -> Int -> AcknowledgeThirdPartyJobResponse)
-> Either String (Maybe JobStatus)
-> Either String (Int -> AcknowledgeThirdPartyJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe JobStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
Either String (Int -> AcknowledgeThirdPartyJobResponse)
-> Either String Int
-> Either String AcknowledgeThirdPartyJobResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable AcknowledgeThirdPartyJob
instance Prelude.NFData AcknowledgeThirdPartyJob
instance Core.ToHeaders AcknowledgeThirdPartyJob where
toHeaders :: AcknowledgeThirdPartyJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> AcknowledgeThirdPartyJob -> 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
"CodePipeline_20150709.AcknowledgeThirdPartyJob" ::
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 AcknowledgeThirdPartyJob where
toJSON :: AcknowledgeThirdPartyJob -> Value
toJSON AcknowledgeThirdPartyJob' {Text
clientToken :: Text
nonce :: Text
jobId :: Text
$sel:clientToken:AcknowledgeThirdPartyJob' :: AcknowledgeThirdPartyJob -> Text
$sel:nonce:AcknowledgeThirdPartyJob' :: AcknowledgeThirdPartyJob -> Text
$sel:jobId:AcknowledgeThirdPartyJob' :: AcknowledgeThirdPartyJob -> 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
"jobId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"nonce" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
nonce),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
]
)
instance Core.ToPath AcknowledgeThirdPartyJob where
toPath :: AcknowledgeThirdPartyJob -> ByteString
toPath = ByteString -> AcknowledgeThirdPartyJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AcknowledgeThirdPartyJob where
toQuery :: AcknowledgeThirdPartyJob -> QueryString
toQuery = QueryString -> AcknowledgeThirdPartyJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AcknowledgeThirdPartyJobResponse = AcknowledgeThirdPartyJobResponse'
{
AcknowledgeThirdPartyJobResponse -> Maybe JobStatus
status :: Prelude.Maybe JobStatus,
AcknowledgeThirdPartyJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AcknowledgeThirdPartyJobResponse
-> AcknowledgeThirdPartyJobResponse -> Bool
(AcknowledgeThirdPartyJobResponse
-> AcknowledgeThirdPartyJobResponse -> Bool)
-> (AcknowledgeThirdPartyJobResponse
-> AcknowledgeThirdPartyJobResponse -> Bool)
-> Eq AcknowledgeThirdPartyJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcknowledgeThirdPartyJobResponse
-> AcknowledgeThirdPartyJobResponse -> Bool
$c/= :: AcknowledgeThirdPartyJobResponse
-> AcknowledgeThirdPartyJobResponse -> Bool
== :: AcknowledgeThirdPartyJobResponse
-> AcknowledgeThirdPartyJobResponse -> Bool
$c== :: AcknowledgeThirdPartyJobResponse
-> AcknowledgeThirdPartyJobResponse -> Bool
Prelude.Eq, ReadPrec [AcknowledgeThirdPartyJobResponse]
ReadPrec AcknowledgeThirdPartyJobResponse
Int -> ReadS AcknowledgeThirdPartyJobResponse
ReadS [AcknowledgeThirdPartyJobResponse]
(Int -> ReadS AcknowledgeThirdPartyJobResponse)
-> ReadS [AcknowledgeThirdPartyJobResponse]
-> ReadPrec AcknowledgeThirdPartyJobResponse
-> ReadPrec [AcknowledgeThirdPartyJobResponse]
-> Read AcknowledgeThirdPartyJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcknowledgeThirdPartyJobResponse]
$creadListPrec :: ReadPrec [AcknowledgeThirdPartyJobResponse]
readPrec :: ReadPrec AcknowledgeThirdPartyJobResponse
$creadPrec :: ReadPrec AcknowledgeThirdPartyJobResponse
readList :: ReadS [AcknowledgeThirdPartyJobResponse]
$creadList :: ReadS [AcknowledgeThirdPartyJobResponse]
readsPrec :: Int -> ReadS AcknowledgeThirdPartyJobResponse
$creadsPrec :: Int -> ReadS AcknowledgeThirdPartyJobResponse
Prelude.Read, Int -> AcknowledgeThirdPartyJobResponse -> ShowS
[AcknowledgeThirdPartyJobResponse] -> ShowS
AcknowledgeThirdPartyJobResponse -> String
(Int -> AcknowledgeThirdPartyJobResponse -> ShowS)
-> (AcknowledgeThirdPartyJobResponse -> String)
-> ([AcknowledgeThirdPartyJobResponse] -> ShowS)
-> Show AcknowledgeThirdPartyJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcknowledgeThirdPartyJobResponse] -> ShowS
$cshowList :: [AcknowledgeThirdPartyJobResponse] -> ShowS
show :: AcknowledgeThirdPartyJobResponse -> String
$cshow :: AcknowledgeThirdPartyJobResponse -> String
showsPrec :: Int -> AcknowledgeThirdPartyJobResponse -> ShowS
$cshowsPrec :: Int -> AcknowledgeThirdPartyJobResponse -> ShowS
Prelude.Show, (forall x.
AcknowledgeThirdPartyJobResponse
-> Rep AcknowledgeThirdPartyJobResponse x)
-> (forall x.
Rep AcknowledgeThirdPartyJobResponse x
-> AcknowledgeThirdPartyJobResponse)
-> Generic AcknowledgeThirdPartyJobResponse
forall x.
Rep AcknowledgeThirdPartyJobResponse x
-> AcknowledgeThirdPartyJobResponse
forall x.
AcknowledgeThirdPartyJobResponse
-> Rep AcknowledgeThirdPartyJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AcknowledgeThirdPartyJobResponse x
-> AcknowledgeThirdPartyJobResponse
$cfrom :: forall x.
AcknowledgeThirdPartyJobResponse
-> Rep AcknowledgeThirdPartyJobResponse x
Prelude.Generic)
newAcknowledgeThirdPartyJobResponse ::
Prelude.Int ->
AcknowledgeThirdPartyJobResponse
newAcknowledgeThirdPartyJobResponse :: Int -> AcknowledgeThirdPartyJobResponse
newAcknowledgeThirdPartyJobResponse Int
pHttpStatus_ =
AcknowledgeThirdPartyJobResponse' :: Maybe JobStatus -> Int -> AcknowledgeThirdPartyJobResponse
AcknowledgeThirdPartyJobResponse'
{ $sel:status:AcknowledgeThirdPartyJobResponse' :: Maybe JobStatus
status =
Maybe JobStatus
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AcknowledgeThirdPartyJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
acknowledgeThirdPartyJobResponse_status :: Lens.Lens' AcknowledgeThirdPartyJobResponse (Prelude.Maybe JobStatus)
acknowledgeThirdPartyJobResponse_status :: (Maybe JobStatus -> f (Maybe JobStatus))
-> AcknowledgeThirdPartyJobResponse
-> f AcknowledgeThirdPartyJobResponse
acknowledgeThirdPartyJobResponse_status = (AcknowledgeThirdPartyJobResponse -> Maybe JobStatus)
-> (AcknowledgeThirdPartyJobResponse
-> Maybe JobStatus -> AcknowledgeThirdPartyJobResponse)
-> Lens
AcknowledgeThirdPartyJobResponse
AcknowledgeThirdPartyJobResponse
(Maybe JobStatus)
(Maybe JobStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcknowledgeThirdPartyJobResponse' {Maybe JobStatus
status :: Maybe JobStatus
$sel:status:AcknowledgeThirdPartyJobResponse' :: AcknowledgeThirdPartyJobResponse -> Maybe JobStatus
status} -> Maybe JobStatus
status) (\s :: AcknowledgeThirdPartyJobResponse
s@AcknowledgeThirdPartyJobResponse' {} Maybe JobStatus
a -> AcknowledgeThirdPartyJobResponse
s {$sel:status:AcknowledgeThirdPartyJobResponse' :: Maybe JobStatus
status = Maybe JobStatus
a} :: AcknowledgeThirdPartyJobResponse)
acknowledgeThirdPartyJobResponse_httpStatus :: Lens.Lens' AcknowledgeThirdPartyJobResponse Prelude.Int
acknowledgeThirdPartyJobResponse_httpStatus :: (Int -> f Int)
-> AcknowledgeThirdPartyJobResponse
-> f AcknowledgeThirdPartyJobResponse
acknowledgeThirdPartyJobResponse_httpStatus = (AcknowledgeThirdPartyJobResponse -> Int)
-> (AcknowledgeThirdPartyJobResponse
-> Int -> AcknowledgeThirdPartyJobResponse)
-> Lens
AcknowledgeThirdPartyJobResponse
AcknowledgeThirdPartyJobResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcknowledgeThirdPartyJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:AcknowledgeThirdPartyJobResponse' :: AcknowledgeThirdPartyJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AcknowledgeThirdPartyJobResponse
s@AcknowledgeThirdPartyJobResponse' {} Int
a -> AcknowledgeThirdPartyJobResponse
s {$sel:httpStatus:AcknowledgeThirdPartyJobResponse' :: Int
httpStatus = Int
a} :: AcknowledgeThirdPartyJobResponse)
instance
Prelude.NFData
AcknowledgeThirdPartyJobResponse