{-# 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.QuickSight.UpdateTemplate
-- 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)
--
-- Updates a template from an existing Amazon QuickSight analysis or
-- another template.
module Amazonka.QuickSight.UpdateTemplate
  ( -- * Creating a Request
    UpdateTemplate (..),
    newUpdateTemplate,

    -- * Request Lenses
    updateTemplate_versionDescription,
    updateTemplate_name,
    updateTemplate_awsAccountId,
    updateTemplate_templateId,
    updateTemplate_sourceEntity,

    -- * Destructuring the Response
    UpdateTemplateResponse (..),
    newUpdateTemplateResponse,

    -- * Response Lenses
    updateTemplateResponse_requestId,
    updateTemplateResponse_arn,
    updateTemplateResponse_creationStatus,
    updateTemplateResponse_templateId,
    updateTemplateResponse_versionArn,
    updateTemplateResponse_status,
  )
where

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

-- | /See:/ 'newUpdateTemplate' smart constructor.
data UpdateTemplate = UpdateTemplate'
  { -- | A description of the current template version that is being updated.
    -- Every time you call @UpdateTemplate@, you create a new version of the
    -- template. Each version of the template maintains a description of the
    -- version in the @VersionDescription@ field.
    UpdateTemplate -> Maybe Text
versionDescription :: Prelude.Maybe Prelude.Text,
    -- | The name for the template.
    UpdateTemplate -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Web Services account that contains the template
    -- that you\'re updating.
    UpdateTemplate -> Text
awsAccountId :: Prelude.Text,
    -- | The ID for the template.
    UpdateTemplate -> Text
templateId :: Prelude.Text,
    -- | The entity that you are using as a source when you update the template.
    -- In @SourceEntity@, you specify the type of object you\'re using as
    -- source: @SourceTemplate@ for a template or @SourceAnalysis@ for an
    -- analysis. Both of these require an Amazon Resource Name (ARN). For
    -- @SourceTemplate@, specify the ARN of the source template. For
    -- @SourceAnalysis@, specify the ARN of the source analysis. The
    -- @SourceTemplate@ ARN can contain any Amazon Web Services account and any
    -- Amazon QuickSight-supported Amazon Web Services Region;.
    --
    -- Use the @DataSetReferences@ entity within @SourceTemplate@ or
    -- @SourceAnalysis@ to list the replacement datasets for the placeholders
    -- listed in the original. The schema in each dataset must match its
    -- placeholder.
    UpdateTemplate -> TemplateSourceEntity
sourceEntity :: TemplateSourceEntity
  }
  deriving (UpdateTemplate -> UpdateTemplate -> Bool
(UpdateTemplate -> UpdateTemplate -> Bool)
-> (UpdateTemplate -> UpdateTemplate -> Bool) -> Eq UpdateTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTemplate -> UpdateTemplate -> Bool
$c/= :: UpdateTemplate -> UpdateTemplate -> Bool
== :: UpdateTemplate -> UpdateTemplate -> Bool
$c== :: UpdateTemplate -> UpdateTemplate -> Bool
Prelude.Eq, ReadPrec [UpdateTemplate]
ReadPrec UpdateTemplate
Int -> ReadS UpdateTemplate
ReadS [UpdateTemplate]
(Int -> ReadS UpdateTemplate)
-> ReadS [UpdateTemplate]
-> ReadPrec UpdateTemplate
-> ReadPrec [UpdateTemplate]
-> Read UpdateTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTemplate]
$creadListPrec :: ReadPrec [UpdateTemplate]
readPrec :: ReadPrec UpdateTemplate
$creadPrec :: ReadPrec UpdateTemplate
readList :: ReadS [UpdateTemplate]
$creadList :: ReadS [UpdateTemplate]
readsPrec :: Int -> ReadS UpdateTemplate
$creadsPrec :: Int -> ReadS UpdateTemplate
Prelude.Read, Int -> UpdateTemplate -> ShowS
[UpdateTemplate] -> ShowS
UpdateTemplate -> String
(Int -> UpdateTemplate -> ShowS)
-> (UpdateTemplate -> String)
-> ([UpdateTemplate] -> ShowS)
-> Show UpdateTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTemplate] -> ShowS
$cshowList :: [UpdateTemplate] -> ShowS
show :: UpdateTemplate -> String
$cshow :: UpdateTemplate -> String
showsPrec :: Int -> UpdateTemplate -> ShowS
$cshowsPrec :: Int -> UpdateTemplate -> ShowS
Prelude.Show, (forall x. UpdateTemplate -> Rep UpdateTemplate x)
-> (forall x. Rep UpdateTemplate x -> UpdateTemplate)
-> Generic UpdateTemplate
forall x. Rep UpdateTemplate x -> UpdateTemplate
forall x. UpdateTemplate -> Rep UpdateTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateTemplate x -> UpdateTemplate
$cfrom :: forall x. UpdateTemplate -> Rep UpdateTemplate x
Prelude.Generic)

