{-# 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.CreateFHIRDatastore
-- 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)
--
-- Creates a Data Store that can ingest and export FHIR formatted data.
module Amazonka.HealthLake.CreateFHIRDatastore
  ( -- * Creating a Request
    CreateFHIRDatastore (..),
    newCreateFHIRDatastore,

    -- * Request Lenses
    createFHIRDatastore_clientToken,
    createFHIRDatastore_sseConfiguration,
    createFHIRDatastore_datastoreName,
    createFHIRDatastore_preloadDataConfig,
    createFHIRDatastore_tags,
    createFHIRDatastore_datastoreTypeVersion,

    -- * Destructuring the Response
    CreateFHIRDatastoreResponse (..),
    newCreateFHIRDatastoreResponse,

    -- * Response Lenses
    createFHIRDatastoreResponse_httpStatus,
    createFHIRDatastoreResponse_datastoreId,
    createFHIRDatastoreResponse_datastoreArn,
    createFHIRDatastoreResponse_datastoreStatus,
    createFHIRDatastoreResponse_datastoreEndpoint,
  )
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:/ 'newCreateFHIRDatastore' smart constructor.
data CreateFHIRDatastore = CreateFHIRDatastore'
  { -- | Optional user provided token used for ensuring idempotency.
    CreateFHIRDatastore -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The server-side encryption key configuration for a customer provided
    -- encryption key specified for creating a Data Store.
    CreateFHIRDatastore -> Maybe SseConfiguration
sseConfiguration :: Prelude.Maybe SseConfiguration,
    -- | The user generated name for the Data Store.
    CreateFHIRDatastore -> Maybe Text
datastoreName :: Prelude.Maybe Prelude.Text,
    -- | Optional parameter to preload data upon creation of the Data Store.
    -- Currently, the only supported preloaded data is synthetic data generated
    -- from Synthea.
    CreateFHIRDatastore -> Maybe PreloadDataConfig
preloadDataConfig :: Prelude.Maybe PreloadDataConfig,
    -- | Resource tags that are applied to a Data Store when it is created.
    CreateFHIRDatastore -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The FHIR version of the Data Store. The only supported version is R4.
    CreateFHIRDatastore -> FHIRVersion
datastoreTypeVersion :: FHIRVersion
  }
  deriving (CreateFHIRDatastore -> CreateFHIRDatastore -> Bool
(CreateFHIRDatastore -> CreateFHIRDatastore -> Bool)
-> (CreateFHIRDatastore -> CreateFHIRDatastore -> Bool)
-> Eq CreateFHIRDatastore
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFHIRDatastore -> CreateFHIRDatastore -> Bool
$c/= :: CreateFHIRDatastore -> CreateFHIRDatastore -> Bool
== :: CreateFHIRDatastore -> CreateFHIRDatastore -> Bool
$c== :: CreateFHIRDatastore -> CreateFHIRDatastore -> Bool
Prelude.Eq, ReadPrec [CreateFHIRDatastore]
ReadPrec CreateFHIRDatastore
Int -> ReadS CreateFHIRDatastore
ReadS [CreateFHIRDatastore]
(Int -> ReadS CreateFHIRDatastore)
-> ReadS [CreateFHIRDatastore]
-> ReadPrec CreateFHIRDatastore
-> ReadPrec [CreateFHIRDatastore]
-> Read CreateFHIRDatastore
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFHIRDatastore]
$creadListPrec :: ReadPrec [CreateFHIRDatastore]
readPrec :: ReadPrec CreateFHIRDatastore
$creadPrec :: ReadPrec CreateFHIRDatastore
readList :: ReadS [CreateFHIRDatastore]
$creadList :: ReadS [CreateFHIRDatastore]
readsPrec :: Int -> ReadS CreateFHIRDatastore
$creadsPrec :: Int -> ReadS CreateFHIRDatastore
Prelude.Read, Int -> CreateFHIRDatastore -> ShowS
[CreateFHIRDatastore] -> ShowS
CreateFHIRDatastore -> String
(Int -> CreateFHIRDatastore -> ShowS)
-> (CreateFHIRDatastore -> String)
-> ([CreateFHIRDatastore] -> ShowS)
-> Show CreateFHIRDatastore
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFHIRDatastore] -> ShowS
$cshowList :: [CreateFHIRDatastore] -> ShowS
show :: CreateFHIRDatastore -> String
$cshow :: CreateFHIRDatastore -> String
showsPrec :: Int -> CreateFHIRDatastore -> ShowS
$cshowsPrec :: Int -> CreateFHIRDatastore -> ShowS
Prelude.Show, (forall x. CreateFHIRDatastore -> Rep CreateFHIRDatastore x)
-> (forall x. Rep CreateFHIRDatastore x -> CreateFHIRDatastore)
-> Generic CreateFHIRDatastore
forall x. Rep CreateFHIRDatastore x -> CreateFHIRDatastore
forall x. CreateFHIRDatastore -> Rep CreateFHIRDatastore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateFHIRDatastore x -> CreateFHIRDatastore
$cfrom :: forall x. CreateFHIRDatastore -> Rep CreateFHIRDatastore x
Prelude.Generic)

