{-# 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.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 GetThirdPartyJobDetails = GetThirdPartyJobDetails'
{
GetThirdPartyJobDetails -> Text
jobId :: Prelude.Text,
GetThirdPartyJobDetails -> Text
clientToken :: Prelude.Text
}
deriving (GetThirdPartyJobDetails -> GetThirdPartyJobDetails -> Bool
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]
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
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. 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'
{ $sel:jobId:GetThirdPartyJobDetails' :: Text
jobId = Text
pJobId_,
$sel:clientToken:GetThirdPartyJobDetails' :: Text
clientToken = Text
pClientToken_
}
getThirdPartyJobDetails_jobId :: Lens.Lens' GetThirdPartyJobDetails Prelude.Text
getThirdPartyJobDetails_jobId :: Lens' GetThirdPartyJobDetails Text
getThirdPartyJobDetails_jobId = 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 :: Lens' GetThirdPartyJobDetails Text
getThirdPartyJobDetails_clientToken = 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 :: (Service -> Service)
-> GetThirdPartyJobDetails -> Request GetThirdPartyJobDetails
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 GetThirdPartyJobDetails
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetThirdPartyJobDetails)))
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 ThirdPartyJobDetails
-> Int -> GetThirdPartyJobDetailsResponse
GetThirdPartyJobDetailsResponse'
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
"jobDetails")
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 GetThirdPartyJobDetails where
hashWithSalt :: Int -> GetThirdPartyJobDetails -> Int
hashWithSalt Int
_salt GetThirdPartyJobDetails' {Text
clientToken :: Text
jobId :: Text
$sel:clientToken:GetThirdPartyJobDetails' :: GetThirdPartyJobDetails -> Text
$sel:jobId:GetThirdPartyJobDetails' :: GetThirdPartyJobDetails -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientToken
instance Prelude.NFData GetThirdPartyJobDetails where
rnf :: GetThirdPartyJobDetails -> ()
rnf GetThirdPartyJobDetails' {Text
clientToken :: Text
jobId :: Text
$sel:clientToken:GetThirdPartyJobDetails' :: GetThirdPartyJobDetails -> Text
$sel:jobId:GetThirdPartyJobDetails' :: GetThirdPartyJobDetails -> 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
clientToken
instance Data.ToHeaders GetThirdPartyJobDetails where
toHeaders :: GetThirdPartyJobDetails -> 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.GetThirdPartyJobDetails" ::
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 GetThirdPartyJobDetails where
toJSON :: GetThirdPartyJobDetails -> Value
toJSON GetThirdPartyJobDetails' {Text
clientToken :: Text
jobId :: Text
$sel:clientToken:GetThirdPartyJobDetails' :: GetThirdPartyJobDetails -> Text
$sel:jobId:GetThirdPartyJobDetails' :: GetThirdPartyJobDetails -> 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
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientToken)
]
)
instance Data.ToPath GetThirdPartyJobDetails where
toPath :: GetThirdPartyJobDetails -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetThirdPartyJobDetails where
toQuery :: GetThirdPartyJobDetails -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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
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.
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'
{ $sel:jobDetails:GetThirdPartyJobDetailsResponse' :: Maybe ThirdPartyJobDetails
jobDetails =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetThirdPartyJobDetailsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getThirdPartyJobDetailsResponse_jobDetails :: Lens.Lens' GetThirdPartyJobDetailsResponse (Prelude.Maybe ThirdPartyJobDetails)
getThirdPartyJobDetailsResponse_jobDetails :: Lens' GetThirdPartyJobDetailsResponse (Maybe ThirdPartyJobDetails)
getThirdPartyJobDetailsResponse_jobDetails = 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 :: Lens' GetThirdPartyJobDetailsResponse Int
getThirdPartyJobDetailsResponse_httpStatus = 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
where
rnf :: GetThirdPartyJobDetailsResponse -> ()
rnf GetThirdPartyJobDetailsResponse' {Int
Maybe ThirdPartyJobDetails
httpStatus :: Int
jobDetails :: Maybe ThirdPartyJobDetails
$sel:httpStatus:GetThirdPartyJobDetailsResponse' :: GetThirdPartyJobDetailsResponse -> Int
$sel:jobDetails:GetThirdPartyJobDetailsResponse' :: GetThirdPartyJobDetailsResponse -> Maybe ThirdPartyJobDetails
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ThirdPartyJobDetails
jobDetails
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus