{-# 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.HealthLake.DescribeFHIRImportJob
(
DescribeFHIRImportJob (..),
newDescribeFHIRImportJob,
describeFHIRImportJob_datastoreId,
describeFHIRImportJob_jobId,
DescribeFHIRImportJobResponse (..),
newDescribeFHIRImportJobResponse,
describeFHIRImportJobResponse_httpStatus,
describeFHIRImportJobResponse_importJobProperties,
)
where
import qualified Amazonka.Core as Core
import Amazonka.HealthLake.Types
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 DescribeFHIRImportJob = DescribeFHIRImportJob'
{
DescribeFHIRImportJob -> Text
datastoreId :: Prelude.Text,
DescribeFHIRImportJob -> Text
jobId :: Prelude.Text
}
deriving (DescribeFHIRImportJob -> DescribeFHIRImportJob -> Bool
(DescribeFHIRImportJob -> DescribeFHIRImportJob -> Bool)
-> (DescribeFHIRImportJob -> DescribeFHIRImportJob -> Bool)
-> Eq DescribeFHIRImportJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFHIRImportJob -> DescribeFHIRImportJob -> Bool
$c/= :: DescribeFHIRImportJob -> DescribeFHIRImportJob -> Bool
== :: DescribeFHIRImportJob -> DescribeFHIRImportJob -> Bool
$c== :: DescribeFHIRImportJob -> DescribeFHIRImportJob -> Bool
Prelude.Eq, ReadPrec [DescribeFHIRImportJob]
ReadPrec DescribeFHIRImportJob
Int -> ReadS DescribeFHIRImportJob
ReadS [DescribeFHIRImportJob]
(Int -> ReadS DescribeFHIRImportJob)
-> ReadS [DescribeFHIRImportJob]
-> ReadPrec DescribeFHIRImportJob
-> ReadPrec [DescribeFHIRImportJob]
-> Read DescribeFHIRImportJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFHIRImportJob]
$creadListPrec :: ReadPrec [DescribeFHIRImportJob]
readPrec :: ReadPrec DescribeFHIRImportJob
$creadPrec :: ReadPrec DescribeFHIRImportJob
readList :: ReadS [DescribeFHIRImportJob]
$creadList :: ReadS [DescribeFHIRImportJob]
readsPrec :: Int -> ReadS DescribeFHIRImportJob
$creadsPrec :: Int -> ReadS DescribeFHIRImportJob
Prelude.Read, Int -> DescribeFHIRImportJob -> ShowS
[DescribeFHIRImportJob] -> ShowS
DescribeFHIRImportJob -> String
(Int -> DescribeFHIRImportJob -> ShowS)
-> (DescribeFHIRImportJob -> String)
-> ([DescribeFHIRImportJob] -> ShowS)
-> Show DescribeFHIRImportJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFHIRImportJob] -> ShowS
$cshowList :: [DescribeFHIRImportJob] -> ShowS
show :: DescribeFHIRImportJob -> String
$cshow :: DescribeFHIRImportJob -> String
showsPrec :: Int -> DescribeFHIRImportJob -> ShowS
$cshowsPrec :: Int -> DescribeFHIRImportJob -> ShowS
Prelude.Show, (forall x. DescribeFHIRImportJob -> Rep DescribeFHIRImportJob x)
-> (forall x. Rep DescribeFHIRImportJob x -> DescribeFHIRImportJob)
-> Generic DescribeFHIRImportJob
forall x. Rep DescribeFHIRImportJob x -> DescribeFHIRImportJob
forall x. DescribeFHIRImportJob -> Rep DescribeFHIRImportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeFHIRImportJob x -> DescribeFHIRImportJob
$cfrom :: forall x. DescribeFHIRImportJob -> Rep DescribeFHIRImportJob x
Prelude.Generic)
newDescribeFHIRImportJob ::
Prelude.Text ->
Prelude.Text ->
DescribeFHIRImportJob
newDescribeFHIRImportJob :: Text -> Text -> DescribeFHIRImportJob
newDescribeFHIRImportJob Text
pDatastoreId_ Text
pJobId_ =
DescribeFHIRImportJob' :: Text -> Text -> DescribeFHIRImportJob
DescribeFHIRImportJob'
{ $sel:datastoreId:DescribeFHIRImportJob' :: Text
datastoreId = Text
pDatastoreId_,
$sel:jobId:DescribeFHIRImportJob' :: Text
jobId = Text
pJobId_
}
describeFHIRImportJob_datastoreId :: Lens.Lens' DescribeFHIRImportJob Prelude.Text
describeFHIRImportJob_datastoreId :: (Text -> f Text)
-> DescribeFHIRImportJob -> f DescribeFHIRImportJob
describeFHIRImportJob_datastoreId = (DescribeFHIRImportJob -> Text)
-> (DescribeFHIRImportJob -> Text -> DescribeFHIRImportJob)
-> Lens DescribeFHIRImportJob DescribeFHIRImportJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFHIRImportJob' {Text
datastoreId :: Text
$sel:datastoreId:DescribeFHIRImportJob' :: DescribeFHIRImportJob -> Text
datastoreId} -> Text
datastoreId) (\s :: DescribeFHIRImportJob
s@DescribeFHIRImportJob' {} Text
a -> DescribeFHIRImportJob
s {$sel:datastoreId:DescribeFHIRImportJob' :: Text
datastoreId = Text
a} :: DescribeFHIRImportJob)
describeFHIRImportJob_jobId :: Lens.Lens' DescribeFHIRImportJob Prelude.Text
describeFHIRImportJob_jobId :: (Text -> f Text)
-> DescribeFHIRImportJob -> f DescribeFHIRImportJob
describeFHIRImportJob_jobId = (DescribeFHIRImportJob -> Text)
-> (DescribeFHIRImportJob -> Text -> DescribeFHIRImportJob)
-> Lens DescribeFHIRImportJob DescribeFHIRImportJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFHIRImportJob' {Text
jobId :: Text
$sel:jobId:DescribeFHIRImportJob' :: DescribeFHIRImportJob -> Text
jobId} -> Text
jobId) (\s :: DescribeFHIRImportJob
s@DescribeFHIRImportJob' {} Text
a -> DescribeFHIRImportJob
s {$sel:jobId:DescribeFHIRImportJob' :: Text
jobId = Text
a} :: DescribeFHIRImportJob)
instance Core.AWSRequest DescribeFHIRImportJob where
type
AWSResponse DescribeFHIRImportJob =
DescribeFHIRImportJobResponse
request :: DescribeFHIRImportJob -> Request DescribeFHIRImportJob
request = Service -> DescribeFHIRImportJob -> Request DescribeFHIRImportJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeFHIRImportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeFHIRImportJob)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeFHIRImportJob))
-> Logger
-> Service
-> Proxy DescribeFHIRImportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeFHIRImportJob)))
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 ->
Int -> ImportJobProperties -> DescribeFHIRImportJobResponse
DescribeFHIRImportJobResponse'
(Int -> ImportJobProperties -> DescribeFHIRImportJobResponse)
-> Either String Int
-> Either
String (ImportJobProperties -> DescribeFHIRImportJobResponse)
forall (f :: * -> *) a b. Functor 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))
Either
String (ImportJobProperties -> DescribeFHIRImportJobResponse)
-> Either String ImportJobProperties
-> Either String DescribeFHIRImportJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String ImportJobProperties
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ImportJobProperties")
)
instance Prelude.Hashable DescribeFHIRImportJob
instance Prelude.NFData DescribeFHIRImportJob
instance Core.ToHeaders DescribeFHIRImportJob where
toHeaders :: DescribeFHIRImportJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeFHIRImportJob -> 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
"HealthLake.DescribeFHIRImportJob" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DescribeFHIRImportJob where
toJSON :: DescribeFHIRImportJob -> Value
toJSON DescribeFHIRImportJob' {Text
jobId :: Text
datastoreId :: Text
$sel:jobId:DescribeFHIRImportJob' :: DescribeFHIRImportJob -> Text
$sel:datastoreId:DescribeFHIRImportJob' :: DescribeFHIRImportJob -> 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
"DatastoreId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
datastoreId),
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)
]
)
instance Core.ToPath DescribeFHIRImportJob where
toPath :: DescribeFHIRImportJob -> ByteString
toPath = ByteString -> DescribeFHIRImportJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeFHIRImportJob where
toQuery :: DescribeFHIRImportJob -> QueryString
toQuery = QueryString -> DescribeFHIRImportJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeFHIRImportJobResponse = DescribeFHIRImportJobResponse'
{
DescribeFHIRImportJobResponse -> Int
httpStatus :: Prelude.Int,
DescribeFHIRImportJobResponse -> ImportJobProperties
importJobProperties :: ImportJobProperties
}
deriving (DescribeFHIRImportJobResponse
-> DescribeFHIRImportJobResponse -> Bool
(DescribeFHIRImportJobResponse
-> DescribeFHIRImportJobResponse -> Bool)
-> (DescribeFHIRImportJobResponse
-> DescribeFHIRImportJobResponse -> Bool)
-> Eq DescribeFHIRImportJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFHIRImportJobResponse
-> DescribeFHIRImportJobResponse -> Bool
$c/= :: DescribeFHIRImportJobResponse
-> DescribeFHIRImportJobResponse -> Bool
== :: DescribeFHIRImportJobResponse
-> DescribeFHIRImportJobResponse -> Bool
$c== :: DescribeFHIRImportJobResponse
-> DescribeFHIRImportJobResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFHIRImportJobResponse]
ReadPrec DescribeFHIRImportJobResponse
Int -> ReadS DescribeFHIRImportJobResponse
ReadS [DescribeFHIRImportJobResponse]
(Int -> ReadS DescribeFHIRImportJobResponse)
-> ReadS [DescribeFHIRImportJobResponse]
-> ReadPrec DescribeFHIRImportJobResponse
-> ReadPrec [DescribeFHIRImportJobResponse]
-> Read DescribeFHIRImportJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFHIRImportJobResponse]
$creadListPrec :: ReadPrec [DescribeFHIRImportJobResponse]
readPrec :: ReadPrec DescribeFHIRImportJobResponse
$creadPrec :: ReadPrec DescribeFHIRImportJobResponse
readList :: ReadS [DescribeFHIRImportJobResponse]
$creadList :: ReadS [DescribeFHIRImportJobResponse]
readsPrec :: Int -> ReadS DescribeFHIRImportJobResponse
$creadsPrec :: Int -> ReadS DescribeFHIRImportJobResponse
Prelude.Read, Int -> DescribeFHIRImportJobResponse -> ShowS
[DescribeFHIRImportJobResponse] -> ShowS
DescribeFHIRImportJobResponse -> String
(Int -> DescribeFHIRImportJobResponse -> ShowS)
-> (DescribeFHIRImportJobResponse -> String)
-> ([DescribeFHIRImportJobResponse] -> ShowS)
-> Show DescribeFHIRImportJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFHIRImportJobResponse] -> ShowS
$cshowList :: [DescribeFHIRImportJobResponse] -> ShowS
show :: DescribeFHIRImportJobResponse -> String
$cshow :: DescribeFHIRImportJobResponse -> String
showsPrec :: Int -> DescribeFHIRImportJobResponse -> ShowS
$cshowsPrec :: Int -> DescribeFHIRImportJobResponse -> ShowS
Prelude.Show, (forall x.
DescribeFHIRImportJobResponse
-> Rep DescribeFHIRImportJobResponse x)
-> (forall x.
Rep DescribeFHIRImportJobResponse x
-> DescribeFHIRImportJobResponse)
-> Generic DescribeFHIRImportJobResponse
forall x.
Rep DescribeFHIRImportJobResponse x
-> DescribeFHIRImportJobResponse
forall x.
DescribeFHIRImportJobResponse
-> Rep DescribeFHIRImportJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFHIRImportJobResponse x
-> DescribeFHIRImportJobResponse
$cfrom :: forall x.
DescribeFHIRImportJobResponse
-> Rep DescribeFHIRImportJobResponse x
Prelude.Generic)
newDescribeFHIRImportJobResponse ::
Prelude.Int ->
ImportJobProperties ->
DescribeFHIRImportJobResponse
newDescribeFHIRImportJobResponse :: Int -> ImportJobProperties -> DescribeFHIRImportJobResponse
newDescribeFHIRImportJobResponse
Int
pHttpStatus_
ImportJobProperties
pImportJobProperties_ =
DescribeFHIRImportJobResponse' :: Int -> ImportJobProperties -> DescribeFHIRImportJobResponse
DescribeFHIRImportJobResponse'
{ $sel:httpStatus:DescribeFHIRImportJobResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:importJobProperties:DescribeFHIRImportJobResponse' :: ImportJobProperties
importJobProperties = ImportJobProperties
pImportJobProperties_
}
describeFHIRImportJobResponse_httpStatus :: Lens.Lens' DescribeFHIRImportJobResponse Prelude.Int
describeFHIRImportJobResponse_httpStatus :: (Int -> f Int)
-> DescribeFHIRImportJobResponse -> f DescribeFHIRImportJobResponse
describeFHIRImportJobResponse_httpStatus = (DescribeFHIRImportJobResponse -> Int)
-> (DescribeFHIRImportJobResponse
-> Int -> DescribeFHIRImportJobResponse)
-> Lens
DescribeFHIRImportJobResponse DescribeFHIRImportJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFHIRImportJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeFHIRImportJobResponse' :: DescribeFHIRImportJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeFHIRImportJobResponse
s@DescribeFHIRImportJobResponse' {} Int
a -> DescribeFHIRImportJobResponse
s {$sel:httpStatus:DescribeFHIRImportJobResponse' :: Int
httpStatus = Int
a} :: DescribeFHIRImportJobResponse)
describeFHIRImportJobResponse_importJobProperties :: Lens.Lens' DescribeFHIRImportJobResponse ImportJobProperties
describeFHIRImportJobResponse_importJobProperties :: (ImportJobProperties -> f ImportJobProperties)
-> DescribeFHIRImportJobResponse -> f DescribeFHIRImportJobResponse
describeFHIRImportJobResponse_importJobProperties = (DescribeFHIRImportJobResponse -> ImportJobProperties)
-> (DescribeFHIRImportJobResponse
-> ImportJobProperties -> DescribeFHIRImportJobResponse)
-> Lens
DescribeFHIRImportJobResponse
DescribeFHIRImportJobResponse
ImportJobProperties
ImportJobProperties
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFHIRImportJobResponse' {ImportJobProperties
importJobProperties :: ImportJobProperties
$sel:importJobProperties:DescribeFHIRImportJobResponse' :: DescribeFHIRImportJobResponse -> ImportJobProperties
importJobProperties} -> ImportJobProperties
importJobProperties) (\s :: DescribeFHIRImportJobResponse
s@DescribeFHIRImportJobResponse' {} ImportJobProperties
a -> DescribeFHIRImportJobResponse
s {$sel:importJobProperties:DescribeFHIRImportJobResponse' :: ImportJobProperties
importJobProperties = ImportJobProperties
a} :: DescribeFHIRImportJobResponse)
instance Prelude.NFData DescribeFHIRImportJobResponse