Skip to content

Commit 752dade

Browse files
Mark dictionaries as readonly for new csharp emitter (#36490)
* Mark dictionaries as readonly * more * more
1 parent c0a2dde commit 752dade

File tree

8 files changed

+212
-94
lines changed

8 files changed

+212
-94
lines changed

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.AVS/AVS.tsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ model AvsScriptExecutionStartedEventData extends AvsScriptExecutionEventData {}
5151
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "Maintain compatibility with existing models."
5252
model AvsScriptExecutionFinishedEventData extends AvsScriptExecutionEventData {
5353
/** Named outputs of completed execution, if any. */
54+
@visibility(Lifecycle.Read)
5455
namedOutputs: Record<string>;
5556
}
5657

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ model AcsChatThreadPropertiesUpdatedPerUserEventData
183183
editTime: utcDateTime;
184184

185185
/** The thread metadata */
186+
@visibility(Lifecycle.Read)
186187
metadata?: Record<string>;
187188

188189
/** The updated thread properties */
@@ -644,15 +645,19 @@ model AcsRouterWorkerOfferAcceptedEventData extends AcsRouterWorkerEventData {
644645
jobPriority?: int32;
645646

646647
/** Router Worker Offer Accepted Worker Labels */
648+
@visibility(Lifecycle.Read)
647649
workerLabels: Record<string>;
648650

649651
/** Router Worker Offer Accepted Worker Tags */
652+
@visibility(Lifecycle.Read)
650653
workerTags: Record<string>;
651654

652655
/** Router Worker Offer Accepted Job Labels */
656+
@visibility(Lifecycle.Read)
653657
jobLabels: Record<string>;
654658

655659
/** Router Worker Offer Accepted Job Tags */
660+
@visibility(Lifecycle.Read)
656661
jobTags: Record<string>;
657662
}
658663

@@ -692,6 +697,7 @@ model AcsRouterWorkerOfferIssuedEventData extends AcsRouterWorkerEventData {
692697
jobPriority?: int32;
693698

694699
/** Router Worker Offer Issued Worker Labels */
700+
@visibility(Lifecycle.Read)
695701
workerLabels: Record<string>;
696702

697703
/** Router Worker Offer Issued Time in UTC */
@@ -705,12 +711,15 @@ model AcsRouterWorkerOfferIssuedEventData extends AcsRouterWorkerEventData {
705711
expiresOn: utcDateTime;
706712

707713
/** Router Worker Offer Issued Worker Tags */
714+
@visibility(Lifecycle.Read)
708715
workerTags: Record<string>;
709716

710717
/** Router Worker Offer Issued Job Labels */
718+
@visibility(Lifecycle.Read)
711719
jobLabels: Record<string>;
712720

713721
/** Router Worker Offer Issued Job Tags */
722+
@visibility(Lifecycle.Read)
714723
jobTags: Record<string>;
715724
}
716725

@@ -743,9 +752,11 @@ model AcsRouterWorkerRegisteredEventData {
743752
totalCapacity?: int32;
744753

745754
/** Router Worker Registered Labels */
755+
@visibility(Lifecycle.Read)
746756
labels: Record<string>;
747757

748758
/** Router Worker Registered Tags */
759+
@visibility(Lifecycle.Read)
749760
tags: Record<string>;
750761
}
751762

@@ -757,9 +768,11 @@ model AcsRouterJobEventData extends AcsRouterEventData {
757768
queueId?: string;
758769

759770
/** Router Job events Labels */
771+
@visibility(Lifecycle.Read)
760772
labels: Record<string>;
761773

762774
/** Router Jobs events Tags */
775+
@visibility(Lifecycle.Read)
763776
tags: Record<string>;
764777
}
765778

@@ -804,6 +817,7 @@ model AcsRouterQueueDetails {
804817
name?: string;
805818

806819
/** Router Queue Labels */
820+
@visibility(Lifecycle.Read)
807821
labels: Record<string>;
808822
}
809823

@@ -856,6 +870,7 @@ alias AcsChatMessageBaseEventData = {
856870
messageBody: string;
857871

858872
/** The chat message metadata */
873+
@visibility(Lifecycle.Read)
859874
metadata?: Record<string>;
860875
};
861876

@@ -868,6 +883,7 @@ alias AcsChatThreadBaseEventData = {
868883
properties: Record<unknown>;
869884

870885
/** The thread metadata */
886+
@visibility(Lifecycle.Read)
871887
metadata?: Record<string>;
872888

873889
/** The list of properties of participants who are part of the thread */
@@ -897,6 +913,7 @@ alias AcsChatThreadPropertiesBaseEventData = {
897913
properties: Record<unknown>;
898914

899915
/** The thread metadata */
916+
@visibility(Lifecycle.Read)
900917
metadata: Record<string>;
901918
};
902919

@@ -1204,6 +1221,7 @@ model AcsChatThreadParticipantProperties {
12041221
participantCommunicationIdentifier: CommunicationIdentifierModel;
12051222

12061223
/** The metadata of the user */
1224+
@visibility(Lifecycle.Read)
12071225
metadata?: Record<string>;
12081226
}
12091227

@@ -1265,9 +1283,11 @@ model AcsRecordingChunkInfoProperties {
12651283
/** Custom Context of Incoming Call */
12661284
model AcsIncomingCallCustomContext {
12671285
/** Sip Headers for incoming call */
1286+
@visibility(Lifecycle.Read)
12681287
sipHeaders: Record<string>;
12691288

12701289
/** Voip Headers for incoming call */
1290+
@visibility(Lifecycle.Read)
12711291
voipHeaders: Record<string>;
12721292
}
12731293

@@ -1376,9 +1396,11 @@ model AcsRouterWorkerUpdatedEventData {
13761396
totalCapacity?: int32;
13771397

13781398
/** Router Worker Updated Labels */
1399+
@visibility(Lifecycle.Read)
13791400
labels: Record<string>;
13801401

13811402
/** Router Worker Updated Tags */
1403+
@visibility(Lifecycle.Read)
13821404
tags: Record<string>;
13831405

13841406
/** Router Worker Properties Updated */

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.Devices/IotHub.tsp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ model DeviceTelemetryEventProperties {
9797
body: Record<unknown>;
9898

9999
/** Application properties are user-defined strings that can be added to the message. These fields are optional. */
100+
@visibility(Lifecycle.Read)
100101
properties: Record<string>;
101102

102103
/** System properties help identify contents and source of the messages. */
104+
@visibility(Lifecycle.Read)
103105
systemProperties: Record<string>;
104106
}
105107

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,15 @@ model EventGridMQTTClientCreatedOrUpdatedEventData
100100
createdOn: utcDateTime;
101101

102102
/**
103-
Time the client resource is last updated based on the provider's UTC time. If
104-
the client resource was never updated, this value is identical to the value of
105-
the 'createdOn' property.
106-
*/
103+
Time the client resource is last updated based on the provider's UTC time. If
104+
the client resource was never updated, this value is identical to the value of
105+
the 'createdOn' property.
106+
*/
107107
@madeRequired(ServiceApiVersions.v2024_01_01)
108108
updatedOn: utcDateTime;
109109

110110
/** The key-value attributes that are assigned to the client resource. */
111+
@visibility(Lifecycle.Read)
111112
attributes: Record<string>;
112113
}
113114

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.ResourceNotifications/common.tsp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ model ResourceNotificationsResourceUpdatedDetails {
2424
location?: string;
2525

2626
/** the tags on the resource for which the event is being emitted */
27+
@visibility(Lifecycle.Read)
2728
tags?: Record<string>;
2829

2930
/** properties in the payload of the resource for which the event is being emitted */
3031
#suppress "@azure-tools/typespec-azure-core/bad-record-type" "The type of properties is object with additionalProperties object"
32+
@visibility(Lifecycle.Read)
3133
properties?: Record<unknown>;
3234
}
3335

specification/eventgrid/Azure.Messaging.EventGrid.SystemEvents/Microsoft.Resources/Resources.tsp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ namespace Microsoft.EventGrid.SystemEvents {
6969
action?: string;
7070

7171
/** The evidence for the authorization. */
72+
@visibility(Lifecycle.Read)
7273
evidence: Record<string>;
7374
}
7475

@@ -98,6 +99,7 @@ namespace Microsoft.EventGrid.SystemEvents {
9899
authorization: ResourceAuthorization;
99100

100101
/** The properties of the claims. */
102+
@visibility(Lifecycle.Read)
101103
claims: Record<string>;
102104

103105
/** An operation ID used for troubleshooting. */

0 commit comments

Comments
 (0)