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

    -- * Request Lenses
    updateVoiceTemplate_version,
    updateVoiceTemplate_createNewVersion,
    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.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:/ 'newUpdateVoiceTemplate' smart constructor.
data UpdateVoiceTemplate = 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 -> 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.
    UpdateVoiceTemplate -> 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.
    UpdateVoiceTemplate -> Text
templateName :: Prelude.Text,
    UpdateVoiceTemplate -> VoiceTemplateRequest
voiceTemplateRequest :: VoiceTemplateRequest
  }
  deriving (UpdateVoiceTemplate -> UpdateVoiceTemplate -> Bool
(UpdateVoiceTemplate -> UpdateVoiceTemplate -> Bool)
-> (UpdateVoiceTemplate -> UpdateVoiceTemplate -> Bool)
-> Eq UpdateVoiceTemplate
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]
(Int -> ReadS UpdateVoiceTemplate)
-> ReadS [UpdateVoiceTemplate]
-> ReadPrec UpdateVoiceTemplate
-> ReadPrec [UpdateVoiceTemplate]
-> Read 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
(Int -> UpdateVoiceTemplate -> ShowS)
-> (UpdateVoiceTemplate -> String)
-> ([UpdateVoiceTemplate] -> ShowS)
-> Show UpdateVoiceTemplate
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. UpdateVoiceTemplate -> Rep UpdateVoiceTemplate x)
-> (forall x. Rep UpdateVoiceTemplate x -> UpdateVoiceTemplate)
-> Generic UpdateVoiceTemplate
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:
--
-- '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.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Bool
-> Text
-> VoiceTemplateRequest
-> UpdateVoiceTemplate
UpdateVoiceTemplate'
      { $sel:version:UpdateVoiceTemplate' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:createNewVersion:UpdateVoiceTemplate' :: Maybe Bool
createNewVersion = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:templateName:UpdateVoiceTemplate' :: Text
templateName = Text
pTemplateName_,
        $sel:voiceTemplateRequest:UpdateVoiceTemplate' :: VoiceTemplateRequest
voiceTemplateRequest = VoiceTemplateRequest
pVoiceTemplateRequest_
      }

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

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> UpdateVoiceTemplate -> f UpdateVoiceTemplate
updateVoiceTemplate_createNewVersion = (UpdateVoiceTemplate -> Maybe Bool)
-> (UpdateVoiceTemplate -> Maybe Bool -> UpdateVoiceTemplate)
-> Lens
     UpdateVoiceTemplate UpdateVoiceTemplate (Maybe Bool) (Maybe Bool)
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 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 :: (Text -> f Text) -> UpdateVoiceTemplate -> f UpdateVoiceTemplate
updateVoiceTemplate_templateName = (UpdateVoiceTemplate -> Text)
-> (UpdateVoiceTemplate -> Text -> UpdateVoiceTemplate)
-> Lens UpdateVoiceTemplate UpdateVoiceTemplate Text Text
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 :: (VoiceTemplateRequest -> f VoiceTemplateRequest)
-> UpdateVoiceTemplate -> f UpdateVoiceTemplate
updateVoiceTemplate_voiceTemplateRequest = (UpdateVoiceTemplate -> VoiceTemplateRequest)
-> (UpdateVoiceTemplate
    -> VoiceTemplateRequest -> UpdateVoiceTemplate)
-> Lens
     UpdateVoiceTemplate
     UpdateVoiceTemplate
     VoiceTemplateRequest
     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 :: UpdateVoiceTemplate -> Request UpdateVoiceTemplate
request = Service -> UpdateVoiceTemplate -> Request UpdateVoiceTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateVoiceTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateVoiceTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateVoiceTemplate))
-> Logger
-> Service
-> Proxy UpdateVoiceTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateVoiceTemplate)))
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 -> UpdateVoiceTemplateResponse
UpdateVoiceTemplateResponse'
            (Int -> MessageBody -> UpdateVoiceTemplateResponse)