-- |
-- Create a value of 'CreateFHIRDatastore' 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:
--
-- 'clientToken', 'createFHIRDatastore_clientToken' - Optional user provided token used for ensuring idempotency.
--
-- 'sseConfiguration', 'createFHIRDatastore_sseConfiguration' - The server-side encryption key configuration for a customer provided
-- encryption key specified for creating a Data Store.
--
-- 'datastoreName', 'createFHIRDatastore_datastoreName' - The user generated name for the Data Store.
--
-- 'preloadDataConfig', 'createFHIRDatastore_preloadDataConfig' - Optional parameter to preload data upon creation of the Data Store.
-- Currently, the only supported preloaded data is synthetic data generated
-- from Synthea.
--
-- 'tags', 'createFHIRDatastore_tags' - Resource tags that are applied to a Data Store when it is created.
--
-- 'datastoreTypeVersion', 'createFHIRDatastore_datastoreTypeVersion' - The FHIR version of the Data Store. The only supported version is R4.
newCreateFHIRDatastore ::
  -- | 'datastoreTypeVersion'
  FHIRVersion ->
  CreateFHIRDatastore
newCreateFHIRDatastore :: FHIRVersion -> CreateFHIRDatastore
newCreateFHIRDatastore FHIRVersion
pDatastoreTypeVersion_ =
  CreateFHIRDatastore' :: Maybe Text
-> Maybe SseConfiguration
-> Maybe Text
-> Maybe PreloadDataConfig
-> Maybe [Tag]
-> FHIRVersion
-> CreateFHIRDatastore
CreateFHIRDatastore'
    { $sel:clientToken:CreateFHIRDatastore' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sseConfiguration:CreateFHIRDatastore' :: Maybe SseConfiguration
sseConfiguration = Maybe SseConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:datastoreName:CreateFHIRDatastore' :: Maybe Text
datastoreName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preloadDataConfig:CreateFHIRDatastore' :: Maybe PreloadDataConfig
preloadDataConfig = Maybe PreloadDataConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateFHIRDatastore' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:datastoreTypeVersion:CreateFHIRDatastore' :: FHIRVersion
datastoreTypeVersion = FHIRVersion
pDatastoreTypeVersion_
    }

-- | Optional user provided token used for ensuring idempotency.
createFHIRDatastore_clientToken :: Lens.Lens' CreateFHIRDatastore (Prelude.Maybe Prelude.Text)
createFHIRDatastore_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateFHIRDatastore -> f CreateFHIRDatastore
createFHIRDatastore_clientToken = (CreateFHIRDatastore -> Maybe Text)
-> (CreateFHIRDatastore -> Maybe Text -> CreateFHIRDatastore)
-> Lens
     CreateFHIRDatastore CreateFHIRDatastore (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFHIRDatastore' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateFHIRDatastore' :: CreateFHIRDatastore -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateFHIRDatastore
s@CreateFHIRDatastore' {} Maybe Text
a -> CreateFHIRDatastore
s {$sel:clientToken:CreateFHIRDatastore' :: Maybe Text
clientToken = Maybe Text
a} :: CreateFHIRDatastore)

