{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.HealthLake.ListFHIRExportJobs
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all FHIR export jobs associated with an account and their
-- statuses.
module Amazonka.HealthLake.ListFHIRExportJobs
  ( -- * Creating a Request
    ListFHIRExportJobs (..),
    newListFHIRExportJobs,

    -- * Request Lenses
    listFHIRExportJobs_submittedAfter,
    listFHIRExportJobs_jobName,
    listFHIRExportJobs_submittedBefore,
    listFHIRExportJobs_nextToken,
    listFHIRExportJobs_jobStatus,
    listFHIRExportJobs_maxResults,
    listFHIRExportJobs_datastoreId,

    -- * Destructuring the Response
    ListFHIRExportJobsResponse (..),
    newListFHIRExportJobsResponse,

    -- * Response Lenses
    listFHIRExportJobsResponse_nextToken,
    listFHIRExportJobsResponse_httpStatus,
    listFHIRExportJobsResponse_exportJobPropertiesList,
  )
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

-- | /See:/ 'newListFHIRExportJobs' smart constructor.
data ListFHIRExportJobs = ListFHIRExportJobs'
  { -- | This parameter limits the response to FHIR export jobs submitted after a
    -- user specified date.
    ListFHIRExportJobs -> Maybe POSIX
submittedAfter :: Prelude.Maybe Core.POSIX,
    -- | This parameter limits the response to the export job with the specified
    -- job name.
    ListFHIRExportJobs -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
    -- | This parameter limits the response to FHIR export jobs submitted before
    -- a user specified date.
    ListFHIRExportJobs -> Maybe POSIX
submittedBefore :: Prelude.Maybe Core.POSIX,
    -- | A pagination token used to identify the next page of results to return
    -- for a ListFHIRExportJobs query.
    ListFHIRExportJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | This parameter limits the response to the export jobs with the specified
    -- job status.
    ListFHIRExportJobs -> Maybe JobStatus
jobStatus :: Prelude.Maybe JobStatus,
    -- | This parameter limits the number of results returned for a
    -- ListFHIRExportJobs to a maximum quantity specified by the user.
    ListFHIRExportJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | This parameter limits the response to the export job with the specified
    -- Data Store ID.
    ListFHIRExportJobs -> Text
datastoreId :: Prelude.Text
  }
  deriving (ListFHIRExportJobs -> ListFHIRExportJobs -> Bool
(ListFHIRExportJobs -> ListFHIRExportJobs -> Bool)
-> (ListFHIRExportJobs -> ListFHIRExportJobs -> Bool)
-> Eq ListFHIRExportJobs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFHIRExportJobs -> ListFHIRExportJobs -> Bool
$c/= :: ListFHIRExportJobs -> ListFHIRExportJobs -> Bool
== :: ListFHIRExportJobs -> ListFHIRExportJobs -> Bool
$c== :: ListFHIRExportJobs -> ListFHIRExportJobs -> Bool
Prelude.Eq, ReadPrec [ListFHIRExportJobs]
ReadPrec ListFHIRExportJobs
Int -> ReadS ListFHIRExportJobs
ReadS [ListFHIRExportJobs]
(Int -> ReadS ListFHIRExportJobs)
-> ReadS [ListFHIRExportJobs]
-> ReadPrec ListFHIRExportJobs
-> ReadPrec [ListFHIRExportJobs]
-> Read ListFHIRExportJobs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFHIRExportJobs]
$creadListPrec :: ReadPrec [ListFHIRExportJobs]
readPrec :: ReadPrec ListFHIRExportJobs
$creadPrec :: ReadPrec ListFHIRExportJobs
readList :: ReadS [ListFHIRExportJobs]
$creadList :: ReadS [ListFHIRExportJobs]
readsPrec :: Int -> ReadS ListFHIRExportJobs
$creadsPrec :: Int -> ReadS ListFHIRExportJobs
Prelude.Read, Int -> ListFHIRExportJobs -> ShowS
[ListFHIRExportJobs] -> ShowS
ListFHIRExportJobs -> String
(Int -> ListFHIRExportJobs -> ShowS)
-> (ListFHIRExportJobs -> String)
-> ([ListFHIRExportJobs] -> ShowS)
-> Show ListFHIRExportJobs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFHIRExportJobs] -> ShowS
$cshowList :: [ListFHIRExportJobs] -> ShowS
show :: ListFHIRExportJobs -> String
$cshow :: ListFHIRExportJobs -> String
showsPrec :: Int -> ListFHIRExportJobs -> ShowS
$cshowsPrec :: Int -> ListFHIRExportJobs -> ShowS
Prelude.Show, (forall x. ListFHIRExportJobs -> Rep ListFHIRExportJobs x)
-> (forall x. Rep ListFHIRExportJobs x -> ListFHIRExportJobs)
-> Generic ListFHIRExportJobs
forall x. Rep ListFHIRExportJobs x -> ListFHIRExportJobs
forall x. ListFHIRExportJobs -> Rep ListFHIRExportJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFHIRExportJobs x -> ListFHIRExportJobs
$cfrom :: forall x. ListFHIRExportJobs -> Rep ListFHIRExportJobs x
Prelude.Generic)

