Skip to content

Commit 4e8d16d

Browse files
grangasamy-msftsamvaitymikeharderl0lawrenceJeremy Meng
authored
Grangasamy/fixing sdk and add new events (#33669)
* Fixing inconsistencies on TypeSpec for SMSReceived event. * Added TypeSpec fix for SMSDeliveryReportReceived events * Bug fixes. * Fixing inconsistencies for Router events * Fixing Inconsistencies in Chat events * Added ChatAzureBotCommand event. * Added ChatTypingIndication event to SDK. * Fixing ChatTyping name from ChatTypingIndicator to ChatTypingIndicatorSent * Removing changes from 2018 jason file. * Bug fixes * Bug fix adding required to the swagger. * Bug fix. Changing the required for GeneratedSystemEvents.json 2018-01-01 * Fixing the required property based on the decorator. * Updated event type to new names ChatTypingIndicatorReceivedInThread and ChatAzureBotCommanReceivedInThread, and made changes accordingly. * Adding Call Started and Call Ended Events. * Added CallParticipant Added and Removed event. * Code optimize * Resolving comments and bug * Fixing common json. * Fixing Calling events schema and Type enum. * Fixing common json * Fixing startedBy property * Ran prettier - Fixing bug * Resolving comments - Prema * Fixing typo * Typo and comments update fix * Fixing the schema * Fixing the schema examples and adding the nullable * Schema fix * Fixing the naming to meaningful * Updating schemas and adding missing schema examples. * Fixing typo and changing enum back to string * Fixing the required parameter of Azure json file. * Fixing required typo * Fixing the typo * Fixing enum * Bug fixes. * Added required properties for calling events * Fixing the version property * Fixing the version. * Bug fix and system events * Fixing the call_ended and call_participant_removed schema examples. * ACS event renames (#34294) * Pushing new auto gen swaggers and manual swaggers * Richard park changes. * Fixing the x-client-name for type property AcsCallEndedByProperties * Schema fix * Fixing chat typing example schema * add examples.json as @example and remove for validation warnings fix * typos/cspell * formatting * Adding format to integer type. * Adding x-ms-examples for the new event schemas * Renamed snapshotCreated to Call/Chat Created x-ms-example. * Adding AcsCallParticipantRoleKind enum. * Fixing AcsCallParticipantRoleKind * Removing "x-ms-example" : "rolekind" * Add JavaScript name customization - AcsCallingEventProperties => AcsCallingEvent - AcsCallParticipantEventProperties => AcsCallParticipantEvent * Add rename for AcsCallParticipantRoleKind to Go casing standards. (#34568) * more js name overrides * js name fix * Generating swaggers. * Fixing the tsp format for client and propertyNameOverride tsp. --------- Co-authored-by: Sameeksha Vaity <savaity@microsoft.com> Co-authored-by: Mike Harder <mharder@microsoft.com> Co-authored-by: Libba Lawrence <llawrence@microsoft.com> Co-authored-by: Jeremy Meng <jeremy.ymeng@gmail.com.com> Co-authored-by: Richard Park <51494936+richardpark-msft@users.noreply.github.com>
1 parent 224a3b0 commit 4e8d16d

34 files changed

+2151
-170
lines changed

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.Communication/AzureCommunicationServices.tsp

+202-31
Large diffs are not rendered by default.

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.Communication/AzureCommunicationServicesExample.tsp

+154-3
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,9 @@ const MicrosoftCommunicationRouterJobUnassignedExample: AcsRouterJobUnassignedEv
395395

396396
// const MicrosoftCommunicationRouterJobWorkerSelectorsExpiredExample: AcsRouterJobWorkerSelectorsExpiredEventData = #{jobId: "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712", channelReference: "test-abc", channelId: "FooVoiceChannelId", queueId: "625fec06-ab81-4e60-b780-f364ed96ade1", labels: #{locale: "en-us", segment: "Enterprise", token: "FooToken"}, tags: #{locale: "en-us", segment: "Enterprise", token: "FooToken"}, expiredRequestedWorkerSelectors: #[#{key: "string", labelOperator: "equal", value: 5, ttlSeconds: "30"}], attachedWorkerSelectorsExpired: #[#{key: "string", labelOperator: "equal", value: 5, ttlSeconds: "35"}]};
397397

398-
const MicrosoftCommunicationRouterWorkerDeletedExample: AcsRouterWorkerDeletedEventData = #{
399-
workerId: "worker3",
400-
};
398+
// const MicrosoftCommunicationRouterWorkerDeletedExample: AcsRouterWorkerDeletedEventData = #{
399+
// workerId: "worker3",
400+
// };
401401

402402
const MicrosoftCommunicationRouterWorkerDeregisteredExample: AcsRouterWorkerDeregisteredEventData = #{
403403
workerId: "worker3",
@@ -603,3 +603,154 @@ const MicrosoftCommunicationAdvancedMessageReceivedExample: AcsMessageReceivedEv
603603
// threadId: "19:9e8eefe67b3c470a8187b4c2b00240bc@thread.v2",
604604
// transactionId: "GBE9MB2a40KEWzexIg0D3A.1.1.1.1.856359041.1"
605605
// };
606+
607+
const AcsCallEndedExample: AcsCallEndedEventData = #{
608+
reason: #{ code: 1, subCode: 1, phrase: "ReasonCode" },
609+
610+
// callDurationInSeconds: 10,
611+
endedBy: #{
612+
communicationIdentifier: #{
613+
kind: "communicationUser",
614+
rawId: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
615+
communicationUser: #{
616+
id: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
617+
},
618+
},
619+
type: "TestCallEndedBy",
620+
name: "TestCallEndedBy",
621+
},
622+
623+
startedBy: #{
624+
communicationIdentifier: #{
625+
kind: "communicationUser",
626+
rawId: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
627+
communicationUser: #{
628+
id: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
629+
},
630+
},
631+
role: "UserRole",
632+
},
633+
serverCallId: "Y3NVcmw",
634+
group: #{ id: "055d13d6-8161-43c8-af88-2110373e1e4a" },
635+
room: #{ id: "055d13d6-8161-43c8-af88-2110373e1e4a" },
636+
isTwoParty: false,
637+
correlationId: "CallIdGuid",
638+
isRoomsCall: false,
639+
};
640+
641+
const AcsCallParticipantAddedExample: AcsCallParticipantAddedEventData = #{
642+
user: #{
643+
communicationIdentifier: #{
644+
kind: "communicationUser",
645+
rawId: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
646+
communicationUser: #{
647+
id: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
648+
},
649+
},
650+
role: "UserRole",
651+
},
652+
displayName: "displayName1",
653+
participantId: "participant1",
654+
userAgent: "endpointType",
655+
startedBy: #{
656+
communicationIdentifier: #{
657+
kind: "communicationUser",
658+
rawId: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
659+
communicationUser: #{
660+
id: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
661+
},
662+
},
663+
role: "UserRole",
664+
},
665+
serverCallId: "Y3NVcmw",
666+
group: #{ id: "6d16b954-0531-4262-9cdd-c4b85da5c5d8" },
667+
room: #{ id: "055d13d6-8161-43c8-af88-2110373e1e4a" },
668+
isTwoParty: false,
669+
correlationId: "CallIdGuid",
670+
isRoomsCall: false,
671+
};
672+
673+
const AcsCallParticipantRemovedExample: AcsCallParticipantRemovedEventData = #{
674+
user: #{
675+
communicationIdentifier: #{
676+
kind: "communicationUser",
677+
rawId: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
678+
communicationUser: #{
679+
id: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
680+
},
681+
},
682+
role: "UserRole",
683+
},
684+
displayName: "displayName1",
685+
participantId: "participant1",
686+
userAgent: "endpointType",
687+
startedBy: #{
688+
communicationIdentifier: #{
689+
kind: "communicationUser",
690+
rawId: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
691+
communicationUser: #{
692+
id: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
693+
},
694+
},
695+
role: "UserRole",
696+
},
697+
serverCallId: "Y3NVcmw",
698+
group: #{ id: "51422183-029d-4750-9db5-c8e5a578f469" },
699+
room: #{ id: "055d13d6-8161-43c8-af88-2110373e1e4a" },
700+
isTwoParty: false,
701+
correlationId: "CallIdGuid",
702+
isRoomsCall: false,
703+
};
704+
705+
const AcsCallStartedExample: AcsCallStartedEventData = #{
706+
startedBy: #{
707+
communicationIdentifier: #{
708+
kind: "communicationUser",
709+
rawId: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
710+
communicationUser: #{
711+
id: "8:acs:d9ff4983-39e7-4420-8d54-f6354ed06ccd_7a668e62-08f4-4ac1-b29e-f01010f57475",
712+
},
713+
},
714+
role: "UserRole",
715+
},
716+
serverCallId: "Y3NVcmw",
717+
group: #{ id: "aca7bf5b-ff44-4f47-8385-cfd4e0232a6e" },
718+
room: #{ id: "055d13d6-8161-43c8-af88-2110373e1e4a" },
719+
isTwoParty: false,
720+
correlationId: "CallIdGuid",
721+
isRoomsCall: false,
722+
};
723+
724+
const AcsChatAzureBotCommandReceivedInThreadExample: AcsChatAzureBotCommandReceivedInThreadEventData = #{
725+
messageBody: "Welcome to Azure Communication Services",
726+
messageId: "1613694358927",
727+
senderCommunicationIdentifier: #{
728+
rawId: "8:acs:109f0644-b956-4cd9-87b1-71024f6e2f44_00000008-578d-7caf-07fd-084822001724",
729+
communicationUser: #{
730+
id: "8:acs:109f0644-b956-4cd9-87b1-71024f6e2f44_00000008-578d-7caf-07fd-084822001724",
731+
},
732+
},
733+
senderDisplayName: "John",
734+
composeTime: utcDateTime.fromISO("2021-02-19T00:25:58.927Z"),
735+
type: "Text",
736+
version: 1613694358927,
737+
transactionId: "oh+LGB2dUUadMcTAdRWQxQ.1.1.1.1.1827536918.1.7",
738+
threadId: "19:6e5d6ca1d75044a49a36a7965ec4a906@thread.v2",
739+
};
740+
741+
const AcsChatTypingIndicatorReceivedInThreadExample: AcsChatTypingIndicatorReceivedInThreadEventData = #{
742+
messageBody: "Welcome to Azure Communication Services",
743+
messageId: "1613694358927",
744+
senderCommunicationIdentifier: #{
745+
rawId: "8:acs:109f0644-b956-4cd9-87b1-71024f6e2f44_00000008-578d-7caf-07fd-084822001724",
746+
communicationUser: #{
747+
id: "8:acs:109f0644-b956-4cd9-87b1-71024f6e2f44_00000008-578d-7caf-07fd-084822001724",
748+
},
749+
},
750+
composeTime: utcDateTime.fromISO("2021-02-19T00:25:58.927Z"),
751+
senderDisplayName: "John",
752+
transactionId: "oh+LGB2dUUadMcTAdRWQxQ.1.1.1.1.1827536918.1.7",
753+
threadId: "19:6e5d6ca1d75044a49a36a7965ec4a906@thread.v2",
754+
type: "Text",
755+
version: 1613694358927,
756+
};

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.Communication/client.tsp