-- | The server-side encryption key configuration for a customer provided
-- encryption key specified for creating a Data Store.
createFHIRDatastore_sseConfiguration :: Lens.Lens' CreateFHIRDatastore (Prelude.Maybe SseConfiguration)
createFHIRDatastore_sseConfiguration :: (Maybe SseConfiguration -> f (Maybe SseConfiguration))
-> CreateFHIRDatastore -> f CreateFHIRDatastore
createFHIRDatastore_sseConfiguration = (CreateFHIRDatastore -> Maybe SseConfiguration)
-> (CreateFHIRDatastore
    -> Maybe SseConfiguration -> CreateFHIRDatastore)
-> Lens
     CreateFHIRDatastore
     CreateFHIRDatastore
     (Maybe SseConfiguration)
     (Maybe SseConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFHIRDatastore' {Maybe SseConfiguration
sseConfiguration :: Maybe SseConfiguration
$sel:sseConfiguration:CreateFHIRDatastore' :: CreateFHIRDatastore -> Maybe SseConfiguration
sseConfiguration} -> Maybe SseConfiguration
sseConfiguration) (\s :: CreateFHIRDatastore
s@CreateFHIRDatastore' {} Maybe SseConfiguration
a -> CreateFHIRDatastore
s {$sel:sseConfiguration:CreateFHIRDatastore' :: Maybe SseConfiguration
sseConfiguration = Maybe SseConfiguration
a} :: CreateFHIRDatastore)

-- | The user generated name for the Data Store.
createFHIRDatastore_datastoreName :: Lens.Lens' CreateFHIRDatastore (Prelude.Maybe Prelude.Text)
createFHIRDatastore_datastoreName :: (Maybe Text -> f (Maybe Text))
-> CreateFHIRDatastore -> f CreateFHIRDatastore
createFHIRDatastore_datastoreName = (CreateFHIRDatastore -> Maybe Text)
-> (CreateFHIRDatastore -> Maybe Text -> CreateFHIRDatastore)
-> Lens
     CreateFHIRDatastore CreateFHIRDatastore (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFHIRDatastore' {Maybe Text
datastoreName :: Maybe Text
$sel:datastoreName:CreateFHIRDatastore' :: CreateFHIRDatastore -> Maybe Text
datastoreName} -> Maybe Text
datastoreName) (\s :: CreateFHIRDatastore
s@CreateFHIRDatastore' {} Maybe Text
a -> CreateFHIRDatastore
s {$sel:datastoreName:CreateFHIRDatastore' :: Maybe Text
datastoreName = Maybe Text
a} :: CreateFHIRDatastore)

-- | Optional parameter to preload data upon creation of the Data Store.
-- Currently, the only supported preloaded data is synthetic data generated
-- from Synthea.
createFHIRDatastore_preloadDataConfig :: Lens.Lens' CreateFHIRDatastore (Prelude.Maybe PreloadDataConfig)
createFHIRDatastore_preloadDataConfig :: (Maybe PreloadDataConfig -> f (Maybe PreloadDataConfig))
-> CreateFHIRDatastore -> f CreateFHIRDatastore
createFHIRDatastore_preloadDataConfig = (CreateFHIRDatastore -> Maybe PreloadDataConfig)
-> (CreateFHIRDatastore
    -> Maybe PreloadDataConfig -> CreateFHIRDatastore)
