{-# 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.UpdateSmsTemplate
-- 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 SMS channel.
module Amazonka.Pinpoint.UpdateSmsTemplate
  ( -- * Creating a Request
    UpdateSmsTemplate (..),
    newUpdateSmsTemplate,

    -- * Request Lenses
    updateSmsTemplate_createNewVersion,
    updateSmsTemplate_version,
    updateSmsTemplate_templateName,
    updateSmsTemplate_sMSTemplateRequest,

    -- * Destructuring the Response
    UpdateSmsTemplateResponse (..),
    newUpdateSmsTemplateResponse,

    -- * Response Lenses
    updateSmsTemplateResponse_httpStatus,
    updateSmsTemplateResponse_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:/ 'newUpdateSmsTemplate' smart constructor.
data UpdateSmsTemplate = UpdateSmsTemplate'
  { -- | 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.
    UpdateSmsTemplate -> 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.
    UpdateSmsTemplate -> 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.
    UpdateSmsTemplate -> Text
templateName :: Prelude.Text,
    UpdateSmsTemplate -> SMSTemplateRequest
sMSTemplateRequest :: SMSTemplateRequest
  }
  deriving (UpdateSmsTemplate -> UpdateSmsTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSmsTemplate -> UpdateSmsTemplate -> Bool
$c/= :: UpdateSmsTemplate -> UpdateSmsTemplate -> Bool
== :: UpdateSmsTemplate -> UpdateSmsTemplate -> Bool
$c== :: UpdateSmsTemplate -> UpdateSmsTemplate -> Bool
Prelude.Eq, ReadPrec [UpdateSmsTemplate]
ReadPrec UpdateSmsTemplate
Int -> ReadS UpdateSmsTemplate
ReadS [UpdateSmsTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSmsTemplate]
$creadListPrec :: ReadPrec [UpdateSmsTemplate]
readPrec :: ReadPrec UpdateSmsTemplate
$creadPrec :: ReadPrec UpdateSmsTemplate
readList :: ReadS [UpdateSmsTemplate]
$creadList :: ReadS [UpdateSmsTemplate]
readsPrec :: Int -> ReadS UpdateSmsTemplate
$creadsPrec :: Int -> ReadS UpdateSmsTemplate
Prelude.Read, Int -> UpdateSmsTemplate -> ShowS
[UpdateSmsTemplate] -> ShowS
UpdateSmsTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSmsTemplate] -> ShowS
$cshowList :: [UpdateSmsTemplate] -> ShowS
show :: UpdateSmsTemplate -> String
$cshow :: UpdateSmsTemplate -> String
showsPrec :: Int -> UpdateSmsTemplate -> ShowS
$cshowsPrec :: Int -> UpdateSmsTemplate -> ShowS
Prelude.Show, forall x. Rep UpdateSmsTemplate x -> UpdateSmsTemplate
forall x. UpdateSmsTemplate -> Rep UpdateSmsTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateSmsTemplate x -> UpdateSmsTemplate
$cfrom :: forall x. UpdateSmsTemplate -> Rep UpdateSmsTemplate x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSmsTemplate' 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', 'updateSmsTemplate_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', 'updateSmsTemplate_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', 'updateSmsTemplate_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.
--
-- 'sMSTemplateRequest', 'updateSmsTemplate_sMSTemplateRequest' - Undocumented member.
newUpdateSmsTemplate ::
  -- | 'templateName'
  Prelude.Text ->
  -- | 'sMSTemplateRequest'
  SMSTemplateRequest ->
  UpdateSmsTemplate
newUpdateSmsTemplate :: Text -> SMSTemplateRequest -> UpdateSmsTemplate
newUpdateSmsTemplate
  Text
pTemplateName_
  SMSTemplateRequest
pSMSTemplateRequest_ =
    UpdateSmsTemplate'
      { $sel:createNewVersion:UpdateSmsTemplate' :: Maybe Bool
createNewVersion =
          forall a. Maybe a
Prelude.Nothing,
        $sel:version:UpdateSmsTemplate' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
        $sel:templateName:UpdateSmsTemplate' :: Text
templateName = Text
pTemplateName_,
        $sel:sMSTemplateRequest:UpdateSmsTemplate' :: SMSTemplateRequest
sMSTemplateRequest = SMSTemplateRequest
pSMSTemplateRequest_
      }

-- | 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.
updateSmsTemplate_createNewVersion :: Lens.Lens' UpdateSmsTemplate (Prelude.Maybe Prelude.Bool)
updateSmsTemplate_createNewVersion :: Lens' UpdateSmsTemplate (Maybe Bool)
updateSmsTemplate_createNewVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSmsTemplate' {Maybe Bool
createNewVersion :: Maybe Bool
$sel:createNewVersion:UpdateSmsTemplate' :: UpdateSmsTemplate -> Maybe Bool
createNewVersion} -> Maybe Bool
createNewVersion) (\s :: UpdateSmsTemplate
s@UpdateSmsTemplate' {} Maybe Bool
a -> UpdateSmsTemplate
s {$sel:createNewVersion:UpdateSmsTemplate' :: Maybe Bool
createNewVersion = Maybe Bool
a} :: UpdateSmsTemplate)