-- |
-- Create a value of 'UpdateTemplate' 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:
--
-- 'versionDescription', 'updateTemplate_versionDescription' - A description of the current template version that is being updated.
-- Every time you call @UpdateTemplate@, you create a new version of the
-- template. Each version of the template maintains a description of the
-- version in the @VersionDescription@ field.
--
-- 'name', 'updateTemplate_name' - The name for the template.
--
-- 'awsAccountId', 'updateTemplate_awsAccountId' - The ID of the Amazon Web Services account that contains the template
-- that you\'re updating.
--
-- 'templateId', 'updateTemplate_templateId' - The ID for the template.
--
-- 'sourceEntity', 'updateTemplate_sourceEntity' - The entity that you are using as a source when you update the template.
-- In @SourceEntity@, you specify the type of object you\'re using as
-- source: @SourceTemplate@ for a template or @SourceAnalysis@ for an
-- analysis. Both of these require an Amazon Resource Name (ARN). For
-- @SourceTemplate@, specify the ARN of the source template. For
-- @SourceAnalysis@, specify the ARN of the source analysis. The
-- @SourceTemplate@ ARN can contain any Amazon Web Services account and any
-- Amazon QuickSight-supported Amazon Web Services Region;.
--
-- Use the @DataSetReferences@ entity within @SourceTemplate@ or
-- @SourceAnalysis@ to list the replacement datasets for the placeholders
-- listed in the original. The schema in each dataset must match its
-- placeholder.
newUpdateTemplate ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'templateId'
  Prelude.Text ->
  -- | 'sourceEntity'
  TemplateSourceEntity ->
  UpdateTemplate
newUpdateTemplate :: Text -> Text -> TemplateSourceEntity -> UpdateTemplate
newUpdateTemplate
  Text
pAwsAccountId_
  Text
pTemplateId_
  TemplateSourceEntity
pSourceEntity_ =
    UpdateTemplate' :: Maybe Text
-> Maybe Text
-> Text
-> Text
-> TemplateSourceEntity
-> UpdateTemplate
UpdateTemplate'
      { $sel:versionDescription:UpdateTemplate' :: Maybe Text
versionDescription =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:name:UpdateTemplate' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:awsAccountId:UpdateTemplate' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:templateId:UpdateTemplate' :: Text
templateId = Text
pTemplateId_,
        $sel:sourceEntity:UpdateTemplate' :: TemplateSourceEntity
sourceEntity = TemplateSourceEntity
pSourceEntity_
      }

