{-# 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.UiTemplate
-- 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.UiTemplate 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

-- | The Liquid template for the worker user interface.
--
-- /See:/ 'newUiTemplate' smart constructor.
data UiTemplate = UiTemplate'
  { -- | The content of the Liquid template for the worker user interface.
    UiTemplate -> Text
content :: Prelude.Text
  }
  deriving (UiTemplate -> UiTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UiTemplate -> UiTemplate -> Bool
$c/= :: UiTemplate -> UiTemplate -> Bool
== :: UiTemplate -> UiTemplate -> Bool
$c== :: UiTemplate -> UiTemplate -> Bool
Prelude.Eq, ReadPrec [UiTemplate]
ReadPrec UiTemplate
Int -> ReadS UiTemplate
ReadS [UiTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UiTemplate]
$creadListPrec :: ReadPrec [UiTemplate]
readPrec :: ReadPrec UiTemplate
$creadPrec :: ReadPrec UiTemplate
readList :: ReadS [UiTemplate]
$creadList :: ReadS [UiTemplate]
readsPrec :: Int -> ReadS UiTemplate
$creadsPrec :: Int -> ReadS UiTemplate
Prelude.Read, Int -> UiTemplate -> ShowS
[UiTemplate] -> ShowS
UiTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UiTemplate] -> ShowS
$cshowList :: [UiTemplate] -> ShowS
show :: UiTemplate -> String
$cshow :: UiTemplate -> String
showsPrec :: Int -> UiTemplate -> ShowS
$cshowsPrec :: Int -> UiTemplate -> ShowS
Prelude.Show, forall x. Rep UiTemplate x -> UiTemplate
forall x. UiTemplate -> Rep UiTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UiTemplate x -> UiTemplate
$cfrom :: forall x. UiTemplate -> Rep UiTemplate x
Prelude.Generic)

-- |
-- Create a value of 'UiTemplate' 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:
--
-- 'content', 'uiTemplate_content' - The content of the Liquid template for the worker user interface.
newUiTemplate ::
  -- | 'content'
  Prelude.Text ->
  UiTemplate
newUiTemplate :: Text -> UiTemplate
newUiTemplate Text
pContent_ =
  UiTemplate' {$sel:content:UiTemplate' :: Text
content = Text
pContent_}

-- | The content of the Liquid template for the worker user interface.
uiTemplate_content :: Lens.Lens' UiTemplate Prelude.Text
uiTemplate_content :: Lens' UiTemplate Text
uiTemplate_content = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UiTemplate' {Text
content :: Text
$sel:content:UiTemplate' :: UiTemplate -> Text
content} -> Text
content) (\s :: UiTemplate
s@UiTemplate' {} Text
a -> UiTemplate
s {$sel:content:UiTemplate' :: Text
content = Text
a} :: UiTemplate)

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

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

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