-> Lens
     CreateFHIRDatastore
     CreateFHIRDatastore
     (Maybe PreloadDataConfig)
     (Maybe PreloadDataConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFHIRDatastore' {Maybe PreloadDataConfig
preloadDataConfig :: Maybe PreloadDataConfig
$sel:preloadDataConfig:CreateFHIRDatastore' :: CreateFHIRDatastore -> Maybe PreloadDataConfig
preloadDataConfig} -> Maybe PreloadDataConfig
preloadDataConfig) (\s :: CreateFHIRDatastore
s@CreateFHIRDatastore' {} Maybe PreloadDataConfig
a -> CreateFHIRDatastore
s {$sel:preloadDataConfig:CreateFHIRDatastore' :: Maybe PreloadDataConfig
preloadDataConfig = Maybe PreloadDataConfig
a} :: CreateFHIRDatastore)

-- | Resource tags that are applied to a Data Store when it is created.
createFHIRDatastore_tags :: Lens.Lens' CreateFHIRDatastore (Prelude.Maybe [Tag])
createFHIRDatastore_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateFHIRDatastore -> f CreateFHIRDatastore
createFHIRDatastore_tags = (CreateFHIRDatastore -> Maybe [Tag])
-> (CreateFHIRDatastore -> Maybe [Tag] -> CreateFHIRDatastore)
-> Lens
     CreateFHIRDatastore CreateFHIRDatastore (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFHIRDatastore' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateFHIRDatastore' :: CreateFHIRDatastore -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateFHIRDatastore
s@CreateFHIRDatastore' {} Maybe [Tag]
a -> CreateFHIRDatastore
s {$sel:tags:CreateFHIRDatastore' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateFHIRDatastore) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateFHIRDatastore -> f CreateFHIRDatastore)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateFHIRDatastore
-> f CreateFHIRDatastore
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The FHIR version of the Data Store. The only supported version is R4.
createFHIRDatastore_datastoreTypeVersion :: Lens.Lens' CreateFHIRDatastore FHIRVersion
createFHIRDatastore_datastoreTypeVersion :: (FHIRVersion -> f FHIRVersion)
-> CreateFHIRDatastore -> f CreateFHIRDatastore
createFHIRDatastore_datastoreTypeVersion = (CreateFHIRDatastore -> FHIRVersion)
-> (CreateFHIRDatastore -> FHIRVersion -> CreateFHIRDatastore)
-> Lens
     CreateFHIRDatastore CreateFHIRDatastore FHIRVersion FHIRVersion
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFHIRDatastore' {FHIRVersion
datastoreTypeVersion :: FHIRVersion
$sel:datastoreTypeVersion:CreateFHIRDatastore' :: CreateFHIRDatastore -> FHIRVersion
datastoreTypeVersion} -> FHIRVersion
datastoreTypeVersion) (\s :: CreateFHIRDatastore
s@CreateFHIRDatastore' {} FHIRVersion
a -> CreateFHIRDatastore
s {$sel:datastoreTypeVersion:CreateFHIRDatastore' :: FHIRVersion
datastoreTypeVersion = FHIRVersion
a} :: CreateFHIRDatastore)

instance Core.AWSRequest CreateFHIRDatastore where
  type
    AWSResponse CreateFHIRDatastore =
      CreateFHIRDatastoreResponse
  request :: CreateFHIRDatastore -> Request CreateFHIRDatastore
request = Service -> CreateFHIRDatastore -> Request CreateFHIRDatastore
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateFHIRDatastore
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateFHIRDatastore)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateFHIRDatastore))
-> Logger
-> Service
-> Proxy CreateFHIRDatastore
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateFHIRDatastore)))
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
-> Text
-> Text
-> DatastoreStatus
-> Text
-> CreateFHIRDatastoreResponse
CreateFHIRDatastoreResponse'
            (Int
 -> Text
 -> Text
 -> DatastoreStatus
 -> Text
 -> CreateFHIRDatastoreResponse)
-> Either String Int
-> Either
     String
     (Text
      -> Text -> DatastoreStatus -> Text -> CreateFHIRDatastoreResponse)
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
  (Text
   -> Text -> DatastoreStatus -> Text -> CreateFHIRDatastoreResponse)