-- | A description of the current template version that is being updated.
-- Every time you call @UpdateTemplate@, you create a new version of the
-- template. Each version of the template maintains a description of the
-- version in the @VersionDescription@ field.
updateTemplate_versionDescription :: Lens.Lens' UpdateTemplate (Prelude.Maybe Prelude.Text)
updateTemplate_versionDescription :: (Maybe Text -> f (Maybe Text))
-> UpdateTemplate -> f UpdateTemplate
updateTemplate_versionDescription = (UpdateTemplate -> Maybe Text)
-> (UpdateTemplate -> Maybe Text -> UpdateTemplate)
-> Lens UpdateTemplate UpdateTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTemplate' {Maybe Text
versionDescription :: Maybe Text
$sel:versionDescription:UpdateTemplate' :: UpdateTemplate -> Maybe Text
versionDescription} -> Maybe Text
versionDescription) (\s :: UpdateTemplate
s@UpdateTemplate' {} Maybe Text
a -> UpdateTemplate
s {$sel:versionDescription:UpdateTemplate' :: Maybe Text
versionDescription = Maybe Text
a} :: UpdateTemplate)

-- | The name for the template.
updateTemplate_name :: Lens.Lens' UpdateTemplate (Prelude.Maybe Prelude.Text)
updateTemplate_name :: (Maybe Text -> f (Maybe Text))
-> UpdateTemplate -> f UpdateTemplate
updateTemplate_name = (UpdateTemplate -> Maybe Text)
-> (UpdateTemplate -> Maybe Text -> UpdateTemplate)
-> Lens UpdateTemplate UpdateTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTemplate' {Maybe Text
name :: Maybe Text
$sel:name:UpdateTemplate' :: UpdateTemplate -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateTemplate
s@UpdateTemplate' {} Maybe Text
a -> UpdateTemplate
s {$sel:name:UpdateTemplate' :: Maybe Text
name = Maybe Text
a} :: UpdateTemplate)

-- | The ID of the Amazon Web Services account that contains the template
-- that you\'re updating.
updateTemplate_awsAccountId :: Lens.Lens' UpdateTemplate Prelude.Text
updateTemplate_awsAccountId :: (Text -> f Text) -> UpdateTemplate -> f UpdateTemplate
updateTemplate_awsAccountId = (UpdateTemplate -> Text)
-> (UpdateTemplate -> Text -> UpdateTemplate)
-> Lens UpdateTemplate UpdateTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTemplate' {Text
awsAccountId :: Text
$sel:awsAccountId:UpdateTemplate' :: UpdateTemplate -> Text
awsAccountId} -> Text
awsAccountId) (\s :: UpdateTemplate
s@UpdateTemplate' {} Text
a -> UpdateTemplate
s {$sel:awsAccountId:UpdateTemplate' :: Text
awsAccountId = Text
a} :: UpdateTemplate)

-- | The ID for the template.
updateTemplate_templateId :: Lens.Lens' UpdateTemplate Prelude.Text
updateTemplate_templateId :: (Text -> f Text) -> UpdateTemplate -> f UpdateTemplate
updateTemplate_templateId = (UpdateTemplate -> Text)
-> (UpdateTemplate -> Text -> UpdateTemplate)
-> Lens UpdateTemplate UpdateTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTemplate' {Text
templateId :: Text
$sel:templateId:UpdateTemplate' :: UpdateTemplate -> Text
templateId} -> Text
templateId) (\s :: UpdateTemplate
s@UpdateTemplate' {} Text
a -> UpdateTemplate
s {$sel:templateId:UpdateTemplate' :: Text
templateId = Text
a} :: UpdateTemplate)

