{-# 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.GetThirdPartyJobDetails
(
GetThirdPartyJobDetails (..),
newGetThirdPartyJobDetails,
getThirdPartyJobDetails_jobId,
getThirdPartyJobDetails_clientToken,
GetThirdPartyJobDetailsResponse (..),
newGetThirdPartyJobDetailsResponse,
getThirdPartyJobDetailsResponse_jobDetails,
getThirdPartyJobDetailsResponse_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 GetThirdPartyJobDetails = GetThirdPartyJobDetails'
{
GetThirdPartyJobDetails -> Text
jobId :: Prelude.Text,
GetThirdPartyJobDetails -> Text
clientToken :: Prelude.Text
}
deriving (GetThirdPartyJobDetails -> GetThirdPartyJobDetails -> Bool
(GetThirdPartyJobDetails -> GetThirdPartyJobDetails -> Bool)
-> (GetThirdPartyJobDetails -> GetThirdPartyJobDetails -> Bool)
-> Eq GetThirdPartyJobDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetThirdPartyJobDetails -> GetThirdPartyJobDetails -> Bool
$c/= :: GetThirdPartyJobDetails -> GetThirdPartyJobDetails -> Bool
== :: GetThirdPartyJobDetails -> GetThirdPartyJobDetails -> Bool
$c== :: GetThirdPartyJobDetails -> GetThirdPartyJobDetails -> Bool
Prelude.Eq, ReadPrec [GetThirdPartyJobDetails]
ReadPrec GetThirdPartyJobDetails
Int -> ReadS GetThirdPartyJobDetails
ReadS [GetThirdPartyJobDetails]
(Int -> ReadS GetThirdPartyJobDetails)
-> ReadS [GetThirdPartyJobDetails]
-> ReadPrec GetThirdPartyJobDetails
-> ReadPrec [GetThirdPartyJobDetails]
-> Read GetThirdPartyJobDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetThirdPartyJobDetails]
$creadListPrec :: ReadPrec [GetThirdPartyJobDetails]
readPrec :: ReadPrec GetThirdPartyJobDetails
$creadPrec :: ReadPrec GetThirdPartyJobDetails
readList :: ReadS [GetThirdPartyJobDetails]
$creadList :: ReadS [GetThirdPartyJobDetails]
readsPrec :: Int -> ReadS GetThirdPartyJobDetails
$creadsPrec :: Int -> ReadS GetThirdPartyJobDetails
Prelude.Read, Int -> GetThirdPartyJobDetails -> ShowS
[GetThirdPartyJobDetails] -> ShowS
GetThirdPartyJobDetails -> String
(Int -> GetThirdPartyJobDetails -> ShowS)
-> (GetThirdPartyJobDetails -> String)
-> ([GetThirdPartyJobDetails] -> ShowS)
-> Show GetThirdPartyJobDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetThirdPartyJobDetails] -> ShowS
$cshowList :: [GetThirdPartyJobDetails] -> ShowS
show :: GetThirdPartyJobDetails -> String
$cshow :: GetThirdPartyJobDetails -> String
showsPrec :: Int -> GetThirdPartyJobDetails -> ShowS
$cshowsPrec :: Int -> GetThirdPartyJobDetails -> ShowS
Prelude.Show, (forall x.
GetThirdPartyJobDetails -> Rep GetThirdPartyJobDetails x)
-> (forall x.
Rep GetThirdPartyJobDetails x -> GetThirdPartyJobDetails)
-> Generic GetThirdPartyJobDetails
forall x. Rep GetThirdPartyJobDetails x -> GetThirdPartyJobDetails
forall x. GetThirdPartyJobDetails -> Rep GetThirdPartyJobDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetThirdPartyJobDetails x -> GetThirdPartyJobDetails
$cfrom :: forall x. GetThirdPartyJobDetails -> Rep GetThirdPartyJobDetails x
Prelude.Generic)
newGetThirdPartyJobDetails ::
Prelude.Text ->
Prelude.Text ->
GetThirdPartyJobDetails
newGetThirdPartyJobDetails :: Text -> Text -> GetThirdPartyJobDetails
newGetThirdPartyJobDetails Text
pJobId_ Text
pClientToken_ =
GetThirdPartyJobDetails' :: Text -> Text -> GetThirdPartyJobDetails
GetThirdPartyJobDetails'
{ $sel:jobId:GetThirdPartyJobDetails' :: Text
jobId = Text
pJobId_,
$sel:clientToken:GetThirdPartyJobDetails' :: Text
clientToken = Text
pClientToken_
}
getThirdPartyJobDetails_jobId :: Lens.Lens' GetThirdPartyJobDetails Prelude.Text
getThirdPartyJobDetails_jobId :: (Text -> f Text)
-> GetThirdPartyJobDetails -> f GetThirdPartyJobDetails
getThirdPartyJobDetails_jobId = (GetThirdPartyJobDetails -> Text)
-> (GetThirdPartyJobDetails -> Text -> GetThirdPartyJobDetails)
-> Lens GetThirdPartyJobDetails GetThirdPartyJobDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetThirdPartyJobDetails' {Text
jobId :: Text
$sel:jobId:GetThirdPartyJobDetails' :: GetThirdPartyJobDetails -> Text
jobId} -> Text
jobId) (\s :: GetThirdPartyJobDetails
s@GetThirdPartyJobDetails' {} Text
a -> GetThirdPartyJobDetails
s {$sel:jobId:GetThirdPartyJobDetails' :: Text
jobId = Text
a} :: GetThirdPartyJobDetails)
getThirdPartyJobDetails_clientToken :: Lens.Lens' GetThirdPartyJobDetails Prelude.Text
getThirdPartyJobDetails_clientToken :: (Text -> f Text)
-> GetThirdPartyJobDetails -> f GetThirdPartyJobDetails
getThirdPartyJobDetails_clientToken = (GetThirdPartyJobDetails -> Text)
-> (GetThirdPartyJobDetails -> Text -> GetThirdPartyJobDetails)
-> Lens GetThirdPartyJobDetails GetThirdPartyJobDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetThirdPartyJobDetails' {Text
clientToken :: Text
$sel:clientToken:GetThirdPartyJobDetails' :: GetThirdPartyJobDetails -> Text
clientToken} -> Text
clientToken) (\s :: GetThirdPartyJobDetails
s@GetThirdPartyJobDetails' {} Text
a -> GetThirdPartyJobDetails
s {$sel:clientToken:GetThirdPartyJobDetails' :: Text
clientToken = Text
a} :: GetThirdPartyJobDetails)
instance Core.AWSRequest GetThirdPartyJobDetails where
type
AWSResponse GetThirdPartyJobDetails =
GetThirdPartyJobDetailsResponse
request :: GetThirdPartyJobDetails -> Request GetThirdPartyJobDetails
request = Service
-> GetThirdPartyJobDetails -> Request GetThirdPartyJobDetails
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetThirdPartyJobDetails
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetThirdPartyJobDetails)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetThirdPartyJobDetails))
-> Logger
-> Service
-> Proxy GetThirdPartyJobDetails
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetThirdPartyJobDetails)))
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 ThirdPartyJobDetails
-> Int -> GetThirdPartyJobDetailsResponse
GetThirdPartyJobDetailsResponse'
(Maybe ThirdPartyJobDetails
-> Int -> GetThirdPartyJobDetailsResponse)
-> Either String (Maybe ThirdPartyJobDetails)
-> Either String (Int -> GetThirdPartyJobDetailsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ThirdPartyJobDetails)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"jobDetails")
Either String (Int -> GetThirdPartyJobDetailsResponse)
-> Either String Int
-> Either String GetThirdPartyJobDetailsResponse
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 GetThirdPartyJobDetails
instance Prelude.NFData GetThirdPartyJobDetails
instance Core.ToHeaders GetThirdPartyJobDetails where
toHeaders :: GetThirdPartyJobDetails -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetThirdPartyJobDetails -> 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.GetThirdPartyJobDetails" ::
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 GetThirdPartyJobDetails where
toJSON :: GetThirdPartyJobDetails -> Value
toJSON GetThirdPartyJobDetails' {Text
clientToken :: Text
jobId :: Text
$sel:clientToken:GetThirdPartyJobDetails' :: GetThirdPartyJobDetails -> Text
$sel:jobId:GetThirdPartyJobDetails' :: GetThirdPartyJobDetails -> 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
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
]
)
instance Core.ToPath GetThirdPartyJobDetails where
toPath :: GetThirdPartyJobDetails -> ByteString
toPath = ByteString -> GetThirdPartyJobDetails -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetThirdPartyJobDetails where
toQuery :: GetThirdPartyJobDetails -> QueryString
toQuery = QueryString -> GetThirdPartyJobDetails -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetThirdPartyJobDetailsResponse = GetThirdPartyJobDetailsResponse'
{
GetThirdPartyJobDetailsResponse -> Maybe ThirdPartyJobDetails
jobDetails :: Prelude.Maybe ThirdPartyJobDetails,
GetThirdPartyJobDetailsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetThirdPartyJobDetailsResponse
-> GetThirdPartyJobDetailsResponse -> Bool
(GetThirdPartyJobDetailsResponse
-> GetThirdPartyJobDetailsResponse -> Bool)
-> (GetThirdPartyJobDetailsResponse
-> GetThirdPartyJobDetailsResponse -> Bool)
-> Eq GetThirdPartyJobDetailsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetThirdPartyJobDetailsResponse
-> GetThirdPartyJobDetailsResponse -> Bool
$c/= :: GetThirdPartyJobDetailsResponse
-> GetThirdPartyJobDetailsResponse -> Bool
== :: GetThirdPartyJobDetailsResponse
-> GetThirdPartyJobDetailsResponse -> Bool
$c== :: GetThirdPartyJobDetailsResponse
-> GetThirdPartyJobDetailsResponse -> Bool
Prelude.Eq, Int -> GetThirdPartyJobDetailsResponse -> ShowS
[GetThirdPartyJobDetailsResponse] -> ShowS
GetThirdPartyJobDetailsResponse -> String
(Int -> GetThirdPartyJobDetailsResponse -> ShowS)
-> (GetThirdPartyJobDetailsResponse -> String)
-> ([GetThirdPartyJobDetailsResponse] -> ShowS)
-> Show GetThirdPartyJobDetailsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetThirdPartyJobDetailsResponse] -> ShowS
$cshowList :: [GetThirdPartyJobDetailsResponse] -> ShowS
show :: GetThirdPartyJobDetailsResponse -> String
$cshow :: GetThirdPartyJobDetailsResponse -> String
showsPrec :: Int -> GetThirdPartyJobDetailsResponse -> ShowS
$cshowsPrec :: Int -> GetThirdPartyJobDetailsResponse -> ShowS
Prelude.Show, (forall x.
GetThirdPartyJobDetailsResponse
-> Rep GetThirdPartyJobDetailsResponse x)
-> (forall x.
Rep GetThirdPartyJobDetailsResponse x
-> GetThirdPartyJobDetailsResponse)
-> Generic GetThirdPartyJobDetailsResponse
forall x.
Rep GetThirdPartyJobDetailsResponse x
-> GetThirdPartyJobDetailsResponse
forall x.
GetThirdPartyJobDetailsResponse
-> Rep GetThirdPartyJobDetailsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetThirdPartyJobDetailsResponse x
-> GetThirdPartyJobDetailsResponse
$cfrom :: forall x.
GetThirdPartyJobDetailsResponse
-> Rep GetThirdPartyJobDetailsResponse x
Prelude.Generic)
newGetThirdPartyJobDetailsResponse ::
Prelude.Int ->
GetThirdPartyJobDetailsResponse
newGetThirdPartyJobDetailsResponse :: Int -> GetThirdPartyJobDetailsResponse
newGetThirdPartyJobDetailsResponse Int
pHttpStatus_ =
GetThirdPartyJobDetailsResponse' :: Maybe ThirdPartyJobDetails
-> Int -> GetThirdPartyJobDetailsResponse
GetThirdPartyJobDetailsResponse'
{ $sel:jobDetails:GetThirdPartyJobDetailsResponse' :: Maybe ThirdPartyJobDetails
jobDetails =
Maybe ThirdPartyJobDetails
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetThirdPartyJobDetailsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getThirdPartyJobDetailsResponse_jobDetails :: Lens.Lens' GetThirdPartyJobDetailsResponse (Prelude.Maybe ThirdPartyJobDetails)
getThirdPartyJobDetailsResponse_jobDetails :: (Maybe ThirdPartyJobDetails -> f (Maybe ThirdPartyJobDetails))
-> GetThirdPartyJobDetailsResponse
-> f GetThirdPartyJobDetailsResponse
getThirdPartyJobDetailsResponse_jobDetails = (GetThirdPartyJobDetailsResponse -> Maybe ThirdPartyJobDetails)
-> (GetThirdPartyJobDetailsResponse
-> Maybe ThirdPartyJobDetails -> GetThirdPartyJobDetailsResponse)
-> Lens
GetThirdPartyJobDetailsResponse
GetThirdPartyJobDetailsResponse
(Maybe ThirdPartyJobDetails)
(Maybe ThirdPartyJobDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetThirdPartyJobDetailsResponse' {Maybe ThirdPartyJobDetails
jobDetails :: Maybe ThirdPartyJobDetails
$sel:jobDetails:GetThirdPartyJobDetailsResponse' :: GetThirdPartyJobDetailsResponse -> Maybe ThirdPartyJobDetails
jobDetails} -> Maybe ThirdPartyJobDetails
jobDetails) (\s :: GetThirdPartyJobDetailsResponse
s@GetThirdPartyJobDetailsResponse' {} Maybe ThirdPartyJobDetails
a -> GetThirdPartyJobDetailsResponse
s {$sel:jobDetails:GetThirdPartyJobDetailsResponse' :: Maybe ThirdPartyJobDetails
jobDetails = Maybe ThirdPartyJobDetails
a} :: GetThirdPartyJobDetailsResponse)
getThirdPartyJobDetailsResponse_httpStatus :: Lens.Lens' GetThirdPartyJobDetailsResponse Prelude.Int
getThirdPartyJobDetailsResponse_httpStatus :: (Int -> f Int)
-> GetThirdPartyJobDetailsResponse
-> f GetThirdPartyJobDetailsResponse
getThirdPartyJobDetailsResponse_httpStatus = (GetThirdPartyJobDetailsResponse -> Int)
-> (GetThirdPartyJobDetailsResponse
-> Int -> GetThirdPartyJobDetailsResponse)
-> Lens
GetThirdPartyJobDetailsResponse
GetThirdPartyJobDetailsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetThirdPartyJobDetailsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetThirdPartyJobDetailsResponse' :: GetThirdPartyJobDetailsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetThirdPartyJobDetailsResponse
s@GetThirdPartyJobDetailsResponse' {} Int
a -> GetThirdPartyJobDetailsResponse
s {$sel:httpStatus:GetThirdPartyJobDetailsResponse' :: Int
httpStatus = Int
a} :: GetThirdPartyJobDetailsResponse)
instance
Prelude.NFData
GetThirdPartyJobDetailsResponse