Skip to content

Commit 7413218

Browse files
author
SDKAuto
committed
CodeGen from PR 33669 in Azure/azure-rest-api-specs
Merge 5556dbfa9ad3a17e1fe7c4e72b632f683284ee85 into 7b94be99f4c65d06d2b980843ac54234becbbdda
1 parent 4985e98 commit 7413218

File tree

67 files changed

+3295
-1948
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+3295
-1948
lines changed

sdk/eventgrid/azure-messaging-eventgrid-systemevents/src/main/java/com/azure/messaging/eventgrid/SystemEventNames.java

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
package com.azure.messaging.eventgrid;
55

6+
import com.azure.messaging.eventgrid.systemevents.AcsCallEndedEventData;
7+
import com.azure.messaging.eventgrid.systemevents.AcsCallParticipantAddedEventData;
8+
import com.azure.messaging.eventgrid.systemevents.AcsCallParticipantRemovedEventData;
9+
import com.azure.messaging.eventgrid.systemevents.AcsCallStartedEventData;
10+
import com.azure.messaging.eventgrid.systemevents.AcsChatAzureBotCommandReceivedInThreadEventData;
611
import com.azure.messaging.eventgrid.systemevents.AcsChatMessageDeletedEventData;
712
import com.azure.messaging.eventgrid.systemevents.AcsChatMessageDeletedInThreadEventData;
813
import com.azure.messaging.eventgrid.systemevents.AcsChatMessageEditedEventData;
@@ -19,6 +24,7 @@
1924
import com.azure.messaging.eventgrid.systemevents.AcsChatThreadPropertiesUpdatedEventData;
2025
import com.azure.messaging.eventgrid.systemevents.AcsChatThreadPropertiesUpdatedPerUserEventData;
2126
import com.azure.messaging.eventgrid.systemevents.AcsChatThreadWithUserDeletedEventData;
27+
import com.azure.messaging.eventgrid.systemevents.AcsChatTypingIndicatorReceivedInThreadEventData;
2228
import com.azure.messaging.eventgrid.systemevents.AcsEmailDeliveryReportReceivedEventData;
2329
import com.azure.messaging.eventgrid.systemevents.AcsEmailEngagementTrackingReportReceivedEventData;
2430
import com.azure.messaging.eventgrid.systemevents.AcsIncomingCallEventData;
@@ -212,6 +218,33 @@
212218
*/
213219
public final class SystemEventNames {
214220

221+
/**
222+
* Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallEnded event.
223+
*/
224+
public static final String ACS_CALL_ENDED = "Microsoft.Communication.CallEnded";
225+
226+
/**
227+
* Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallParticipantAdded event.
228+
*/
229+
public static final String ACS_CALL_PARTICIPANT_ADDED = "Microsoft.Communication.CallParticipantAdded";
230+
231+
/**
232+
* Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallParticipantRemoved event.
233+
*/
234+
public static final String ACS_CALL_PARTICIPANT_REMOVED = "Microsoft.Communication.CallParticipantRemoved";
235+
236+
/**
237+
* Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallStarted event.
238+
*/
239+
public static final String ACS_CALL_STARTED = "Microsoft.Communication.CallStarted";
240+
241+
/**
242+
* Schema of the Data property of an EventGridEvent for a
243+
* Microsoft.Communication.ChatAzureBotCommandReceivedInThread event.
244+
*/
245+
public static final String ACS_CHAT_AZURE_BOT_COMMAND_RECEIVED_IN_THREAD
246+
= "Microsoft.Communication.ChatAzureBotCommandReceivedInThread";
247+
215248
/**
216249
* Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeleted event.
217250
*/
@@ -304,6 +337,13 @@ public final class SystemEventNames {
304337
*/
305338
public static final String ACS_CHAT_THREAD_WITH_USER_DELETED = "Microsoft.Communication.ChatThreadWithUserDeleted";
306339

340+
/**
341+
* Schema of the Data property of an EventGridEvent for a
342+
* Microsoft.Communication.ChatTypingIndicatorReceivedInThread event.
343+
*/
344+
public static final String ACS_CHAT_TYPING_INDICATOR_RECEIVED_IN_THREAD
345+
= "Microsoft.Communication.ChatTypingIndicatorReceivedInThread";
346+
307347
/**
308348
* Schema of the Data property of an EventGridEvent for a Microsoft.Communication.EmailDeliveryReportReceived event.
309349
*/
@@ -1267,6 +1307,11 @@ public final class SystemEventNames {
12671307

12681308
private static final Map<String, Class<?>> SYSTEM_EVENT_MAPPINGS = new HashMap<String, Class<?>>() {
12691309
{
1310+
put(ACS_CALL_ENDED, AcsCallEndedEventData.class);
1311+
put(ACS_CALL_PARTICIPANT_ADDED, AcsCallParticipantAddedEventData.class);
1312+
put(ACS_CALL_PARTICIPANT_REMOVED, AcsCallParticipantRemovedEventData.class);
1313+
put(ACS_CALL_STARTED, AcsCallStartedEventData.class);
1314+
put(ACS_CHAT_AZURE_BOT_COMMAND_RECEIVED_IN_THREAD, AcsChatAzureBotCommandReceivedInThreadEventData.class);
12701315
put(ACS_CHAT_MESSAGE_DELETED, AcsChatMessageDeletedEventData.class);
12711316
put(ACS_CHAT_MESSAGE_DELETED_IN_THREAD, AcsChatMessageDeletedInThreadEventData.class);
12721317
put(ACS_CHAT_MESSAGE_EDITED, AcsChatMessageEditedEventData.class);
@@ -1284,6 +1329,7 @@ public final class SystemEventNames {
12841329
put(ACS_CHAT_THREAD_PROPERTIES_UPDATED, AcsChatThreadPropertiesUpdatedEventData.class);
12851330
put(ACS_CHAT_THREAD_PROPERTIES_UPDATED_PER_USER, AcsChatThreadPropertiesUpdatedPerUserEventData.class);
12861331
put(ACS_CHAT_THREAD_WITH_USER_DELETED, AcsChatThreadWithUserDeletedEventData.class);
1332+
put(ACS_CHAT_TYPING_INDICATOR_RECEIVED_IN_THREAD, AcsChatTypingIndicatorReceivedInThreadEventData.class);
12871333
put(ACS_EMAIL_DELIVERY_REPORT_RECEIVED, AcsEmailDeliveryReportReceivedEventData.class);
12881334
put(ACS_EMAIL_ENGAGEMENT_TRACKING_REPORT_RECEIVED, AcsEmailEngagementTrackingReportReceivedEventData.class);
12891335
put(ACS_INCOMING_CALL, AcsIncomingCallEventData.class);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.messaging.eventgrid.systemevents;
6+
7+
import com.azure.core.annotation.Generated;
8+
import com.azure.core.annotation.Immutable;
9+
import com.azure.json.JsonReader;
10+
import com.azure.json.JsonSerializable;
11+
import com.azure.json.JsonToken;
12+
import com.azure.json.JsonWriter;
13+
import java.io.IOException;
14+
15+
/**
16+
* Schema of calling event reason properties.
17+
*/
18+
@Immutable
19+
public final class AcsCallEndReasonProperties implements JsonSerializable<AcsCallEndReasonProperties> {
20+
/*
21+
* Reason code for ending the call.
22+
*/
23+
@Generated
24+
private Integer code;
25+
26+
/*
27+
* Reason subcode for ending the call.
28+
*/
29+
@Generated
30+
private Integer subCode;
31+
32+
/*
33+
* Reason for the ending the call.
34+
*/
35+
@Generated
36+
private String phrase;
37+
38+
/**
39+
* Creates an instance of AcsCallEndReasonProperties class.
40+
*/
41+
@Generated
42+
private AcsCallEndReasonProperties() {
43+
}
44+
45+
/**
46+
* Get the code property: Reason code for ending the call.
47+
*
48+
* @return the code value.
49+
*/
50+
@Generated
51+
public Integer getCode() {
52+
return this.code;
53+
}
54+
55+
/**
56+
* Get the subCode property: Reason subcode for ending the call.
57+
*
58+
* @return the subCode value.
59+
*/
60+
@Generated
61+
public Integer getSubCode() {
62+
return this.subCode;
63+
}
64+
65+
/**
66+
* Get the phrase property: Reason for the ending the call.
67+
*
68+
* @return the phrase value.
69+
*/
70+
@Generated
71+
public String getPhrase() {
72+
return this.phrase;
73+
}
74+
75+
/**
76+
* {@inheritDoc}
77+
*/
78+
@Generated
79+
@Override
80+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
81+
jsonWriter.writeStartObject();
82+
jsonWriter.writeNumberField("code", this.code);
83+
jsonWriter.writeNumberField("subCode", this.subCode);
84+
jsonWriter.writeStringField("phrase", this.phrase);
85+
return jsonWriter.writeEndObject();
86+
}
87+
88+
/**
89+
* Reads an instance of AcsCallEndReasonProperties from the JsonReader.
90+
*
91+
* @param jsonReader The JsonReader being read.
92+
* @return An instance of AcsCallEndReasonProperties if the JsonReader was pointing to an instance of it, or null if
93+
* it was pointing to JSON null.
94+
* @throws IOException If an error occurs while reading the AcsCallEndReasonProperties.
95+
*/
96+
@Generated
97+
public static AcsCallEndReasonProperties fromJson(JsonReader jsonReader) throws IOException {
98+
return jsonReader.readObject(reader -> {
99+
AcsCallEndReasonProperties deserializedAcsCallEndReasonProperties = new AcsCallEndReasonProperties();
100+
while (reader.nextToken() != JsonToken.END_OBJECT) {
101+
String fieldName = reader.getFieldName();
102+
reader.nextToken();
103+
104+
if ("code".equals(fieldName)) {
105+
deserializedAcsCallEndReasonProperties.code = reader.getNullable(JsonReader::getInt);
106+
} else if ("subCode".equals(fieldName)) {
107+
deserializedAcsCallEndReasonProperties.subCode = reader.getNullable(JsonReader::getInt);
108+
} else if ("phrase".equals(fieldName)) {
109+
deserializedAcsCallEndReasonProperties.phrase = reader.getString();
110+
} else {
111+
reader.skipChildren();
112+
}
113+
}
114+
115+
return deserializedAcsCallEndReasonProperties;
116+
});
117+
}
118+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.messaging.eventgrid.systemevents;
6+
7+
import com.azure.core.annotation.Generated;
8+
import com.azure.core.util.ExpandableStringEnum;
9+
import java.util.Collection;
10+
11+
/**
12+
* Call ended participant kind.
13+
*/
14+
public final class AcsCallEndedByKind extends ExpandableStringEnum<AcsCallEndedByKind> {
15+
/**
16+
* Participant.
17+
*/
18+
@Generated
19+
public static final AcsCallEndedByKind PARTICIPANT = fromString("Participant");
20+
21+
/**
22+
* MicrosoftInternal.
23+
*/
24+
@Generated
25+
public static final AcsCallEndedByKind MICROSOFT_INTERNAL = fromString("MicrosoftInternal");
26+
27+
/**
28+
* Creates a new instance of AcsCallEndedByKind value.
29+
*
30+
* @deprecated Use the {@link #fromString(String)} factory method.
31+
*/
32+
@Generated
33+
@Deprecated
34+
public AcsCallEndedByKind() {
35+
}
36+
37+
/**
38+
* Creates or finds a AcsCallEndedByKind from its string representation.
39+
*
40+
* @param name a name to look for.
41+
* @return the corresponding AcsCallEndedByKind.
42+
*/
43+
@Generated
44+
public static AcsCallEndedByKind fromString(String name) {
45+
return fromString(name, AcsCallEndedByKind.class);
46+
}
47+
48+
/**
49+
* Gets known AcsCallEndedByKind values.
50+
*
51+
* @return known AcsCallEndedByKind values.
52+
*/
53+
@Generated
54+
public static Collection<AcsCallEndedByKind> values() {
55+
return values(AcsCallEndedByKind.class);
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.messaging.eventgrid.systemevents;
6+
7+
import com.azure.core.annotation.Generated;
8+
import com.azure.core.annotation.Immutable;
9+
import com.azure.json.JsonReader;
10+
import com.azure.json.JsonSerializable;
11+
import com.azure.json.JsonToken;
12+
import com.azure.json.JsonWriter;
13+
import java.io.IOException;
14+
15+
/**
16+
* Schema of calling event endedby properties.
17+
*/
18+
@Immutable
19+
public final class AcsCallEndedByProperties implements JsonSerializable<AcsCallEndedByProperties> {
20+
/*
21+
* The communication identifier of the call ended by
22+
*/
23+
@Generated
24+
private final CommunicationIdentifierModel communicationIdentifier;
25+
26+
/*
27+
* The type of call ended by.
28+
*/
29+
@Generated
30+
private final AcsCallEndedByKind type;
31+
32+
/*
33+
* The name of the call ended by.
34+
*/
35+
@Generated
36+
private final String name;
37+
38+
/**
39+
* Creates an instance of AcsCallEndedByProperties class.
40+
*
41+
* @param communicationIdentifier the communicationIdentifier value to set.
42+
* @param type the type value to set.
43+
* @param name the name value to set.
44+
*/
45+
@Generated
46+
private AcsCallEndedByProperties(CommunicationIdentifierModel communicationIdentifier, AcsCallEndedByKind type,
47+
String name) {
48+
this.communicationIdentifier = communicationIdentifier;
49+
this.type = type;
50+
this.name = name;
51+
}
52+
53+
/**
54+
* Get the communicationIdentifier property: The communication identifier of the call ended by.
55+
*
56+
* @return the communicationIdentifier value.
57+
*/
58+
@Generated
59+
public CommunicationIdentifierModel getCommunicationIdentifier() {
60+
return this.communicationIdentifier;
61+
}
62+
63+
/**
64+
* Get the type property: The type of call ended by.
65+
*
66+
* @return the type value.
67+
*/
68+
@Generated
69+
public AcsCallEndedByKind getType() {
70+
return this.type;
71+
}
72+
73+
/**
74+
* Get the name property: The name of the call ended by.
75+
*
76+
* @return the name value.
77+
*/
78+
@Generated
79+
public String getName() {
80+
return this.name;
81+
}
82+
83+
/**
84+
* {@inheritDoc}
85+
*/
86+
@Generated
87+
@Override
88+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
89+
jsonWriter.writeStartObject();
90+
jsonWriter.writeJsonField("communicationIdentifier", this.communicationIdentifier);
91+
jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
92+
jsonWriter.writeStringField("name", this.name);
93+
return jsonWriter.writeEndObject();
94+
}
95+
96+
/**
97+
* Reads an instance of AcsCallEndedByProperties from the JsonReader.
98+
*
99+
* @param jsonReader The JsonReader being read.
100+
* @return An instance of AcsCallEndedByProperties if the JsonReader was pointing to an instance of it, or null if
101+
* it was pointing to JSON null.
102+
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
103+
* @throws IOException If an error occurs while reading the AcsCallEndedByProperties.
104+
*/
105+
@Generated
106+
public static AcsCallEndedByProperties fromJson(JsonReader jsonReader) throws IOException {
107+
return jsonReader.readObject(reader -> {
108+
CommunicationIdentifierModel communicationIdentifier = null;
109+
AcsCallEndedByKind type = null;
110+
String name = null;
111+
while (reader.nextToken() != JsonToken.END_OBJECT) {
112+
String fieldName = reader.getFieldName();
113+
reader.nextToken();
114+
115+
if ("communicationIdentifier".equals(fieldName)) {
116+
communicationIdentifier = CommunicationIdentifierModel.fromJson(reader);
117+
} else if ("type".equals(fieldName)) {
118+
type = AcsCallEndedByKind.fromString(reader.getString());
119+
} else if ("name".equals(fieldName)) {
120+
name = reader.getString();
121+
} else {
122+
reader.skipChildren();
123+
}
124+
}
125+
return new AcsCallEndedByProperties(communicationIdentifier, type, name);
126+
});
127+
}
128+
}

0 commit comments

Comments
 (0)