-- | The entity that you are using as a source when you update the template.
-- In @SourceEntity@, you specify the type of object you\'re using as
-- source: @SourceTemplate@ for a template or @SourceAnalysis@ for an
-- analysis. Both of these require an Amazon Resource Name (ARN). For
-- @SourceTemplate@, specify the ARN of the source template. For
-- @SourceAnalysis@, specify the ARN of the source analysis. The
-- @SourceTemplate@ ARN can contain any Amazon Web Services account and any
-- Amazon QuickSight-supported Amazon Web Services Region;.
--
-- Use the @DataSetReferences@ entity within @SourceTemplate@ or
-- @SourceAnalysis@ to list the replacement datasets for the placeholders
-- listed in the original. The schema in each dataset must match its
-- placeholder.
updateTemplate_sourceEntity :: Lens.Lens' UpdateTemplate TemplateSourceEntity
updateTemplate_sourceEntity :: (TemplateSourceEntity -> f TemplateSourceEntity)
-> UpdateTemplate -> f UpdateTemplate
updateTemplate_sourceEntity = (UpdateTemplate -> TemplateSourceEntity)
-> (UpdateTemplate -> TemplateSourceEntity -> UpdateTemplate)
-> Lens
     UpdateTemplate
     UpdateTemplate
     TemplateSourceEntity
     TemplateSourceEntity
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTemplate' {TemplateSourceEntity
sourceEntity :: TemplateSourceEntity
$sel:sourceEntity:UpdateTemplate' :: UpdateTemplate -> TemplateSourceEntity
sourceEntity} -> TemplateSourceEntity
sourceEntity) (\s :: UpdateTemplate
s@UpdateTemplate' {} TemplateSourceEntity
a -> UpdateTemplate
s {$sel:sourceEntity:UpdateTemplate' :: TemplateSourceEntity
sourceEntity = TemplateSourceEntity
a} :: UpdateTemplate)

instance Core.AWSRequest UpdateTemplate where
  type
    AWSResponse UpdateTemplate =
      UpdateTemplateResponse
  request :: UpdateTemplate -> Request UpdateTemplate
request = Service -> UpdateTemplate -> Request UpdateTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateTemplate))
-> Logger
-> Service
-> Proxy UpdateTemplate
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateTemplate)))
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 ->
          Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateTemplateResponse
UpdateTemplateResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe ResourceStatus
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> UpdateTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ResourceStatus
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateTemplateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RequestId")
            Either
  String
  (Maybe Text
   -> Maybe ResourceStatus
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ResourceStatus
      -> Maybe Text -> Maybe Text -> Int -> UpdateTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Arn")
            Either
  String
  (Maybe ResourceStatus
   -> Maybe Text -> Maybe Text -> Int -> UpdateTemplateResponse)
-> Either String (Maybe ResourceStatus)
-> Either
     String (Maybe Text -> Maybe Text -> Int -> UpdateTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ResourceStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationStatus")
            Either
  String (Maybe Text -> Maybe Text -> Int -> UpdateTemplateResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> UpdateTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TemplateId")
            Either String (Maybe Text -> Int -> UpdateTemplateResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"VersionArn")
            Either String (Int -> UpdateTemplateResponse)
-> Either String Int -> Either String UpdateTemplateResponse
forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable UpdateTemplate

instance Prelude.NFData UpdateTemplate

instance Core.ToHeaders UpdateTemplate where
  toHeaders :: UpdateTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateTemplate where
  toJSON :: UpdateTemplate -> Value
toJSON UpdateTemplate' {Maybe Text
Text
TemplateSourceEntity
sourceEntity :: TemplateSourceEntity
templateId :: Text
awsAccountId :: Text
name :: Maybe Text
versionDescription :: Maybe Text
$sel:sourceEntity:UpdateTemplate' :: UpdateTemplate -> TemplateSourceEntity
$sel:templateId:UpdateTemplate' :: UpdateTemplate -> Text
$sel:awsAccountId:UpdateTemplate' :: UpdateTemplate -> Text
$sel:name:UpdateTemplate' :: UpdateTemplate -> Maybe Text
$sel:versionDescription:UpdateTemplate' :: UpdateTemplate -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"VersionDescription" 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
versionDescription,
            (Text
"Name" 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
name,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SourceEntity" Text -> TemplateSourceEntity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TemplateSourceEntity
sourceEntity)
          ]
      )

instance Core.ToPath UpdateTemplate where
  toPath :: UpdateTemplate -> ByteString
toPath UpdateTemplate' {Maybe Text
Text
TemplateSourceEntity
sourceEntity :: TemplateSourceEntity
templateId :: Text
awsAccountId :: Text
name :: Maybe Text
versionDescription :: Maybe Text
$sel:sourceEntity:UpdateTemplate' :: UpdateTemplate -> TemplateSourceEntity
$sel:templateId:UpdateTemplate' :: UpdateTemplate -> Text
$sel:awsAccountId:UpdateTemplate' :: UpdateTemplate -> Text
$sel:name:UpdateTemplate' :: UpdateTemplate -> Maybe Text
$sel:versionDescription:UpdateTemplate' :: UpdateTemplate -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
        ByteString
"/templates/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
templateId
      ]

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

