#[non_exhaustive]pub struct PushSubscriptionCreateInput<'a> {
pub client_id: Option<&'a str>,
pub device_client_id: &'a str,
pub url: &'a str,
pub expires: Option<&'a UTCDate>,
pub types: Option<&'a [&'a str]>,
pub chat_push: Option<&'a [(&'a Id, ChatPushConfig)]>,
}Expand description
Input parameters for PushSubscription/set create (RFC 8620 §7.2).
Creates a PushSubscription with the optional chatPush extension
(draft-atwood-jmap-chat-push-00 §3.1).
device_client_id and url have no safe defaults and must always be supplied.
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.client_id: Option<&'a str>Caller-supplied creation key. When None, a ULID is generated automatically.
device_client_id: &'a strStable client device identifier, used by the server to deduplicate subscriptions.
url: &'a strPush endpoint URL registered with the platform push service.
expires: Option<&'a UTCDate>Subscription expiry time. None lets the server choose.
types: Option<&'a [&'a str]>Data type names to include in StateChange notifications.
None means the server delivers all changed types.
chat_push: Option<&'a [(&'a Id, ChatPushConfig)]>Per-account ChatPushConfig entries for inline push. Each entry is
(accountId, config). Pass None to omit the chatPush property.
Implementations§
Source§impl<'a> PushSubscriptionCreateInput<'a>
impl<'a> PushSubscriptionCreateInput<'a>
Sourcepub fn new(device_client_id: &'a str, url: &'a str) -> Self
pub fn new(device_client_id: &'a str, url: &'a str) -> Self
Create a PushSubscriptionCreateInput with required fields; optional fields default to None.
Sourcepub fn with_client_id(self, id: &'a str) -> Self
pub fn with_client_id(self, id: &'a str) -> Self
Set the caller-supplied creation key (overrides the auto-generated ULID).
Sourcepub fn with_types(self, types: &'a [&'a str]) -> Self
pub fn with_types(self, types: &'a [&'a str]) -> Self
Restrict StateChange notifications to these data type names.
Sourcepub fn with_chat_push(self, chat_push: &'a [(&'a Id, ChatPushConfig)]) -> Self
pub fn with_chat_push(self, chat_push: &'a [(&'a Id, ChatPushConfig)]) -> Self
Attach per-account ChatPushConfig entries for inline push.