#[non_exhaustive]pub struct CreateMessageRequest {
pub parent: String,
pub message: Option<Message>,
pub thread_key: String,
pub request_id: String,
pub message_reply_option: MessageReplyOption,
pub message_id: String,
pub create_message_notification_options: Option<CreateMessageNotificationOptions>,
/* private fields */
}Expand description
Creates a message.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.parent: StringRequired. The resource name of the space in which to create a message.
Format: spaces/{space}
message: Option<Message>Required. Message body.
thread_key: StringOptional. 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.
request_id: StringOptional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.
message_reply_option: MessageReplyOptionOptional. 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: StringOptional. 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.
create_message_notification_options: Option<CreateMessageNotificationOptions>Optional. Controls the notification behavior when the message is posted. To learn more, see Force notifications or send silent messages.
Implementations§
Source§impl CreateMessageRequest
impl CreateMessageRequest
Sourcepub fn set_parent<T: Into<String>>(self, v: T) -> Self
pub fn set_parent<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_message<T>(self, v: T) -> Self
pub fn set_message<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_message<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_message<T>(self, v: Option<T>) -> Self
Sourcepub fn set_thread_key<T: Into<String>>(self, v: T) -> Self
👎Deprecated
pub fn set_thread_key<T: Into<String>>(self, v: T) -> Self
Sets the value of thread_key.
§Example
let x = CreateMessageRequest::new().set_thread_key("example");Sourcepub fn set_request_id<T: Into<String>>(self, v: T) -> Self
pub fn set_request_id<T: Into<String>>(self, v: T) -> Self
Sets the value of request_id.
§Example
let x = CreateMessageRequest::new().set_request_id("example");Sourcepub fn set_message_reply_option<T: Into<MessageReplyOption>>(self, v: T) -> Self
pub fn set_message_reply_option<T: Into<MessageReplyOption>>(self, v: T) -> Self
Sets the value of message_reply_option.
§Example
use google_chat_v1::model::create_message_request::MessageReplyOption;
let x0 = CreateMessageRequest::new().set_message_reply_option(MessageReplyOption::ReplyMessageFallbackToNewThread);
let x1 = CreateMessageRequest::new().set_message_reply_option(MessageReplyOption::ReplyMessageOrFail);Sourcepub fn set_message_id<T: Into<String>>(self, v: T) -> Self
pub fn set_message_id<T: Into<String>>(self, v: T) -> Self
Sets the value of message_id.
§Example
let x = CreateMessageRequest::new().set_message_id("example");Sourcepub fn set_create_message_notification_options<T>(self, v: T) -> Selfwhere
T: Into<CreateMessageNotificationOptions>,
pub fn set_create_message_notification_options<T>(self, v: T) -> Selfwhere
T: Into<CreateMessageNotificationOptions>,
Sets the value of create_message_notification_options.
§Example
use google_chat_v1::model::CreateMessageNotificationOptions;
let x = CreateMessageRequest::new().set_create_message_notification_options(CreateMessageNotificationOptions::default()/* use setters */);Sourcepub fn set_or_clear_create_message_notification_options<T>(
self,
v: Option<T>,
) -> Selfwhere
T: Into<CreateMessageNotificationOptions>,
pub fn set_or_clear_create_message_notification_options<T>(
self,
v: Option<T>,
) -> Selfwhere
T: Into<CreateMessageNotificationOptions>,
Sets or clears the value of create_message_notification_options.
§Example
use google_chat_v1::model::CreateMessageNotificationOptions;
let x = CreateMessageRequest::new().set_or_clear_create_message_notification_options(Some(CreateMessageNotificationOptions::default()/* use setters */));
let x = CreateMessageRequest::new().set_or_clear_create_message_notification_options(None::<CreateMessageNotificationOptions>);Trait Implementations§
Source§impl Clone for CreateMessageRequest
impl Clone for CreateMessageRequest
Source§fn clone(&self) -> CreateMessageRequest
fn clone(&self) -> CreateMessageRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more