{-# 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.Pinpoint.UpdateEmailTemplate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates an existing message template for messages that are sent through
-- the email channel.
module Amazonka.Pinpoint.UpdateEmailTemplate
  ( -- * Creating a Request
    UpdateEmailTemplate (..),
    newUpdateEmailTemplate,

    -- * Request Lenses
    updateEmailTemplate_createNewVersion,
    updateEmailTemplate_version,
    updateEmailTemplate_templateName,
    updateEmailTemplate_emailTemplateRequest,

    -- * Destructuring the Response
    UpdateEmailTemplateResponse (..),
    newUpdateEmailTemplateResponse,

    -- * Response Lenses
    updateEmailTemplateResponse_httpStatus,
    updateEmailTemplateResponse_messageBody,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Pinpoint.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateEmailTemplate' smart constructor.
data UpdateEmailTemplate = UpdateEmailTemplate'
  { -- | Specifies whether to save the updates as a new version of the message
    -- template. Valid values are: true, save the updates as a new version;
    -- and, false, save the updates to (overwrite) the latest existing version
    -- of the template.
    --
    -- If you don\'t specify a value for this parameter, Amazon Pinpoint saves
    -- the updates to (overwrites) the latest existing version of the template.
    -- If you specify a value of true for this parameter, don\'t specify a
    -- value for the version parameter. Otherwise, an error will occur.
    UpdateEmailTemplate -> Maybe Bool
createNewVersion :: Prelude.Maybe Prelude.Bool,
    -- | The unique identifier for the version of the message template to update,
    -- retrieve information about, or delete. To retrieve identifiers and other
    -- information for all the versions of a template, use the Template
    -- Versions resource.
    --
    -- If specified, this value must match the identifier for an existing
    -- template version. If specified for an update operation, this value must
    -- match the identifier for the latest existing version of the template.
    -- This restriction helps ensure that race conditions don\'t occur.
    --
    -- If you don\'t specify a value for this parameter, Amazon Pinpoint does
    -- the following:
    --
    -- -   For a get operation, retrieves information about the active version
    --     of the template.
    --
    -- -   For an update operation, saves the updates to (overwrites) the
    --     latest existing version of the template, if the create-new-version
    --     parameter isn\'t used or is set to false.
    --
    -- -   For a delete operation, deletes the template, including all versions
    --     of the template.
    UpdateEmailTemplate -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The name of the message template. A template name must start with an
    -- alphanumeric character and can contain a maximum of 128 characters. The
    -- characters can be alphanumeric characters, underscores (_), or hyphens
    -- (-). Template names are case sensitive.
    UpdateEmailTemplate -> Text
templateName :: Prelude.Text,
    UpdateEmailTemplate -> EmailTemplateRequest
emailTemplateRequest :: EmailTemplateRequest
  }
  deriving (UpdateEmailTemplate -> UpdateEmailTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEmailTemplate -> UpdateEmailTemplate -> Bool
$c/= :: UpdateEmailTemplate -> UpdateEmailTemplate -> Bool
== :: UpdateEmailTemplate -> UpdateEmailTemplate -> Bool
$c== :: UpdateEmailTemplate -> UpdateEmailTemplate -> Bool
Prelude.Eq, ReadPrec [UpdateEmailTemplate]
ReadPrec UpdateEmailTemplate
Int -> ReadS UpdateEmailTemplate
ReadS [UpdateEmailTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEmailTemplate]
$creadListPrec :: ReadPrec [UpdateEmailTemplate]
readPrec :: ReadPrec UpdateEmailTemplate
$creadPrec :: ReadPrec UpdateEmailTemplate
readList :: ReadS [UpdateEmailTemplate]
$creadList :: ReadS [UpdateEmailTemplate]
readsPrec :: Int -> ReadS UpdateEmailTemplate
$creadsPrec :: Int -> ReadS UpdateEmailTemplate
Prelude.Read, Int -> UpdateEmailTemplate -> ShowS
[UpdateEmailTemplate] -> ShowS
UpdateEmailTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEmailTemplate] -> ShowS
$cshowList :: [UpdateEmailTemplate] -> ShowS
show :: UpdateEmailTemplate -> String
$cshow :: UpdateEmailTemplate -> String
showsPrec :: Int -> UpdateEmailTemplate -> ShowS
$cshowsPrec :: Int -> UpdateEmailTemplate -> ShowS
Prelude.Show, forall x. Rep UpdateEmailTemplate x -> UpdateEmailTemplate
forall x. UpdateEmailTemplate -> Rep UpdateEmailTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateEmailTemplate x -> UpdateEmailTemplate
$cfrom :: forall x. UpdateEmailTemplate -> Rep UpdateEmailTemplate x
Prelude.Generic)

-- |
-- Create a value of 'UpdateEmailTemplate' 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:
--
-- 'createNewVersion', 'updateEmailTemplate_createNewVersion' - Specifies whether to save the updates as a new version of the message
-- template. Valid values are: true, save the updates as a new version;
-- and, false, save the updates to (overwrite) the latest existing version
-- of the template.
--
-- If you don\'t specify a value for this parameter, Amazon Pinpoint saves
-- the updates to (overwrites) the latest existing version of the template.
-- If you specify a value of true for this parameter, don\'t specify a
-- value for the version parameter. Otherwise, an error will occur.
--
-- 'version', 'updateEmailTemplate_version' - The unique identifier for the version of the message template to update,
-- retrieve information about, or delete. To retrieve identifiers and other
-- information for all the versions of a template, use the Template
-- Versions resource.
--
-- If specified, this value must match the identifier for an existing
-- template version. If specified for an update operation, this value must
-- match the identifier for the latest existing version of the template.
-- This restriction helps ensure that race conditions don\'t occur.
--
-- If you don\'t specify a value for this parameter, Amazon Pinpoint does
-- the following:
--
-- -   For a get operation, retrieves information about the active version
--     of the template.
--
-- -   For an update operation, saves the updates to (overwrites) the
--     latest existing version of the template, if the create-new-version
--     parameter isn\'t used or is set to false.
--
-- -   For a delete operation, deletes the template, including all versions
--     of the template.
--
-- 'templateName', 'updateEmailTemplate_templateName' - The name of the message template. A template name must start with an
-- alphanumeric character and can contain a maximum of 128 characters. The
-- characters can be alphanumeric characters, underscores (_), or hyphens
-- (-). Template names are case sensitive.
--
-- 'emailTemplateRequest', 'updateEmailTemplate_emailTemplateRequest' - Undocumented member.
newUpdateEmailTemplate ::
  -- | 'templateName'
  Prelude.Text ->
  -- | 'emailTemplateRequest'
  EmailTemplateRequest ->
  UpdateEmailTemplate
newUpdateEmailTemplate :: Text -> EmailTemplateRequest -> UpdateEmailTemplate
newUpdateEmailTemplate
  Text
pTemplateName_
  EmailTemplateRequest
pEmailTemplateRequest_ =
    UpdateEmailTemplate'
      { $sel:createNewVersion:UpdateEmailTemplate' :: Maybe Bool
createNewVersion =
          forall a. Maybe a
Prelude.Nothing,
        $sel:version:UpdateEmailTemplate' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
        $sel:templateName:UpdateEmailTemplate' :: Text
templateName = Text
pTemplateName_,
        $sel:emailTemplateRequest:UpdateEmailTemplate' :: EmailTemplateRequest
emailTemplateRequest = EmailTemplateRequest
pEmailTemplateRequest_
      }

-- | Specifies whether to save the updates as a new version of the message
-- template. Valid values are: true, save the updates as a new version;
-- and, false, save the updates to (overwrite) the latest existing version
-- of the template.
--
-- If you don\'t specify a value for this parameter, Amazon Pinpoint saves
-- the updates to (overwrites) the latest existing version of the template.
-- If you specify a value of true for this parameter, don\'t specify a
-- value for the version parameter. Otherwise, an error will occur.
updateEmailTemplate_createNewVersion :: Lens.Lens' UpdateEmailTemplate (Prelude.Maybe Prelude.Bool)
updateEmailTemplate_createNewVersion :: Lens' UpdateEmailTemplate (Maybe Bool)
updateEmailTemplate_createNewVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEmailTemplate' {Maybe Bool
createNewVersion :: Maybe Bool
$sel:createNewVersion:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Bool
createNewVersion} -> Maybe Bool
createNewVersion) (\s :: UpdateEmailTemplate
s@UpdateEmailTemplate' {} Maybe Bool
a -> UpdateEmailTemplate
s {$sel:createNewVersion:UpdateEmailTemplate' :: Maybe Bool
createNewVersion = Maybe Bool
a} :: UpdateEmailTemplate)