-> Either String Text
-> Either
     String
     (Text -> DatastoreStatus -> Text -> CreateFHIRDatastoreResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DatastoreId")
            Either
  String
  (Text -> DatastoreStatus -> Text -> CreateFHIRDatastoreResponse)
-> Either String Text
-> Either
     String (DatastoreStatus -> Text -> CreateFHIRDatastoreResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DatastoreArn")
            Either
  String (DatastoreStatus -> Text -> CreateFHIRDatastoreResponse)
-> Either String DatastoreStatus
-> Either String (Text -> CreateFHIRDatastoreResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String DatastoreStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DatastoreStatus")
            Either String (Text -> CreateFHIRDatastoreResponse)
-> Either String Text -> Either String CreateFHIRDatastoreResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DatastoreEndpoint")
      )

instance Prelude.Hashable CreateFHIRDatastore

instance Prelude.NFData CreateFHIRDatastore

instance Core.ToHeaders CreateFHIRDatastore where
  toHeaders :: CreateFHIRDatastore -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateFHIRDatastore -> 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.CreateFHIRDatastore" ::
                          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 CreateFHIRDatastore where
  toJSON :: CreateFHIRDatastore -> Value
toJSON CreateFHIRDatastore' {Maybe [Tag]
Maybe Text
Maybe PreloadDataConfig
Maybe SseConfiguration
FHIRVersion
datastoreTypeVersion :: FHIRVersion
tags :: Maybe [Tag]
preloadDataConfig :: Maybe PreloadDataConfig
datastoreName :: Maybe Text
sseConfiguration :: Maybe SseConfiguration
clientToken :: Maybe Text
$sel:datastoreTypeVersion:CreateFHIRDatastore' :: CreateFHIRDatastore -> FHIRVersion
$sel:tags:CreateFHIRDatastore' :: CreateFHIRDatastore -> Maybe [Tag]
$sel:preloadDataConfig:CreateFHIRDatastore' :: CreateFHIRDatastore -> Maybe PreloadDataConfig
$sel:datastoreName:CreateFHIRDatastore' :: CreateFHIRDatastore -> Maybe Text
$sel:sseConfiguration:CreateFHIRDatastore' :: CreateFHIRDatastore -> Maybe SseConfiguration
$sel:clientToken:CreateFHIRDatastore' :: CreateFHIRDatastore -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ClientToken" 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
clientToken,
            (Text
"SseConfiguration" Text -> SseConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SseConfiguration -> Pair) -> Maybe SseConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SseConfiguration
sseConfiguration,
            (Text
"DatastoreName" 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
datastoreName,
            (Text
"PreloadDataConfig" Text -> PreloadDataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PreloadDataConfig -> Pair)
-> Maybe PreloadDataConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PreloadDataConfig
preloadDataConfig,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"DatastoreTypeVersion"
                  Text -> FHIRVersion -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= FHIRVersion
datastoreTypeVersion
              )
          ]
      )

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

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

