{-# 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.ListFHIRDatastores
(
ListFHIRDatastores (..),
newListFHIRDatastores,
listFHIRDatastores_filter,
listFHIRDatastores_maxResults,
listFHIRDatastores_nextToken,
ListFHIRDatastoresResponse (..),
newListFHIRDatastoresResponse,
listFHIRDatastoresResponse_nextToken,
listFHIRDatastoresResponse_httpStatus,
listFHIRDatastoresResponse_datastorePropertiesList,
)
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
data ListFHIRDatastores = ListFHIRDatastores'
{
ListFHIRDatastores -> Maybe DatastoreFilter
filter' :: Prelude.Maybe DatastoreFilter,
ListFHIRDatastores -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListFHIRDatastores -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListFHIRDatastores -> ListFHIRDatastores -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFHIRDatastores -> ListFHIRDatastores -> Bool
$c/= :: ListFHIRDatastores -> ListFHIRDatastores -> Bool
== :: ListFHIRDatastores -> ListFHIRDatastores -> Bool
$c== :: ListFHIRDatastores -> ListFHIRDatastores -> Bool
Prelude.Eq, ReadPrec [ListFHIRDatastores]
ReadPrec ListFHIRDatastores
Int -> ReadS ListFHIRDatastores
ReadS [ListFHIRDatastores]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFHIRDatastores]
$creadListPrec :: ReadPrec [ListFHIRDatastores]
readPrec :: ReadPrec ListFHIRDatastores
$creadPrec :: ReadPrec ListFHIRDatastores
readList :: ReadS [ListFHIRDatastores]
$creadList :: ReadS [ListFHIRDatastores]
readsPrec :: Int -> ReadS ListFHIRDatastores
$creadsPrec :: Int -> ReadS ListFHIRDatastores
Prelude.Read, Int -> ListFHIRDatastores -> ShowS
[ListFHIRDatastores] -> ShowS
ListFHIRDatastores -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFHIRDatastores] -> ShowS
$cshowList :: [ListFHIRDatastores] -> ShowS
show :: ListFHIRDatastores -> String
$cshow :: ListFHIRDatastores -> String
showsPrec :: Int -> ListFHIRDatastores -> ShowS
$cshowsPrec :: Int -> ListFHIRDatastores -> ShowS
Prelude.Show, forall x. Rep ListFHIRDatastores x -> ListFHIRDatastores
forall x. ListFHIRDatastores -> Rep ListFHIRDatastores x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListFHIRDatastores x -> ListFHIRDatastores
$cfrom :: forall x. ListFHIRDatastores -> Rep ListFHIRDatastores x
Prelude.Generic)
newListFHIRDatastores ::
ListFHIRDatastores
newListFHIRDatastores :: ListFHIRDatastores
newListFHIRDatastores =
ListFHIRDatastores'
{ $sel:filter':ListFHIRDatastores' :: Maybe DatastoreFilter
filter' = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListFHIRDatastores' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListFHIRDatastores' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listFHIRDatastores_filter :: Lens.Lens' ListFHIRDatastores (Prelude.Maybe DatastoreFilter)
listFHIRDatastores_filter :: Lens' ListFHIRDatastores (Maybe DatastoreFilter)
listFHIRDatastores_filter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRDatastores' {Maybe DatastoreFilter
filter' :: Maybe DatastoreFilter
$sel:filter':ListFHIRDatastores' :: ListFHIRDatastores -> Maybe DatastoreFilter
filter'} -> Maybe DatastoreFilter
filter') (\s :: ListFHIRDatastores
s@ListFHIRDatastores' {} Maybe DatastoreFilter
a -> ListFHIRDatastores
s {$sel:filter':ListFHIRDatastores' :: Maybe DatastoreFilter
filter' = Maybe DatastoreFilter
a} :: ListFHIRDatastores)
listFHIRDatastores_maxResults :: Lens.Lens' ListFHIRDatastores (Prelude.Maybe Prelude.Natural)
listFHIRDatastores_maxResults :: Lens' ListFHIRDatastores (Maybe Natural)
listFHIRDatastores_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRDatastores' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListFHIRDatastores' :: ListFHIRDatastores -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListFHIRDatastores
s@ListFHIRDatastores' {} Maybe Natural
a -> ListFHIRDatastores
s {$sel:maxResults:ListFHIRDatastores' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListFHIRDatastores)
listFHIRDatastores_nextToken :: Lens.Lens' ListFHIRDatastores (Prelude.Maybe Prelude.Text)
listFHIRDatastores_nextToken :: Lens' ListFHIRDatastores (Maybe Text)
listFHIRDatastores_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRDatastores' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFHIRDatastores' :: ListFHIRDatastores -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFHIRDatastores
s@ListFHIRDatastores' {} Maybe Text
a -> ListFHIRDatastores
s {$sel:nextToken:ListFHIRDatastores' :: Maybe Text
nextToken = Maybe Text
a} :: ListFHIRDatastores)
instance Core.AWSRequest ListFHIRDatastores where
type
AWSResponse ListFHIRDatastores =
ListFHIRDatastoresResponse
request :: (Service -> Service)
-> ListFHIRDatastores -> Request ListFHIRDatastores
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 ListFHIRDatastores
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListFHIRDatastores)))
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 -> [DatastoreProperties] -> ListFHIRDatastoresResponse
ListFHIRDatastoresResponse'
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
"DatastorePropertiesList"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ListFHIRDatastores where
hashWithSalt :: Int -> ListFHIRDatastores -> Int
hashWithSalt Int
_salt ListFHIRDatastores' {Maybe Natural
Maybe Text
Maybe DatastoreFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe DatastoreFilter
$sel:nextToken:ListFHIRDatastores' :: ListFHIRDatastores -> Maybe Text
$sel:maxResults:ListFHIRDatastores' :: ListFHIRDatastores -> Maybe Natural
$sel:filter':ListFHIRDatastores' :: ListFHIRDatastores -> Maybe DatastoreFilter
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DatastoreFilter
filter'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListFHIRDatastores where
rnf :: ListFHIRDatastores -> ()
rnf ListFHIRDatastores' {Maybe Natural
Maybe Text
Maybe DatastoreFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe DatastoreFilter
$sel:nextToken:ListFHIRDatastores' :: ListFHIRDatastores -> Maybe Text
$sel:maxResults:ListFHIRDatastores' :: ListFHIRDatastores -> Maybe Natural
$sel:filter':ListFHIRDatastores' :: ListFHIRDatastores -> Maybe DatastoreFilter
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DatastoreFilter
filter'
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
instance Data.ToHeaders ListFHIRDatastores where
toHeaders :: ListFHIRDatastores -> 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.ListFHIRDatastores" ::
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 ListFHIRDatastores where
toJSON :: ListFHIRDatastores -> Value
toJSON ListFHIRDatastores' {Maybe Natural
Maybe Text
Maybe DatastoreFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe DatastoreFilter
$sel:nextToken:ListFHIRDatastores' :: ListFHIRDatastores -> Maybe Text
$sel:maxResults:ListFHIRDatastores' :: ListFHIRDatastores -> Maybe Natural
$sel:filter':ListFHIRDatastores' :: ListFHIRDatastores -> Maybe DatastoreFilter
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Filter" 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 DatastoreFilter
filter',
(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
]
)
instance Data.ToPath ListFHIRDatastores where
toPath :: ListFHIRDatastores -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListFHIRDatastores where
toQuery :: ListFHIRDatastores -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListFHIRDatastoresResponse = ListFHIRDatastoresResponse'
{
ListFHIRDatastoresResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListFHIRDatastoresResponse -> Int
httpStatus :: Prelude.Int,
ListFHIRDatastoresResponse -> [DatastoreProperties]
datastorePropertiesList :: [DatastoreProperties]
}
deriving (ListFHIRDatastoresResponse -> ListFHIRDatastoresResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListFHIRDatastoresResponse -> ListFHIRDatastoresResponse -> Bool
$c/= :: ListFHIRDatastoresResponse -> ListFHIRDatastoresResponse -> Bool
== :: ListFHIRDatastoresResponse -> ListFHIRDatastoresResponse -> Bool
$c== :: ListFHIRDatastoresResponse -> ListFHIRDatastoresResponse -> Bool
Prelude.Eq, ReadPrec [ListFHIRDatastoresResponse]
ReadPrec ListFHIRDatastoresResponse
Int -> ReadS ListFHIRDatastoresResponse
ReadS [ListFHIRDatastoresResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListFHIRDatastoresResponse]
$creadListPrec :: ReadPrec [ListFHIRDatastoresResponse]
readPrec :: ReadPrec ListFHIRDatastoresResponse
$creadPrec :: ReadPrec ListFHIRDatastoresResponse
readList :: ReadS [ListFHIRDatastoresResponse]
$creadList :: ReadS [ListFHIRDatastoresResponse]
readsPrec :: Int -> ReadS ListFHIRDatastoresResponse
$creadsPrec :: Int -> ReadS ListFHIRDatastoresResponse
Prelude.Read, Int -> ListFHIRDatastoresResponse -> ShowS
[ListFHIRDatastoresResponse] -> ShowS
ListFHIRDatastoresResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListFHIRDatastoresResponse] -> ShowS
$cshowList :: [ListFHIRDatastoresResponse] -> ShowS
show :: ListFHIRDatastoresResponse -> String
$cshow :: ListFHIRDatastoresResponse -> String
showsPrec :: Int -> ListFHIRDatastoresResponse -> ShowS
$cshowsPrec :: Int -> ListFHIRDatastoresResponse -> ShowS
Prelude.Show, forall x.
Rep ListFHIRDatastoresResponse x -> ListFHIRDatastoresResponse
forall x.
ListFHIRDatastoresResponse -> Rep ListFHIRDatastoresResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListFHIRDatastoresResponse x -> ListFHIRDatastoresResponse
$cfrom :: forall x.
ListFHIRDatastoresResponse -> Rep ListFHIRDatastoresResponse x
Prelude.Generic)
newListFHIRDatastoresResponse ::
Prelude.Int ->
ListFHIRDatastoresResponse
newListFHIRDatastoresResponse :: Int -> ListFHIRDatastoresResponse
newListFHIRDatastoresResponse Int
pHttpStatus_ =
ListFHIRDatastoresResponse'
{ $sel:nextToken:ListFHIRDatastoresResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListFHIRDatastoresResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:datastorePropertiesList:ListFHIRDatastoresResponse' :: [DatastoreProperties]
datastorePropertiesList = forall a. Monoid a => a
Prelude.mempty
}
listFHIRDatastoresResponse_nextToken :: Lens.Lens' ListFHIRDatastoresResponse (Prelude.Maybe Prelude.Text)
listFHIRDatastoresResponse_nextToken :: Lens' ListFHIRDatastoresResponse (Maybe Text)
listFHIRDatastoresResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRDatastoresResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListFHIRDatastoresResponse' :: ListFHIRDatastoresResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListFHIRDatastoresResponse
s@ListFHIRDatastoresResponse' {} Maybe Text
a -> ListFHIRDatastoresResponse
s {$sel:nextToken:ListFHIRDatastoresResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListFHIRDatastoresResponse)
listFHIRDatastoresResponse_httpStatus :: Lens.Lens' ListFHIRDatastoresResponse Prelude.Int
listFHIRDatastoresResponse_httpStatus :: Lens' ListFHIRDatastoresResponse Int
listFHIRDatastoresResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRDatastoresResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListFHIRDatastoresResponse' :: ListFHIRDatastoresResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListFHIRDatastoresResponse
s@ListFHIRDatastoresResponse' {} Int
a -> ListFHIRDatastoresResponse
s {$sel:httpStatus:ListFHIRDatastoresResponse' :: Int
httpStatus = Int
a} :: ListFHIRDatastoresResponse)
listFHIRDatastoresResponse_datastorePropertiesList :: Lens.Lens' ListFHIRDatastoresResponse [DatastoreProperties]
listFHIRDatastoresResponse_datastorePropertiesList :: Lens' ListFHIRDatastoresResponse [DatastoreProperties]
listFHIRDatastoresResponse_datastorePropertiesList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListFHIRDatastoresResponse' {[DatastoreProperties]
datastorePropertiesList :: [DatastoreProperties]
$sel:datastorePropertiesList:ListFHIRDatastoresResponse' :: ListFHIRDatastoresResponse -> [DatastoreProperties]
datastorePropertiesList} -> [DatastoreProperties]
datastorePropertiesList) (\s :: ListFHIRDatastoresResponse
s@ListFHIRDatastoresResponse' {} [DatastoreProperties]
a -> ListFHIRDatastoresResponse
s {$sel:datastorePropertiesList:ListFHIRDatastoresResponse' :: [DatastoreProperties]
datastorePropertiesList = [DatastoreProperties]
a} :: ListFHIRDatastoresResponse) 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 ListFHIRDatastoresResponse where
rnf :: ListFHIRDatastoresResponse -> ()
rnf ListFHIRDatastoresResponse' {Int
[DatastoreProperties]
Maybe Text
datastorePropertiesList :: [DatastoreProperties]
httpStatus :: Int
nextToken :: Maybe Text
$sel:datastorePropertiesList:ListFHIRDatastoresResponse' :: ListFHIRDatastoresResponse -> [DatastoreProperties]
$sel:httpStatus:ListFHIRDatastoresResponse' :: ListFHIRDatastoresResponse -> Int
$sel:nextToken:ListFHIRDatastoresResponse' :: ListFHIRDatastoresResponse -> 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 [DatastoreProperties]
datastorePropertiesList