-- | 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.
updateSmsTemplate_version :: Lens.Lens' UpdateSmsTemplate (Prelude.Maybe Prelude.Text)
updateSmsTemplate_version :: Lens' UpdateSmsTemplate (Maybe Text)
updateSmsTemplate_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSmsTemplate' {Maybe Text
version :: Maybe Text
$sel:version:UpdateSmsTemplate' :: UpdateSmsTemplate -> Maybe Text
version} -> Maybe Text
version) (\s :: UpdateSmsTemplate
s@UpdateSmsTemplate' {} Maybe Text
a -> UpdateSmsTemplate
s {$sel:version:UpdateSmsTemplate' :: Maybe Text
version = Maybe Text
a} :: UpdateSmsTemplate)

-- | 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.
updateSmsTemplate_templateName :: Lens.Lens' UpdateSmsTemplate Prelude.Text
updateSmsTemplate_templateName :: Lens' UpdateSmsTemplate Text
updateSmsTemplate_templateName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSmsTemplate' {Text
templateName :: Text
$sel:templateName:UpdateSmsTemplate' :: UpdateSmsTemplate -> Text
templateName} -> Text
templateName) (\s :: UpdateSmsTemplate
s@UpdateSmsTemplate' {} Text
a -> UpdateSmsTemplate
s {$sel:templateName:UpdateSmsTemplate' :: Text
templateName = Text
a} :: UpdateSmsTemplate)

-- | Undocumented member.
updateSmsTemplate_sMSTemplateRequest :: Lens.Lens' UpdateSmsTemplate SMSTemplateRequest
updateSmsTemplate_sMSTemplateRequest :: Lens' UpdateSmsTemplate SMSTemplateRequest
updateSmsTemplate_sMSTemplateRequest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSmsTemplate' {SMSTemplateRequest
sMSTemplateRequest :: SMSTemplateRequest
$sel:sMSTemplateRequest:UpdateSmsTemplate' :: UpdateSmsTemplate -> SMSTemplateRequest
sMSTemplateRequest} -> SMSTemplateRequest
sMSTemplateRequest) (\s :: UpdateSmsTemplate
s@UpdateSmsTemplate' {} SMSTemplateRequest
a -> UpdateSmsTemplate
s {$sel:sMSTemplateRequest:UpdateSmsTemplate' :: SMSTemplateRequest
sMSTemplateRequest = SMSTemplateRequest
a} :: UpdateSmsTemplate)

instance Core.AWSRequest UpdateSmsTemplate where
  type
    AWSResponse UpdateSmsTemplate =
      UpdateSmsTemplateResponse
  request :: (Service -> Service)
-> UpdateSmsTemplate -> Request UpdateSmsTemplate
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 UpdateSmsTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateSmsTemplate)))
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 -> UpdateSmsTemplateResponse
UpdateSmsTemplateResponse'
            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 UpdateSmsTemplate where
  hashWithSalt :: Int -> UpdateSmsTemplate -> Int
hashWithSalt Int
_salt UpdateSmsTemplate' {Maybe Bool
Maybe Text
Text
SMSTemplateRequest
sMSTemplateRequest :: SMSTemplateRequest
templateName :: Text
version :: Maybe Text
createNewVersion :: Maybe Bool
$sel:sMSTemplateRequest:UpdateSmsTemplate' :: UpdateSmsTemplate -> SMSTemplateRequest
$sel:templateName:UpdateSmsTemplate' :: UpdateSmsTemplate -> Text
$sel:version:UpdateSmsTemplate' :: UpdateSmsTemplate -> Maybe Text
$sel:createNewVersion:UpdateSmsTemplate' :: UpdateSmsTemplate -> 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` SMSTemplateRequest
sMSTemplateRequest

instance Prelude.NFData UpdateSmsTemplate where
  rnf :: UpdateSmsTemplate -> ()
rnf UpdateSmsTemplate' {Maybe Bool
Maybe Text
Text
SMSTemplateRequest
sMSTemplateRequest :: SMSTemplateRequest
templateName :: Text
version :: Maybe Text
createNewVersion :: Maybe Bool
$sel:sMSTemplateRequest:UpdateSmsTemplate' :: UpdateSmsTemplate -> SMSTemplateRequest
$sel:templateName:UpdateSmsTemplate' :: UpdateSmsTemplate -> Text
$sel:version:UpdateSmsTemplate' :: UpdateSmsTemplate -> Maybe Text
$sel:createNewVersion:UpdateSmsTemplate' :: UpdateSmsTemplate -> 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 SMSTemplateRequest
sMSTemplateRequest

