global with sharing class PlatformEvent {
* success = false indicates this is an error message.
* Include error details in the withMessage( str ) method.
global PlatformEvent withSuccess(Boolean success){
global PlatformEvent withType(String eType){
// See [Event Types](../../events/types)
global PlatformEvent withRecord(String id){
global PlatformEvent withRecord(SObject obj){
* The SObject name for RecordID
global PlatformEvent withRecordType(String t){
global PlatformEvent withSubject(String s){
global PlatformEvent withMessage(String msg){
global PlatformEvent withContact(Contact c){
global PlatformEvent withContact(String id){
global PlatformEvent withUser(User u){
global PlatformEvent withUser(String userId){
global PlatformEvent withRoom(DocumentRoom__c r){
global PlatformEvent withRoom(String roomId){
global PlatformEvent withRoomItem(DocumentRoomItem__c item){
global PlatformEvent withRoomItem(String itemId){
global PlatformEvent withRoomMember(DocumentRoomMember__c member){
global PlatformEvent withRoomMember(String memberId){
global PlatformEvent withValue(Double val){
* Defaults to current DateTime.now() if not provided.
global PlatformEvent withTimestamp(DateTime dt){
global PlatformEvent withContentDocument(String cid){
global PlatformEvent withContentDocument(ContentDocument dc){
global PlatformEvent withContentVersion(String cid){
global PlatformEvent withContentVersion(ContentVersion cv){
global PlatformEvent withAttachment(String aid){
global rooms__Event__e toRecord(){
// Validates and creates a rooms__Event__e platform event record.
global PlatformEvent publish(){
global class EventException extends Exception{