Skip to content

Commit

Permalink
new events
Browse files Browse the repository at this point in the history
  • Loading branch information
l0lawrence committed Apr 24, 2024
1 parent c744c80 commit cd66f0e
Show file tree
Hide file tree
Showing 6 changed files with 617 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ model AvsClusterFailedEventData extends AvsClusterEventData {
failureMessage?: string;
}

/** Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionStarted event. */
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "Maintain compatibility with existing models."
model AvsScriptExecutionStartedEventData extends AvsScriptExecutionEventData {}

/** Schema of the Data property of an EventGridEvent for a Microsoft.AVS.ScriptExecutionFinished event. */
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "Maintain compatibility with existing models."
model AvsScriptExecutionFinishedEventData extends AvsScriptExecutionEventData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ using Azure.ClientGenerator.Core;
@@access(Microsoft.EventGrid.SystemEvents.AvsClusterFailedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionStartedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionStartedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AvsScriptExecutionFinishedEventData,
Usage.output
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,9 @@ union AcsUserEngagement {

/** Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. */
model CommunicationIdentifierModel {
/** The identifier kind. Only required in responses. */
kind?: CommunicationIdentifierModelKind;

/** Raw Id of the identifier. Optional in requests, required in responses. */
rawId?: string;

Expand All @@ -1044,6 +1047,26 @@ model CommunicationIdentifierModel {

/** The Microsoft Teams user. */
microsoftTeamsUser?: MicrosoftTeamsUserIdentifierModel;

/** The Microsoft Teams application. */
microsoftTeamsApp?: MicrosoftTeamsAppIdentifierModel;
}

union CommunicationIdentifierModelKind {
"unknown",
"communicationUser",
"phoneNumber",
"microsoftTeamsUser",
string,
}

/** A Microsoft Teams application. */
model MicrosoftTeamsAppIdentifierModel {
/** The Id of the Microsoft Teams application */
appId: string;

/** The cloud that the Microsoft Teams application belongs to. By default 'public' if missing. */
cloud?: CommunicationCloudEnvironmentModel;
}

/** A Microsoft Teams user. */
Expand Down Expand Up @@ -1094,6 +1117,161 @@ model AcsRouterWorkerUpdatedEventData {
updatedWorkerProperties?: AcsRouterUpdatedWorkerProperty[];
}

/** Schema of the Data property of an EventGridEvent for a Microsoft.Communication.AdvancedMessageDeliveryStatusUpdated event. */
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "Maintain compatibility with existing models."
model AcsMessageDeliveryStatusUpdatedEventData extends AcsMessageEventData {
/** The message id */
messageId?: string;

/** The updated message status */
status?: AcsMessageDeliveryStatus;

/** The updated message channel type */
channelType?: AcsMessageChannelKind;
}

/** Schema of the Data property of an EventGridEvent for a Microsoft.Communication.AdvancedMessageReceived event. */
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "Maintain compatibility with existing models."
model AcsMessageReceivedEventData extends AcsMessageEventData {
/** The message content */
content?: string;

/** The message channel type */
channelType?: AcsMessageChannelKind;

/** The received message media content */
media?: AcsMessageMediaContent;

/** The received message context */
context?: AcsMessageContext;

/** The received message button content */
button?: AcsMessageButtonContent;

/** The received message interactive content */
interactive?: AcsMessageInteractiveContent;
}

/** Message Media Content */
model AcsMessageMediaContent {
/** The MIME type of the file this media represents */
mimeType?: string;

/** The media identifier */
id?: string;

/** The filename of the underlying media file as specified when uploaded */
filename?: string;

/** The caption for the media object, if supported and provided */
caption?: string;
}

/** Message Context */
model AcsMessageContext {
/** The WhatsApp ID for the customer who replied to an inbound message. */
from?: string;

/** The message ID for the sent message for an inbound reply */
id?: string;
}

/** Message Button Content */
model AcsMessageButtonContent {
/** The Text of the button */
text?: string;

/** The Payload of the button which was clicked by the user, setup by the business */
payload?: string;
}

/** Message Interactive Content */
model AcsMessageInteractiveContent {
/** The Message interactive reply type */
type?: AcsInteractiveReplyKind;

/** The Message Sent when a customer clicks a button */
buttonReply?: AcsMessageInteractiveButtonReplyContent;

/** The Message Sent when a customer selects an item from a list */
listReply?: AcsMessageInteractiveListReplyContent;
}

/** Message Interactive button reply content for a user to business message */
model AcsMessageInteractiveButtonReplyContent {
/** The ID of the button */
id?: string;

/** The title of the button */
title?: string;
}

/** Message Interactive list reply content for a user to business message */
model AcsMessageInteractiveListReplyContent {
/** The ID of the selected list item */
id?: string;

/** The title of the selected list item */
title?: string;

/** The sescription of the selected row */
description?: string;
}

/** Schema of common properties of all chat thread events */
model AcsMessageEventData {
/** The message sender */
from?: string;

/** The message recipient */
to?: string;

/** The time message was received */
receivedTimeStamp?: utcDateTime;

/** The channel event error */
error?: AcsMessageChannelEventError;
}

/** Message Channel Event Error */
model AcsMessageChannelEventError {
/** The channel error code */
channelCode?: string;

/** The channel error message */
channelMessage?: string;
}

union AcsInteractiveReplyKind {
/** Messaged interactive reply type is ButtonReply */
"buttonReply",

/** Messaged interactive reply type is ListReply */
"listReply",

/** Messaged interactive reply type is Unknown */
"unknown",

string,
}

union AcsMessageChannelKind {
/** Updated message channel type is Whatsapp */
"whatsapp",

string,
}

union AcsMessageDeliveryStatus {
"Read",
"Delivered",
"Failed",
"Sent",
"Warning",
"Unknown",
string,
}

union AcsRouterUpdatedWorkerProperty {
"AvailableForOffers",
"TotalCapacity",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,12 @@ using Azure.ClientGenerator.Core;
@@access(Microsoft.EventGrid.SystemEvents.CommunicationIdentifierModel,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.MicrosoftTeamsAppIdentifierModel,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.MicrosoftTeamsUserIdentifierModel,
Usage.output
);
Expand All @@ -400,6 +406,54 @@ using Azure.ClientGenerator.Core;
@@access(Microsoft.EventGrid.SystemEvents.AcsRouterWorkerUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AcsMessageReceivedEventData,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AcsMessageReceivedEventData,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AcsMessageMediaContent, Usage.output);
@@access(Microsoft.EventGrid.SystemEvents.AcsMessageMediaContent,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AcsMessageContext, Usage.output);
@@access(Microsoft.EventGrid.SystemEvents.AcsMessageContext, Access.public);
@@usage(Microsoft.EventGrid.SystemEvents.AcsMessageButtonContent, Usage.output);
@@access(Microsoft.EventGrid.SystemEvents.AcsMessageButtonContent,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AcsMessageInteractiveContent,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AcsMessageInteractiveContent,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AcsMessageEventData, Usage.output);
@@access(Microsoft.EventGrid.SystemEvents.AcsMessageEventData, Access.public);
@@usage(Microsoft.EventGrid.SystemEvents.AcsMessageChannelEventError,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AcsMessageChannelEventError,
Access.public
);
//Enums
@@usage(Microsoft.EventGrid.SystemEvents.AcsRouterJobStatus, Usage.output);
@@access(Microsoft.EventGrid.SystemEvents.AcsRouterJobStatus, Access.public);
Expand Down Expand Up @@ -427,6 +481,24 @@ using Azure.ClientGenerator.Core;
);
@@usage(Microsoft.EventGrid.SystemEvents.AcsUserEngagement, Usage.output);
@@access(Microsoft.EventGrid.SystemEvents.AcsUserEngagement, Access.public);
@@usage(Microsoft.EventGrid.SystemEvents.CommunicationIdentifierModelKind,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.CommunicationIdentifierModelKind,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AcsInteractiveReplyKind, Usage.output);
@@access(Microsoft.EventGrid.SystemEvents.AcsInteractiveReplyKind,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AcsMessageChannelKind, Usage.output);
@@access(Microsoft.EventGrid.SystemEvents.AcsMessageChannelKind, Access.public);
@@usage(Microsoft.EventGrid.SystemEvents.AcsMessageDeliveryStatus,
Usage.output
);
@@access(Microsoft.EventGrid.SystemEvents.AcsMessageDeliveryStatus,
Access.public
);
@@usage(Microsoft.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty,
Usage.output
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,48 @@ using Azure.ClientGenerator.Core;
"summaryReportBlobUri",
"autorest"
);

@@clientName(Microsoft.EventGrid.SystemEvents.AcsMessageDeliveryStatusUpdatedEventData.channelType,
"channelKind",
"autorest"
);

@@clientName(Microsoft.EventGrid.SystemEvents.AcsMessageReceivedEventData.channelType,
"channelKind",
"autorest"
);

@@clientName(Microsoft.EventGrid.SystemEvents.AcsMessageReceivedEventData.media,
"mediaContent",
"autorest"
);

@@clientName(Microsoft.EventGrid.SystemEvents.AcsMessageReceivedEventData.interactive,
"interactiveContent",
"autorest"
);

@@clientName(Microsoft.EventGrid.SystemEvents.AcsMessageMediaContent.id,
"mediaId",
"autorest"
);

@@clientName(Microsoft.EventGrid.SystemEvents.AcsMessageContext.id,
"messageId",
"autorest"
);

@@clientName(Microsoft.EventGrid.SystemEvents.AcsMessageInteractiveContent.type,
"replyKind",
"autorest"
);

@@clientName(Microsoft.EventGrid.SystemEvents.AcsMessageInteractiveButtonReplyContent.id,
"buttonId",
"autorest"
);

@@clientName(Microsoft.EventGrid.SystemEvents.AcsMessageInteractiveListReplyContent.id,
"listItemId",
"autorest"
);
Loading

0 comments on commit cd66f0e

Please sign in to comment.