instance Data.ToHeaders UpdateSmsTemplate where
  toHeaders :: UpdateSmsTemplate -> 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 UpdateSmsTemplate where
  toJSON :: UpdateSmsTemplate -> Value
toJSON UpdateSmsTemplate' {Maybe Bool
Maybe Text
Text
SMSTemplateRequest
sMSTemplateRequest :: SMSTemplateRequest
templateName :: Text
version :: Maybe Text
createNewVersion :: Maybe Bool
$sel:sMSTemplateRequest:UpdateSmsTemplate' :: UpdateSmsTemplate -> SMSTemplateRequest
$sel:templateName:UpdateSmsTemplate' :: UpdateSmsTemplate -> Text
$sel:version:UpdateSmsTemplate' :: UpdateSmsTemplate -> Maybe Text
$sel:createNewVersion:UpdateSmsTemplate' :: UpdateSmsTemplate -> Maybe Bool
..} =
    forall a. ToJSON a => a -> Value
Data.toJSON SMSTemplateRequest
sMSTemplateRequest

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

instance Data.ToQuery UpdateSmsTemplate where
  toQuery :: UpdateSmsTemplate -> QueryString
toQuery UpdateSmsTemplate' {Maybe Bool
Maybe Text
Text
SMSTemplateRequest
sMSTemplateRequest :: SMSTemplateRequest
templateName :: Text
version :: Maybe Text
createNewVersion :: Maybe Bool
$sel:sMSTemplateRequest:UpdateSmsTemplate' :: UpdateSmsTemplate -> SMSTemplateRequest
$sel:templateName:UpdateSmsTemplate' :: UpdateSmsTemplate -> Text
$sel:version:UpdateSmsTemplate' :: UpdateSmsTemplate -> Maybe Text
$sel:createNewVersion:UpdateSmsTemplate' :: UpdateSmsTemplate -> 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:/ 'newUpdateSmsTemplateResponse' smart constructor.
data UpdateSmsTemplateResponse = UpdateSmsTemplateResponse'
  { -- | The response's http status code.
    UpdateSmsTemplateResponse -> Int
httpStatus :: Prelude.Int,
    UpdateSmsTemplateResponse -> MessageBody
messageBody :: MessageBody
  }
  deriving (UpdateSmsTemplateResponse -> UpdateSmsTemplateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSmsTemplateResponse -> UpdateSmsTemplateResponse -> Bool
$c/= :: UpdateSmsTemplateResponse -> UpdateSmsTemplateResponse -> Bool
== :: UpdateSmsTemplateResponse -> UpdateSmsTemplateResponse -> Bool
$c== :: UpdateSmsTemplateResponse -> UpdateSmsTemplateResponse -> Bool
Prelude.Eq, ReadPrec [UpdateSmsTemplateResponse]
ReadPrec UpdateSmsTemplateResponse
Int -> ReadS UpdateSmsTemplateResponse
ReadS [UpdateSmsTemplateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSmsTemplateResponse]
$creadListPrec :: ReadPrec [UpdateSmsTemplateResponse]
readPrec :: ReadPrec UpdateSmsTemplateResponse
$creadPrec :: ReadPrec UpdateSmsTemplateResponse
readList :: ReadS [UpdateSmsTemplateResponse]
$creadList :: ReadS [UpdateSmsTemplateResponse]
readsPrec :: Int -> ReadS UpdateSmsTemplateResponse
$creadsPrec :: Int -> ReadS UpdateSmsTemplateResponse
Prelude.Read, Int -> UpdateSmsTemplateResponse -> ShowS
[UpdateSmsTemplateResponse] -> ShowS
UpdateSmsTemplateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSmsTemplateResponse] -> ShowS
$cshowList :: [UpdateSmsTemplateResponse] -> ShowS
show :: UpdateSmsTemplateResponse -> String
$cshow :: UpdateSmsTemplateResponse -> String
showsPrec :: Int -> UpdateSmsTemplateResponse -> ShowS
$cshowsPrec :: Int -> UpdateSmsTemplateResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateSmsTemplateResponse x -> UpdateSmsTemplateResponse
forall x.
UpdateSmsTemplateResponse -> Rep UpdateSmsTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSmsTemplateResponse x -> UpdateSmsTemplateResponse
$cfrom :: forall x.
UpdateSmsTemplateResponse -> Rep UpdateSmsTemplateResponse x
Prelude.Generic)

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

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

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

instance Prelude.NFData UpdateSmsTemplateResponse where
  rnf :: UpdateSmsTemplateResponse -> ()
rnf UpdateSmsTemplateResponse' {Int
MessageBody
messageBody :: MessageBody
httpStatus :: Int
$sel:messageBody:UpdateSmsTemplateResponse' :: UpdateSmsTemplateResponse -> MessageBody
$sel:httpStatus:UpdateSmsTemplateResponse' :: UpdateSmsTemplateResponse -> 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