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

    -- * Request Lenses
    updatePushTemplate_version,
    updatePushTemplate_createNewVersion,
    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.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:/ 'newUpdatePushTemplate' smart constructor.
data UpdatePushTemplate = 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 -> 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.
    UpdatePushTemplate -> 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.
    UpdatePushTemplate -> Text
templateName :: Prelude.Text,
    UpdatePushTemplate -> PushNotificationTemplateRequest
pushNotificationTemplateRequest :: PushNotificationTemplateRequest
  }
  deriving (UpdatePushTemplate -> UpdatePushTemplate -> Bool
(UpdatePushTemplate -> UpdatePushTemplate -> Bool)
-> (UpdatePushTemplate -> UpdatePushTemplate -> Bool)
-> Eq UpdatePushTemplate
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]
(Int -> ReadS UpdatePushTemplate)
-> ReadS [UpdatePushTemplate]
-> ReadPrec UpdatePushTemplate
-> ReadPrec [UpdatePushTemplate]
-> Read 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
(Int -> UpdatePushTemplate -> ShowS)
-> (UpdatePushTemplate -> String)
-> ([UpdatePushTemplate] -> ShowS)
-> Show UpdatePushTemplate
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. UpdatePushTemplate -> Rep UpdatePushTemplate x)
-> (forall x. Rep UpdatePushTemplate x -> UpdatePushTemplate)
-> Generic UpdatePushTemplate
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:
--
-- '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.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Bool
-> Text
-> PushNotificationTemplateRequest
-> UpdatePushTemplate
UpdatePushTemplate'
      { $sel:version:UpdatePushTemplate' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:createNewVersion:UpdatePushTemplate' :: Maybe Bool
createNewVersion = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:templateName:UpdatePushTemplate' :: Text
templateName = Text
pTemplateName_,
        $sel:pushNotificationTemplateRequest:UpdatePushTemplate' :: PushNotificationTemplateRequest
pushNotificationTemplateRequest =
          PushNotificationTemplateRequest
pPushNotificationTemplateRequest_
      }

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

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> UpdatePushTemplate -> f UpdatePushTemplate
updatePushTemplate_createNewVersion = (UpdatePushTemplate -> Maybe Bool)
-> (UpdatePushTemplate -> Maybe Bool -> UpdatePushTemplate)
-> Lens
     UpdatePushTemplate UpdatePushTemplate (Maybe Bool) (Maybe Bool)
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 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 :: (Text -> f Text) -> UpdatePushTemplate -> f UpdatePushTemplate
updatePushTemplate_templateName = (UpdatePushTemplate -> Text)
-> (UpdatePushTemplate -> Text -> UpdatePushTemplate)
-> Lens UpdatePushTemplate UpdatePushTemplate Text Text
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 :: (PushNotificationTemplateRequest
 -> f PushNotificationTemplateRequest)
-> UpdatePushTemplate -> f UpdatePushTemplate
updatePushTemplate_pushNotificationTemplateRequest = (UpdatePushTemplate -> PushNotificationTemplateRequest)
-> (UpdatePushTemplate
    -> PushNotificationTemplateRequest -> UpdatePushTemplate)
-> Lens
     UpdatePushTemplate
     UpdatePushTemplate
     PushNotificationTemplateRequest
     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 :: UpdatePushTemplate -> Request UpdatePushTemplate
request = Service -> UpdatePushTemplate -> Request UpdatePushTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdatePushTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdatePushTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdatePushTemplate))
-> Logger
-> Service
-> Proxy UpdatePushTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdatePushTemplate)))
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 -> UpdatePushTemplateResponse
UpdatePushTemplateResponse'
            (Int -> MessageBody -> UpdatePushTemplateResponse)
-> Either String Int
-> Either String (MessageBody -> UpdatePushTemplateResponse)
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 -> UpdatePushTemplateResponse)
-> Either String MessageBody
-> Either String UpdatePushTemplateResponse
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 UpdatePushTemplate

instance Prelude.NFData UpdatePushTemplate

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

instance Core.ToPath UpdatePushTemplate where
  toPath :: UpdatePushTemplate -> ByteString
toPath UpdatePushTemplate' {Maybe Bool
Maybe Text
Text
PushNotificationTemplateRequest
pushNotificationTemplateRequest :: PushNotificationTemplateRequest
templateName :: Text
createNewVersion :: Maybe Bool
version :: Maybe Text
$sel:pushNotificationTemplateRequest:UpdatePushTemplate' :: UpdatePushTemplate -> PushNotificationTemplateRequest
$sel:templateName:UpdatePushTemplate' :: UpdatePushTemplate -> Text
$sel:createNewVersion:UpdatePushTemplate' :: UpdatePushTemplate -> Maybe Bool
$sel:version:UpdatePushTemplate' :: UpdatePushTemplate -> 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
"/push"]

instance Core.ToQuery UpdatePushTemplate where
  toQuery :: UpdatePushTemplate -> QueryString
toQuery UpdatePushTemplate' {Maybe Bool
Maybe Text
Text
PushNotificationTemplateRequest
pushNotificationTemplateRequest :: PushNotificationTemplateRequest
templateName :: Text
createNewVersion :: Maybe Bool
version :: Maybe Text
$sel:pushNotificationTemplateRequest:UpdatePushTemplate' :: UpdatePushTemplate -> PushNotificationTemplateRequest
$sel:templateName:UpdatePushTemplate' :: UpdatePushTemplate -> Text
$sel:createNewVersion:UpdatePushTemplate' :: UpdatePushTemplate -> Maybe Bool
$sel:version:UpdatePushTemplate' :: UpdatePushTemplate -> 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:/ '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
(UpdatePushTemplateResponse -> UpdatePushTemplateResponse -> Bool)
-> (UpdatePushTemplateResponse
    -> UpdatePushTemplateResponse -> Bool)
-> Eq UpdatePushTemplateResponse
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]
(Int -> ReadS UpdatePushTemplateResponse)
-> ReadS [UpdatePushTemplateResponse]
-> ReadPrec UpdatePushTemplateResponse
-> ReadPrec [UpdatePushTemplateResponse]
-> Read 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
(Int -> UpdatePushTemplateResponse -> ShowS)
-> (UpdatePushTemplateResponse -> String)
-> ([UpdatePushTemplateResponse] -> ShowS)
-> Show UpdatePushTemplateResponse
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.
 UpdatePushTemplateResponse -> Rep UpdatePushTemplateResponse x)
-> (forall x.
    Rep UpdatePushTemplateResponse x -> UpdatePushTemplateResponse)
-> Generic UpdatePushTemplateResponse
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' :: Int -> MessageBody -> UpdatePushTemplateResponse
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 :: (Int -> f Int)
-> UpdatePushTemplateResponse -> f UpdatePushTemplateResponse
updatePushTemplateResponse_httpStatus = (UpdatePushTemplateResponse -> Int)
-> (UpdatePushTemplateResponse
    -> Int -> UpdatePushTemplateResponse)
-> Lens
     UpdatePushTemplateResponse UpdatePushTemplateResponse Int Int
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 :: (MessageBody -> f MessageBody)
-> UpdatePushTemplateResponse -> f UpdatePushTemplateResponse
updatePushTemplateResponse_messageBody = (UpdatePushTemplateResponse -> MessageBody)
-> (UpdatePushTemplateResponse
    -> MessageBody -> UpdatePushTemplateResponse)
-> Lens
     UpdatePushTemplateResponse
     UpdatePushTemplateResponse
     MessageBody
     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