{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.RenderUiTemplate
-- 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)
--
-- Renders the UI template so that you can preview the worker\'s
-- experience.
module Amazonka.SageMaker.RenderUiTemplate
  ( -- * Creating a Request
    RenderUiTemplate (..),
    newRenderUiTemplate,

    -- * Request Lenses
    renderUiTemplate_uiTemplate,
    renderUiTemplate_humanTaskUiArn,
    renderUiTemplate_task,
    renderUiTemplate_roleArn,

    -- * Destructuring the Response
    RenderUiTemplateResponse (..),
    newRenderUiTemplateResponse,

    -- * Response Lenses
    renderUiTemplateResponse_httpStatus,
    renderUiTemplateResponse_renderedContent,
    renderUiTemplateResponse_errors,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types

-- | /See:/ 'newRenderUiTemplate' smart constructor.
data RenderUiTemplate = RenderUiTemplate'
  { -- | A @Template@ object containing the worker UI template to render.
    RenderUiTemplate -> Maybe UiTemplate
uiTemplate :: Prelude.Maybe UiTemplate,
    -- | The @HumanTaskUiArn@ of the worker UI that you want to render. Do not
    -- provide a @HumanTaskUiArn@ if you use the @UiTemplate@ parameter.
    --
    -- See a list of available Human Ui Amazon Resource Names (ARNs) in
    -- UiConfig.
    RenderUiTemplate -> Maybe Text
humanTaskUiArn :: Prelude.Maybe Prelude.Text,
    -- | A @RenderableTask@ object containing a representative task to render.
    RenderUiTemplate -> RenderableTask
task :: RenderableTask,
    -- | The Amazon Resource Name (ARN) that has access to the S3 objects that
    -- are used by the template.
    RenderUiTemplate -> Text
roleArn :: Prelude.Text
  }
  deriving (RenderUiTemplate -> RenderUiTemplate -> Bool
(RenderUiTemplate -> RenderUiTemplate -> Bool)
-> (RenderUiTemplate -> RenderUiTemplate -> Bool)
-> Eq RenderUiTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RenderUiTemplate -> RenderUiTemplate -> Bool
$c/= :: RenderUiTemplate -> RenderUiTemplate -> Bool
== :: RenderUiTemplate -> RenderUiTemplate -> Bool
$c== :: RenderUiTemplate -> RenderUiTemplate -> Bool
Prelude.Eq, ReadPrec [RenderUiTemplate]
ReadPrec RenderUiTemplate
Int -> ReadS RenderUiTemplate
ReadS [RenderUiTemplate]
(Int -> ReadS RenderUiTemplate)
-> ReadS [RenderUiTemplate]
-> ReadPrec RenderUiTemplate
-> ReadPrec [RenderUiTemplate]
-> Read RenderUiTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RenderUiTemplate]
$creadListPrec :: ReadPrec [RenderUiTemplate]
readPrec :: ReadPrec RenderUiTemplate
$creadPrec :: ReadPrec RenderUiTemplate
readList :: ReadS [RenderUiTemplate]
$creadList :: ReadS [RenderUiTemplate]
readsPrec :: Int -> ReadS RenderUiTemplate
$creadsPrec :: Int -> ReadS RenderUiTemplate
Prelude.Read, Int -> RenderUiTemplate -> ShowS
[RenderUiTemplate] -> ShowS
RenderUiTemplate -> String
(Int -> RenderUiTemplate -> ShowS)
-> (RenderUiTemplate -> String)
-> ([RenderUiTemplate] -> ShowS)
-> Show RenderUiTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RenderUiTemplate] -> ShowS
$cshowList :: [RenderUiTemplate] -> ShowS
show :: RenderUiTemplate -> String
$cshow :: RenderUiTemplate -> String
showsPrec :: Int -> RenderUiTemplate -> ShowS
$cshowsPrec :: Int -> RenderUiTemplate -> ShowS
Prelude.Show, (forall x. RenderUiTemplate -> Rep RenderUiTemplate x)
-> (forall x. Rep RenderUiTemplate x -> RenderUiTemplate)
-> Generic RenderUiTemplate
forall x. Rep RenderUiTemplate x -> RenderUiTemplate
forall x. RenderUiTemplate -> Rep RenderUiTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RenderUiTemplate x -> RenderUiTemplate
$cfrom :: forall x. RenderUiTemplate -> Rep RenderUiTemplate x
Prelude.Generic)