-- |
-- Create a value of 'ListFHIRExportJobs' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'submittedAfter', 'listFHIRExportJobs_submittedAfter' - This parameter limits the response to FHIR export jobs submitted after a
-- user specified date.
--
-- 'jobName', 'listFHIRExportJobs_jobName' - This parameter limits the response to the export job with the specified
-- job name.
--
-- 'submittedBefore', 'listFHIRExportJobs_submittedBefore' - This parameter limits the response to FHIR export jobs submitted before
-- a user specified date.
--
-- 'nextToken', 'listFHIRExportJobs_nextToken' - A pagination token used to identify the next page of results to return
-- for a ListFHIRExportJobs query.
--
-- 'jobStatus', 'listFHIRExportJobs_jobStatus' - This parameter limits the response to the export jobs with the specified
-- job status.
--
-- 'maxResults', 'listFHIRExportJobs_maxResults' - This parameter limits the number of results returned for a
-- ListFHIRExportJobs to a maximum quantity specified by the user.
--
-- 'datastoreId', 'listFHIRExportJobs_datastoreId' - This parameter limits the response to the export job with the specified
-- Data Store ID.
newListFHIRExportJobs ::
  -- | 'datastoreId'
  Prelude.Text ->
  ListFHIRExportJobs
newListFHIRExportJobs :: Text -> ListFHIRExportJobs
newListFHIRExportJobs Text
pDatastoreId_ =
  ListFHIRExportJobs' :: Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe JobStatus
-> Maybe Natural
-> Text
-> ListFHIRExportJobs
ListFHIRExportJobs'
    { $sel:submittedAfter:ListFHIRExportJobs' :: Maybe POSIX
submittedAfter =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:jobName:ListFHIRExportJobs' :: Maybe Text
jobName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:submittedBefore:ListFHIRExportJobs' :: Maybe POSIX
submittedBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListFHIRExportJobs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobStatus:ListFHIRExportJobs' :: Maybe JobStatus
jobStatus = Maybe JobStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFHIRExportJobs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:datastoreId:ListFHIRExportJobs' :: Text
datastoreId = Text
pDatastoreId_
    }

-- | This parameter limits the response to FHIR export jobs submitted after a
-- user specified date.
listFHIRExportJobs_submittedAfter :: Lens.Lens' ListFHIRExportJobs (Prelude.Maybe Prelude.UTCTime)
listFHIRExportJobs_submittedAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListFHIRExportJobs -> f ListFHIRExportJobs
listFHIRExportJobs_submittedAfter = (ListFHIRExportJobs -> Maybe POSIX)
-> (ListFHIRExportJobs -> Maybe POSIX -> ListFHIRExportJobs)
-> Lens
     ListFHIRExportJobs ListFHIRExportJobs (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRExportJobs' {Maybe POSIX
submittedAfter :: Maybe POSIX
$sel:submittedAfter:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe POSIX
submittedAfter} -> Maybe POSIX
submittedAfter) (\s :: ListFHIRExportJobs
s@ListFHIRExportJobs' {} Maybe POSIX
a -> ListFHIRExportJobs
s {$sel:submittedAfter:ListFHIRExportJobs' :: Maybe POSIX
submittedAfter = Maybe POSIX
a} :: ListFHIRExportJobs) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListFHIRExportJobs -> f ListFHIRExportJobs)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListFHIRExportJobs
-> f ListFHIRExportJobs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | This parameter limits the response to the export job with the specified
-- job name.
listFHIRExportJobs_jobName :: Lens.Lens' ListFHIRExportJobs (Prelude.Maybe Prelude.Text)
listFHIRExportJobs_jobName :: (Maybe Text -> f (Maybe Text))
-> ListFHIRExportJobs -> f ListFHIRExportJobs
listFHIRExportJobs_jobName = (ListFHIRExportJobs -> Maybe Text)
-> (ListFHIRExportJobs -> Maybe Text -> ListFHIRExportJobs)
-> Lens
     ListFHIRExportJobs ListFHIRExportJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRExportJobs' {Maybe Text
