{-# 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.UpdateInAppTemplate
-- 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 sent through the
-- in-app message channel.
module Amazonka.Pinpoint.UpdateInAppTemplate
  ( -- * Creating a Request
    UpdateInAppTemplate (..),
    newUpdateInAppTemplate,

    -- * Request Lenses
    updateInAppTemplate_createNewVersion,
    updateInAppTemplate_version,
    updateInAppTemplate_templateName,
    updateInAppTemplate_inAppTemplateRequest,

    -- * Destructuring the Response
    UpdateInAppTemplateResponse (..),
    newUpdateInAppTemplateResponse,

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

-- |
-- Create a value of 'UpdateInAppTemplate' 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', 'updateInAppTemplate_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', 'updateInAppTemplate_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', 'updateInAppTemplate_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.
--
-- 'inAppTemplateRequest', 'updateInAppTemplate_inAppTemplateRequest' - Undocumented member.
newUpdateInAppTemplate ::
  -- | 'templateName'
  Prelude.Text ->
  -- | 'inAppTemplateRequest'
  InAppTemplateRequest ->
  UpdateInAppTemplate
newUpdateInAppTemplate :: Text -> InAppTemplateRequest -> UpdateInAppTemplate
newUpdateInAppTemplate
  Text
pTemplateName_
  InAppTemplateRequest
pInAppTemplateRequest_ =
    UpdateInAppTemplate'
      { $sel:createNewVersion:UpdateInAppTemplate' :: Maybe Bool
createNewVersion =
          forall a. Maybe a
Prelude.Nothing,
        $sel:version:UpdateInAppTemplate' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
        $sel:templateName:UpdateInAppTemplate' :: Text
templateName = Text
pTemplateName_,
        $sel:inAppTemplateRequest:UpdateInAppTemplate' :: InAppTemplateRequest
inAppTemplateRequest = InAppTemplateRequest
pInAppTemplateRequest_
      }

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

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

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

-- | Undocumented member.
updateInAppTemplate_inAppTemplateRequest :: Lens.Lens' UpdateInAppTemplate InAppTemplateRequest
updateInAppTemplate_inAppTemplateRequest :: Lens' UpdateInAppTemplate InAppTemplateRequest
updateInAppTemplate_inAppTemplateRequest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInAppTemplate' {InAppTemplateRequest
inAppTemplateRequest :: InAppTemplateRequest
$sel:inAppTemplateRequest:UpdateInAppTemplate' :: UpdateInAppTemplate -> InAppTemplateRequest
inAppTemplateRequest} -> InAppTemplateRequest
inAppTemplateRequest) (\s :: UpdateInAppTemplate
s@UpdateInAppTemplate' {} InAppTemplateRequest
a -> UpdateInAppTemplate
s {$sel:inAppTemplateRequest:UpdateInAppTemplate' :: InAppTemplateRequest
inAppTemplateRequest = InAppTemplateRequest
a} :: UpdateInAppTemplate)

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

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

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

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

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

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

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

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

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