-- | /See:/ 'newCreateFHIRDatastoreResponse' smart constructor.
data CreateFHIRDatastoreResponse = CreateFHIRDatastoreResponse'
  { -- | The response's http status code.
    CreateFHIRDatastoreResponse -> Int
httpStatus :: Prelude.Int,
    -- | The AWS-generated Data Store id. This id is in the output from the
    -- initial Data Store creation call.
    CreateFHIRDatastoreResponse -> Text
datastoreId :: Prelude.Text,
    -- | The datastore ARN is generated during the creation of the Data Store and
    -- can be found in the output from the initial Data Store creation call.
    CreateFHIRDatastoreResponse -> Text
datastoreArn :: Prelude.Text,
    -- | The status of the FHIR Data Store. Possible statuses are ‘CREATING’,
    -- ‘ACTIVE’, ‘DELETING’, ‘DELETED’.
    CreateFHIRDatastoreResponse -> DatastoreStatus
datastoreStatus :: DatastoreStatus,
    -- | The AWS endpoint for the created Data Store. For preview, only US-east-1
    -- endpoints are supported.
    CreateFHIRDatastoreResponse -> Text
datastoreEndpoint :: Prelude.Text
  }
  deriving (CreateFHIRDatastoreResponse -> CreateFHIRDatastoreResponse -> Bool
(CreateFHIRDatastoreResponse
 -> CreateFHIRDatastoreResponse -> Bool)
-> (CreateFHIRDatastoreResponse
    -> CreateFHIRDatastoreResponse -> Bool)
-> Eq CreateFHIRDatastoreResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFHIRDatastoreResponse -> CreateFHIRDatastoreResponse -> Bool
$c/= :: CreateFHIRDatastoreResponse -> CreateFHIRDatastoreResponse -> Bool
== :: CreateFHIRDatastoreResponse -> CreateFHIRDatastoreResponse -> Bool
$c== :: CreateFHIRDatastoreResponse -> CreateFHIRDatastoreResponse -> Bool
Prelude.Eq, ReadPrec [CreateFHIRDatastoreResponse]
ReadPrec CreateFHIRDatastoreResponse
Int -> ReadS CreateFHIRDatastoreResponse
ReadS [CreateFHIRDatastoreResponse]
(Int -> ReadS CreateFHIRDatastoreResponse)
-> ReadS [CreateFHIRDatastoreResponse]
-> ReadPrec CreateFHIRDatastoreResponse
-> ReadPrec [CreateFHIRDatastoreResponse]
-> Read CreateFHIRDatastoreResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFHIRDatastoreResponse]
$creadListPrec :: ReadPrec [CreateFHIRDatastoreResponse]
readPrec :: ReadPrec CreateFHIRDatastoreResponse
$creadPrec :: ReadPrec CreateFHIRDatastoreResponse
readList :: ReadS [CreateFHIRDatastoreResponse]
$creadList :: ReadS [CreateFHIRDatastoreResponse]
readsPrec :: Int -> ReadS CreateFHIRDatastoreResponse
$creadsPrec :: Int -> ReadS CreateFHIRDatastoreResponse
Prelude.Read, Int -> CreateFHIRDatastoreResponse -> ShowS
[CreateFHIRDatastoreResponse] -> ShowS
CreateFHIRDatastoreResponse -> String
(Int -> CreateFHIRDatastoreResponse -> ShowS)
-> (CreateFHIRDatastoreResponse -> String)
-> ([CreateFHIRDatastoreResponse] -> ShowS)
-> Show CreateFHIRDatastoreResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFHIRDatastoreResponse] -> ShowS
$cshowList :: [CreateFHIRDatastoreResponse] -> ShowS
show :: CreateFHIRDatastoreResponse -> String
$cshow :: CreateFHIRDatastoreResponse -> String
showsPrec :: Int -> CreateFHIRDatastoreResponse -> ShowS
$cshowsPrec :: Int -> CreateFHIRDatastoreResponse -> ShowS
Prelude.Show, (forall x.
 CreateFHIRDatastoreResponse -> Rep CreateFHIRDatastoreResponse x)
-> (forall x.
    Rep CreateFHIRDatastoreResponse x -> CreateFHIRDatastoreResponse)
