{-# 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.SageMaker.Types.ModelInput
-- 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.SageMaker.Types.ModelInput 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

-- | Input object for the model.
--
-- /See:/ 'newModelInput' smart constructor.
data ModelInput = ModelInput'
  { -- | The input configuration object for the model.
    ModelInput -> Text
dataInputConfig :: Prelude.Text
  }
  deriving (ModelInput -> ModelInput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelInput -> ModelInput -> Bool
$c/= :: ModelInput -> ModelInput -> Bool
== :: ModelInput -> ModelInput -> Bool
$c== :: ModelInput -> ModelInput -> Bool
Prelude.Eq, ReadPrec [ModelInput]
ReadPrec ModelInput
Int -> ReadS ModelInput
ReadS [ModelInput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelInput]
$creadListPrec :: ReadPrec [ModelInput]
readPrec :: ReadPrec ModelInput
$creadPrec :: ReadPrec ModelInput
readList :: ReadS [ModelInput]
$creadList :: ReadS [ModelInput]
readsPrec :: Int -> ReadS ModelInput
$creadsPrec :: Int -> ReadS ModelInput
Prelude.Read, Int -> ModelInput -> ShowS
[ModelInput] -> ShowS
ModelInput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelInput] -> ShowS
$cshowList :: [ModelInput] -> ShowS
show :: ModelInput -> String
$cshow :: ModelInput -> String
showsPrec :: Int -> ModelInput -> ShowS
$cshowsPrec :: Int -> ModelInput -> ShowS
Prelude.Show, forall x. Rep ModelInput x -> ModelInput
forall x. ModelInput -> Rep ModelInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModelInput x -> ModelInput
$cfrom :: forall x. ModelInput -> Rep ModelInput x
Prelude.Generic)

-- |
-- Create a value of 'ModelInput' 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:
--
-- 'dataInputConfig', 'modelInput_dataInputConfig' - The input configuration object for the model.
newModelInput ::
  -- | 'dataInputConfig'
  Prelude.Text ->
  ModelInput
newModelInput :: Text -> ModelInput
newModelInput Text
pDataInputConfig_ =
  ModelInput' {$sel:dataInputConfig:ModelInput' :: Text
dataInputConfig = Text
pDataInputConfig_}

-- | The input configuration object for the model.
modelInput_dataInputConfig :: Lens.Lens' ModelInput Prelude.Text
modelInput_dataInputConfig :: Lens' ModelInput Text
modelInput_dataInputConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelInput' {Text
dataInputConfig :: Text
$sel:dataInputConfig:ModelInput' :: ModelInput -> Text
dataInputConfig} -> Text
dataInputConfig) (\s :: ModelInput
s@ModelInput' {} Text
a -> ModelInput
s {$sel:dataInputConfig:ModelInput' :: Text
dataInputConfig = Text
a} :: ModelInput)

instance Data.FromJSON ModelInput where
  parseJSON :: Value -> Parser ModelInput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ModelInput"
      ( \Object
x ->
          Text -> ModelInput
ModelInput'
            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
"DataInputConfig")
      )

instance Prelude.Hashable ModelInput where
  hashWithSalt :: Int -> ModelInput -> Int
hashWithSalt Int
_salt ModelInput' {Text
dataInputConfig :: Text
$sel:dataInputConfig:ModelInput' :: ModelInput -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dataInputConfig

instance Prelude.NFData ModelInput where
  rnf :: ModelInput -> ()
rnf ModelInput' {Text
dataInputConfig :: Text
$sel:dataInputConfig:ModelInput' :: ModelInput -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
dataInputConfig

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