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

    -- * Request Lenses
    updateInAppTemplate_version,
    updateInAppTemplate_createNewVersion,
    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.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:/ 'newUpdateInAppTemplate' smart constructor.
data UpdateInAppTemplate = 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 -> 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.
    UpdateInAppTemplate -> 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.
    UpdateInAppTemplate -> Text
templateName :: Prelude.Text,
    UpdateInAppTemplate -> InAppTemplateRequest
inAppTemplateRequest :: InAppTemplateRequest
  }
  deriving (UpdateInAppTemplate -> UpdateInAppTemplate -> Bool
(UpdateInAppTemplate -> UpdateInAppTemplate -> Bool)
-> (UpdateInAppTemplate -> UpdateInAppTemplate -> Bool)
-> Eq UpdateInAppTemplate
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]
(Int -> ReadS UpdateInAppTemplate)
-> ReadS [UpdateInAppTemplate]
-> ReadPrec UpdateInAppTemplate
-> ReadPrec [UpdateInAppTemplate]
-> Read 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
(Int -> UpdateInAppTemplate -> ShowS)
-> (UpdateInAppTemplate -> String)
-> ([UpdateInAppTemplate] -> ShowS)
-> Show UpdateInAppTemplate
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. UpdateInAppTemplate -> Rep UpdateInAppTemplate x)
-> (forall x. Rep UpdateInAppTemplate x -> UpdateInAppTemplate)
-> Generic UpdateInAppTemplate
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:
--
-- '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.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Bool
-> Text
-> InAppTemplateRequest
-> UpdateInAppTemplate
UpdateInAppTemplate'
      { $sel:version:UpdateInAppTemplate' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:createNewVersion:UpdateInAppTemplate' :: Maybe Bool
createNewVersion = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:templateName:UpdateInAppTemplate' :: Text
templateName = Text
pTemplateName_,
        $sel:inAppTemplateRequest:UpdateInAppTemplate' :: InAppTemplateRequest
inAppTemplateRequest = InAppTemplateRequest
pInAppTemplateRequest_
      }

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

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> UpdateInAppTemplate -> f UpdateInAppTemplate
updateInAppTemplate_createNewVersion = (UpdateInAppTemplate -> Maybe Bool)
-> (UpdateInAppTemplate -> Maybe Bool -> UpdateInAppTemplate)
-> Lens
     UpdateInAppTemplate UpdateInAppTemplate (Maybe Bool) (Maybe Bool)
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 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 :: (Text -> f Text) -> UpdateInAppTemplate -> f UpdateInAppTemplate
updateInAppTemplate_templateName = (UpdateInAppTemplate -> Text)
-> (UpdateInAppTemplate -> Text -> UpdateInAppTemplate)
-> Lens UpdateInAppTemplate UpdateInAppTemplate Text Text
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 :: (InAppTemplateRequest -> f InAppTemplateRequest)
-> UpdateInAppTemplate -> f UpdateInAppTemplate
updateInAppTemplate_inAppTemplateRequest = (UpdateInAppTemplate -> InAppTemplateRequest)
-> (UpdateInAppTemplate
    -> InAppTemplateRequest -> UpdateInAppTemplate)
-> Lens
     UpdateInAppTemplate
     UpdateInAppTemplate
     InAppTemplateRequest
     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 :: UpdateInAppTemplate -> Request UpdateInAppTemplate
request = Service -> UpdateInAppTemplate -> Request UpdateInAppTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateInAppTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateInAppTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateInAppTemplate))
-> Logger
-> Service
-> Proxy UpdateInAppTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateInAppTemplate)))
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 -> UpdateInAppTemplateResponse
UpdateInAppTemplateResponse'
            (Int -> MessageBody -> UpdateInAppTemplateResponse)
-> Either String Int
-> Either String (MessageBody -> UpdateInAppTemplateResponse)
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 -> UpdateInAppTemplateResponse)
-> Either String MessageBody
-> Either String UpdateInAppTemplateResponse
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 UpdateInAppTemplate

instance Prelude.NFData UpdateInAppTemplate

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

instance Core.ToPath UpdateInAppTemplate where
  toPath :: UpdateInAppTemplate -> ByteString
toPath UpdateInAppTemplate' {Maybe Bool
Maybe Text
Text
InAppTemplateRequest
inAppTemplateRequest :: InAppTemplateRequest
templateName :: Text
createNewVersion :: Maybe Bool
version :: Maybe Text
$sel:inAppTemplateRequest:UpdateInAppTemplate' :: UpdateInAppTemplate -> InAppTemplateRequest
$sel:templateName:UpdateInAppTemplate' :: UpdateInAppTemplate -> Text
$sel:createNewVersion:UpdateInAppTemplate' :: UpdateInAppTemplate -> Maybe Bool
$sel:version:UpdateInAppTemplate' :: UpdateInAppTemplate -> 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
"/inapp"]

instance Core.ToQuery UpdateInAppTemplate where
  toQuery :: UpdateInAppTemplate -> QueryString
toQuery UpdateInAppTemplate' {Maybe Bool
Maybe Text
Text
InAppTemplateRequest
inAppTemplateRequest :: InAppTemplateRequest
templateName :: Text
createNewVersion :: Maybe Bool
version :: Maybe Text
$sel:inAppTemplateRequest:UpdateInAppTemplate' :: UpdateInAppTemplate -> InAppTemplateRequest
$sel:templateName:UpdateInAppTemplate' :: UpdateInAppTemplate -> Text
$sel:createNewVersion:UpdateInAppTemplate' :: UpdateInAppTemplate -> Maybe Bool
$sel:version:UpdateInAppTemplate' :: UpdateInAppTemplate -> 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:/ '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
(UpdateInAppTemplateResponse
 -> UpdateInAppTemplateResponse -> Bool)
-> (UpdateInAppTemplateResponse
    -> UpdateInAppTemplateResponse -> Bool)
-> Eq UpdateInAppTemplateResponse
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]
(Int -> ReadS UpdateInAppTemplateResponse)
-> ReadS [UpdateInAppTemplateResponse]
-> ReadPrec UpdateInAppTemplateResponse
-> ReadPrec [UpdateInAppTemplateResponse]
-> Read 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
(Int -> UpdateInAppTemplateResponse -> ShowS)
-> (UpdateInAppTemplateResponse -> String)
-> ([UpdateInAppTemplateResponse] -> ShowS)
-> Show UpdateInAppTemplateResponse
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.
 UpdateInAppTemplateResponse -> Rep UpdateInAppTemplateResponse x)
-> (forall x.
    Rep UpdateInAppTemplateResponse x -> UpdateInAppTemplateResponse)
-> Generic UpdateInAppTemplateResponse
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' :: Int -> MessageBody -> UpdateInAppTemplateResponse
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 :: (Int -> f Int)
-> UpdateInAppTemplateResponse -> f UpdateInAppTemplateResponse
updateInAppTemplateResponse_httpStatus = (UpdateInAppTemplateResponse -> Int)
-> (UpdateInAppTemplateResponse
    -> Int -> UpdateInAppTemplateResponse)
-> Lens
     UpdateInAppTemplateResponse UpdateInAppTemplateResponse Int Int
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 :: (MessageBody -> f MessageBody)
-> UpdateInAppTemplateResponse -> f UpdateInAppTemplateResponse
updateInAppTemplateResponse_messageBody = (UpdateInAppTemplateResponse -> MessageBody)
-> (UpdateInAppTemplateResponse
    -> MessageBody -> UpdateInAppTemplateResponse)
-> Lens
     UpdateInAppTemplateResponse
     UpdateInAppTemplateResponse
     MessageBody
     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