-- | /See:/ 'newUpdateTemplateResponse' smart constructor.
data UpdateTemplateResponse = UpdateTemplateResponse'
  { -- | The Amazon Web Services request ID for this operation.
    UpdateTemplateResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the template.
    UpdateTemplateResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The creation status of the template.
    UpdateTemplateResponse -> Maybe ResourceStatus
creationStatus :: Prelude.Maybe ResourceStatus,
    -- | The ID for the template.
    UpdateTemplateResponse -> Maybe Text
templateId :: Prelude.Maybe Prelude.Text,
    -- | The ARN for the template, including the version information of the first
    -- version.
    UpdateTemplateResponse -> Maybe Text
versionArn :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    UpdateTemplateResponse -> Int
status :: Prelude.Int
  }
  deriving (UpdateTemplateResponse -> UpdateTemplateResponse -> Bool
(UpdateTemplateResponse -> UpdateTemplateResponse -> Bool)
-> (UpdateTemplateResponse -> UpdateTemplateResponse -> Bool)
-> Eq UpdateTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTemplateResponse -> UpdateTemplateResponse -> Bool
$c/= :: UpdateTemplateResponse -> UpdateTemplateResponse -> Bool
== :: UpdateTemplateResponse -> UpdateTemplateResponse -> Bool
$c== :: UpdateTemplateResponse -> UpdateTemplateResponse -> Bool
Prelude.Eq, ReadPrec [UpdateTemplateResponse]
ReadPrec UpdateTemplateResponse
Int -> ReadS UpdateTemplateResponse
ReadS [UpdateTemplateResponse]
(Int -> ReadS UpdateTemplateResponse)
-> ReadS [UpdateTemplateResponse]
-> ReadPrec UpdateTemplateResponse
-> ReadPrec [UpdateTemplateResponse]
-> Read UpdateTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTemplateResponse]
$creadListPrec :: ReadPrec [UpdateTemplateResponse]
readPrec :: ReadPrec UpdateTemplateResponse
$creadPrec :: ReadPrec UpdateTemplateResponse
readList :: ReadS [UpdateTemplateResponse]
$creadList :: ReadS [UpdateTemplateResponse]
readsPrec :: Int -> ReadS UpdateTemplateResponse
$creadsPrec :: Int -> ReadS UpdateTemplateResponse
Prelude.Read, Int -> UpdateTemplateResponse -> ShowS
[UpdateTemplateResponse] -> ShowS
UpdateTemplateResponse -> String
(Int -> UpdateTemplateResponse -> ShowS)
-> (UpdateTemplateResponse -> String)
-> ([UpdateTemplateResponse] -> ShowS)
-> Show UpdateTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTemplateResponse] -> ShowS
$cshowList :: [UpdateTemplateResponse] -> ShowS
show :: UpdateTemplateResponse -> String
$cshow :: UpdateTemplateResponse -> String
showsPrec :: Int -> UpdateTemplateResponse -> ShowS
$cshowsPrec :: Int -> UpdateTemplateResponse -> ShowS
Prelude.Show, (forall x. UpdateTemplateResponse -> Rep UpdateTemplateResponse x)
-> (forall x.
    Rep UpdateTemplateResponse x -> UpdateTemplateResponse)
