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

    -- * Request Lenses
    updateSmsTemplate_version,
    updateSmsTemplate_createNewVersion,
    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.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:/ 'newUpdateSmsTemplate' smart constructor.
data UpdateSmsTemplate = 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 -> 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.
    UpdateSmsTemplate -> 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.
    UpdateSmsTemplate -> Text
templateName :: Prelude.Text,
    UpdateSmsTemplate -> SMSTemplateRequest
sMSTemplateRequest :: SMSTemplateRequest
  }
  deriving (UpdateSmsTemplate -> UpdateSmsTemplate -> Bool
(UpdateSmsTemplate -> UpdateSmsTemplate -> Bool)
-> (UpdateSmsTemplate -> UpdateSmsTemplate -> Bool)
-> Eq UpdateSmsTemplate
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]
(Int -> ReadS UpdateSmsTemplate)
-> ReadS [UpdateSmsTemplate]
-> ReadPrec UpdateSmsTemplate
-> ReadPrec [UpdateSmsTemplate]
-> Read 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
(Int -> UpdateSmsTemplate -> ShowS)
-> (UpdateSmsTemplate -> String)
-> ([UpdateSmsTemplate] -> ShowS)
-> Show UpdateSmsTemplate
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. UpdateSmsTemplate -> Rep UpdateSmsTemplate x)
-> (forall x. Rep UpdateSmsTemplate x -> UpdateSmsTemplate)
-> Generic UpdateSmsTemplate
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:
--
-- '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.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Bool -> Text -> SMSTemplateRequest -> UpdateSmsTemplate
UpdateSmsTemplate'
      { $sel:version:UpdateSmsTemplate' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:createNewVersion:UpdateSmsTemplate' :: Maybe Bool
createNewVersion = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:templateName:UpdateSmsTemplate' :: Text
templateName = Text
pTemplateName_,
        $sel:sMSTemplateRequest:UpdateSmsTemplate' :: SMSTemplateRequest
sMSTemplateRequest = SMSTemplateRequest
pSMSTemplateRequest_
      }

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

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> UpdateSmsTemplate -> f UpdateSmsTemplate
updateSmsTemplate_createNewVersion = (UpdateSmsTemplate -> Maybe Bool)
-> (UpdateSmsTemplate -> Maybe Bool -> UpdateSmsTemplate)
-> Lens
     UpdateSmsTemplate UpdateSmsTemplate (Maybe Bool) (Maybe Bool)
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 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 :: (Text -> f Text) -> UpdateSmsTemplate -> f UpdateSmsTemplate
updateSmsTemplate_templateName = (UpdateSmsTemplate -> Text)
-> (UpdateSmsTemplate -> Text -> UpdateSmsTemplate)
-> Lens UpdateSmsTemplate UpdateSmsTemplate Text Text
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 :: (SMSTemplateRequest -> f SMSTemplateRequest)
-> UpdateSmsTemplate -> f UpdateSmsTemplate
updateSmsTemplate_sMSTemplateRequest = (UpdateSmsTemplate -> SMSTemplateRequest)
-> (UpdateSmsTemplate -> SMSTemplateRequest -> UpdateSmsTemplate)
-> Lens
     UpdateSmsTemplate
     UpdateSmsTemplate
     SMSTemplateRequest
     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 :: UpdateSmsTemplate -> Request UpdateSmsTemplate
request = Service -> UpdateSmsTemplate -> Request UpdateSmsTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateSmsTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateSmsTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateSmsTemplate))
-> Logger
-> Service
-> Proxy UpdateSmsTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateSmsTemplate)))
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 -> UpdateSmsTemplateResponse
UpdateSmsTemplateResponse'
            (Int -> MessageBody -> UpdateSmsTemplateResponse)
-> Either String Int
-> Either String (MessageBody -> UpdateSmsTemplateResponse)
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 -> UpdateSmsTemplateResponse)
-> Either String MessageBody
-> Either String UpdateSmsTemplateResponse
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 UpdateSmsTemplate

instance Prelude.NFData UpdateSmsTemplate

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

instance Core.ToPath UpdateSmsTemplate where
  toPath :: UpdateSmsTemplate -> ByteString
toPath UpdateSmsTemplate' {Maybe Bool
Maybe Text
Text
SMSTemplateRequest
sMSTemplateRequest :: SMSTemplateRequest
templateName :: Text
createNewVersion :: Maybe Bool
version :: Maybe Text
$sel:sMSTemplateRequest:UpdateSmsTemplate' :: UpdateSmsTemplate -> SMSTemplateRequest
$sel:templateName:UpdateSmsTemplate' :: UpdateSmsTemplate -> Text
$sel:createNewVersion:UpdateSmsTemplate' :: UpdateSmsTemplate -> Maybe Bool
$sel:version:UpdateSmsTemplate' :: UpdateSmsTemplate -> 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
"/sms"]

instance Core.ToQuery UpdateSmsTemplate where
  toQuery :: UpdateSmsTemplate -> QueryString
toQuery UpdateSmsTemplate' {Maybe Bool
Maybe Text
Text
SMSTemplateRequest
sMSTemplateRequest :: SMSTemplateRequest
templateName :: Text
createNewVersion :: Maybe Bool
version :: Maybe Text
$sel:sMSTemplateRequest:UpdateSmsTemplate' :: UpdateSmsTemplate -> SMSTemplateRequest
$sel:templateName:UpdateSmsTemplate' :: UpdateSmsTemplate -> Text
$sel:createNewVersion:UpdateSmsTemplate' :: UpdateSmsTemplate -> Maybe Bool
$sel:version:UpdateSmsTemplate' :: UpdateSmsTemplate -> 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:/ '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
(UpdateSmsTemplateResponse -> UpdateSmsTemplateResponse -> Bool)
-> (UpdateSmsTemplateResponse -> UpdateSmsTemplateResponse -> Bool)
-> Eq UpdateSmsTemplateResponse
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]
(Int -> ReadS UpdateSmsTemplateResponse)
-> ReadS [UpdateSmsTemplateResponse]
-> ReadPrec UpdateSmsTemplateResponse
-> ReadPrec [UpdateSmsTemplateResponse]
-> Read 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
(Int -> UpdateSmsTemplateResponse -> ShowS)
-> (UpdateSmsTemplateResponse -> String)
-> ([UpdateSmsTemplateResponse] -> ShowS)
-> Show UpdateSmsTemplateResponse
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.
 UpdateSmsTemplateResponse -> Rep UpdateSmsTemplateResponse x)
-> (forall x.
    Rep UpdateSmsTemplateResponse x -> UpdateSmsTemplateResponse)
-> Generic UpdateSmsTemplateResponse
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' :: Int -> MessageBody -> UpdateSmsTemplateResponse
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 :: (Int -> f Int)
-> UpdateSmsTemplateResponse -> f UpdateSmsTemplateResponse
updateSmsTemplateResponse_httpStatus = (UpdateSmsTemplateResponse -> Int)
-> (UpdateSmsTemplateResponse -> Int -> UpdateSmsTemplateResponse)
-> Lens UpdateSmsTemplateResponse UpdateSmsTemplateResponse Int Int
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 :: (MessageBody -> f MessageBody)
-> UpdateSmsTemplateResponse -> f UpdateSmsTemplateResponse
updateSmsTemplateResponse_messageBody = (UpdateSmsTemplateResponse -> MessageBody)
-> (UpdateSmsTemplateResponse
    -> MessageBody -> UpdateSmsTemplateResponse)
-> Lens
     UpdateSmsTemplateResponse
     UpdateSmsTemplateResponse
     MessageBody
     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