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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(UiTemplate -> UiTemplate -> Bool)
-> (UiTemplate -> UiTemplate -> Bool) -> Eq UiTemplate
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]
(Int -> ReadS UiTemplate)
-> ReadS [UiTemplate]
-> ReadPrec UiTemplate
-> ReadPrec [UiTemplate]
-> Read 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
(Int -> UiTemplate -> ShowS)
-> (UiTemplate -> String)
-> ([UiTemplate] -> ShowS)
-> Show UiTemplate
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. UiTemplate -> Rep UiTemplate x)
-> (forall x. Rep UiTemplate x -> UiTemplate) -> Generic UiTemplate
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' :: Text -> UiTemplate
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 :: (Text -> f Text) -> UiTemplate -> f UiTemplate
uiTemplate_content = (UiTemplate -> Text)
-> (UiTemplate -> Text -> UiTemplate)
-> Lens UiTemplate UiTemplate Text Text
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

instance Prelude.NFData UiTemplate

instance Core.ToJSON UiTemplate where
  toJSON :: UiTemplate -> Value
toJSON UiTemplate' {Text
content :: Text
$sel:content:UiTemplate' :: UiTemplate -> 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
"Content" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
content)]
      )