jobName :: Maybe Text
$sel:jobName:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe Text
jobName} -> Maybe Text
jobName) (\s :: ListFHIRExportJobs
s@ListFHIRExportJobs' {} Maybe Text
a -> ListFHIRExportJobs
s {$sel:jobName:ListFHIRExportJobs' :: Maybe Text
jobName = Maybe Text
a} :: ListFHIRExportJobs)

-- | This parameter limits the response to FHIR export jobs submitted before
-- a user specified date.
listFHIRExportJobs_submittedBefore :: Lens.Lens' ListFHIRExportJobs (Prelude.Maybe Prelude.UTCTime)
listFHIRExportJobs_submittedBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListFHIRExportJobs -> f ListFHIRExportJobs
listFHIRExportJobs_submittedBefore = (ListFHIRExportJobs -> Maybe POSIX)
-> (ListFHIRExportJobs -> Maybe POSIX -> ListFHIRExportJobs)
-> Lens
     ListFHIRExportJobs ListFHIRExportJobs (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRExportJobs' {Maybe POSIX
submittedBefore :: Maybe POSIX
$sel:submittedBefore:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe POSIX
submittedBefore} -> Maybe POSIX
submittedBefore) (\s :: ListFHIRExportJobs
s@ListFHIRExportJobs' {} Maybe POSIX
a -> ListFHIRExportJobs
s {$sel:submittedBefore:ListFHIRExportJobs' :: Maybe POSIX
submittedBefore = Maybe POSIX
a} :: ListFHIRExportJobs) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListFHIRExportJobs -> f ListFHIRExportJobs)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListFHIRExportJobs
-> f ListFHIRExportJobs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A pagination token used to identify the next page of results to return
-- for a ListFHIRExportJobs query.
listFHIRExportJobs_nextToken :: Lens.Lens' ListFHIRExportJobs (Prelude.Maybe Prelude.Text)
listFHIRExportJobs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFHIRExportJobs -> f ListFHIRExportJobs
listFHIRExportJobs_nextToken = (ListFHIRExportJobs -> Maybe Text)
-> (ListFHIRExportJobs -> Maybe Text -> ListFHIRExportJobs)
-> Lens
     ListFHIRExportJobs ListFHIRExportJobs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRExportJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFHIRExportJobs
s@ListFHIRExportJobs' {} Maybe Text
a -> ListFHIRExportJobs
s {$sel:nextToken:ListFHIRExportJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListFHIRExportJobs)

-- | This parameter limits the response to the export jobs with the specified
-- job status.
listFHIRExportJobs_jobStatus :: Lens.Lens' ListFHIRExportJobs (Prelude.Maybe JobStatus)
listFHIRExportJobs_jobStatus :: (Maybe JobStatus -> f (Maybe JobStatus))
-> ListFHIRExportJobs -> f ListFHIRExportJobs
listFHIRExportJobs_jobStatus = (ListFHIRExportJobs -> Maybe JobStatus)
-> (ListFHIRExportJobs -> Maybe JobStatus -> ListFHIRExportJobs)
-> Lens
     ListFHIRExportJobs
     ListFHIRExportJobs
     (Maybe JobStatus)
     (Maybe JobStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRExportJobs' {Maybe JobStatus
jobStatus :: Maybe JobStatus
$sel:jobStatus:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe JobStatus
jobStatus} -> Maybe JobStatus
jobStatus) (\s :: ListFHIRExportJobs
s@ListFHIRExportJobs' {} Maybe JobStatus
a -> ListFHIRExportJobs
s {$sel:jobStatus:ListFHIRExportJobs' :: Maybe JobStatus
jobStatus = Maybe JobStatus
a} :: ListFHIRExportJobs)

-- | This parameter limits the number of results returned for a
-- ListFHIRExportJobs to a maximum quantity specified by the user.
listFHIRExportJobs_maxResults :: Lens.Lens' ListFHIRExportJobs (Prelude.Maybe Prelude.Natural)
listFHIRExportJobs_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListFHIRExportJobs -> f ListFHIRExportJobs
listFHIRExportJobs_maxResults = (ListFHIRExportJobs -> Maybe Natural)
-> (ListFHIRExportJobs -> Maybe Natural -> ListFHIRExportJobs)
-> Lens
     ListFHIRExportJobs
     ListFHIRExportJobs
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRExportJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListFHIRExportJobs
s@ListFHIRExportJobs' {} Maybe Natural
a -> ListFHIRExportJobs
s {$sel:maxResults:ListFHIRExportJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListFHIRExportJobs)