-> Generic CreateFHIRDatastoreResponse
forall x.
Rep CreateFHIRDatastoreResponse x -> CreateFHIRDatastoreResponse
forall x.
CreateFHIRDatastoreResponse -> Rep CreateFHIRDatastoreResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateFHIRDatastoreResponse x -> CreateFHIRDatastoreResponse
$cfrom :: forall x.
CreateFHIRDatastoreResponse -> Rep CreateFHIRDatastoreResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateFHIRDatastoreResponse' 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:
--
-- 'httpStatus', 'createFHIRDatastoreResponse_httpStatus' - The response's http status code.
--
-- 'datastoreId', 'createFHIRDatastoreResponse_datastoreId' - The AWS-generated Data Store id. This id is in the output from the
-- initial Data Store creation call.
--
-- 'datastoreArn', 'createFHIRDatastoreResponse_datastoreArn' - The datastore ARN is generated during the creation of the Data Store and
-- can be found in the output from the initial Data Store creation call.
--
-- 'datastoreStatus', 'createFHIRDatastoreResponse_datastoreStatus' - The status of the FHIR Data Store. Possible statuses are ‘CREATING’,
-- ‘ACTIVE’, ‘DELETING’, ‘DELETED’.
--
-- 'datastoreEndpoint', 'createFHIRDatastoreResponse_datastoreEndpoint' - The AWS endpoint for the created Data Store. For preview, only US-east-1
-- endpoints are supported.
newCreateFHIRDatastoreResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'datastoreId'
  Prelude.Text ->
  -- | 'datastoreArn'
  Prelude.Text ->
  -- | 'datastoreStatus'
  DatastoreStatus ->
  -- | 'datastoreEndpoint'
  Prelude.Text ->
  CreateFHIRDatastoreResponse
newCreateFHIRDatastoreResponse :: Int
-> Text
-> Text
-> DatastoreStatus
-> Text
-> CreateFHIRDatastoreResponse
newCreateFHIRDatastoreResponse
  Int
pHttpStatus_
  Text
pDatastoreId_
  Text
pDatastoreArn_
  DatastoreStatus
pDatastoreStatus_
  Text
pDatastoreEndpoint_ =
    CreateFHIRDatastoreResponse' :: Int
-> Text
-> Text
-> DatastoreStatus
-> Text
-> CreateFHIRDatastoreResponse
CreateFHIRDatastoreResponse'
      { $sel:httpStatus:CreateFHIRDatastoreResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:datastoreId:CreateFHIRDatastoreResponse' :: Text
datastoreId = Text
pDatastoreId_,
        $sel:datastoreArn:CreateFHIRDatastoreResponse' :: Text
datastoreArn = Text
pDatastoreArn_,
        $sel:datastoreStatus:CreateFHIRDatastoreResponse' :: DatastoreStatus
datastoreStatus = DatastoreStatus
pDatastoreStatus_,
        $sel:datastoreEndpoint:CreateFHIRDatastoreResponse' :: Text
datastoreEndpoint = Text
pDatastoreEndpoint_
      }

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

-- | The AWS-generated Data Store id. This id is in the output from the
-- initial Data Store creation call.
createFHIRDatastoreResponse_datastoreId :: Lens.Lens' CreateFHIRDatastoreResponse Prelude.Text
createFHIRDatastoreResponse_datastoreId :: (Text -> f Text)
-> CreateFHIRDatastoreResponse -> f CreateFHIRDatastoreResponse
createFHIRDatastoreResponse_datastoreId = (CreateFHIRDatastoreResponse -> Text)
-> (CreateFHIRDatastoreResponse
    -> Text -> CreateFHIRDatastoreResponse)
-> Lens
     CreateFHIRDatastoreResponse CreateFHIRDatastoreResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFHIRDatastoreResponse' {Text
datastoreId :: Text
$sel:datastoreId:CreateFHIRDatastoreResponse' :: CreateFHIRDatastoreResponse -> Text
datastoreId} -> Text
datastoreId) (\s :: CreateFHIRDatastoreResponse
s@CreateFHIRDatastoreResponse' {} Text
a -> CreateFHIRDatastoreResponse
s {$sel:datastoreId:CreateFHIRDatastoreResponse' :: Text
datastoreId = Text
a} :: CreateFHIRDatastoreResponse)

-- | The datastore ARN is generated during the creation of the Data Store and
-- can be found in the output from the initial Data Store creation call.
createFHIRDatastoreResponse_datastoreArn :: Lens.Lens' CreateFHIRDatastoreResponse Prelude.Text
createFHIRDatastoreResponse_datastoreArn :: (Text -> f Text)
-> CreateFHIRDatastoreResponse -> f CreateFHIRDatastoreResponse
createFHIRDatastoreResponse_datastoreArn = (CreateFHIRDatastoreResponse -> Text)
-> (CreateFHIRDatastoreResponse
    -> Text -> CreateFHIRDatastoreResponse)