-- |
-- Create a value of 'RenderUiTemplate' 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:
--
-- 'uiTemplate', 'renderUiTemplate_uiTemplate' - A @Template@ object containing the worker UI template to render.
--
-- 'humanTaskUiArn', 'renderUiTemplate_humanTaskUiArn' - The @HumanTaskUiArn@ of the worker UI that you want to render. Do not
-- provide a @HumanTaskUiArn@ if you use the @UiTemplate@ parameter.
--
-- See a list of available Human Ui Amazon Resource Names (ARNs) in
-- UiConfig.
--
-- 'task', 'renderUiTemplate_task' - A @RenderableTask@ object containing a representative task to render.
--
-- 'roleArn', 'renderUiTemplate_roleArn' - The Amazon Resource Name (ARN) that has access to the S3 objects that
-- are used by the template.
newRenderUiTemplate ::
  -- | 'task'
  RenderableTask ->
  -- | 'roleArn'
  Prelude.Text ->
  RenderUiTemplate
newRenderUiTemplate :: RenderableTask -> Text -> RenderUiTemplate
newRenderUiTemplate RenderableTask
pTask_ Text
pRoleArn_ =
  RenderUiTemplate' :: Maybe UiTemplate
-> Maybe Text -> RenderableTask -> Text -> RenderUiTemplate
RenderUiTemplate'
    { $sel:uiTemplate:RenderUiTemplate' :: Maybe UiTemplate
uiTemplate = Maybe UiTemplate
forall a. Maybe a
Prelude.Nothing,
      $sel:humanTaskUiArn:RenderUiTemplate' :: Maybe Text
humanTaskUiArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:task:RenderUiTemplate' :: RenderableTask
task = RenderableTask
pTask_,
      $sel:roleArn:RenderUiTemplate' :: Text
roleArn = Text
pRoleArn_
    }

-- | A @Template@ object containing the worker UI template to render.
renderUiTemplate_uiTemplate :: Lens.Lens' RenderUiTemplate (Prelude.Maybe UiTemplate)
renderUiTemplate_uiTemplate :: (Maybe UiTemplate -> f (Maybe UiTemplate))
-> RenderUiTemplate -> f RenderUiTemplate
renderUiTemplate_uiTemplate = (RenderUiTemplate -> Maybe UiTemplate)
-> (RenderUiTemplate -> Maybe UiTemplate -> RenderUiTemplate)
-> Lens
     RenderUiTemplate
     RenderUiTemplate
     (Maybe UiTemplate)
     (Maybe UiTemplate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenderUiTemplate' {Maybe UiTemplate
uiTemplate :: Maybe UiTemplate
$sel:uiTemplate:RenderUiTemplate' :: RenderUiTemplate -> Maybe UiTemplate
uiTemplate} -> Maybe UiTemplate
uiTemplate) (\s :: RenderUiTemplate
s@RenderUiTemplate' {} Maybe UiTemplate
a -> RenderUiTemplate
s {$sel:uiTemplate:RenderUiTemplate' :: Maybe UiTemplate
uiTemplate = Maybe UiTemplate
a} :: RenderUiTemplate)

-- | The @HumanTaskUiArn@ of the worker UI that you want to render. Do not
-- provide a @HumanTaskUiArn@ if you use the @UiTemplate@ parameter.
--
-- See a list of available Human Ui Amazon Resource Names (ARNs) in
-- UiConfig.
renderUiTemplate_humanTaskUiArn :: Lens.Lens' RenderUiTemplate (Prelude.Maybe Prelude.Text)
renderUiTemplate_humanTaskUiArn :: (Maybe Text -> f (Maybe Text))
-> RenderUiTemplate -> f RenderUiTemplate
renderUiTemplate_humanTaskUiArn = (RenderUiTemplate -> Maybe Text)
-> (RenderUiTemplate -> Maybe Text -> RenderUiTemplate)
-> Lens RenderUiTemplate RenderUiTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenderUiTemplate' {Maybe Text
humanTaskUiArn :: Maybe Text
$sel:humanTaskUiArn:RenderUiTemplate' :: RenderUiTemplate -> Maybe Text
humanTaskUiArn} -> Maybe Text
humanTaskUiArn) (\s :: RenderUiTemplate
s@RenderUiTemplate' {} Maybe Text
a -> RenderUiTemplate
s {$sel:humanTaskUiArn:RenderUiTemplate' :: Maybe Text
humanTaskUiArn = Maybe Text
a} :: RenderUiTemplate)