-- | The unique identifier for the version of the message template to update,
-- retrieve information about, or delete. To retrieve identifiers and other
-- information for all the versions of a template, use the Template
-- Versions resource.
--
-- If specified, this value must match the identifier for an existing
-- template version. If specified for an update operation, this value must
-- match the identifier for the latest existing version of the template.
-- This restriction helps ensure that race conditions don\'t occur.
--
-- If you don\'t specify a value for this parameter, Amazon Pinpoint does
-- the following:
--
-- -   For a get operation, retrieves information about the active version
--     of the template.
--
-- -   For an update operation, saves the updates to (overwrites) the
--     latest existing version of the template, if the create-new-version
--     parameter isn\'t used or is set to false.
--
-- -   For a delete operation, deletes the template, including all versions
--     of the template.
updateEmailTemplate_version :: Lens.Lens' UpdateEmailTemplate (Prelude.Maybe Prelude.Text)
updateEmailTemplate_version :: Lens' UpdateEmailTemplate (Maybe Text)
updateEmailTemplate_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEmailTemplate' {Maybe Text
version :: Maybe Text
$sel:version:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Text
version} -> Maybe Text
version) (\s :: UpdateEmailTemplate
s@UpdateEmailTemplate' {} Maybe Text
a -> UpdateEmailTemplate
s {$sel:version:UpdateEmailTemplate' :: Maybe Text
version = Maybe Text
a} :: UpdateEmailTemplate)

