{-# 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.SageMakerGeoSpatial.Types.VectorEnrichmentJobConfig
-- 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.SageMakerGeoSpatial.Types.VectorEnrichmentJobConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMakerGeoSpatial.Types.MapMatchingConfig
import Amazonka.SageMakerGeoSpatial.Types.ReverseGeocodingConfig

-- | It contains configs such as ReverseGeocodingConfig and
-- MapMatchingConfig.
--
-- /See:/ 'newVectorEnrichmentJobConfig' smart constructor.
data VectorEnrichmentJobConfig = VectorEnrichmentJobConfig'
  { VectorEnrichmentJobConfig -> Maybe MapMatchingConfig
mapMatchingConfig :: Prelude.Maybe MapMatchingConfig,
    VectorEnrichmentJobConfig -> Maybe ReverseGeocodingConfig
reverseGeocodingConfig :: Prelude.Maybe ReverseGeocodingConfig
  }
  deriving (VectorEnrichmentJobConfig -> VectorEnrichmentJobConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VectorEnrichmentJobConfig -> VectorEnrichmentJobConfig -> Bool
$c/= :: VectorEnrichmentJobConfig -> VectorEnrichmentJobConfig -> Bool
== :: VectorEnrichmentJobConfig -> VectorEnrichmentJobConfig -> Bool
$c== :: VectorEnrichmentJobConfig -> VectorEnrichmentJobConfig -> Bool
Prelude.Eq, ReadPrec [VectorEnrichmentJobConfig]
ReadPrec VectorEnrichmentJobConfig
Int -> ReadS VectorEnrichmentJobConfig
ReadS [VectorEnrichmentJobConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VectorEnrichmentJobConfig]
$creadListPrec :: ReadPrec [VectorEnrichmentJobConfig]
readPrec :: ReadPrec VectorEnrichmentJobConfig
$creadPrec :: ReadPrec VectorEnrichmentJobConfig
readList :: ReadS [VectorEnrichmentJobConfig]
$creadList :: ReadS [VectorEnrichmentJobConfig]
readsPrec :: Int -> ReadS VectorEnrichmentJobConfig
$creadsPrec :: Int -> ReadS VectorEnrichmentJobConfig
Prelude.Read, Int -> VectorEnrichmentJobConfig -> ShowS
[VectorEnrichmentJobConfig] -> ShowS
VectorEnrichmentJobConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VectorEnrichmentJobConfig] -> ShowS
$cshowList :: [VectorEnrichmentJobConfig] -> ShowS
show :: VectorEnrichmentJobConfig -> String
$cshow :: VectorEnrichmentJobConfig -> String
showsPrec :: Int -> VectorEnrichmentJobConfig -> ShowS
$cshowsPrec :: Int -> VectorEnrichmentJobConfig -> ShowS
Prelude.Show, forall x.
Rep VectorEnrichmentJobConfig x -> VectorEnrichmentJobConfig
forall x.
VectorEnrichmentJobConfig -> Rep VectorEnrichmentJobConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VectorEnrichmentJobConfig x -> VectorEnrichmentJobConfig
$cfrom :: forall x.
VectorEnrichmentJobConfig -> Rep VectorEnrichmentJobConfig x
Prelude.Generic)

-- |
-- Create a value of 'VectorEnrichmentJobConfig' 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:
--
-- 'mapMatchingConfig', 'vectorEnrichmentJobConfig_mapMatchingConfig' -
--
-- 'reverseGeocodingConfig', 'vectorEnrichmentJobConfig_reverseGeocodingConfig' -
newVectorEnrichmentJobConfig ::
  VectorEnrichmentJobConfig
newVectorEnrichmentJobConfig :: VectorEnrichmentJobConfig
newVectorEnrichmentJobConfig =
  VectorEnrichmentJobConfig'
    { $sel:mapMatchingConfig:VectorEnrichmentJobConfig' :: Maybe MapMatchingConfig
mapMatchingConfig =
        forall a. Maybe a
Prelude.Nothing,
      $sel:reverseGeocodingConfig:VectorEnrichmentJobConfig' :: Maybe ReverseGeocodingConfig
reverseGeocodingConfig = forall a. Maybe a
Prelude.Nothing
    }

vectorEnrichmentJobConfig_mapMatchingConfig :: Lens.Lens' VectorEnrichmentJobConfig (Prelude.Maybe MapMatchingConfig)
vectorEnrichmentJobConfig_mapMatchingConfig :: Lens' VectorEnrichmentJobConfig (Maybe MapMatchingConfig)
vectorEnrichmentJobConfig_mapMatchingConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VectorEnrichmentJobConfig' {Maybe MapMatchingConfig
mapMatchingConfig :: Maybe MapMatchingConfig
$sel:mapMatchingConfig:VectorEnrichmentJobConfig' :: VectorEnrichmentJobConfig -> Maybe MapMatchingConfig
mapMatchingConfig} -> Maybe MapMatchingConfig
mapMatchingConfig) (\s :: VectorEnrichmentJobConfig
s@VectorEnrichmentJobConfig' {} Maybe MapMatchingConfig
a -> VectorEnrichmentJobConfig
s {$sel:mapMatchingConfig:VectorEnrichmentJobConfig' :: Maybe MapMatchingConfig
mapMatchingConfig = Maybe MapMatchingConfig
a} :: VectorEnrichmentJobConfig)

