{-# 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.UiTemplateInfo
-- 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.UiTemplateInfo where

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

-- | Container for user interface template information.
--
-- /See:/ 'newUiTemplateInfo' smart constructor.
data UiTemplateInfo = UiTemplateInfo'
  { -- | The URL for the user interface template.
    UiTemplateInfo -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
    -- | The SHA-256 digest of the contents of the template.
    UiTemplateInfo -> Maybe Text
contentSha256 :: Prelude.Maybe Prelude.Text
  }
  deriving (UiTemplateInfo -> UiTemplateInfo -> Bool
(UiTemplateInfo -> UiTemplateInfo -> Bool)
-> (UiTemplateInfo -> UiTemplateInfo -> Bool) -> Eq UiTemplateInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UiTemplateInfo -> UiTemplateInfo -> Bool
$c/= :: UiTemplateInfo -> UiTemplateInfo -> Bool
== :: UiTemplateInfo -> UiTemplateInfo -> Bool
$c== :: UiTemplateInfo -> UiTemplateInfo -> Bool
Prelude.Eq, ReadPrec [UiTemplateInfo]
ReadPrec UiTemplateInfo
Int -> ReadS UiTemplateInfo
ReadS [UiTemplateInfo]
(Int -> ReadS UiTemplateInfo)
-> ReadS [UiTemplateInfo]
-> ReadPrec UiTemplateInfo
-> ReadPrec [UiTemplateInfo]
-> Read UiTemplateInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UiTemplateInfo]
$creadListPrec :: ReadPrec [UiTemplateInfo]
readPrec :: ReadPrec UiTemplateInfo
$creadPrec :: ReadPrec UiTemplateInfo
readList :: ReadS [UiTemplateInfo]
$creadList :: ReadS [UiTemplateInfo]
readsPrec :: Int -> ReadS UiTemplateInfo
$creadsPrec :: Int -> ReadS UiTemplateInfo
Prelude.Read, Int -> UiTemplateInfo -> ShowS
[UiTemplateInfo] -> ShowS
UiTemplateInfo -> String
(Int -> UiTemplateInfo -> ShowS)
-> (UiTemplateInfo -> String)
-> ([UiTemplateInfo] -> ShowS)
-> Show UiTemplateInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UiTemplateInfo] -> ShowS
$cshowList :: [UiTemplateInfo] -> ShowS
show :: UiTemplateInfo -> String
$cshow :: UiTemplateInfo -> String
showsPrec :: Int -> UiTemplateInfo -> ShowS
$cshowsPrec :: Int -> UiTemplateInfo -> ShowS
Prelude.Show, (forall x. UiTemplateInfo -> Rep UiTemplateInfo x)
-> (forall x. Rep UiTemplateInfo x -> UiTemplateInfo)
-> Generic UiTemplateInfo
forall x. Rep UiTemplateInfo x -> UiTemplateInfo
forall x. UiTemplateInfo -> Rep UiTemplateInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UiTemplateInfo x -> UiTemplateInfo
$cfrom :: forall x. UiTemplateInfo -> Rep UiTemplateInfo x
Prelude.Generic)

-- |
-- Create a value of 'UiTemplateInfo' 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:
--
-- 'url', 'uiTemplateInfo_url' - The URL for the user interface template.
--
-- 'contentSha256', 'uiTemplateInfo_contentSha256' - The SHA-256 digest of the contents of the template.
newUiTemplateInfo ::
  UiTemplateInfo
newUiTemplateInfo :: UiTemplateInfo
newUiTemplateInfo =
  UiTemplateInfo' :: Maybe Text -> Maybe Text -> UiTemplateInfo
UiTemplateInfo'
    { $sel:url:UiTemplateInfo' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentSha256:UiTemplateInfo' :: Maybe Text
contentSha256 = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The URL for the user interface template.
uiTemplateInfo_url :: Lens.Lens' UiTemplateInfo (Prelude.Maybe Prelude.Text)
uiTemplateInfo_url :: (Maybe Text -> f (Maybe Text))
-> UiTemplateInfo -> f UiTemplateInfo
uiTemplateInfo_url = (UiTemplateInfo -> Maybe Text)
-> (UiTemplateInfo -> Maybe Text -> UiTemplateInfo)
-> Lens UiTemplateInfo UiTemplateInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UiTemplateInfo' {Maybe Text
url :: Maybe Text
$sel:url:UiTemplateInfo' :: UiTemplateInfo -> Maybe Text
url} -> Maybe Text
url) (\s :: UiTemplateInfo
s@UiTemplateInfo' {} Maybe Text
a -> UiTemplateInfo
s {$sel:url:UiTemplateInfo' :: Maybe Text
url = Maybe Text
a} :: UiTemplateInfo)

-- | The SHA-256 digest of the contents of the template.
uiTemplateInfo_contentSha256 :: Lens.Lens' UiTemplateInfo (Prelude.Maybe Prelude.Text)
uiTemplateInfo_contentSha256 :: (Maybe Text -> f (Maybe Text))
-> UiTemplateInfo -> f UiTemplateInfo
uiTemplateInfo_contentSha256 = (UiTemplateInfo -> Maybe Text)
-> (UiTemplateInfo -> Maybe Text -> UiTemplateInfo)
-> Lens UiTemplateInfo UiTemplateInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UiTemplateInfo' {Maybe Text
contentSha256 :: Maybe Text
$sel:contentSha256:UiTemplateInfo' :: UiTemplateInfo -> Maybe Text
contentSha256} -> Maybe Text
contentSha256) (\s :: UiTemplateInfo
s@UiTemplateInfo' {} Maybe Text
a -> UiTemplateInfo
s {$sel:contentSha256:UiTemplateInfo' :: Maybe Text
contentSha256 = Maybe Text
a} :: UiTemplateInfo)

instance Core.FromJSON UiTemplateInfo where
  parseJSON :: Value -> Parser UiTemplateInfo
parseJSON =
    String
-> (Object -> Parser UiTemplateInfo)
-> Value
-> Parser UiTemplateInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"UiTemplateInfo"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> UiTemplateInfo
UiTemplateInfo'
            (Maybe Text -> Maybe Text -> UiTemplateInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> UiTemplateInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Url")
            Parser (Maybe Text -> UiTemplateInfo)
-> Parser (Maybe Text) -> Parser UiTemplateInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContentSha256")
      )

instance Prelude.Hashable UiTemplateInfo

instance Prelude.NFData UiTemplateInfo