Reference documentation and code samples for the Google Apps Chat V1 Client class DeleteMessageRequest.
Request to delete a message.
Generated from protobuf message google.chat.v1.DeleteMessageRequest
Namespace
Google \ Apps \ Chat \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Required. Resource name of the message. Format: spaces/{space}/messages/{message} If you've set a custom ID for your message, you can use the value from the clientAssignedMessageId field for {message}. For details, see Name a message.
↳ force
bool
Optional. When true, deleting a message also deletes its threaded replies. When false, if a message has threaded replies, deletion fails. Only applies when authenticating as a user. Has no effect when authenticating as a Chat app.
getName
Required. Resource name of the message.
Format: spaces/{space}/messages/{message}
If you've set a custom ID for your message, you can use the value from the
clientAssignedMessageId field for {message}. For details, see Name a
message.
Returns
Type
Description
string
setName
Required. Resource name of the message.
Format: spaces/{space}/messages/{message}
If you've set a custom ID for your message, you can use the value from the
clientAssignedMessageId field for {message}. For details, see Name a
message.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getForce
Optional. When true, deleting a message also deletes its threaded
replies. When false, if a message has threaded replies, deletion fails.
If you've set a custom ID for your message, you can use the value from the
clientAssignedMessageId field for {message}. For details, see Name a
message. Please see
ChatServiceClient::messageName() for help formatting this field.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Apps Chat V1 Client - Class DeleteMessageRequest (0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/php/docs/reference/apps-chat/latest/Chat.V1.DeleteMessageRequest)\n- [0.11.2](/php/docs/reference/apps-chat/0.11.2/Chat.V1.DeleteMessageRequest)\n- [0.10.0](/php/docs/reference/apps-chat/0.10.0/Chat.V1.DeleteMessageRequest)\n- [0.9.0](/php/docs/reference/apps-chat/0.9.0/Chat.V1.DeleteMessageRequest)\n- [0.8.1](/php/docs/reference/apps-chat/0.8.1/Chat.V1.DeleteMessageRequest)\n- [0.7.2](/php/docs/reference/apps-chat/0.7.2/Chat.V1.DeleteMessageRequest)\n- [0.6.1](/php/docs/reference/apps-chat/0.6.1/Chat.V1.DeleteMessageRequest)\n- [0.5.0](/php/docs/reference/apps-chat/0.5.0/Chat.V1.DeleteMessageRequest)\n- [0.4.0](/php/docs/reference/apps-chat/0.4.0/Chat.V1.DeleteMessageRequest)\n- [0.3.0](/php/docs/reference/apps-chat/0.3.0/Chat.V1.DeleteMessageRequest)\n- [0.2.0](/php/docs/reference/apps-chat/0.2.0/Chat.V1.DeleteMessageRequest)\n- [0.1.4](/php/docs/reference/apps-chat/0.1.4/Chat.V1.DeleteMessageRequest) \nReference documentation and code samples for the Google Apps Chat V1 Client class DeleteMessageRequest.\n\nRequest to delete a message.\n\nGenerated from protobuf message `google.chat.v1.DeleteMessageRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Apps \\\\ Chat \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nRequired. Resource name of the message.\n\nFormat: `spaces/{space}/messages/{message}`\nIf you've set a custom ID for your message, you can use the value from the\n`clientAssignedMessageId` field for `{message}`. For details, see [Name a\nmessage](https://developers.google.com/workspace/chat/create-messages#name_a_created_message).\n\n### setName\n\nRequired. Resource name of the message.\n\nFormat: `spaces/{space}/messages/{message}`\nIf you've set a custom ID for your message, you can use the value from the\n`clientAssignedMessageId` field for `{message}`. For details, see [Name a\nmessage](https://developers.google.com/workspace/chat/create-messages#name_a_created_message).\n\n### getForce\n\nOptional. When `true`, deleting a message also deletes its threaded\nreplies. When `false`, if a message has threaded replies, deletion fails.\n\nOnly applies when [authenticating as a\nuser](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).\nHas no effect when [authenticating as a Chat app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).\n\n### setForce\n\nOptional. When `true`, deleting a message also deletes its threaded\nreplies. When `false`, if a message has threaded replies, deletion fails.\n\nOnly applies when [authenticating as a\nuser](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).\nHas no effect when [authenticating as a Chat app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).\n\n### static::build"]]