From 24af32139598bfa04d8fbe97877b15d1bfe527d0 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Thu, 9 Jan 2025 15:37:04 -0800 Subject: [PATCH 1/2] update --- .../Azure.Messaging.EventGrid.SystemEvents/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md b/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md index fbbaa2816aba..e8498ab171eb 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md +++ b/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md @@ -13,15 +13,18 @@ In order to automate the mapping of event definition with event type, please fol Under the `Azure.Messaging.EventGrid.SystemEvents` folder find or create your service's `.tsp` file. This is where you will add your new event. For help with typespec conventions refer to [this doc](https://microsoft.github.io/typespec/) about typespec basics. Each new event will be represented as a typespec `model`. After you create your new event, in the `client.tsp` file, you need to add `@@usage(EventGrid.YourEventName, Usage.output)` and `@@access(EventGrid.YourEventName, Access.public)`. -A sample valid event definition is shown below: +A sample valid event definition is shown below with `required` and `optional` properties: ~~~ markdown /** Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event. */ model AcsChatMessageReceivedEventData { ...AcsChatMessageEventBaseProperties; - /** The body of the chat message. */ - messageBody : string; + /** Required as shown. */ + requiredProperty : string; + + /** Optional as shown */ + optionalProperty ?: string; } ~~~ From f373c0a6db1389dd557f9e668701e1500545c3b5 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Fri, 10 Jan 2025 10:22:06 -0800 Subject: [PATCH 2/2] update for clarity --- .../Azure.Messaging.EventGrid.SystemEvents/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md b/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md index e8498ab171eb..6a18958f5fff 100644 --- a/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md +++ b/specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/README.md @@ -20,10 +20,10 @@ A sample valid event definition is shown below with `required` and `optional` pr model AcsChatMessageReceivedEventData { ...AcsChatMessageEventBaseProperties; - /** Required as shown. */ + /** Required. Field is always present in the event. */ requiredProperty : string; - /** Optional as shown */ + /** Optional. Field may not be present in some events. */ optionalProperty ?: string; } ~~~