-- | This parameter limits the response to the export job with the specified
-- Data Store ID.
listFHIRExportJobs_datastoreId :: Lens.Lens' ListFHIRExportJobs Prelude.Text
listFHIRExportJobs_datastoreId :: (Text -> f Text) -> ListFHIRExportJobs -> f ListFHIRExportJobs
listFHIRExportJobs_datastoreId = (ListFHIRExportJobs -> Text)
-> (ListFHIRExportJobs -> Text -> ListFHIRExportJobs)
-> Lens ListFHIRExportJobs ListFHIRExportJobs Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRExportJobs' {Text
datastoreId :: Text
$sel:datastoreId:ListFHIRExportJobs' :: ListFHIRExportJobs -> Text
datastoreId} -> Text
datastoreId) (\s :: ListFHIRExportJobs
s@ListFHIRExportJobs' {} Text
a -> ListFHIRExportJobs
s {$sel:datastoreId:ListFHIRExportJobs' :: Text
datastoreId = Text
a} :: ListFHIRExportJobs)

instance Core.AWSRequest ListFHIRExportJobs where
  type
    AWSResponse ListFHIRExportJobs =
      ListFHIRExportJobsResponse
  request :: ListFHIRExportJobs -> Request ListFHIRExportJobs
request = Service -> ListFHIRExportJobs -> Request ListFHIRExportJobs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListFHIRExportJobs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListFHIRExportJobs)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListFHIRExportJobs))
-> Logger
-> Service
-> Proxy ListFHIRExportJobs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListFHIRExportJobs)))
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 Text
-> Int -> [ExportJobProperties] -> ListFHIRExportJobsResponse
ListFHIRExportJobsResponse'
            (Maybe Text
 -> Int -> [ExportJobProperties] -> ListFHIRExportJobsResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> [ExportJobProperties] -> ListFHIRExportJobsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String (Int -> [ExportJobProperties] -> ListFHIRExportJobsResponse)
-> Either String Int
-> Either
     String ([ExportJobProperties] -> ListFHIRExportJobsResponse)
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))
            Either String ([ExportJobProperties] -> ListFHIRExportJobsResponse)
-> Either String [ExportJobProperties]
-> Either String ListFHIRExportJobsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [ExportJobProperties])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ExportJobPropertiesList"
                            Either String (Maybe [ExportJobProperties])
-> [ExportJobProperties] -> Either String [ExportJobProperties]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [ExportJobProperties]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListFHIRExportJobs

instance Prelude.NFData ListFHIRExportJobs

instance Core.ToHeaders ListFHIRExportJobs where
  toHeaders :: ListFHIRExportJobs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListFHIRExportJobs -> 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.ListFHIRExportJobs" ::
                          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 ListFHIRExportJobs where
  toJSON :: ListFHIRExportJobs -> Value
toJSON ListFHIRExportJobs' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe JobStatus
Text
datastoreId :: Text
maxResults :: Maybe Natural
jobStatus :: Maybe JobStatus
nextToken :: Maybe Text
submittedBefore :: Maybe POSIX
jobName :: Maybe Text
submittedAfter :: Maybe POSIX
$sel:datastoreId:ListFHIRExportJobs' :: ListFHIRExportJobs -> Text
$sel:maxResults:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe Natural
$sel:jobStatus:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe JobStatus
$sel:nextToken:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe Text
$sel:submittedBefore:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe POSIX
$sel:jobName:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe Text
$sel:submittedAfter:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe POSIX
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SubmittedAfter" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
submittedAfter,
            (Text
"JobName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
jobName,
            (Text
"SubmittedBefore" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
submittedBefore,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"JobStatus" Text -> JobStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (JobStatus -> Pair) -> Maybe JobStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobStatus
jobStatus,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            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)
          ]
      )

instance Core.ToPath ListFHIRExportJobs where
  toPath :: ListFHIRExportJobs -> ByteString
toPath = ByteString -> ListFHIRExportJobs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListFHIRExportJobs where
  toQuery :: ListFHIRExportJobs -> QueryString
toQuery = QueryString -> ListFHIRExportJobs -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListFHIRExportJobsResponse' smart constructor.
data ListFHIRExportJobsResponse = ListFHIRExportJobsResponse'
  { -- | A pagination token used to identify the next page of results to return
    -- for a ListFHIRExportJobs query.
    ListFHIRExportJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListFHIRExportJobsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The properties of listed FHIR export jobs, including the ID, ARN, name,
    -- and the status of the job.
    ListFHIRExportJobsResponse -> [ExportJobProperties]
exportJobPropertiesList :: [ExportJobProperties]
  }
  deriving (ListFHIRExportJobsResponse -> ListFHIRExportJobsResponse -> Bool
(ListFHIRExportJobsResponse -> ListFHIRExportJobsResponse -> Bool)
-> (ListFHIRExportJobsResponse
    -> ListFHIRExportJobsResponse -> Bool)
-> Eq ListFHIRExportJobsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFHIRExportJobsResponse -> ListFHIRExportJobsResponse -> Bool
$c/= :: ListFHIRExportJobsResponse -> ListFHIRExportJobsResponse -> Bool
== :: ListFHIRExportJobsResponse -> ListFHIRExportJobsResponse -> Bool
$c== :: ListFHIRExportJobsResponse -> ListFHIRExportJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListFHIRExportJobsResponse]
ReadPrec ListFHIRExportJobsResponse
Int -> ReadS ListFHIRExportJobsResponse
ReadS [ListFHIRExportJobsResponse]
(Int -> ReadS ListFHIRExportJobsResponse)
-> ReadS [ListFHIRExportJobsResponse]
-> ReadPrec ListFHIRExportJobsResponse
-> ReadPrec [ListFHIRExportJobsResponse]
-> Read ListFHIRExportJobsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFHIRExportJobsResponse]
$creadListPrec :: ReadPrec [ListFHIRExportJobsResponse]
readPrec :: ReadPrec ListFHIRExportJobsResponse
$creadPrec :: ReadPrec ListFHIRExportJobsResponse
readList :: ReadS [ListFHIRExportJobsResponse]
$creadList :: ReadS [ListFHIRExportJobsResponse]
readsPrec :: Int -> ReadS ListFHIRExportJobsResponse
$creadsPrec :: Int -> ReadS ListFHIRExportJobsResponse
Prelude.Read, Int -> ListFHIRExportJobsResponse -> ShowS
[ListFHIRExportJobsResponse] -> ShowS
ListFHIRExportJobsResponse -> String
(Int -> ListFHIRExportJobsResponse -> ShowS)
-> (ListFHIRExportJobsResponse -> String)
-> ([ListFHIRExportJobsResponse] -> ShowS)
-> Show ListFHIRExportJobsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFHIRExportJobsResponse] -> ShowS
$cshowList :: [ListFHIRExportJobsResponse] -> ShowS
show :: ListFHIRExportJobsResponse -> String
$cshow :: ListFHIRExportJobsResponse -> String
showsPrec :: Int -> ListFHIRExportJobsResponse -> ShowS
$cshowsPrec :: Int -> ListFHIRExportJobsResponse -> ShowS
Prelude.Show, (forall x.
 ListFHIRExportJobsResponse -> Rep ListFHIRExportJobsResponse x)
-> (forall x.
    Rep ListFHIRExportJobsResponse x -> ListFHIRExportJobsResponse)
-> Generic ListFHIRExportJobsResponse
forall x.
Rep ListFHIRExportJobsResponse x -> ListFHIRExportJobsResponse
forall x.
ListFHIRExportJobsResponse -> Rep ListFHIRExportJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFHIRExportJobsResponse x -> ListFHIRExportJobsResponse
$cfrom :: forall x.
ListFHIRExportJobsResponse -> Rep ListFHIRExportJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListFHIRExportJobsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listFHIRExportJobsResponse_nextToken' - A pagination token used to identify the next page of results to return
-- for a ListFHIRExportJobs query.
--
-- 'httpStatus', 'listFHIRExportJobsResponse_httpStatus' - The response's http status code.
--
-- 'exportJobPropertiesList', 'listFHIRExportJobsResponse_exportJobPropertiesList' - The properties of listed FHIR export jobs, including the ID, ARN, name,
-- and the status of the job.
newListFHIRExportJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListFHIRExportJobsResponse
newListFHIRExportJobsResponse :: Int -> ListFHIRExportJobsResponse
newListFHIRExportJobsResponse Int
pHttpStatus_ =
  ListFHIRExportJobsResponse' :: Maybe Text
