{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.PreloadDataConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.HealthLake.Types.PreloadDataConfig 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.PreloadDataType
import qualified Amazonka.Prelude as Prelude

-- | The input properties for the preloaded Data Store. Only data preloaded
-- from Synthea is supported.
--
-- /See:/ 'newPreloadDataConfig' smart constructor.
data PreloadDataConfig = PreloadDataConfig'
  { -- | The type of preloaded data. Only Synthea preloaded data is supported.
    PreloadDataConfig -> PreloadDataType
preloadDataType :: PreloadDataType
  }
  deriving (PreloadDataConfig -> PreloadDataConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PreloadDataConfig -> PreloadDataConfig -> Bool
$c/= :: PreloadDataConfig -> PreloadDataConfig -> Bool
== :: PreloadDataConfig -> PreloadDataConfig -> Bool
$c== :: PreloadDataConfig -> PreloadDataConfig -> Bool
Prelude.Eq, ReadPrec [PreloadDataConfig]
ReadPrec PreloadDataConfig
Int -> ReadS PreloadDataConfig
ReadS [PreloadDataConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PreloadDataConfig]
$creadListPrec :: ReadPrec [PreloadDataConfig]
readPrec :: ReadPrec PreloadDataConfig
$creadPrec :: ReadPrec PreloadDataConfig
readList :: ReadS [PreloadDataConfig]
$creadList :: ReadS [PreloadDataConfig]
readsPrec :: Int -> ReadS PreloadDataConfig
$creadsPrec :: Int -> ReadS PreloadDataConfig
Prelude.Read, Int -> PreloadDataConfig -> ShowS
[PreloadDataConfig] -> ShowS
PreloadDataConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PreloadDataConfig] -> ShowS
$cshowList :: [PreloadDataConfig] -> ShowS
show :: PreloadDataConfig -> String
$cshow :: PreloadDataConfig -> String
showsPrec :: Int -> PreloadDataConfig -> ShowS
$cshowsPrec :: Int -> PreloadDataConfig -> ShowS
Prelude.Show, forall x. Rep PreloadDataConfig x -> PreloadDataConfig
forall x. PreloadDataConfig -> Rep PreloadDataConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PreloadDataConfig x -> PreloadDataConfig
$cfrom :: forall x. PreloadDataConfig -> Rep PreloadDataConfig x
Prelude.Generic)

-- |
-- Create a value of 'PreloadDataConfig' 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:
--
-- 'preloadDataType', 'preloadDataConfig_preloadDataType' - The type of preloaded data. Only Synthea preloaded data is supported.
newPreloadDataConfig ::
  -- | 'preloadDataType'
  PreloadDataType ->
  PreloadDataConfig
newPreloadDataConfig :: PreloadDataType -> PreloadDataConfig
newPreloadDataConfig PreloadDataType
pPreloadDataType_ =
  PreloadDataConfig'
    { $sel:preloadDataType:PreloadDataConfig' :: PreloadDataType
preloadDataType =
        PreloadDataType
pPreloadDataType_
    }

-- | The type of preloaded data. Only Synthea preloaded data is supported.
preloadDataConfig_preloadDataType :: Lens.Lens' PreloadDataConfig PreloadDataType
preloadDataConfig_preloadDataType :: Lens' PreloadDataConfig PreloadDataType
preloadDataConfig_preloadDataType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PreloadDataConfig' {PreloadDataType
preloadDataType :: PreloadDataType
$sel:preloadDataType:PreloadDataConfig' :: PreloadDataConfig -> PreloadDataType
preloadDataType} -> PreloadDataType
preloadDataType) (\s :: PreloadDataConfig
s@PreloadDataConfig' {} PreloadDataType
a -> PreloadDataConfig
s {$sel:preloadDataType:PreloadDataConfig' :: PreloadDataType
preloadDataType = PreloadDataType
a} :: PreloadDataConfig)

instance Data.FromJSON PreloadDataConfig where
  parseJSON :: Value -> Parser PreloadDataConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PreloadDataConfig"
      ( \Object
x ->
          PreloadDataType -> PreloadDataConfig
PreloadDataConfig'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"PreloadDataType")
      )

instance Prelude.Hashable PreloadDataConfig where
  hashWithSalt :: Int -> PreloadDataConfig -> Int
hashWithSalt Int
_salt PreloadDataConfig' {PreloadDataType
preloadDataType :: PreloadDataType
$sel:preloadDataType:PreloadDataConfig' :: PreloadDataConfig -> PreloadDataType
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PreloadDataType
preloadDataType

instance Prelude.NFData PreloadDataConfig where
  rnf :: PreloadDataConfig -> ()
rnf PreloadDataConfig' {PreloadDataType
preloadDataType :: PreloadDataType
$sel:preloadDataType:PreloadDataConfig' :: PreloadDataConfig -> PreloadDataType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf PreloadDataType
preloadDataType

instance Data.ToJSON PreloadDataConfig where
  toJSON :: PreloadDataConfig -> Value
toJSON PreloadDataConfig' {PreloadDataType
preloadDataType :: PreloadDataType
$sel:preloadDataType:PreloadDataConfig' :: PreloadDataConfig -> PreloadDataType
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"PreloadDataType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= PreloadDataType
preloadDataType)
          ]
      )