+74
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,78 @@ using Azure.ClientGenerator.Core;
1414
@@access(Microsoft.EventGrid.SystemEvents.AcsUserDisconnectedEventData,
1515
Access.public
1616
);
17+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallParticipantAddedEventData,
18+
Usage.output
19+
);
20+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallParticipantAddedEventData,
21+
Access.public
22+
);
23+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallParticipantRemovedEventData,
24+
Usage.output
25+
);
26+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallParticipantRemovedEventData,
27+
Access.public
28+
);
29+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallParticipantEventProperties,
30+
Usage.output
31+
);
32+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallParticipantEventProperties,
33+
Access.public
34+
);
35+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallStartedEventData, Usage.output);
36+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallStartedEventData,
37+
Access.public
38+
);
39+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallEndedEventData, Usage.output);
40+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallEndedEventData, Access.public);
41+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallingEventProperties,
42+
Usage.output
43+
);
44+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallingEventProperties,
45+
Access.public
46+
);
47+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallGroupProperties, Usage.output);
48+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallGroupProperties,
49+
Access.public
50+
);
51+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallRoomProperties, Usage.output);
52+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallRoomProperties, Access.public);
53+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallEndedByProperties,
54+
Usage.output
55+
);
56+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallEndedByProperties,
57+
Access.public
58+
);
59+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallEndReasonProperties,
60+
Usage.output
61+
);
62+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallEndReasonProperties,
63+
Access.public
64+
);
65+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallParticipantProperties,
66+
Usage.output
67+
);
68+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallParticipantProperties,
69+
Access.public
70+
);
1771
@@usage(Microsoft.EventGrid.SystemEvents.AcsChatMessageReceivedEventData,
1872
Usage.output
1973
);
2074
@@access(Microsoft.EventGrid.SystemEvents.AcsChatMessageReceivedEventData,
2175
Access.public
2276
);
77+
@@usage(Microsoft.EventGrid.SystemEvents.AcsChatAzureBotCommandReceivedInThreadEventData,
78+
Usage.output
79+
);
80+
@@access(Microsoft.EventGrid.SystemEvents.AcsChatAzureBotCommandReceivedInThreadEventData,
81+
Access.public
82+
);
83+
@@usage(Microsoft.EventGrid.SystemEvents.AcsChatTypingIndicatorReceivedInThreadEventData,
84+
Usage.output
85+
);
86+
@@access(Microsoft.EventGrid.SystemEvents.AcsChatTypingIndicatorReceivedInThreadEventData,
87+
Access.public
88+
);
2389
@@usage(Microsoft.EventGrid.SystemEvents.AcsChatMessageReceivedInThreadEventData,
2490
Usage.output
2591
);
@@ -505,6 +571,14 @@ using Azure.ClientGenerator.Core;
505571
@@access(Microsoft.EventGrid.SystemEvents.AcsRouterUpdatedWorkerProperty,
506572
Access.public
507573
);
574+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallEndedByKind, Usage.output);
575+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallEndedByKind, Access.public);
576+
@@usage(Microsoft.EventGrid.SystemEvents.AcsCallParticipantRoleKind,
577+
Usage.output
578+
);
579+
@@access(Microsoft.EventGrid.SystemEvents.AcsCallParticipantRoleKind,
580+
Access.public
581+
);
508582
@@usage(Microsoft.EventGrid.SystemEvents.CommunicationCloudEnvironmentModel,
509583
Usage.output
510584
);

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/examples/2018-01-01/sms_delivery_report_received.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
"time": "2020-09-18T00:22:20.0000000Z",
66
"id": "Outgoing_202009180022138813a09b-0cbf-4304-9b03-1546683bb910",
77
"data": {
8-
"MessageId": "Outgoing_202009180022138813a09b-0cbf-4304-9b03-1546683bb910",
9-
"From": "15555555555",
10-
"To": "+15555555555",
11-
"DeliveryStatus": "Delivered",
12-
"DeliveryStatusDetails": "No error.",
13-
"ReceivedTimestamp": "2020-09-18T00:22:20.2855749Z",
14-
"DeliveryAttempts": [
8+
"messageId": "Outgoing_202009180022138813a09b-0cbf-4304-9b03-1546683bb910",
9+
"from": "15555555555",
10+
"to": "+15555555555",
11+
"deliveryStatus": "Delivered",
12+
"deliveryStatusDetails": "No error.",
13+
"receivedTimestamp": "2020-09-18T00:22:20.2855749Z",
14+
"deliveryAttempts": [
1515
{
16-
"Timestamp": "2020-09-18T00:22:14.9315918Z",
17-
"SegmentsSucceeded": 1,
18-
"SegmentsFailed": 0
16+
"timestamp": "2020-09-18T00:22:14.9315918Z",
17+
"segmentsSucceeded": 1,
18+
"segmentsFailed": 0
1919
}
2020
]
2121
},

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/examples/2018-01-01/sms_received.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"time": "2020-09-18T00:27:47.0000000Z",
66
"id": "Incoming_20200918002745d29ebbea-3341-4466-9690-0a03af35228e",
77
"data": {
8-
"MessageId": "Incoming_20200918002745d29ebbea-3341-4466-9690-0a03af35228e",
9-
"From": "15555555555",
10-
"To": "15555555555",
11-
"Message": "Great to connect with ACS events",
12-
"ReceivedTimestamp": "2020-09-18T00:27:45.32Z",
13-
"SegmentCount": 1
8+
"messageId": "Incoming_20200918002745d29ebbea-3341-4466-9690-0a03af35228e",
9+
"from": "15555555555",
10+
"to": "15555555555",
11+
"message": "Great to connect with ACS events",
12+
"receivedTimestamp": "2020-09-18T00:27:45.32Z",
13+
"segmentCount": 1
1414
},
1515
"specversion": "1.0",
1616
"operationId": "SMSReceivedEventName",

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/examples/2024-01-01/router_job_queued.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@
2323
"key": "string",
2424
"labelOperator": "equal",
2525
"value": 5,
26-
"ttl": "40"
26+
"ttlSeconds": "40",
27+
"expirationTime": "2022-02-17T00:56:25.1736293Z",
28+
"state": "active"
2729
}
2830
],
2931
"attachedWorkerSelectors": [
3032
{
3133
"key": "string",
3234
"labelOperator": "equal",
3335
"value": 5,
34-
"ttlSeconds": "39"
36+
"ttlSeconds": "39",
37+
"expirationTime": "2022-02-17T00:56:25.1736293Z",
38+
"state": "active"
3539
}
3640
]
3741
},

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/examples/2024-01-01/router_job_scheduling_failed.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@
2323
"key": "string",
2424
"labelOperator": "equal",
2525
"value": 5,
26-
"ttlSeconds": "36"
26+
"ttlSeconds": "36",
27+
"expirationTime": "2022-02-17T00:56:25.1736293Z",
28+
"state": "active"
2729
}
2830
],
2931
"attachedWorkerSelectors": [
3032
{
3133
"key": "string",
3234
"labelOperator": "equal",
3335
"value": 5,
34-
"ttlSeconds": "30"
36+
"ttlSeconds": "30",
37+
"expirationTime": "2022-02-17T00:56:25.1736293Z",
38+
"state": "active"
3539
}
3640
],
3741
"scheduledOn": "2022-02-17T00:55:25.1736293Z",

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/examples/2024-01-01/router_job_waiting_for_activation.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@
2323
"key": "string",
2424
"labelOperator": "equal",
2525
"value": 5,
26-
"ttlSeconds": "45"
26+
"ttlSeconds": "45",
27+
"expirationTime": "2022-02-17T00:56:25.1736293Z",
28+
"state": "active"
2729
}
2830
],
2931
"attachedWorkerSelectors": [
3032
{
3133
"key": "string",
3234
"labelOperator": "equal",
3335
"value": 5,
34-
"ttlSeconds": "32"
36+
"ttlSeconds": "32",
37+
"expirationTime": "2022-02-17T00:56:25.1736293Z",
38+
"state": "active"
3539
}
3640
],
3741
"scheduledOn": "2022-02-17T00:55:25.1736293Z",

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/examples/2024-01-01/router_job_worker_selectors_expired.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,19 @@
2222
"key": "string",
2323
"labelOperator": "equal",
2424
"value": 5,
25-
"ttlSeconds": "30"
25+
"ttlSeconds": "30",
26+
"expirationTime": "2022-02-17T00:56:25.1736293Z",
27+
"state": "active"
2628
}
2729
],
2830
"attachedWorkerSelectorsExpired": [
2931
{
3032
"key": "string",
3133
"labelOperator": "equal",
3234
"value": 5,
33-
"ttlSeconds": "35"
35+
"ttlSeconds": "35",
36+
"expirationTime": "2022-02-17T00:56:25.1736293Z",
37+
"state": "active"
3438
}
3539
]
3640
},

0 commit comments

Comments
 (0)