-- | A @RenderableTask@ object containing a representative task to render.
renderUiTemplate_task :: Lens.Lens' RenderUiTemplate RenderableTask
renderUiTemplate_task :: (RenderableTask -> f RenderableTask)
-> RenderUiTemplate -> f RenderUiTemplate
renderUiTemplate_task = (RenderUiTemplate -> RenderableTask)
-> (RenderUiTemplate -> RenderableTask -> RenderUiTemplate)
-> Lens
     RenderUiTemplate RenderUiTemplate RenderableTask RenderableTask
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenderUiTemplate' {RenderableTask
task :: RenderableTask
$sel:task:RenderUiTemplate' :: RenderUiTemplate -> RenderableTask
task} -> RenderableTask
task) (\s :: RenderUiTemplate
s@RenderUiTemplate' {} RenderableTask
a -> RenderUiTemplate
s {$sel:task:RenderUiTemplate' :: RenderableTask
task = RenderableTask
a} :: RenderUiTemplate)

-- | The Amazon Resource Name (ARN) that has access to the S3 objects that
-- are used by the template.
renderUiTemplate_roleArn :: Lens.Lens' RenderUiTemplate Prelude.Text
renderUiTemplate_roleArn :: (Text -> f Text) -> RenderUiTemplate -> f RenderUiTemplate
renderUiTemplate_roleArn = (RenderUiTemplate -> Text)
-> (RenderUiTemplate -> Text -> RenderUiTemplate)
-> Lens RenderUiTemplate RenderUiTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenderUiTemplate' {Text
roleArn :: Text
$sel:roleArn:RenderUiTemplate' :: RenderUiTemplate -> Text
roleArn} -> Text
roleArn) (\s :: RenderUiTemplate
s@RenderUiTemplate' {} Text
a -> RenderUiTemplate
s {$sel:roleArn:RenderUiTemplate' :: Text
roleArn = Text
a} :: RenderUiTemplate)

instance Core.AWSRequest RenderUiTemplate where
  type
    AWSResponse RenderUiTemplate =
      RenderUiTemplateResponse
  request :: RenderUiTemplate -> Request RenderUiTemplate
request = Service -> RenderUiTemplate -> Request RenderUiTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy RenderUiTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RenderUiTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse RenderUiTemplate))
-> Logger
-> Service
-> Proxy RenderUiTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RenderUiTemplate)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> Text -> [RenderingError] -> RenderUiTemplateResponse
RenderUiTemplateResponse'
            (Int -> Text -> [RenderingError] -> RenderUiTemplateResponse)
-> Either String Int
-> Either
     String (Text -> [RenderingError] -> RenderUiTemplateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String (Text -> [RenderingError] -> RenderUiTemplateResponse)
-> Either String Text
-> Either String ([RenderingError] -> RenderUiTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"RenderedContent")
            Either String ([RenderingError] -> RenderUiTemplateResponse)
-> Either String [RenderingError]
-> Either String RenderUiTemplateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [RenderingError])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Errors" Either String (Maybe [RenderingError])
-> [RenderingError] -> Either String [RenderingError]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [RenderingError]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable RenderUiTemplate

instance Prelude.NFData RenderUiTemplate

instance Core.ToHeaders RenderUiTemplate where
  toHeaders :: RenderUiTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders -> RenderUiTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"SageMaker.RenderUiTemplate" :: Prelude.ByteString),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON RenderUiTemplate where
  toJSON :: RenderUiTemplate -> Value
toJSON RenderUiTemplate' {Maybe Text
Maybe UiTemplate
Text
RenderableTask
roleArn :: Text
task :: RenderableTask
humanTaskUiArn :: Maybe Text
uiTemplate :: Maybe UiTemplate
$sel:roleArn:RenderUiTemplate' :: RenderUiTemplate -> Text
$sel:task:RenderUiTemplate' :: RenderUiTemplate -> RenderableTask
$sel:humanTaskUiArn:RenderUiTemplate' :: RenderUiTemplate -> Maybe Text
$sel:uiTemplate:RenderUiTemplate' :: RenderUiTemplate -> Maybe UiTemplate
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"UiTemplate" Text -> UiTemplate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (UiTemplate -> Pair) -> Maybe UiTemplate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UiTemplate
uiTemplate,
            (Text
"HumanTaskUiArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
humanTaskUiArn,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Task" Text -> RenderableTask -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RenderableTask
task),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn)
          ]
      )

