{-# 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.SageMakerA2IRuntime.Types.HumanLoopInput
-- 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)
module Amazonka.SageMakerA2IRuntime.Types.HumanLoopInput where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An object containing the human loop input in JSON format.
--
-- /See:/ 'newHumanLoopInput' smart constructor.
data HumanLoopInput = HumanLoopInput'
  { -- | Serialized input from the human loop. The input must be a string
    -- representation of a file in JSON format.
    HumanLoopInput -> Text
inputContent :: Prelude.Text
  }
  deriving (HumanLoopInput -> HumanLoopInput -> Bool
(HumanLoopInput -> HumanLoopInput -> Bool)
-> (HumanLoopInput -> HumanLoopInput -> Bool) -> Eq HumanLoopInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HumanLoopInput -> HumanLoopInput -> Bool
$c/= :: HumanLoopInput -> HumanLoopInput -> Bool
== :: HumanLoopInput -> HumanLoopInput -> Bool
$c== :: HumanLoopInput -> HumanLoopInput -> Bool
Prelude.Eq, ReadPrec [HumanLoopInput]
ReadPrec HumanLoopInput
Int -> ReadS HumanLoopInput
ReadS [HumanLoopInput]
(Int -> ReadS HumanLoopInput)
-> ReadS [HumanLoopInput]
-> ReadPrec HumanLoopInput
-> ReadPrec [HumanLoopInput]
-> Read HumanLoopInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HumanLoopInput]
$creadListPrec :: ReadPrec [HumanLoopInput]
readPrec :: ReadPrec HumanLoopInput
$creadPrec :: ReadPrec HumanLoopInput
readList :: ReadS [HumanLoopInput]
$creadList :: ReadS [HumanLoopInput]
readsPrec :: Int -> ReadS HumanLoopInput
$creadsPrec :: Int -> ReadS HumanLoopInput
Prelude.Read, Int -> HumanLoopInput -> ShowS
[HumanLoopInput] -> ShowS
HumanLoopInput -> String
(Int -> HumanLoopInput -> ShowS)
-> (HumanLoopInput -> String)
-> ([HumanLoopInput] -> ShowS)
-> Show HumanLoopInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HumanLoopInput] -> ShowS
$cshowList :: [HumanLoopInput] -> ShowS
show :: HumanLoopInput -> String
$cshow :: HumanLoopInput -> String
showsPrec :: Int -> HumanLoopInput -> ShowS
$cshowsPrec :: Int -> HumanLoopInput -> ShowS
Prelude.Show, (forall x. HumanLoopInput -> Rep HumanLoopInput x)
-> (forall x. Rep HumanLoopInput x -> HumanLoopInput)
-> Generic HumanLoopInput
forall x. Rep HumanLoopInput x -> HumanLoopInput
forall x. HumanLoopInput -> Rep HumanLoopInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HumanLoopInput x -> HumanLoopInput
$cfrom :: forall x. HumanLoopInput -> Rep HumanLoopInput x
Prelude.Generic)

-- |
-- Create a value of 'HumanLoopInput' 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:
--
-- 'inputContent', 'humanLoopInput_inputContent' - Serialized input from the human loop. The input must be a string
-- representation of a file in JSON format.
newHumanLoopInput ::
  -- | 'inputContent'
  Prelude.Text ->
  HumanLoopInput
newHumanLoopInput :: Text -> HumanLoopInput
newHumanLoopInput Text
pInputContent_ =
  HumanLoopInput' :: Text -> HumanLoopInput
HumanLoopInput' {$sel:inputContent:HumanLoopInput' :: Text
inputContent = Text
pInputContent_}

-- | Serialized input from the human loop. The input must be a string
-- representation of a file in JSON format.
humanLoopInput_inputContent :: Lens.Lens' HumanLoopInput Prelude.Text
humanLoopInput_inputContent :: (Text -> f Text) -> HumanLoopInput -> f HumanLoopInput
humanLoopInput_inputContent = (HumanLoopInput -> Text)
-> (HumanLoopInput -> Text -> HumanLoopInput)
-> Lens HumanLoopInput HumanLoopInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HumanLoopInput' {Text
inputContent :: Text
$sel:inputContent:HumanLoopInput' :: HumanLoopInput -> Text
inputContent} -> Text
inputContent) (\s :: HumanLoopInput
s@HumanLoopInput' {} Text
a -> HumanLoopInput
s {$sel:inputContent:HumanLoopInput' :: Text
inputContent = Text
a} :: HumanLoopInput)

instance Prelude.Hashable HumanLoopInput

instance Prelude.NFData HumanLoopInput

instance Core.ToJSON HumanLoopInput where
  toJSON :: HumanLoopInput -> Value
toJSON HumanLoopInput' {Text
inputContent :: Text
$sel:inputContent:HumanLoopInput' :: HumanLoopInput -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InputContent" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
inputContent)]
      )