{-# 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-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 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_version,
    updateEmailTemplate_createNewVersion,
    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.Lens as Lens
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'
  { -- | 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,
    -- | 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 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
(UpdateEmailTemplate -> UpdateEmailTemplate -> Bool)
-> (UpdateEmailTemplate -> UpdateEmailTemplate -> Bool)
-> Eq UpdateEmailTemplate
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]
(Int -> ReadS UpdateEmailTemplate)
-> ReadS [UpdateEmailTemplate]
-> ReadPrec UpdateEmailTemplate
-> ReadPrec [UpdateEmailTemplate]
-> Read 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
(Int -> UpdateEmailTemplate -> ShowS)
-> (UpdateEmailTemplate -> String)
-> ([UpdateEmailTemplate] -> ShowS)
-> Show UpdateEmailTemplate
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. UpdateEmailTemplate -> Rep UpdateEmailTemplate x)
-> (forall x. Rep UpdateEmailTemplate x -> UpdateEmailTemplate)
-> Generic UpdateEmailTemplate
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:
--
-- '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.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Bool
-> Text
-> EmailTemplateRequest
-> UpdateEmailTemplate
UpdateEmailTemplate'
      { $sel:version:UpdateEmailTemplate' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:createNewVersion:UpdateEmailTemplate' :: Maybe Bool
createNewVersion = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:templateName:UpdateEmailTemplate' :: Text
templateName = Text
pTemplateName_,
        $sel:emailTemplateRequest:UpdateEmailTemplate' :: EmailTemplateRequest
emailTemplateRequest = EmailTemplateRequest
pEmailTemplateRequest_
      }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> UpdateEmailTemplate -> f UpdateEmailTemplate
updateEmailTemplate_version = (UpdateEmailTemplate -> Maybe Text)
-> (UpdateEmailTemplate -> Maybe Text -> UpdateEmailTemplate)
-> Lens
     UpdateEmailTemplate UpdateEmailTemplate (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> UpdateEmailTemplate -> f UpdateEmailTemplate
updateEmailTemplate_createNewVersion = (UpdateEmailTemplate -> Maybe Bool)
-> (UpdateEmailTemplate -> Maybe Bool -> UpdateEmailTemplate)
-> Lens
     UpdateEmailTemplate UpdateEmailTemplate (Maybe Bool) (Maybe Bool)
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 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 :: (Text -> f Text) -> UpdateEmailTemplate -> f UpdateEmailTemplate
updateEmailTemplate_templateName = (UpdateEmailTemplate -> Text)
-> (UpdateEmailTemplate -> Text -> UpdateEmailTemplate)
-> Lens UpdateEmailTemplate UpdateEmailTemplate Text Text
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 :: (EmailTemplateRequest -> f EmailTemplateRequest)
-> UpdateEmailTemplate -> f UpdateEmailTemplate
updateEmailTemplate_emailTemplateRequest = (UpdateEmailTemplate -> EmailTemplateRequest)
-> (UpdateEmailTemplate
    -> EmailTemplateRequest -> UpdateEmailTemplate)
-> Lens
     UpdateEmailTemplate
     UpdateEmailTemplate
     EmailTemplateRequest
     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 :: UpdateEmailTemplate -> Request UpdateEmailTemplate
request = Service -> UpdateEmailTemplate -> Request UpdateEmailTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateEmailTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateEmailTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateEmailTemplate))
-> Logger
-> Service
-> Proxy UpdateEmailTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateEmailTemplate)))
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 -> MessageBody -> UpdateEmailTemplateResponse
UpdateEmailTemplateResponse'
            (Int -> MessageBody -> UpdateEmailTemplateResponse)
-> Either String Int
-> Either String (MessageBody -> UpdateEmailTemplateResponse)
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 (MessageBody -> UpdateEmailTemplateResponse)
-> Either String MessageBody
-> Either String UpdateEmailTemplateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String MessageBody
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
      )

instance Prelude.Hashable UpdateEmailTemplate

instance Prelude.NFData UpdateEmailTemplate

instance Core.ToHeaders UpdateEmailTemplate where
  toHeaders :: UpdateEmailTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateEmailTemplate -> 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.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateEmailTemplate where
  toJSON :: UpdateEmailTemplate -> Value
toJSON UpdateEmailTemplate' {Maybe Bool
Maybe Text
Text
EmailTemplateRequest
emailTemplateRequest :: EmailTemplateRequest
templateName :: Text
createNewVersion :: Maybe Bool
version :: Maybe Text
$sel:emailTemplateRequest:UpdateEmailTemplate' :: UpdateEmailTemplate -> EmailTemplateRequest
$sel:templateName:UpdateEmailTemplate' :: UpdateEmailTemplate -> Text
$sel:createNewVersion:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe Bool
$sel:version:UpdateEmailTemplate' :: UpdateEmailTemplate -> Maybe 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
"EmailTemplateRequest"
                  Text -> EmailTemplateRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= EmailTemplateRequest
emailTemplateRequest
              )
          ]
      )

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

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

-- | /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
(UpdateEmailTemplateResponse
 -> UpdateEmailTemplateResponse -> Bool)
-> (UpdateEmailTemplateResponse
    -> UpdateEmailTemplateResponse -> Bool)
-> Eq UpdateEmailTemplateResponse
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]
(Int -> ReadS UpdateEmailTemplateResponse)
-> ReadS [UpdateEmailTemplateResponse]
-> ReadPrec UpdateEmailTemplateResponse
-> ReadPrec [UpdateEmailTemplateResponse]
-> Read 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
(Int -> UpdateEmailTemplateResponse -> ShowS)
-> (UpdateEmailTemplateResponse -> String)
-> ([UpdateEmailTemplateResponse] -> ShowS)
-> Show UpdateEmailTemplateResponse
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.
 UpdateEmailTemplateResponse -> Rep UpdateEmailTemplateResponse x)
-> (forall x.
    Rep UpdateEmailTemplateResponse x -> UpdateEmailTemplateResponse)
-> Generic UpdateEmailTemplateResponse
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' :: Int -> MessageBody -> UpdateEmailTemplateResponse
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 :: (Int -> f Int)
-> UpdateEmailTemplateResponse -> f UpdateEmailTemplateResponse
updateEmailTemplateResponse_httpStatus = (UpdateEmailTemplateResponse -> Int)
-> (UpdateEmailTemplateResponse
    -> Int -> UpdateEmailTemplateResponse)
-> Lens
     UpdateEmailTemplateResponse UpdateEmailTemplateResponse Int Int
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 :: (MessageBody -> f MessageBody)
-> UpdateEmailTemplateResponse -> f UpdateEmailTemplateResponse
updateEmailTemplateResponse_messageBody = (UpdateEmailTemplateResponse -> MessageBody)
-> (UpdateEmailTemplateResponse
    -> MessageBody -> UpdateEmailTemplateResponse)
-> Lens
     UpdateEmailTemplateResponse
     UpdateEmailTemplateResponse
     MessageBody
     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