instance Core.ToPath RenderUiTemplate where
  toPath :: RenderUiTemplate -> ByteString
toPath = ByteString -> RenderUiTemplate -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery RenderUiTemplate where
  toQuery :: RenderUiTemplate -> QueryString
toQuery = QueryString -> RenderUiTemplate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newRenderUiTemplateResponse' smart constructor.
data RenderUiTemplateResponse = RenderUiTemplateResponse'
  { -- | The response's http status code.
    RenderUiTemplateResponse -> Int
httpStatus :: Prelude.Int,
    -- | A Liquid template that renders the HTML for the worker UI.
    RenderUiTemplateResponse -> Text
renderedContent :: Prelude.Text,
    -- | A list of one or more @RenderingError@ objects if any were encountered
    -- while rendering the template. If there were no errors, the list is
    -- empty.
    RenderUiTemplateResponse -> [RenderingError]
errors :: [RenderingError]
  }
  deriving (RenderUiTemplateResponse -> RenderUiTemplateResponse -> Bool
(RenderUiTemplateResponse -> RenderUiTemplateResponse -> Bool)
-> (RenderUiTemplateResponse -> RenderUiTemplateResponse -> Bool)
-> Eq RenderUiTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RenderUiTemplateResponse -> RenderUiTemplateResponse -> Bool
$c/= :: RenderUiTemplateResponse -> RenderUiTemplateResponse -> Bool
== :: RenderUiTemplateResponse -> RenderUiTemplateResponse -> Bool
$c== :: RenderUiTemplateResponse -> RenderUiTemplateResponse -> Bool
Prelude.Eq, ReadPrec [RenderUiTemplateResponse]
ReadPrec RenderUiTemplateResponse
Int -> ReadS RenderUiTemplateResponse
ReadS [RenderUiTemplateResponse]
(Int -> ReadS RenderUiTemplateResponse)
-> ReadS [RenderUiTemplateResponse]
-> ReadPrec RenderUiTemplateResponse
-> ReadPrec [RenderUiTemplateResponse]
-> Read RenderUiTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RenderUiTemplateResponse]
$creadListPrec :: ReadPrec [RenderUiTemplateResponse]
readPrec :: ReadPrec RenderUiTemplateResponse
$creadPrec :: ReadPrec RenderUiTemplateResponse
readList :: ReadS [RenderUiTemplateResponse]
$creadList :: ReadS [RenderUiTemplateResponse]
readsPrec :: Int -> ReadS RenderUiTemplateResponse
$creadsPrec :: Int -> ReadS RenderUiTemplateResponse
Prelude.Read, Int -> RenderUiTemplateResponse -> ShowS
[RenderUiTemplateResponse] -> ShowS
RenderUiTemplateResponse -> String
(Int -> RenderUiTemplateResponse -> ShowS)
-> (RenderUiTemplateResponse -> String)
-> ([RenderUiTemplateResponse] -> ShowS)
-> Show RenderUiTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RenderUiTemplateResponse] -> ShowS
$cshowList :: [RenderUiTemplateResponse] -> ShowS
show :: RenderUiTemplateResponse -> String
$cshow :: RenderUiTemplateResponse -> String
showsPrec :: Int -> RenderUiTemplateResponse -> ShowS
$cshowsPrec :: Int -> RenderUiTemplateResponse -> ShowS
Prelude.Show, (forall x.
 RenderUiTemplateResponse -> Rep RenderUiTemplateResponse x)
-> (forall x.
    Rep RenderUiTemplateResponse x -> RenderUiTemplateResponse)
-> Generic RenderUiTemplateResponse
forall x.
Rep RenderUiTemplateResponse x -> RenderUiTemplateResponse
forall x.
RenderUiTemplateResponse -> Rep RenderUiTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RenderUiTemplateResponse x -> RenderUiTemplateResponse
$cfrom :: forall x.
RenderUiTemplateResponse -> Rep RenderUiTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'RenderUiTemplateResponse' 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:
--
-- 'httpStatus', 'renderUiTemplateResponse_httpStatus' - The response's http status code.
--
-- 'renderedContent', 'renderUiTemplateResponse_renderedContent' - A Liquid template that renders the HTML for the worker UI.
--
-- 'errors', 'renderUiTemplateResponse_errors' - A list of one or more @RenderingError@ objects if any were encountered
-- while rendering the template. If there were no errors, the list is
-- empty.
newRenderUiTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'renderedContent'
  Prelude.Text ->
  RenderUiTemplateResponse