-- | The name of the message template. A template name must start with an
-- alphanumeric character and can contain a maximum of 128 characters. The
-- characters can be alphanumeric characters, underscores (_), or hyphens
-- (-). Template names are case sensitive.
updateEmailTemplate_templateName :: Lens.Lens' UpdateEmailTemplate Prelude.Text
updateEmailTemplate_templateName :: Lens' UpdateEmailTemplate Text
updateEmailTemplate_templateName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEmailTemplate' {Text
templateName :: Text
$sel:templateName:UpdateEmailTemplate' :: UpdateEmailTemplate -> Text
templateName} -> Text
templateName) (\s :: UpdateEmailTemplate
s@UpdateEmailTemplate' {} Text
a -> UpdateEmailTemplate
s {$sel:templateName:UpdateEmailTemplate' :: Text
templateName = Text
a} :: UpdateEmailTemplate)

-- | Undocumented member.
updateEmailTemplate_emailTemplateRequest :: Lens.Lens' UpdateEmailTemplate EmailTemplateRequest
updateEmailTemplate_emailTemplateRequest :: Lens' UpdateEmailTemplate EmailTemplateRequest
updateEmailTemplate_emailTemplateRequest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEmailTemplate' {EmailTemplateRequest
emailTemplateRequest :: EmailTemplateRequest
$sel:emailTemplateRequest:UpdateEmailTemplate' :: UpdateEmailTemplate -> EmailTemplateRequest
emailTemplateRequest} -> EmailTemplateRequest
emailTemplateRequest) (\s :: UpdateEmailTemplate
s@UpdateEmailTemplate' {} EmailTemplateRequest
a -> UpdateEmailTemplate
s {$sel:emailTemplateRequest:UpdateEmailTemplate' :: EmailTemplateRequest
emailTemplateRequest = EmailTemplateRequest
a} :: UpdateEmailTemplate)

instance Core.AWSRequest UpdateEmailTemplate where
  type
    AWSResponse UpdateEmailTemplate =
      UpdateEmailTemplateResponse
  request :: (Service -> Service)
-> UpdateEmailTemplate -> Request UpdateEmailTemplate
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateEmailTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateEmailTemplate)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> MessageBody -> UpdateEmailTemplateResponse
UpdateEmailTemplateResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
      )

