{-# 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.UpdateVoiceTemplate
-- 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
-- the voice channel.
module Amazonka.Pinpoint.UpdateVoiceTemplate
  ( -- * Creating a Request
    UpdateVoiceTemplate (..),
    newUpdateVoiceTemplate,

    -- * Request Lenses
    updateVoiceTemplate_createNewVersion,
    updateVoiceTemplate_version,
    updateVoiceTemplate_templateName,
    updateVoiceTemplate_voiceTemplateRequest,

    -- * Destructuring the Response
    UpdateVoiceTemplateResponse (..),
    newUpdateVoiceTemplateResponse,

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

-- |
-- Create a value of 'UpdateVoiceTemplate' 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', 'updateVoiceTemplate_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', 'updateVoiceTemplate_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', 'updateVoiceTemplate_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.
--
-- 'voiceTemplateRequest', 'updateVoiceTemplate_voiceTemplateRequest' - Undocumented member.
newUpdateVoiceTemplate ::
  -- | 'templateName'
  Prelude.Text ->
  -- | 'voiceTemplateRequest'
  VoiceTemplateRequest ->
  UpdateVoiceTemplate
newUpdateVoiceTemplate :: Text -> VoiceTemplateRequest -> UpdateVoiceTemplate
newUpdateVoiceTemplate
  Text
pTemplateName_
  VoiceTemplateRequest
pVoiceTemplateRequest_ =
    UpdateVoiceTemplate'
      { $sel:createNewVersion:UpdateVoiceTemplate' :: Maybe Bool
createNewVersion =
          forall a. Maybe a
Prelude.Nothing,
        $sel:version:UpdateVoiceTemplate' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
        $sel:templateName:UpdateVoiceTemplate' :: Text
templateName = Text
pTemplateName_,
        $sel:voiceTemplateRequest:UpdateVoiceTemplate' :: VoiceTemplateRequest
voiceTemplateRequest = VoiceTemplateRequest
pVoiceTemplateRequest_
      }

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

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

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

-- | Undocumented member.
updateVoiceTemplate_voiceTemplateRequest :: Lens.Lens' UpdateVoiceTemplate VoiceTemplateRequest
updateVoiceTemplate_voiceTemplateRequest :: Lens' UpdateVoiceTemplate VoiceTemplateRequest
updateVoiceTemplate_voiceTemplateRequest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVoiceTemplate' {VoiceTemplateRequest
voiceTemplateRequest :: VoiceTemplateRequest
$sel:voiceTemplateRequest:UpdateVoiceTemplate' :: UpdateVoiceTemplate -> VoiceTemplateRequest
voiceTemplateRequest} -> VoiceTemplateRequest
voiceTemplateRequest) (\s :: UpdateVoiceTemplate
s@UpdateVoiceTemplate' {} VoiceTemplateRequest
a -> UpdateVoiceTemplate
s {$sel:voiceTemplateRequest:UpdateVoiceTemplate' :: VoiceTemplateRequest
voiceTemplateRequest = VoiceTemplateRequest
a} :: UpdateVoiceTemplate)

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

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

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

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

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

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

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

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

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