Skip to content

Commit

Permalink
[EventGrid] Add Azure Communication Service Events
Browse files Browse the repository at this point in the history
This change adds typings for the new events sent by the Azure
Communication Services
  • Loading branch information
ellismg committed Sep 23, 2020
1 parent 5fa7f3f commit 47c591f
Show file tree
Hide file tree
Showing 6 changed files with 812 additions and 15 deletions.
1 change: 1 addition & 0 deletions sdk/eventgrid/eventgrid/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 3.0.0-beta.2 (Unreleased)

- Added support for system events sent by the Azure Communication Services.

## 3.0.0-beta.1 (2020-09-08)

Expand Down
267 changes: 267 additions & 0 deletions sdk/eventgrid/eventgrid/src/generated/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3039,6 +3039,273 @@ export interface WebAppServicePlanUpdatedEventDataSku {
capacity?: string;
}

/**
* Schema of common properties of all chat events
*/
export interface ACSChatEventBaseProperties {
/**
* The MRI of the target user
*/
recipientId?: string;
/**
* The transaction id will be used as co-relation vector
*/
transactionId?: string;
/**
* The chat thread id
*/
threadId?: string;
}

/**
* Schema of common properties of all chat message events
*/
export type ACSChatMessageEventBaseProperties = ACSChatEventBaseProperties & {
/**
* The chat message id
*/
messageId?: string;
/**
* The MRI of the sender
*/
senderId?: string;
/**
* The display name of the sender
*/
senderDisplayName?: string;
/**
* The original compose time of the message
*/
composeTime?: Date;
/**
* The type of the message
*/
type?: string;
/**
* The version of the message
*/
version?: number;
};

/**
* Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceived event.
*/
export type ACSChatMessageReceivedEventData = ACSChatMessageEventBaseProperties & {
/**
* The body of the chat message
*/
messageBody?: string;
};

/**
* Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageEdited event.
*/
export type ACSChatMessageEditedEventData = ACSChatMessageEventBaseProperties & {
/**
* The body of the chat message
*/
messageBody?: string;
/**
* The time at which the message was edited
*/
editTime?: Date;
};

/**
* Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeleted event.
*/
export type ACSChatMessageDeletedEventData = ACSChatMessageEventBaseProperties & {
/**
* The time at which the message was deleted
*/
deleteTime?: Date;
};

/**
* Schema of common properties of all chat thread events
*/
export type ACSChatThreadEventBaseProperties = ACSChatEventBaseProperties & {
/**
* The original creation time of the thread
*/
createTime?: Date;
/**
* The version of the thread
*/
version?: number;
};

/**
* Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadCreatedWithUser event.
*/
export type ACSChatThreadCreatedWithUserEventData = ACSChatThreadEventBaseProperties & {
/**
* The MRI of the creator of the thread
*/
createdBy?: string;
/**
* The thread properties
*/
properties?: { [propertyName: string]: any };
/**
* The list of properties of users who are part of the thread
*/
members?: ACSChatThreadMemberProperties[];
};

/**
* Schema of the chat thread member
*/
export interface ACSChatThreadMemberProperties {
/**
* The name of the user
*/
displayName?: string;
/**
* The MRI of the user
*/
memberId?: string;
}

/**
* Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadWithUserDeleted event.
*/
export type ACSChatThreadWithUserDeletedEventData = ACSChatThreadEventBaseProperties & {
/**
* The MRI of the user who deleted the thread
*/
deletedBy?: string;
/**
* The deletion time of the thread
*/
deleteTime?: Date;
};

/**
* Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event.
*/
export type ACSChatThreadPropertiesUpdatedPerUserEventData = ACSChatThreadEventBaseProperties & {
/**
* The MRI of the user who updated the thread properties
*/
editedBy?: string;
/**
* The time at which the properties of the thread were updated
*/
editTime?: Date;
/**
* The updated thread properties
*/
properties?: { [propertyName: string]: any };
};

/**
* Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMemberAddedToThreadWithUser event.
*/
export type ACSChatMemberAddedToThreadWithUserEventData = ACSChatThreadEventBaseProperties & {
/**
* The time at which the user was added to the thread
*/
time?: Date;
/**
* The MRI of the user who added the user
*/
addedBy?: string;
/**
* The details of the user who was added
*/
memberAdded?: ACSChatThreadMemberProperties;
};

/**
* Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMemberRemovedFromThreadWithUser event.
*/
export type ACSChatMemberRemovedFromThreadWithUserEventData = ACSChatThreadEventBaseProperties & {
/**
* The time at which the user was removed to the thread
*/
time?: Date;
/**
* The MRI of the user who removed the user
*/
removedBy?: string;
/**
* The details of the user who was removed
*/
memberRemoved?: ACSChatThreadMemberProperties;
};

/**
* Schema of common properties of all SMS events
*/
export interface AcssmsEventBaseProperties {
/**
* The identity of the SMS message
*/
messageId?: string;
/**
* The identity of SMS message sender
*/
from?: string;
/**
* The identity of SMS message receiver
*/
to?: string;
}

/**
* Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSDeliveryReportReceived event.
*/
export type AcssmsDeliveryReportReceivedEventData = AcssmsEventBaseProperties & {
/**
* Status of Delivery
*/
deliveryStatus?: string;
/**
* Details about Delivery Status
*/
deliveryStatusDetails?: string;
/**
* List of details of delivery attempts made
*/
deliveryAttempts?: AcssmsDeliveryAttemptProperties[];
/**
* The time at which the SMS delivery report was received
*/
receivedTimestamp?: Date;
};

/**
* Schema for details of a delivery attempt
*/
export interface AcssmsDeliveryAttemptProperties {
/**
* TimeStamp when delivery was attempted
*/
timestamp?: Date;
/**
* Number of segments that were successfully delivered
*/
segmentsSucceeded?: number;
/**
* Number of segments whose delivery failed
*/
segmentsFailed?: number;
}

/**
* Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSReceived event.
*/
export type AcssmsReceivedEventData = AcssmsEventBaseProperties & {
/**
* The SMS content
*/
message?: string;
/**
* The time at which the SMS was received
*/
receivedTimestamp?: Date;
};
/**
* Defines values for AppAction.
*/
Expand Down
Loading

0 comments on commit 47c591f

Please sign in to comment.