instance Prelude.Hashable UpdateEmailTemplate where
  hashWithSalt :: Int -> UpdateEmailTemplate -> Int
hashWithSalt Int
_salt UpdateEmailTemplate' {Maybe Bool
Maybe Text
Text
EmailTemplateRequest
emailTemplateRequest :: EmailTemplateRequest
templateName :: Text
version :: Maybe Text
createNewVersion :: Maybe Bool
$sel:emailTemplateRequest:UpdateEmailTemplate' :: UpdateEmailTemplate -> EmailTemplateRequest
$sel:templateName:UpdateEmailTemplate' :: UpdateEmailTemplate -> Text
$sel:version:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Text
$sel:createNewVersion:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
createNewVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EmailTemplateRequest
emailTemplateRequest

instance Prelude.NFData UpdateEmailTemplate where
  rnf :: UpdateEmailTemplate -> ()
rnf UpdateEmailTemplate' {Maybe Bool
Maybe Text
Text
EmailTemplateRequest
emailTemplateRequest :: EmailTemplateRequest
templateName :: Text
version :: Maybe Text
createNewVersion :: Maybe Bool
$sel:emailTemplateRequest:UpdateEmailTemplate' :: UpdateEmailTemplate -> EmailTemplateRequest
$sel:templateName:UpdateEmailTemplate' :: UpdateEmailTemplate -> Text
$sel:version:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Text
$sel:createNewVersion:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
createNewVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EmailTemplateRequest
emailTemplateRequest

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

instance Data.ToJSON UpdateEmailTemplate where
  toJSON :: UpdateEmailTemplate -> Value
toJSON UpdateEmailTemplate' {Maybe Bool
Maybe Text
Text
EmailTemplateRequest
emailTemplateRequest :: EmailTemplateRequest
templateName :: Text
version :: Maybe Text
createNewVersion :: Maybe Bool
$sel:emailTemplateRequest:UpdateEmailTemplate' :: UpdateEmailTemplate -> EmailTemplateRequest
$sel:templateName:UpdateEmailTemplate' :: UpdateEmailTemplate -> Text
$sel:version:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Text
$sel:createNewVersion:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Bool
..} =
    forall a. ToJSON a => a -> Value
Data.toJSON EmailTemplateRequest
emailTemplateRequest

instance Data.ToPath UpdateEmailTemplate where
  toPath :: UpdateEmailTemplate -> ByteString
toPath UpdateEmailTemplate' {Maybe Bool
Maybe Text
Text
EmailTemplateRequest
emailTemplateRequest :: EmailTemplateRequest
templateName :: Text
version :: Maybe Text
createNewVersion :: Maybe Bool
$sel:emailTemplateRequest:UpdateEmailTemplate' :: UpdateEmailTemplate -> EmailTemplateRequest
$sel:templateName:UpdateEmailTemplate' :: UpdateEmailTemplate -> Text
$sel:version:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Text
$sel:createNewVersion:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v1/templates/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
templateName, ByteString
"/email"]

instance Data.ToQuery UpdateEmailTemplate where
  toQuery :: UpdateEmailTemplate -> QueryString
toQuery UpdateEmailTemplate' {Maybe Bool
Maybe Text
Text
EmailTemplateRequest
emailTemplateRequest :: EmailTemplateRequest
templateName :: Text
version :: Maybe Text
createNewVersion :: Maybe Bool
$sel:emailTemplateRequest:UpdateEmailTemplate' :: UpdateEmailTemplate -> EmailTemplateRequest
$sel:templateName:UpdateEmailTemplate' :: UpdateEmailTemplate -> Text
$sel:version:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Text
$sel:createNewVersion:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"create-new-version" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
createNewVersion,
        ByteString
"version" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
version
      ]