vectorEnrichmentJobConfig_reverseGeocodingConfig :: Lens.Lens' VectorEnrichmentJobConfig (Prelude.Maybe ReverseGeocodingConfig)
vectorEnrichmentJobConfig_reverseGeocodingConfig :: Lens' VectorEnrichmentJobConfig (Maybe ReverseGeocodingConfig)
vectorEnrichmentJobConfig_reverseGeocodingConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VectorEnrichmentJobConfig' {Maybe ReverseGeocodingConfig
reverseGeocodingConfig :: Maybe ReverseGeocodingConfig
$sel:reverseGeocodingConfig:VectorEnrichmentJobConfig' :: VectorEnrichmentJobConfig -> Maybe ReverseGeocodingConfig
reverseGeocodingConfig} -> Maybe ReverseGeocodingConfig
reverseGeocodingConfig) (\s :: VectorEnrichmentJobConfig
s@VectorEnrichmentJobConfig' {} Maybe ReverseGeocodingConfig
a -> VectorEnrichmentJobConfig
s {$sel:reverseGeocodingConfig:VectorEnrichmentJobConfig' :: Maybe ReverseGeocodingConfig
reverseGeocodingConfig = Maybe ReverseGeocodingConfig
a} :: VectorEnrichmentJobConfig)

instance Data.FromJSON VectorEnrichmentJobConfig where
  parseJSON :: Value -> Parser VectorEnrichmentJobConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VectorEnrichmentJobConfig"
      ( \Object
x ->
          Maybe MapMatchingConfig
-> Maybe ReverseGeocodingConfig -> VectorEnrichmentJobConfig
VectorEnrichmentJobConfig'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MapMatchingConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ReverseGeocodingConfig")
      )

instance Prelude.Hashable VectorEnrichmentJobConfig where
  hashWithSalt :: Int -> VectorEnrichmentJobConfig -> Int
hashWithSalt Int
_salt VectorEnrichmentJobConfig' {Maybe MapMatchingConfig
Maybe ReverseGeocodingConfig
reverseGeocodingConfig :: Maybe ReverseGeocodingConfig
mapMatchingConfig :: Maybe MapMatchingConfig
$sel:reverseGeocodingConfig:VectorEnrichmentJobConfig' :: VectorEnrichmentJobConfig -> Maybe ReverseGeocodingConfig
$sel:mapMatchingConfig:VectorEnrichmentJobConfig' :: VectorEnrichmentJobConfig -> Maybe MapMatchingConfig
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MapMatchingConfig
mapMatchingConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReverseGeocodingConfig
reverseGeocodingConfig

instance Prelude.NFData VectorEnrichmentJobConfig where
  rnf :: VectorEnrichmentJobConfig -> ()
rnf VectorEnrichmentJobConfig' {Maybe MapMatchingConfig
Maybe ReverseGeocodingConfig
reverseGeocodingConfig :: Maybe ReverseGeocodingConfig
mapMatchingConfig :: Maybe MapMatchingConfig
$sel:reverseGeocodingConfig:VectorEnrichmentJobConfig' :: VectorEnrichmentJobConfig -> Maybe ReverseGeocodingConfig
$sel:mapMatchingConfig:VectorEnrichmentJobConfig' :: VectorEnrichmentJobConfig -> Maybe MapMatchingConfig
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe MapMatchingConfig
mapMatchingConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReverseGeocodingConfig
reverseGeocodingConfig

instance Data.ToJSON VectorEnrichmentJobConfig where
  toJSON :: VectorEnrichmentJobConfig -> Value
toJSON VectorEnrichmentJobConfig' {Maybe MapMatchingConfig
Maybe ReverseGeocodingConfig
reverseGeocodingConfig :: Maybe ReverseGeocodingConfig
mapMatchingConfig :: Maybe MapMatchingConfig
$sel:reverseGeocodingConfig:VectorEnrichmentJobConfig' :: VectorEnrichmentJobConfig -> Maybe ReverseGeocodingConfig
$sel:mapMatchingConfig:VectorEnrichmentJobConfig' :: VectorEnrichmentJobConfig -> Maybe MapMatchingConfig
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MapMatchingConfig" 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 MapMatchingConfig
mapMatchingConfig,
            (Key
"ReverseGeocodingConfig" 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 ReverseGeocodingConfig
reverseGeocodingConfig
          ]
      )