{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $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 :: Lens' AcknowledgeThirdPartyJob Text
acknowledgeThirdPartyJob_jobId = 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 :: Lens' AcknowledgeThirdPartyJob Text
acknowledgeThirdPartyJob_nonce = 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 :: Lens' AcknowledgeThirdPartyJob Text
acknowledgeThirdPartyJob_clientToken = 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 :: (Service -> Service)
-> AcknowledgeThirdPartyJob -> Request AcknowledgeThirdPartyJob
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy AcknowledgeThirdPartyJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AcknowledgeThirdPartyJob)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe JobStatus -> Int -> AcknowledgeThirdPartyJobResponse
AcknowledgeThirdPartyJobResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"status")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable AcknowledgeThirdPartyJob where
hashWithSalt :: Int -> AcknowledgeThirdPartyJob -> Int
hashWithSalt Int
_salt AcknowledgeThirdPartyJob' {Text
clientToken :: Text
nonce :: Text
jobId :: Text
$sel:clientToken:AcknowledgeThirdPartyJob' :: AcknowledgeThirdPartyJob -> Text
$sel:nonce:AcknowledgeThirdPartyJob' :: AcknowledgeThirdPartyJob -> Text
$sel:jobId:AcknowledgeThirdPartyJob' :: AcknowledgeThirdPartyJob -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
nonce
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientToken
instance Prelude.NFData AcknowledgeThirdPartyJob where
rnf :: AcknowledgeThirdPartyJob -> ()
rnf AcknowledgeThirdPartyJob' {Text
clientToken :: Text
nonce :: Text
jobId :: Text
$sel:clientToken:AcknowledgeThirdPartyJob' :: AcknowledgeThirdPartyJob -> Text
$sel:nonce:AcknowledgeThirdPartyJob' :: AcknowledgeThirdPartyJob -> Text
$sel:jobId:AcknowledgeThirdPartyJob' :: AcknowledgeThirdPartyJob -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
jobId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
nonce
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientToken
instance Data.ToHeaders AcknowledgeThirdPartyJob where
toHeaders :: AcknowledgeThirdPartyJob -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"CodePipeline_20150709.AcknowledgeThirdPartyJob" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"jobId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobId),
forall a. a -> Maybe a
Prelude.Just (Key
"nonce" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
nonce),
forall a. a -> Maybe a
Prelude.Just (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientToken)
]
)
instance Data.ToPath AcknowledgeThirdPartyJob where
toPath :: AcknowledgeThirdPartyJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery AcknowledgeThirdPartyJob where
toQuery :: AcknowledgeThirdPartyJob -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:status:AcknowledgeThirdPartyJobResponse' :: Maybe JobStatus
status =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AcknowledgeThirdPartyJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
acknowledgeThirdPartyJobResponse_status :: Lens.Lens' AcknowledgeThirdPartyJobResponse (Prelude.Maybe JobStatus)
acknowledgeThirdPartyJobResponse_status :: Lens' AcknowledgeThirdPartyJobResponse (Maybe JobStatus)
acknowledgeThirdPartyJobResponse_status = 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 :: Lens' AcknowledgeThirdPartyJobResponse Int
acknowledgeThirdPartyJobResponse_httpStatus = 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
where
rnf :: AcknowledgeThirdPartyJobResponse -> ()
rnf AcknowledgeThirdPartyJobResponse' {Int
Maybe JobStatus
httpStatus :: Int
status :: Maybe JobStatus
$sel:httpStatus:AcknowledgeThirdPartyJobResponse' :: AcknowledgeThirdPartyJobResponse -> Int
$sel:status:AcknowledgeThirdPartyJobResponse' :: AcknowledgeThirdPartyJobResponse -> Maybe JobStatus
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe JobStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus