{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_jobName,
    listFHIRExportJobs_jobStatus,
    listFHIRExportJobs_maxResults,
    listFHIRExportJobs_nextToken,
    listFHIRExportJobs_submittedAfter,
    listFHIRExportJobs_submittedBefore,
    listFHIRExportJobs_datastoreId,

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

    -- * Response Lenses
    listFHIRExportJobsResponse_nextToken,
    listFHIRExportJobsResponse_httpStatus,
    listFHIRExportJobsResponse_exportJobPropertiesList,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.HealthLake.Types
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 the export job with the specified
    -- job name.
    ListFHIRExportJobs -> Maybe Text
jobName :: 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,
    -- | 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 FHIR export jobs submitted after a
    -- user specified date.
    ListFHIRExportJobs -> Maybe POSIX
submittedAfter :: Prelude.Maybe Data.POSIX,
    -- | This parameter limits the response to FHIR export jobs submitted before
    -- a user specified date.
    ListFHIRExportJobs -> Maybe POSIX
submittedBefore :: Prelude.Maybe Data.POSIX,
    -- | This parameter limits the response to the export job with the specified
    -- Data Store ID.
    ListFHIRExportJobs -> Text
datastoreId :: Prelude.Text
  }
  deriving (ListFHIRExportJobs -> ListFHIRExportJobs -> Bool
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]
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
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. 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:
--
-- 'jobName', 'listFHIRExportJobs_jobName' - This parameter limits the response to the export job with the specified
-- job name.
--
-- '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.
--
-- 'nextToken', 'listFHIRExportJobs_nextToken' - A pagination token used to identify the next page of results to return
-- for a ListFHIRExportJobs query.
--
-- 'submittedAfter', 'listFHIRExportJobs_submittedAfter' - This parameter limits the response to FHIR export jobs submitted after a
-- user specified date.
--
-- 'submittedBefore', 'listFHIRExportJobs_submittedBefore' - This parameter limits the response to FHIR export jobs submitted before
-- a user specified date.
--
-- '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'
    { $sel:jobName:ListFHIRExportJobs' :: Maybe Text
jobName = forall a. Maybe a
Prelude.Nothing,
      $sel:jobStatus:ListFHIRExportJobs' :: Maybe JobStatus
jobStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListFHIRExportJobs' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListFHIRExportJobs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:submittedAfter:ListFHIRExportJobs' :: Maybe POSIX
submittedAfter = forall a. Maybe a
Prelude.Nothing,
      $sel:submittedBefore:ListFHIRExportJobs' :: Maybe POSIX
submittedBefore = forall a. Maybe a
Prelude.Nothing,
      $sel:datastoreId:ListFHIRExportJobs' :: Text
datastoreId = Text
pDatastoreId_
    }

-- | 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 :: Lens' ListFHIRExportJobs (Maybe Text)
listFHIRExportJobs_jobName = 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 the export jobs with the specified
-- job status.
listFHIRExportJobs_jobStatus :: Lens.Lens' ListFHIRExportJobs (Prelude.Maybe JobStatus)
listFHIRExportJobs_jobStatus :: Lens' ListFHIRExportJobs (Maybe JobStatus)
listFHIRExportJobs_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 :: Lens' ListFHIRExportJobs (Maybe Natural)
listFHIRExportJobs_maxResults = 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)

-- | 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 :: Lens' ListFHIRExportJobs (Maybe Text)
listFHIRExportJobs_nextToken = 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 FHIR export jobs submitted after a
-- user specified date.
listFHIRExportJobs_submittedAfter :: Lens.Lens' ListFHIRExportJobs (Prelude.Maybe Prelude.UTCTime)
listFHIRExportJobs_submittedAfter :: Lens' ListFHIRExportJobs (Maybe UTCTime)
listFHIRExportJobs_submittedAfter = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | 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 :: Lens' ListFHIRExportJobs (Maybe UTCTime)
listFHIRExportJobs_submittedBefore = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | This parameter limits the response to the export job with the specified
-- Data Store ID.
listFHIRExportJobs_datastoreId :: Lens.Lens' ListFHIRExportJobs Prelude.Text
listFHIRExportJobs_datastoreId :: Lens' ListFHIRExportJobs Text
listFHIRExportJobs_datastoreId = 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 :: (Service -> Service)
-> ListFHIRExportJobs -> Request ListFHIRExportJobs
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 ListFHIRExportJobs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListFHIRExportJobs)))
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 Text
-> Int -> [ExportJobProperties] -> ListFHIRExportJobsResponse
ListFHIRExportJobsResponse'
            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
"NextToken")
            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))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ExportJobPropertiesList"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListFHIRExportJobs where
  hashWithSalt :: Int -> ListFHIRExportJobs -> Int
hashWithSalt Int
_salt ListFHIRExportJobs' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe JobStatus
Text
datastoreId :: Text
submittedBefore :: Maybe POSIX
submittedAfter :: Maybe POSIX
nextToken :: Maybe Text
maxResults :: Maybe Natural
jobStatus :: Maybe JobStatus
jobName :: Maybe Text
$sel:datastoreId:ListFHIRExportJobs' :: ListFHIRExportJobs -> Text
$sel:submittedBefore:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe POSIX
$sel:submittedAfter:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe POSIX
$sel:nextToken:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe Text
$sel:maxResults:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe Natural
$sel:jobStatus:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe JobStatus
$sel:jobName:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
jobName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JobStatus
jobStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
submittedAfter
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
submittedBefore
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
datastoreId

instance Prelude.NFData ListFHIRExportJobs where
  rnf :: ListFHIRExportJobs -> ()
rnf ListFHIRExportJobs' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe JobStatus
Text
datastoreId :: Text
submittedBefore :: Maybe POSIX
submittedAfter :: Maybe POSIX
nextToken :: Maybe Text
maxResults :: Maybe Natural
jobStatus :: Maybe JobStatus
jobName :: Maybe Text
$sel:datastoreId:ListFHIRExportJobs' :: ListFHIRExportJobs -> Text
$sel:submittedBefore:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe POSIX
$sel:submittedAfter:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe POSIX
$sel:nextToken:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe Text
$sel:maxResults:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe Natural
$sel:jobStatus:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe JobStatus
$sel:jobName:ListFHIRExportJobs' :: ListFHIRExportJobs -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
jobName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JobStatus
jobStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
submittedAfter
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
submittedBefore
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
datastoreId

instance Data.ToHeaders ListFHIRExportJobs where
  toHeaders :: ListFHIRExportJobs -> 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
"HealthLake.ListFHIRExportJobs" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

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

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

instance Data.ToQuery ListFHIRExportJobs where
  toQuery :: ListFHIRExportJobs -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
    { $sel:nextToken:ListFHIRExportJobsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListFHIRExportJobsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:exportJobPropertiesList:ListFHIRExportJobsResponse' :: [ExportJobProperties]
exportJobPropertiesList = 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 :: Lens' ListFHIRExportJobsResponse (Maybe Text)
listFHIRExportJobsResponse_nextToken = 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 :: Lens' ListFHIRExportJobsResponse Int
listFHIRExportJobsResponse_httpStatus = 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 :: Lens' ListFHIRExportJobsResponse [ExportJobProperties]
listFHIRExportJobsResponse_exportJobPropertiesList = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListFHIRExportJobsResponse where
  rnf :: ListFHIRExportJobsResponse -> ()
rnf ListFHIRExportJobsResponse' {Int
[ExportJobProperties]
Maybe Text
exportJobPropertiesList :: [ExportJobProperties]
httpStatus :: Int
nextToken :: Maybe Text
$sel:exportJobPropertiesList:ListFHIRExportJobsResponse' :: ListFHIRExportJobsResponse -> [ExportJobProperties]
$sel:httpStatus:ListFHIRExportJobsResponse' :: ListFHIRExportJobsResponse -> Int
$sel:nextToken:ListFHIRExportJobsResponse' :: ListFHIRExportJobsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ExportJobProperties]
exportJobPropertiesList