-- | /See:/ 'newUpdateEmailTemplateResponse' smart constructor.
data UpdateEmailTemplateResponse = UpdateEmailTemplateResponse'
  { -- | The response's http status code.
    UpdateEmailTemplateResponse -> Int
httpStatus :: Prelude.Int,
    UpdateEmailTemplateResponse -> MessageBody
messageBody :: MessageBody
  }
  deriving (UpdateEmailTemplateResponse -> UpdateEmailTemplateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEmailTemplateResponse -> UpdateEmailTemplateResponse -> Bool
$c/= :: UpdateEmailTemplateResponse -> UpdateEmailTemplateResponse -> Bool
== :: UpdateEmailTemplateResponse -> UpdateEmailTemplateResponse -> Bool
$c== :: UpdateEmailTemplateResponse -> UpdateEmailTemplateResponse -> Bool
Prelude.Eq, ReadPrec [UpdateEmailTemplateResponse]
ReadPrec UpdateEmailTemplateResponse
Int -> ReadS UpdateEmailTemplateResponse
ReadS [UpdateEmailTemplateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEmailTemplateResponse]
$creadListPrec :: ReadPrec [UpdateEmailTemplateResponse]
readPrec :: ReadPrec UpdateEmailTemplateResponse
$creadPrec :: ReadPrec UpdateEmailTemplateResponse
readList :: ReadS [UpdateEmailTemplateResponse]
$creadList :: ReadS [UpdateEmailTemplateResponse]
readsPrec :: Int -> ReadS UpdateEmailTemplateResponse
$creadsPrec :: Int -> ReadS UpdateEmailTemplateResponse
Prelude.Read, Int -> UpdateEmailTemplateResponse -> ShowS
[UpdateEmailTemplateResponse] -> ShowS
UpdateEmailTemplateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEmailTemplateResponse] -> ShowS
$cshowList :: [UpdateEmailTemplateResponse] -> ShowS
show :: UpdateEmailTemplateResponse -> String
$cshow :: UpdateEmailTemplateResponse -> String
showsPrec :: Int -> UpdateEmailTemplateResponse -> ShowS
$cshowsPrec :: Int -> UpdateEmailTemplateResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateEmailTemplateResponse x -> UpdateEmailTemplateResponse
forall x.
UpdateEmailTemplateResponse -> Rep UpdateEmailTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEmailTemplateResponse x -> UpdateEmailTemplateResponse
$cfrom :: forall x.
UpdateEmailTemplateResponse -> Rep UpdateEmailTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateEmailTemplateResponse' 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', 'updateEmailTemplateResponse_httpStatus' - The response's http status code.
--
-- 'messageBody', 'updateEmailTemplateResponse_messageBody' - Undocumented member.
newUpdateEmailTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'messageBody'
  MessageBody ->
  UpdateEmailTemplateResponse
newUpdateEmailTemplateResponse :: Int -> MessageBody -> UpdateEmailTemplateResponse
newUpdateEmailTemplateResponse
  Int
pHttpStatus_
  MessageBody
pMessageBody_ =
    UpdateEmailTemplateResponse'
      { $sel:httpStatus:UpdateEmailTemplateResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:messageBody:UpdateEmailTemplateResponse' :: MessageBody
messageBody = MessageBody
pMessageBody_
      }

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

-- | Undocumented member.
updateEmailTemplateResponse_messageBody :: Lens.Lens' UpdateEmailTemplateResponse MessageBody
updateEmailTemplateResponse_messageBody :: Lens' UpdateEmailTemplateResponse MessageBody
updateEmailTemplateResponse_messageBody = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEmailTemplateResponse' {MessageBody
messageBody :: MessageBody
$sel:messageBody:UpdateEmailTemplateResponse' :: UpdateEmailTemplateResponse -> MessageBody
messageBody} -> MessageBody
messageBody) (\s :: UpdateEmailTemplateResponse
s@UpdateEmailTemplateResponse' {} MessageBody
a -> UpdateEmailTemplateResponse
s {$sel:messageBody:UpdateEmailTemplateResponse' :: MessageBody
messageBody = MessageBody
a} :: UpdateEmailTemplateResponse)

instance Prelude.NFData UpdateEmailTemplateResponse where
  rnf :: UpdateEmailTemplateResponse -> ()
rnf UpdateEmailTemplateResponse' {Int
MessageBody
messageBody :: MessageBody
httpStatus :: Int
$sel:messageBody:UpdateEmailTemplateResponse' :: UpdateEmailTemplateResponse -> MessageBody
$sel:httpStatus:UpdateEmailTemplateResponse' :: UpdateEmailTemplateResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MessageBody
messageBody