{-# 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.LakeFormation.GetWorkUnitResults
(
GetWorkUnitResults (..),
newGetWorkUnitResults,
getWorkUnitResults_queryId,
getWorkUnitResults_workUnitId,
getWorkUnitResults_workUnitToken,
GetWorkUnitResultsResponse (..),
newGetWorkUnitResultsResponse,
getWorkUnitResultsResponse_httpStatus,
getWorkUnitResultsResponse_resultStream,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LakeFormation.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetWorkUnitResults = GetWorkUnitResults'
{
GetWorkUnitResults -> Text
queryId :: Prelude.Text,
GetWorkUnitResults -> Natural
workUnitId :: Prelude.Natural,
GetWorkUnitResults -> Sensitive Text
workUnitToken :: Data.Sensitive Prelude.Text
}
deriving (GetWorkUnitResults -> GetWorkUnitResults -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetWorkUnitResults -> GetWorkUnitResults -> Bool
$c/= :: GetWorkUnitResults -> GetWorkUnitResults -> Bool
== :: GetWorkUnitResults -> GetWorkUnitResults -> Bool
$c== :: GetWorkUnitResults -> GetWorkUnitResults -> Bool
Prelude.Eq, Int -> GetWorkUnitResults -> ShowS
[GetWorkUnitResults] -> ShowS
GetWorkUnitResults -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetWorkUnitResults] -> ShowS
$cshowList :: [GetWorkUnitResults] -> ShowS
show :: GetWorkUnitResults -> String
$cshow :: GetWorkUnitResults -> String
showsPrec :: Int -> GetWorkUnitResults -> ShowS
$cshowsPrec :: Int -> GetWorkUnitResults -> ShowS
Prelude.Show, forall x. Rep GetWorkUnitResults x -> GetWorkUnitResults
forall x. GetWorkUnitResults -> Rep GetWorkUnitResults x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetWorkUnitResults x -> GetWorkUnitResults
$cfrom :: forall x. GetWorkUnitResults -> Rep GetWorkUnitResults x
Prelude.Generic)
newGetWorkUnitResults ::
Prelude.Text ->
Prelude.Natural ->
Prelude.Text ->
GetWorkUnitResults
newGetWorkUnitResults :: Text -> Natural -> Text -> GetWorkUnitResults
newGetWorkUnitResults
Text
pQueryId_
Natural
pWorkUnitId_
Text
pWorkUnitToken_ =
GetWorkUnitResults'
{ $sel:queryId:GetWorkUnitResults' :: Text
queryId = Text
pQueryId_,
$sel:workUnitId:GetWorkUnitResults' :: Natural
workUnitId = Natural
pWorkUnitId_,
$sel:workUnitToken:GetWorkUnitResults' :: Sensitive Text
workUnitToken =
forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pWorkUnitToken_
}
getWorkUnitResults_queryId :: Lens.Lens' GetWorkUnitResults Prelude.Text
getWorkUnitResults_queryId :: Lens' GetWorkUnitResults Text
getWorkUnitResults_queryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkUnitResults' {Text
queryId :: Text
$sel:queryId:GetWorkUnitResults' :: GetWorkUnitResults -> Text
queryId} -> Text
queryId) (\s :: GetWorkUnitResults
s@GetWorkUnitResults' {} Text
a -> GetWorkUnitResults
s {$sel:queryId:GetWorkUnitResults' :: Text
queryId = Text
a} :: GetWorkUnitResults)
getWorkUnitResults_workUnitId :: Lens.Lens' GetWorkUnitResults Prelude.Natural
getWorkUnitResults_workUnitId :: Lens' GetWorkUnitResults Natural
getWorkUnitResults_workUnitId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkUnitResults' {Natural
workUnitId :: Natural
$sel:workUnitId:GetWorkUnitResults' :: GetWorkUnitResults -> Natural
workUnitId} -> Natural
workUnitId) (\s :: GetWorkUnitResults
s@GetWorkUnitResults' {} Natural
a -> GetWorkUnitResults
s {$sel:workUnitId:GetWorkUnitResults' :: Natural
workUnitId = Natural
a} :: GetWorkUnitResults)
getWorkUnitResults_workUnitToken :: Lens.Lens' GetWorkUnitResults Prelude.Text
getWorkUnitResults_workUnitToken :: Lens' GetWorkUnitResults Text
getWorkUnitResults_workUnitToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkUnitResults' {Sensitive Text
workUnitToken :: Sensitive Text
$sel:workUnitToken:GetWorkUnitResults' :: GetWorkUnitResults -> Sensitive Text
workUnitToken} -> Sensitive Text
workUnitToken) (\s :: GetWorkUnitResults
s@GetWorkUnitResults' {} Sensitive Text
a -> GetWorkUnitResults
s {$sel:workUnitToken:GetWorkUnitResults' :: Sensitive Text
workUnitToken = Sensitive Text
a} :: GetWorkUnitResults) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Core.AWSRequest GetWorkUnitResults where
type
AWSResponse GetWorkUnitResults =
GetWorkUnitResultsResponse
request :: (Service -> Service)
-> GetWorkUnitResults -> Request GetWorkUnitResults
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 GetWorkUnitResults
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetWorkUnitResults)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int
-> ResponseHeaders
-> ResponseBody
-> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveBody
( \Int
s ResponseHeaders
h ResponseBody
x ->
Int -> ResponseBody -> GetWorkUnitResultsResponse
GetWorkUnitResultsResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure ResponseBody
x)
)
instance Prelude.Hashable GetWorkUnitResults where
hashWithSalt :: Int -> GetWorkUnitResults -> Int
hashWithSalt Int
_salt GetWorkUnitResults' {Natural
Text
Sensitive Text
workUnitToken :: Sensitive Text
workUnitId :: Natural
queryId :: Text
$sel:workUnitToken:GetWorkUnitResults' :: GetWorkUnitResults -> Sensitive Text
$sel:workUnitId:GetWorkUnitResults' :: GetWorkUnitResults -> Natural
$sel:queryId:GetWorkUnitResults' :: GetWorkUnitResults -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
queryId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
workUnitId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
workUnitToken
instance Prelude.NFData GetWorkUnitResults where
rnf :: GetWorkUnitResults -> ()
rnf GetWorkUnitResults' {Natural
Text
Sensitive Text
workUnitToken :: Sensitive Text
workUnitId :: Natural
queryId :: Text
$sel:workUnitToken:GetWorkUnitResults' :: GetWorkUnitResults -> Sensitive Text
$sel:workUnitId:GetWorkUnitResults' :: GetWorkUnitResults -> Natural
$sel:queryId:GetWorkUnitResults' :: GetWorkUnitResults -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
queryId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
workUnitId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
workUnitToken
instance Data.ToHeaders GetWorkUnitResults where
toHeaders :: GetWorkUnitResults -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetWorkUnitResults where
toJSON :: GetWorkUnitResults -> Value
toJSON GetWorkUnitResults' {Natural
Text
Sensitive Text
workUnitToken :: Sensitive Text
workUnitId :: Natural
queryId :: Text
$sel:workUnitToken:GetWorkUnitResults' :: GetWorkUnitResults -> Sensitive Text
$sel:workUnitId:GetWorkUnitResults' :: GetWorkUnitResults -> Natural
$sel:queryId:GetWorkUnitResults' :: GetWorkUnitResults -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"QueryId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
queryId),
forall a. a -> Maybe a
Prelude.Just (Key
"WorkUnitId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
workUnitId),
forall a. a -> Maybe a
Prelude.Just
(Key
"WorkUnitToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
workUnitToken)
]
)
instance Data.ToPath GetWorkUnitResults where
toPath :: GetWorkUnitResults -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/GetWorkUnitResults"
instance Data.ToQuery GetWorkUnitResults where
toQuery :: GetWorkUnitResults -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetWorkUnitResultsResponse = GetWorkUnitResultsResponse'
{
GetWorkUnitResultsResponse -> Int
httpStatus :: Prelude.Int,
GetWorkUnitResultsResponse -> ResponseBody
resultStream :: Data.ResponseBody
}
deriving (Int -> GetWorkUnitResultsResponse -> ShowS
[GetWorkUnitResultsResponse] -> ShowS
GetWorkUnitResultsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetWorkUnitResultsResponse] -> ShowS
$cshowList :: [GetWorkUnitResultsResponse] -> ShowS
show :: GetWorkUnitResultsResponse -> String
$cshow :: GetWorkUnitResultsResponse -> String
showsPrec :: Int -> GetWorkUnitResultsResponse -> ShowS
$cshowsPrec :: Int -> GetWorkUnitResultsResponse -> ShowS
Prelude.Show, forall x.
Rep GetWorkUnitResultsResponse x -> GetWorkUnitResultsResponse
forall x.
GetWorkUnitResultsResponse -> Rep GetWorkUnitResultsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetWorkUnitResultsResponse x -> GetWorkUnitResultsResponse
$cfrom :: forall x.
GetWorkUnitResultsResponse -> Rep GetWorkUnitResultsResponse x
Prelude.Generic)
newGetWorkUnitResultsResponse ::
Prelude.Int ->
Data.ResponseBody ->
GetWorkUnitResultsResponse
newGetWorkUnitResultsResponse :: Int -> ResponseBody -> GetWorkUnitResultsResponse
newGetWorkUnitResultsResponse
Int
pHttpStatus_
ResponseBody
pResultStream_ =
GetWorkUnitResultsResponse'
{ $sel:httpStatus:GetWorkUnitResultsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:resultStream:GetWorkUnitResultsResponse' :: ResponseBody
resultStream = ResponseBody
pResultStream_
}
getWorkUnitResultsResponse_httpStatus :: Lens.Lens' GetWorkUnitResultsResponse Prelude.Int
getWorkUnitResultsResponse_httpStatus :: Lens' GetWorkUnitResultsResponse Int
getWorkUnitResultsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkUnitResultsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetWorkUnitResultsResponse' :: GetWorkUnitResultsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetWorkUnitResultsResponse
s@GetWorkUnitResultsResponse' {} Int
a -> GetWorkUnitResultsResponse
s {$sel:httpStatus:GetWorkUnitResultsResponse' :: Int
httpStatus = Int
a} :: GetWorkUnitResultsResponse)
getWorkUnitResultsResponse_resultStream :: Lens.Lens' GetWorkUnitResultsResponse Data.ResponseBody
getWorkUnitResultsResponse_resultStream :: Lens' GetWorkUnitResultsResponse ResponseBody
getWorkUnitResultsResponse_resultStream = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkUnitResultsResponse' {ResponseBody
resultStream :: ResponseBody
$sel:resultStream:GetWorkUnitResultsResponse' :: GetWorkUnitResultsResponse -> ResponseBody
resultStream} -> ResponseBody
resultStream) (\s :: GetWorkUnitResultsResponse
s@GetWorkUnitResultsResponse' {} ResponseBody
a -> GetWorkUnitResultsResponse
s {$sel:resultStream:GetWorkUnitResultsResponse' :: ResponseBody
resultStream = ResponseBody
a} :: GetWorkUnitResultsResponse)