-> Generic UpdateTemplateResponse
forall x. Rep UpdateTemplateResponse x -> UpdateTemplateResponse
forall x. UpdateTemplateResponse -> Rep UpdateTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateTemplateResponse x -> UpdateTemplateResponse
$cfrom :: forall x. UpdateTemplateResponse -> Rep UpdateTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateTemplateResponse' 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:
--
-- 'requestId', 'updateTemplateResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'arn', 'updateTemplateResponse_arn' - The Amazon Resource Name (ARN) for the template.
--
-- 'creationStatus', 'updateTemplateResponse_creationStatus' - The creation status of the template.
--
-- 'templateId', 'updateTemplateResponse_templateId' - The ID for the template.
--
-- 'versionArn', 'updateTemplateResponse_versionArn' - The ARN for the template, including the version information of the first
-- version.
--
-- 'status', 'updateTemplateResponse_status' - The HTTP status of the request.
newUpdateTemplateResponse ::
  -- | 'status'
  Prelude.Int ->
  UpdateTemplateResponse
newUpdateTemplateResponse :: Int -> UpdateTemplateResponse
newUpdateTemplateResponse Int
pStatus_ =
  UpdateTemplateResponse' :: Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateTemplateResponse
UpdateTemplateResponse'
    { $sel:requestId:UpdateTemplateResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:UpdateTemplateResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationStatus:UpdateTemplateResponse' :: Maybe ResourceStatus
creationStatus = Maybe ResourceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:templateId:UpdateTemplateResponse' :: Maybe Text
templateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:versionArn:UpdateTemplateResponse' :: Maybe Text
versionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateTemplateResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
updateTemplateResponse_requestId :: Lens.Lens' UpdateTemplateResponse (Prelude.Maybe Prelude.Text)
updateTemplateResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> UpdateTemplateResponse -> f UpdateTemplateResponse
updateTemplateResponse_requestId = (UpdateTemplateResponse -> Maybe Text)
-> (UpdateTemplateResponse -> Maybe Text -> UpdateTemplateResponse)
-> Lens
     UpdateTemplateResponse
     UpdateTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTemplateResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:UpdateTemplateResponse' :: UpdateTemplateResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: UpdateTemplateResponse
s@UpdateTemplateResponse' {} Maybe Text
a -> UpdateTemplateResponse
s {$sel:requestId:UpdateTemplateResponse' :: Maybe Text
requestId = Maybe Text
a} :: UpdateTemplateResponse)

-- | The Amazon Resource Name (ARN) for the template.
updateTemplateResponse_arn :: Lens.Lens' UpdateTemplateResponse (Prelude.Maybe Prelude.Text)
updateTemplateResponse_arn :: (Maybe Text -> f (Maybe Text))
-> UpdateTemplateResponse -> f UpdateTemplateResponse
updateTemplateResponse_arn = (UpdateTemplateResponse -> Maybe Text)
-> (UpdateTemplateResponse -> Maybe Text -> UpdateTemplateResponse)
-> Lens
     UpdateTemplateResponse
     UpdateTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTemplateResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:UpdateTemplateResponse' :: UpdateTemplateResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: UpdateTemplateResponse
s@UpdateTemplateResponse' {} Maybe Text
a -> UpdateTemplateResponse
s {$sel:arn:UpdateTemplateResponse' :: Maybe Text
arn = Maybe Text
a} :: UpdateTemplateResponse)

-- | The creation status of the template.
updateTemplateResponse_creationStatus :: Lens.Lens' UpdateTemplateResponse (Prelude.Maybe ResourceStatus)
updateTemplateResponse_creationStatus :: (Maybe ResourceStatus -> f (Maybe ResourceStatus))
-> UpdateTemplateResponse -> f UpdateTemplateResponse
updateTemplateResponse_creationStatus = (UpdateTemplateResponse -> Maybe ResourceStatus)
-> (UpdateTemplateResponse
    -> Maybe ResourceStatus -> UpdateTemplateResponse)