-> Lens
     CreateFHIRDatastoreResponse CreateFHIRDatastoreResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFHIRDatastoreResponse' {Text
datastoreArn :: Text
$sel:datastoreArn:CreateFHIRDatastoreResponse' :: CreateFHIRDatastoreResponse -> Text
datastoreArn} -> Text
datastoreArn) (\s :: CreateFHIRDatastoreResponse
s@CreateFHIRDatastoreResponse' {} Text
a -> CreateFHIRDatastoreResponse
s {$sel:datastoreArn:CreateFHIRDatastoreResponse' :: Text
datastoreArn = Text
a} :: CreateFHIRDatastoreResponse)

-- | The status of the FHIR Data Store. Possible statuses are ‘CREATING’,
-- ‘ACTIVE’, ‘DELETING’, ‘DELETED’.
createFHIRDatastoreResponse_datastoreStatus :: Lens.Lens' CreateFHIRDatastoreResponse DatastoreStatus
createFHIRDatastoreResponse_datastoreStatus :: (DatastoreStatus -> f DatastoreStatus)
-> CreateFHIRDatastoreResponse -> f CreateFHIRDatastoreResponse
createFHIRDatastoreResponse_datastoreStatus = (CreateFHIRDatastoreResponse -> DatastoreStatus)
-> (CreateFHIRDatastoreResponse
    -> DatastoreStatus -> CreateFHIRDatastoreResponse)
-> Lens
     CreateFHIRDatastoreResponse
     CreateFHIRDatastoreResponse
     DatastoreStatus
     DatastoreStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFHIRDatastoreResponse' {DatastoreStatus
datastoreStatus :: DatastoreStatus
$sel:datastoreStatus:CreateFHIRDatastoreResponse' :: CreateFHIRDatastoreResponse -> DatastoreStatus
datastoreStatus} -> DatastoreStatus
datastoreStatus) (\s :: CreateFHIRDatastoreResponse
s@CreateFHIRDatastoreResponse' {} DatastoreStatus
a -> CreateFHIRDatastoreResponse
s {$sel:datastoreStatus:CreateFHIRDatastoreResponse' :: DatastoreStatus
datastoreStatus = DatastoreStatus
a} :: CreateFHIRDatastoreResponse)

-- | The AWS endpoint for the created Data Store. For preview, only US-east-1
-- endpoints are supported.
createFHIRDatastoreResponse_datastoreEndpoint :: Lens.Lens' CreateFHIRDatastoreResponse Prelude.Text
createFHIRDatastoreResponse_datastoreEndpoint :: (Text -> f Text)
-> CreateFHIRDatastoreResponse -> f CreateFHIRDatastoreResponse
createFHIRDatastoreResponse_datastoreEndpoint = (CreateFHIRDatastoreResponse -> Text)
-> (CreateFHIRDatastoreResponse
    -> Text -> CreateFHIRDatastoreResponse)
-> Lens
     CreateFHIRDatastoreResponse CreateFHIRDatastoreResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFHIRDatastoreResponse' {Text
datastoreEndpoint :: Text
$sel:datastoreEndpoint:CreateFHIRDatastoreResponse' :: CreateFHIRDatastoreResponse -> Text
datastoreEndpoint} -> Text
datastoreEndpoint) (\s :: CreateFHIRDatastoreResponse
s@CreateFHIRDatastoreResponse' {} Text
a -> CreateFHIRDatastoreResponse
s {$sel:datastoreEndpoint:CreateFHIRDatastoreResponse' :: Text
datastoreEndpoint = Text
a} :: CreateFHIRDatastoreResponse)

instance Prelude.NFData CreateFHIRDatastoreResponse