-> Either String Int
-> Either String (MessageBody -> UpdateVoiceTemplateResponse)
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 -> UpdateVoiceTemplateResponse)
-> Either String MessageBody
-> Either String UpdateVoiceTemplateResponse
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 UpdateVoiceTemplate

instance Prelude.NFData UpdateVoiceTemplate

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

instance Core.ToPath UpdateVoiceTemplate where
  toPath :: UpdateVoiceTemplate -> ByteString
toPath UpdateVoiceTemplate' {Maybe Bool
Maybe Text
Text
VoiceTemplateRequest
voiceTemplateRequest :: VoiceTemplateRequest
templateName :: Text
createNewVersion :: Maybe Bool
version :: Maybe Text
$sel:voiceTemplateRequest:UpdateVoiceTemplate' :: UpdateVoiceTemplate -> VoiceTemplateRequest
$sel:templateName:UpdateVoiceTemplate' :: UpdateVoiceTemplate -> Text
$sel:createNewVersion:UpdateVoiceTemplate' :: UpdateVoiceTemplate -> Maybe Bool
$sel:version:UpdateVoiceTemplate' :: UpdateVoiceTemplate -> 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
"/voice"]

instance Core.ToQuery UpdateVoiceTemplate where
  toQuery :: UpdateVoiceTemplate -> QueryString
toQuery UpdateVoiceTemplate' {Maybe Bool
Maybe Text
Text
VoiceTemplateRequest
voiceTemplateRequest :: VoiceTemplateRequest
templateName :: Text
createNewVersion :: Maybe Bool
version :: Maybe Text
$sel:voiceTemplateRequest:UpdateVoiceTemplate' :: UpdateVoiceTemplate -> VoiceTemplateRequest
$sel:templateName:UpdateVoiceTemplate' :: UpdateVoiceTemplate -> Text
$sel:createNewVersion:UpdateVoiceTemplate' :: UpdateVoiceTemplate -> Maybe Bool
$sel:version:UpdateVoiceTemplate' :: UpdateVoiceTemplate -> 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:/ '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
(UpdateVoiceTemplateResponse
 -> UpdateVoiceTemplateResponse -> Bool)
-> (UpdateVoiceTemplateResponse
    -> UpdateVoiceTemplateResponse -> Bool)
-> Eq UpdateVoiceTemplateResponse
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]
(Int -> ReadS UpdateVoiceTemplateResponse)
-> ReadS [UpdateVoiceTemplateResponse]
-> ReadPrec UpdateVoiceTemplateResponse
-> ReadPrec [UpdateVoiceTemplateResponse]
-> Read 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
(Int -> UpdateVoiceTemplateResponse -> ShowS)
-> (UpdateVoiceTemplateResponse -> String)
-> ([UpdateVoiceTemplateResponse] -> ShowS)
-> Show UpdateVoiceTemplateResponse
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.
 UpdateVoiceTemplateResponse -> Rep UpdateVoiceTemplateResponse x)
-> (forall x.
    Rep UpdateVoiceTemplateResponse x -> UpdateVoiceTemplateResponse)
-> Generic UpdateVoiceTemplateResponse
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' :: Int -> MessageBody -> UpdateVoiceTemplateResponse
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 :: (Int -> f Int)
-> UpdateVoiceTemplateResponse -> f UpdateVoiceTemplateResponse
updateVoiceTemplateResponse_httpStatus = (UpdateVoiceTemplateResponse -> Int)
-> (UpdateVoiceTemplateResponse
    -> Int -> UpdateVoiceTemplateResponse)
-> Lens
     UpdateVoiceTemplateResponse UpdateVoiceTemplateResponse Int Int
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 :: (MessageBody -> f MessageBody)
-> UpdateVoiceTemplateResponse -> f UpdateVoiceTemplateResponse
updateVoiceTemplateResponse_messageBody = (UpdateVoiceTemplateResponse -> MessageBody)
-> (UpdateVoiceTemplateResponse
    -> MessageBody -> UpdateVoiceTemplateResponse)
-> Lens
     UpdateVoiceTemplateResponse
     UpdateVoiceTemplateResponse
     MessageBody
     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