-> Int -> [ExportJobProperties] -> ListFHIRExportJobsResponse
ListFHIRExportJobsResponse'
    { $sel:nextToken:ListFHIRExportJobsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFHIRExportJobsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:exportJobPropertiesList:ListFHIRExportJobsResponse' :: [ExportJobProperties]
exportJobPropertiesList = [ExportJobProperties]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A pagination token used to identify the next page of results to return
-- for a ListFHIRExportJobs query.
listFHIRExportJobsResponse_nextToken :: Lens.Lens' ListFHIRExportJobsResponse (Prelude.Maybe Prelude.Text)
listFHIRExportJobsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListFHIRExportJobsResponse -> f ListFHIRExportJobsResponse
listFHIRExportJobsResponse_nextToken = (ListFHIRExportJobsResponse -> Maybe Text)
-> (ListFHIRExportJobsResponse
    -> Maybe Text -> ListFHIRExportJobsResponse)
-> Lens
     ListFHIRExportJobsResponse
     ListFHIRExportJobsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRExportJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFHIRExportJobsResponse' :: ListFHIRExportJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFHIRExportJobsResponse
s@ListFHIRExportJobsResponse' {} Maybe Text
a -> ListFHIRExportJobsResponse
s {$sel:nextToken:ListFHIRExportJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFHIRExportJobsResponse)

-- | The response's http status code.
listFHIRExportJobsResponse_httpStatus :: Lens.Lens' ListFHIRExportJobsResponse Prelude.Int
listFHIRExportJobsResponse_httpStatus :: (Int -> f Int)
-> ListFHIRExportJobsResponse -> f ListFHIRExportJobsResponse
listFHIRExportJobsResponse_httpStatus = (ListFHIRExportJobsResponse -> Int)
-> (ListFHIRExportJobsResponse
    -> Int -> ListFHIRExportJobsResponse)
-> Lens
     ListFHIRExportJobsResponse ListFHIRExportJobsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRExportJobsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListFHIRExportJobsResponse' :: ListFHIRExportJobsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListFHIRExportJobsResponse
s@ListFHIRExportJobsResponse' {} Int
a -> ListFHIRExportJobsResponse
s {$sel:httpStatus:ListFHIRExportJobsResponse' :: Int
httpStatus = Int
a} :: ListFHIRExportJobsResponse)

-- | The properties of listed FHIR export jobs, including the ID, ARN, name,
-- and the status of the job.
listFHIRExportJobsResponse_exportJobPropertiesList :: Lens.Lens' ListFHIRExportJobsResponse [ExportJobProperties]
listFHIRExportJobsResponse_exportJobPropertiesList :: ([ExportJobProperties] -> f [ExportJobProperties])
-> ListFHIRExportJobsResponse -> f ListFHIRExportJobsResponse
listFHIRExportJobsResponse_exportJobPropertiesList = (ListFHIRExportJobsResponse -> [ExportJobProperties])
-> (ListFHIRExportJobsResponse
    -> [ExportJobProperties] -> ListFHIRExportJobsResponse)
-> Lens
     ListFHIRExportJobsResponse
     ListFHIRExportJobsResponse
     [ExportJobProperties]
     [ExportJobProperties]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRExportJobsResponse' {[ExportJobProperties]
exportJobPropertiesList :: [ExportJobProperties]
$sel:exportJobPropertiesList:ListFHIRExportJobsResponse' :: ListFHIRExportJobsResponse -> [ExportJobProperties]
exportJobPropertiesList} -> [ExportJobProperties]
exportJobPropertiesList) (\s :: ListFHIRExportJobsResponse
s@ListFHIRExportJobsResponse' {} [ExportJobProperties]
a -> ListFHIRExportJobsResponse
s {$sel:exportJobPropertiesList:ListFHIRExportJobsResponse' :: [ExportJobProperties]
exportJobPropertiesList = [ExportJobProperties]
a} :: ListFHIRExportJobsResponse) (([ExportJobProperties] -> f [ExportJobProperties])
 -> ListFHIRExportJobsResponse -> f ListFHIRExportJobsResponse)
-> (([ExportJobProperties] -> f [ExportJobProperties])
    -> [ExportJobProperties] -> f [ExportJobProperties])
-> ([ExportJobProperties] -> f [ExportJobProperties])
-> ListFHIRExportJobsResponse
-> f ListFHIRExportJobsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ExportJobProperties] -> f [ExportJobProperties])
-> [ExportJobProperties] -> f [ExportJobProperties]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListFHIRExportJobsResponse