pub struct Draft { /* private fields */ }Expand description
Represents a message draft.
Modified from openapi-generator-cli output:
$ openapi-generator-cli generate -g rust -i ./zerver/openapi/zulip.yaml -o zulip-openapi --skip-validate-spec/*
* Zulip REST API
*
* Powerful open source group chat
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/See zerver/openapi/zulip.yaml for the original OpenAPI configuration.
Configuration slightly modified to work with the Rust generator of openapi-generator-cli.
Implementations§
Source§impl Draft
impl Draft
Sourcepub const fn id(&self) -> Option<i64>
pub const fn id(&self) -> Option<i64>
Gets the Draft id.
The unique ID of the draft.
It will only used whenever the drafts are fetched.
This field should not be specified when the draft is being created or edited.
Sourcepub fn set_id(&mut self, val: i64)
pub fn set_id(&mut self, val: i64)
Sets the Draft id.
The unique ID of the draft.
It will only used whenever the drafts are fetched.
This field should not be specified when the draft is being created or edited.
Sourcepub fn unset_id(&mut self) -> Option<i64>
pub fn unset_id(&mut self) -> Option<i64>
Unsets the Draft id.
The unique ID of the draft.
It will only used whenever the drafts are fetched.
This field should not be specified when the draft is being created or edited.
Sourcepub fn with_id(self, val: i64) -> Self
pub fn with_id(self, val: i64) -> Self
Builder function that sets the Draft id.
The unique ID of the draft.
It will only used whenever the drafts are fetched.
This field should not be specified when the draft is being created or edited.
Sourcepub const fn timestamp(&self) -> Option<u64>
pub const fn timestamp(&self) -> Option<u64>
Gets the Draft timestamp.
A Unix timestamp (seconds only) representing when the draft was last edited.
When creating a draft, this key need not be present and it will be filled in automatically by the server.
Sourcepub fn set_timestamp(&mut self, val: u64)
pub fn set_timestamp(&mut self, val: u64)
Sets the Draft timestamp.
A Unix timestamp (seconds only) representing when the draft was last edited.
When creating a draft, this key need not be present and it will be filled in automatically by the server.
Sourcepub fn unset_timestamp(&mut self) -> Option<u64>
pub fn unset_timestamp(&mut self) -> Option<u64>
Unsets the Draft timestamp.
A Unix timestamp (seconds only) representing when the draft was last edited.
When creating a draft, this key need not be present and it will be filled in automatically by the server.
Sourcepub fn with_timestamp(self, val: u64) -> Self
pub fn with_timestamp(self, val: u64) -> Self
Builder function that sets the Draft timestamp.
A Unix timestamp (seconds only) representing when the draft was last edited.
When creating a draft, this key need not be present and it will be filled in automatically by the server.
Source§impl Draft
impl Draft
Sourcepub const fn draft_type(&self) -> DraftType
pub const fn draft_type(&self) -> DraftType
Gets the Draft draft_type.
The type of the draft.
Either unaddressed (empty string), \"stream\", or \"private\" (for one-on-one and group direct messages).
Sourcepub fn set_draft_type(&mut self, val: DraftType)
pub fn set_draft_type(&mut self, val: DraftType)
Sets the Draft draft_type.
The type of the draft.
Either unaddressed (empty string), \"stream\", or \"private\" (for one-on-one and group direct messages).
Sourcepub fn with_draft_type(self, val: DraftType) -> Self
pub fn with_draft_type(self, val: DraftType) -> Self
Builder function that sets the Draft draft_type.
The type of the draft.
Either unaddressed (empty string), \"stream\", or \"private\" (for one-on-one and group direct messages).
Source§impl Draft
impl Draft
Sourcepub fn to(&self) -> &[u64]
pub fn to(&self) -> &[u64]
Gets the Draft to.
An array of the tentative target audience IDs.
For channel messages, this should contain exactly 1 ID, the ID of the target channel.
For direct messages, this should be an array of target user IDs.
For unaddressed drafts, this is ignored, and clients should send an empty array.
Sourcepub fn set_to<'a, C: Into<Cow<'a, [u64]>>>(&mut self, val: C)
pub fn set_to<'a, C: Into<Cow<'a, [u64]>>>(&mut self, val: C)
Sets the Draft to.
An array of the tentative target audience IDs.
For channel messages, this should contain exactly 1 ID, the ID of the target channel.
For direct messages, this should be an array of target user IDs.
For unaddressed drafts, this is ignored, and clients should send an empty array.
Sourcepub fn with_to<'a, C: Into<Cow<'a, [u64]>>>(self, val: C) -> Self
pub fn with_to<'a, C: Into<Cow<'a, [u64]>>>(self, val: C) -> Self
Builder function that sets the Draft to.
An array of the tentative target audience IDs.
For channel messages, this should contain exactly 1 ID, the ID of the target channel.
For direct messages, this should be an array of target user IDs.
For unaddressed drafts, this is ignored, and clients should send an empty array.
Sourcepub fn topic(&self) -> &str
pub fn topic(&self) -> &str
Gets the Draft topic.
For channel message drafts, the tentative topic name.
For direct or unaddressed messages, this will be ignored and should ideally be the empty string.
Should not contain null bytes.
Sourcepub fn set_topic<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
pub fn set_topic<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
Sets the Draft topic.
For channel message drafts, the tentative topic name.
For direct or unaddressed messages, this will be ignored and should ideally be the empty string.
Should not contain null bytes.
Sourcepub fn with_topic<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
pub fn with_topic<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
Builder function that sets the Draft topic.
For channel message drafts, the tentative topic name.
For direct or unaddressed messages, this will be ignored and should ideally be the empty string.
Should not contain null bytes.