Reference documentation and code samples for the Google Apps Chat V1 Client class CreateMessageRequest.
Creates a message.
Generated from protobuf message google.chat.v1.CreateMessageRequest
Namespace
Google \ Apps \ Chat \ V1Methods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ parent |
string
Required. The resource name of the space in which to create a message. Format: |
↳ message |
Message
Required. Message body. |
↳ thread_key |
string
Optional. Deprecated: Use thread.thread_key instead. ID for the thread. Supports up to 4000 characters. To start or add to a thread, create a message and specify a |
↳ request_id |
string
Optional. A unique ID for this request. A random UUID is recommended. Specifying a request ID makes the request idempotent, which ensures that multiple identical requests with the same request ID result in only a single message being created. Subsequent requests with the same request ID return the existing message and do not update the message, even if the requested details differ from the current state. To use this field effectively: - Ensure that subsequent requests are identical and use the same authentication credentials as the original request. - If a message was already created with the provided request ID, the request returns that message. Note that the returned message might not be fully populated; the API echoes the message in your request with the system-assigned resource names populated. To retrieve the latest metadata for the message, call |
↳ message_reply_option |
int
Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces. When responding to user interactions, this field is ignored. For interactions within a thread, the reply is created in the same thread. Otherwise, the reply is created as a new thread. |
↳ message_id |
string
Optional. A custom ID for a message. Lets Chat apps get, update, or delete a message without needing to store the system-assigned ID in the message's resource name (represented in the message |
↳ create_message_notification_options |
CreateMessageNotificationOptions
Optional. Controls the notification behavior when the message is posted. To learn more, see Force notifications or send silent messages. |
getParent
Required. The resource name of the space in which to create a message.
Format: spaces/{space}
| Returns | |
|---|---|
| Type | Description |
string |
|
setParent
Required. The resource name of the space in which to create a message.
Format: spaces/{space}
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getMessage
Required. Message body.
| Returns | |
|---|---|
| Type | Description |
Message|null |
|
hasMessage
clearMessage
setMessage
Required. Message body.
| Parameter | |
|---|---|
| Name | Description |
var |
Message
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getThreadKey
Optional. Deprecated: Use
thread.thread_key instead. ID for the
thread. Supports up to 4000 characters. To start or add to a thread, create
a message and specify a threadKey or the
thread.name. For example usage, see Start or
reply to a message
thread.
| Returns | |
|---|---|
| Type | Description |
string |
|
setThreadKey
Optional. Deprecated: Use
thread.thread_key instead. ID for the
thread. Supports up to 4000 characters. To start or add to a thread, create
a message and specify a threadKey or the
thread.name. For example usage, see Start or
reply to a message
thread.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getRequestId
Optional. A unique ID for this request. A random UUID is recommended.
Specifying a request ID makes the request idempotent, which ensures that multiple identical requests with the same request ID result in only a single message being created. Subsequent requests with the same request ID return the existing message and do not update the message, even if the requested details differ from the current state. To use this field effectively:
- Ensure that subsequent requests are identical and use the same authentication credentials as the original request.
- If a message was already created with the provided request ID, the
request returns that message. Note that the returned message might not be
fully populated; the API echoes the message in your request with the
system-assigned resource names populated. To retrieve the latest metadata
for the message, call
GetMessage. - Reusing an existing request ID with a different authenticated user results in an error.
| Returns | |
|---|---|
| Type | Description |
string |
|
setRequestId
Optional. A unique ID for this request. A random UUID is recommended.
Specifying a request ID makes the request idempotent, which ensures that multiple identical requests with the same request ID result in only a single message being created. Subsequent requests with the same request ID return the existing message and do not update the message, even if the requested details differ from the current state. To use this field effectively:
- Ensure that subsequent requests are identical and use the same authentication credentials as the original request.
- If a message was already created with the provided request ID, the
request returns that message. Note that the returned message might not be
fully populated; the API echoes the message in your request with the
system-assigned resource names populated. To retrieve the latest metadata
for the message, call
GetMessage. - Reusing an existing request ID with a different authenticated user results in an error.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getMessageReplyOption
Optional. Specifies whether a message starts a thread or replies to one.
Only supported in named spaces. When responding to user interactions, this field is ignored. For interactions within a thread, the reply is created in the same thread. Otherwise, the reply is created as a new thread.
| Returns | |
|---|---|
| Type | Description |
int |
Enum of type MessageReplyOption. |
setMessageReplyOption
Optional. Specifies whether a message starts a thread or replies to one.
Only supported in named spaces. When responding to user interactions, this field is ignored. For interactions within a thread, the reply is created in the same thread. Otherwise, the reply is created as a new thread.
| Parameter | |
|---|---|
| Name | Description |
var |
int
Enum of type MessageReplyOption. |
| Returns | |
|---|---|
| Type | Description |
$this |
|
getMessageId
Optional. A custom ID for a message. Lets Chat apps get, update, or delete
a message without needing to store the system-assigned ID in the message's
resource name (represented in the message name field).
The value for this field must meet the following requirements:
- Begins with
client-. For example,client-custom-nameis a valid custom ID, butcustom-nameis not. - Contains up to 63 characters and only lowercase letters, numbers, and hyphens.
- Is unique within a space. A Chat app can't use the same custom ID for different messages. For details, see Name a message.
| Returns | |
|---|---|
| Type | Description |
string |
|
setMessageId
Optional. A custom ID for a message. Lets Chat apps get, update, or delete
a message without needing to store the system-assigned ID in the message's
resource name (represented in the message name field).
The value for this field must meet the following requirements:
- Begins with
client-. For example,client-custom-nameis a valid custom ID, butcustom-nameis not. - Contains up to 63 characters and only lowercase letters, numbers, and hyphens.
- Is unique within a space. A Chat app can't use the same custom ID for different messages. For details, see Name a message.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getCreateMessageNotificationOptions
Optional. Controls the notification behavior when the message is posted.
To learn more, see Force notifications or send silent messages.
| Returns | |
|---|---|
| Type | Description |
CreateMessageNotificationOptions|null |
|
hasCreateMessageNotificationOptions
clearCreateMessageNotificationOptions
setCreateMessageNotificationOptions
Optional. Controls the notification behavior when the message is posted.
To learn more, see Force notifications or send silent messages.
| Parameter | |
|---|---|
| Name | Description |
var |
CreateMessageNotificationOptions
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
static::build
| Parameters | |
|---|---|
| Name | Description |
parent |
string
Required. The resource name of the space in which to create a message. Format: |
message |
Message
Required. Message body. |
messageId |
string
Optional. A custom ID for a message. Lets Chat apps get, update, or delete
a message without needing to store the system-assigned ID in the message's
resource name (represented in the message The value for this field must meet the following requirements:
For details, see Name a message. |
| Returns | |
|---|---|
| Type | Description |
CreateMessageRequest |
|