{-# 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.UpdatePushTemplate
-- 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
-- a push notification channel.
module Amazonka.Pinpoint.UpdatePushTemplate
  ( -- * Creating a Request
    UpdatePushTemplate (..),
    newUpdatePushTemplate,

    -- * Request Lenses
    updatePushTemplate_createNewVersion,
    updatePushTemplate_version,
    updatePushTemplate_templateName,
    updatePushTemplate_pushNotificationTemplateRequest,

    -- * Destructuring the Response
    UpdatePushTemplateResponse (..),
    newUpdatePushTemplateResponse,

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

-- |
-- Create a value of 'UpdatePushTemplate' 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', 'updatePushTemplate_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', 'updatePushTemplate_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', 'updatePushTemplate_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.
--
-- 'pushNotificationTemplateRequest', 'updatePushTemplate_pushNotificationTemplateRequest' - Undocumented member.
newUpdatePushTemplate ::
  -- | 'templateName'
  Prelude.Text ->
  -- | 'pushNotificationTemplateRequest'
  PushNotificationTemplateRequest ->
  UpdatePushTemplate
newUpdatePushTemplate :: Text -> PushNotificationTemplateRequest -> UpdatePushTemplate
newUpdatePushTemplate
  Text
pTemplateName_
  PushNotificationTemplateRequest
pPushNotificationTemplateRequest_ =
    UpdatePushTemplate'
      { $sel:createNewVersion:UpdatePushTemplate' :: Maybe Bool
createNewVersion =
          forall a. Maybe a
Prelude.Nothing,
        $sel:version:UpdatePushTemplate' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
        $sel:templateName:UpdatePushTemplate' :: Text
templateName = Text
pTemplateName_,
        $sel:pushNotificationTemplateRequest:UpdatePushTemplate' :: PushNotificationTemplateRequest
pushNotificationTemplateRequest =
          PushNotificationTemplateRequest
pPushNotificationTemplateRequest_
      }

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

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

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

-- | Undocumented member.
updatePushTemplate_pushNotificationTemplateRequest :: Lens.Lens' UpdatePushTemplate PushNotificationTemplateRequest
updatePushTemplate_pushNotificationTemplateRequest :: Lens' UpdatePushTemplate PushNotificationTemplateRequest
updatePushTemplate_pushNotificationTemplateRequest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePushTemplate' {PushNotificationTemplateRequest
pushNotificationTemplateRequest :: PushNotificationTemplateRequest
$sel:pushNotificationTemplateRequest:UpdatePushTemplate' :: UpdatePushTemplate -> PushNotificationTemplateRequest
pushNotificationTemplateRequest} -> PushNotificationTemplateRequest
pushNotificationTemplateRequest) (\s :: UpdatePushTemplate
s@UpdatePushTemplate' {} PushNotificationTemplateRequest
a -> UpdatePushTemplate
s {$sel:pushNotificationTemplateRequest:UpdatePushTemplate' :: PushNotificationTemplateRequest
pushNotificationTemplateRequest = PushNotificationTemplateRequest
a} :: UpdatePushTemplate)

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

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

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

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

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

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

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

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

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