newRenderUiTemplateResponse :: Int -> Text -> RenderUiTemplateResponse
newRenderUiTemplateResponse
  Int
pHttpStatus_
  Text
pRenderedContent_ =
    RenderUiTemplateResponse' :: Int -> Text -> [RenderingError] -> RenderUiTemplateResponse
RenderUiTemplateResponse'
      { $sel:httpStatus:RenderUiTemplateResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:renderedContent:RenderUiTemplateResponse' :: Text
renderedContent = Text
pRenderedContent_,
        $sel:errors:RenderUiTemplateResponse' :: [RenderingError]
errors = [RenderingError]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The response's http status code.
renderUiTemplateResponse_httpStatus :: Lens.Lens' RenderUiTemplateResponse Prelude.Int
renderUiTemplateResponse_httpStatus :: (Int -> f Int)
-> RenderUiTemplateResponse -> f RenderUiTemplateResponse
renderUiTemplateResponse_httpStatus = (RenderUiTemplateResponse -> Int)
-> (RenderUiTemplateResponse -> Int -> RenderUiTemplateResponse)
-> Lens RenderUiTemplateResponse RenderUiTemplateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenderUiTemplateResponse' {Int
httpStatus :: Int
$sel:httpStatus:RenderUiTemplateResponse' :: RenderUiTemplateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RenderUiTemplateResponse
s@RenderUiTemplateResponse' {} Int
a -> RenderUiTemplateResponse
s {$sel:httpStatus:RenderUiTemplateResponse' :: Int
httpStatus = Int
a} :: RenderUiTemplateResponse)

-- | A Liquid template that renders the HTML for the worker UI.
renderUiTemplateResponse_renderedContent :: Lens.Lens' RenderUiTemplateResponse Prelude.Text
renderUiTemplateResponse_renderedContent :: (Text -> f Text)
-> RenderUiTemplateResponse -> f RenderUiTemplateResponse
renderUiTemplateResponse_renderedContent = (RenderUiTemplateResponse -> Text)
-> (RenderUiTemplateResponse -> Text -> RenderUiTemplateResponse)
-> Lens RenderUiTemplateResponse RenderUiTemplateResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenderUiTemplateResponse' {Text
renderedContent :: Text
$sel:renderedContent:RenderUiTemplateResponse' :: RenderUiTemplateResponse -> Text
renderedContent} -> Text
renderedContent) (\s :: RenderUiTemplateResponse
s@RenderUiTemplateResponse' {} Text
a -> RenderUiTemplateResponse
s {$sel:renderedContent:RenderUiTemplateResponse' :: Text
renderedContent = Text
a} :: RenderUiTemplateResponse)

-- | A list of one or more @RenderingError@ objects if any were encountered
-- while rendering the template. If there were no errors, the list is
-- empty.
renderUiTemplateResponse_errors :: Lens.Lens' RenderUiTemplateResponse [RenderingError]
renderUiTemplateResponse_errors :: ([RenderingError] -> f [RenderingError])
-> RenderUiTemplateResponse -> f RenderUiTemplateResponse
renderUiTemplateResponse_errors = (RenderUiTemplateResponse -> [RenderingError])
-> (RenderUiTemplateResponse
    -> [RenderingError] -> RenderUiTemplateResponse)
-> Lens
     RenderUiTemplateResponse
     RenderUiTemplateResponse
     [RenderingError]
     [RenderingError]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RenderUiTemplateResponse' {[RenderingError]
errors :: [RenderingError]
$sel:errors:RenderUiTemplateResponse' :: RenderUiTemplateResponse -> [RenderingError]
errors} -> [RenderingError]
errors) (\s :: RenderUiTemplateResponse
s@RenderUiTemplateResponse' {} [RenderingError]
a -> RenderUiTemplateResponse
s {$sel:errors:RenderUiTemplateResponse' :: [RenderingError]
errors = [RenderingError]
a} :: RenderUiTemplateResponse) (([RenderingError] -> f [RenderingError])
 -> RenderUiTemplateResponse -> f RenderUiTemplateResponse)
-> (([RenderingError] -> f [RenderingError])
    -> [RenderingError] -> f [RenderingError])
-> ([RenderingError] -> f [RenderingError])
-> RenderUiTemplateResponse
-> f RenderUiTemplateResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RenderingError] -> f [RenderingError])
-> [RenderingError] -> f [RenderingError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData RenderUiTemplateResponse