-> Lens
     UpdateTemplateResponse
     UpdateTemplateResponse
     (Maybe ResourceStatus)
     (Maybe ResourceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTemplateResponse' {Maybe ResourceStatus
creationStatus :: Maybe ResourceStatus
$sel:creationStatus:UpdateTemplateResponse' :: UpdateTemplateResponse -> Maybe ResourceStatus
creationStatus} -> Maybe ResourceStatus
creationStatus) (\s :: UpdateTemplateResponse
s@UpdateTemplateResponse' {} Maybe ResourceStatus
a -> UpdateTemplateResponse
s {$sel:creationStatus:UpdateTemplateResponse' :: Maybe ResourceStatus
creationStatus = Maybe ResourceStatus
a} :: UpdateTemplateResponse)

-- | The ID for the template.
updateTemplateResponse_templateId :: Lens.Lens' UpdateTemplateResponse (Prelude.Maybe Prelude.Text)
updateTemplateResponse_templateId :: (Maybe Text -> f (Maybe Text))
-> UpdateTemplateResponse -> f UpdateTemplateResponse
updateTemplateResponse_templateId = (UpdateTemplateResponse -> Maybe Text)
-> (UpdateTemplateResponse -> Maybe Text -> UpdateTemplateResponse)
-> Lens
     UpdateTemplateResponse
     UpdateTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTemplateResponse' {Maybe Text
templateId :: Maybe Text
$sel:templateId:UpdateTemplateResponse' :: UpdateTemplateResponse -> Maybe Text
templateId} -> Maybe Text
templateId) (\s :: UpdateTemplateResponse
s@UpdateTemplateResponse' {} Maybe Text
a -> UpdateTemplateResponse
s {$sel:templateId:UpdateTemplateResponse' :: Maybe Text
templateId = Maybe Text
a} :: UpdateTemplateResponse)

-- | The ARN for the template, including the version information of the first
-- version.
updateTemplateResponse_versionArn :: Lens.Lens' UpdateTemplateResponse (Prelude.Maybe Prelude.Text)
updateTemplateResponse_versionArn :: (Maybe Text -> f (Maybe Text))
-> UpdateTemplateResponse -> f UpdateTemplateResponse
updateTemplateResponse_versionArn = (UpdateTemplateResponse -> Maybe Text)
-> (UpdateTemplateResponse -> Maybe Text -> UpdateTemplateResponse)
-> Lens
     UpdateTemplateResponse
     UpdateTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTemplateResponse' {Maybe Text
versionArn :: Maybe Text
$sel:versionArn:UpdateTemplateResponse' :: UpdateTemplateResponse -> Maybe Text
versionArn} -> Maybe Text
versionArn) (\s :: UpdateTemplateResponse
s@UpdateTemplateResponse' {} Maybe Text
a -> UpdateTemplateResponse
s {$sel:versionArn:UpdateTemplateResponse' :: Maybe Text
versionArn = Maybe Text
a} :: UpdateTemplateResponse)

-- | The HTTP status of the request.
updateTemplateResponse_status :: Lens.Lens' UpdateTemplateResponse Prelude.Int
updateTemplateResponse_status :: (Int -> f Int)
-> UpdateTemplateResponse -> f UpdateTemplateResponse
updateTemplateResponse_status = (UpdateTemplateResponse -> Int)
-> (UpdateTemplateResponse -> Int -> UpdateTemplateResponse)
-> Lens UpdateTemplateResponse UpdateTemplateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTemplateResponse' {Int
status :: Int
$sel:status:UpdateTemplateResponse' :: UpdateTemplateResponse -> Int
status} -> Int
status) (\s :: UpdateTemplateResponse
s@UpdateTemplateResponse' {} Int
a -> UpdateTemplateResponse
s {$sel:status:UpdateTemplateResponse' :: Int
status = Int
a} :: UpdateTemplateResponse)

instance Prelude.NFData UpdateTemplateResponse