Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

package com.azure.messaging.eventgrid;

import com.azure.messaging.eventgrid.systemevents.AcsCallEndedEventData;
import com.azure.messaging.eventgrid.systemevents.AcsCallParticipantAddedEventData;
import com.azure.messaging.eventgrid.systemevents.AcsCallParticipantRemovedEventData;
import com.azure.messaging.eventgrid.systemevents.AcsCallStartedEventData;
import com.azure.messaging.eventgrid.systemevents.AcsChatAzureBotCommandReceivedInThreadEventData;
import com.azure.messaging.eventgrid.systemevents.AcsChatMessageDeletedEventData;
import com.azure.messaging.eventgrid.systemevents.AcsChatMessageDeletedInThreadEventData;
import com.azure.messaging.eventgrid.systemevents.AcsChatMessageEditedEventData;
Expand All @@ -19,6 +24,7 @@
import com.azure.messaging.eventgrid.systemevents.AcsChatThreadPropertiesUpdatedEventData;
import com.azure.messaging.eventgrid.systemevents.AcsChatThreadPropertiesUpdatedPerUserEventData;
import com.azure.messaging.eventgrid.systemevents.AcsChatThreadWithUserDeletedEventData;
import com.azure.messaging.eventgrid.systemevents.AcsChatTypingIndicatorReceivedInThreadEventData;
import com.azure.messaging.eventgrid.systemevents.AcsEmailDeliveryReportReceivedEventData;
import com.azure.messaging.eventgrid.systemevents.AcsEmailEngagementTrackingReportReceivedEventData;
import com.azure.messaging.eventgrid.systemevents.AcsIncomingCallEventData;
Expand Down Expand Up @@ -212,6 +218,33 @@
*/
public final class SystemEventNames {

/**
* Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallEnded event.
*/
public static final String ACS_CALL_ENDED = "Microsoft.Communication.CallEnded";

/**
* Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallParticipantAdded event.
*/
public static final String ACS_CALL_PARTICIPANT_ADDED = "Microsoft.Communication.CallParticipantAdded";

/**
* Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallParticipantRemoved event.
*/
public static final String ACS_CALL_PARTICIPANT_REMOVED = "Microsoft.Communication.CallParticipantRemoved";

/**
* Schema of the Data property of an EventGridEvent for a Microsoft.Communication.CallStarted event.
*/
public static final String ACS_CALL_STARTED = "Microsoft.Communication.CallStarted";

/**
* Schema of the Data property of an EventGridEvent for a
* Microsoft.Communication.ChatAzureBotCommandReceivedInThread event.
*/
public static final String ACS_CHAT_AZURE_BOT_COMMAND_RECEIVED_IN_THREAD
= "Microsoft.Communication.ChatAzureBotCommandReceivedInThread";

/**
* Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeleted event.
*/
Expand Down Expand Up @@ -304,6 +337,13 @@ public final class SystemEventNames {
*/
public static final String ACS_CHAT_THREAD_WITH_USER_DELETED = "Microsoft.Communication.ChatThreadWithUserDeleted";

/**
* Schema of the Data property of an EventGridEvent for a
* Microsoft.Communication.ChatTypingIndicatorReceivedInThread event.
*/
public static final String ACS_CHAT_TYPING_INDICATOR_RECEIVED_IN_THREAD
= "Microsoft.Communication.ChatTypingIndicatorReceivedInThread";

/**
* Schema of the Data property of an EventGridEvent for a Microsoft.Communication.EmailDeliveryReportReceived event.
*/
Expand Down Expand Up @@ -1267,6 +1307,11 @@ public final class SystemEventNames {

private static final Map<String, Class<?>> SYSTEM_EVENT_MAPPINGS = new HashMap<String, Class<?>>() {
{
put(ACS_CALL_ENDED, AcsCallEndedEventData.class);
put(ACS_CALL_PARTICIPANT_ADDED, AcsCallParticipantAddedEventData.class);
put(ACS_CALL_PARTICIPANT_REMOVED, AcsCallParticipantRemovedEventData.class);
put(ACS_CALL_STARTED, AcsCallStartedEventData.class);
put(ACS_CHAT_AZURE_BOT_COMMAND_RECEIVED_IN_THREAD, AcsChatAzureBotCommandReceivedInThreadEventData.class);
put(ACS_CHAT_MESSAGE_DELETED, AcsChatMessageDeletedEventData.class);
put(ACS_CHAT_MESSAGE_DELETED_IN_THREAD, AcsChatMessageDeletedInThreadEventData.class);
put(ACS_CHAT_MESSAGE_EDITED, AcsChatMessageEditedEventData.class);
Expand All @@ -1284,6 +1329,7 @@ public final class SystemEventNames {
put(ACS_CHAT_THREAD_PROPERTIES_UPDATED, AcsChatThreadPropertiesUpdatedEventData.class);
put(ACS_CHAT_THREAD_PROPERTIES_UPDATED_PER_USER, AcsChatThreadPropertiesUpdatedPerUserEventData.class);
put(ACS_CHAT_THREAD_WITH_USER_DELETED, AcsChatThreadWithUserDeletedEventData.class);
put(ACS_CHAT_TYPING_INDICATOR_RECEIVED_IN_THREAD, AcsChatTypingIndicatorReceivedInThreadEventData.class);
put(ACS_EMAIL_DELIVERY_REPORT_RECEIVED, AcsEmailDeliveryReportReceivedEventData.class);
put(ACS_EMAIL_ENGAGEMENT_TRACKING_REPORT_RECEIVED, AcsEmailEngagementTrackingReportReceivedEventData.class);
put(ACS_INCOMING_CALL, AcsIncomingCallEventData.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.messaging.eventgrid.systemevents;

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
* Schema of calling event reason properties.
*/
@Immutable
public final class AcsCallEndReasonProperties implements JsonSerializable<AcsCallEndReasonProperties> {
/*
* Reason code for ending the call.
*/
@Generated
private Integer code;

/*
* Reason subcode for ending the call.
*/
@Generated
private Integer subCode;

/*
* Reason for the ending the call.
*/
@Generated
private String phrase;

/**
* Creates an instance of AcsCallEndReasonProperties class.
*/
@Generated
private AcsCallEndReasonProperties() {
}

/**
* Get the code property: Reason code for ending the call.
*
* @return the code value.
*/
@Generated
public Integer getCode() {
return this.code;
}

/**
* Get the subCode property: Reason subcode for ending the call.
*
* @return the subCode value.
*/
@Generated
public Integer getSubCode() {
return this.subCode;
}

/**
* Get the phrase property: Reason for the ending the call.
*
* @return the phrase value.
*/
@Generated
public String getPhrase() {
return this.phrase;
}

/**
* {@inheritDoc}
*/
@Generated
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeNumberField("code", this.code);
jsonWriter.writeNumberField("subCode", this.subCode);
jsonWriter.writeStringField("phrase", this.phrase);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of AcsCallEndReasonProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AcsCallEndReasonProperties if the JsonReader was pointing to an instance of it, or null if
* it was pointing to JSON null.
* @throws IOException If an error occurs while reading the AcsCallEndReasonProperties.
*/
@Generated
public static AcsCallEndReasonProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AcsCallEndReasonProperties deserializedAcsCallEndReasonProperties = new AcsCallEndReasonProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("code".equals(fieldName)) {
deserializedAcsCallEndReasonProperties.code = reader.getNullable(JsonReader::getInt);
} else if ("subCode".equals(fieldName)) {
deserializedAcsCallEndReasonProperties.subCode = reader.getNullable(JsonReader::getInt);
} else if ("phrase".equals(fieldName)) {
deserializedAcsCallEndReasonProperties.phrase = reader.getString();
} else {
reader.skipChildren();
}
}

return deserializedAcsCallEndReasonProperties;
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.messaging.eventgrid.systemevents;

import com.azure.core.annotation.Generated;
import com.azure.core.util.ExpandableStringEnum;
import java.util.Collection;

/**
* Call ended participant kind.
*/
public final class AcsCallEndedByKind extends ExpandableStringEnum<AcsCallEndedByKind> {
/**
* Participant.
*/
@Generated
public static final AcsCallEndedByKind PARTICIPANT = fromString("Participant");

/**
* MicrosoftInternal.
*/
@Generated
public static final AcsCallEndedByKind MICROSOFT_INTERNAL = fromString("MicrosoftInternal");

/**
* Creates a new instance of AcsCallEndedByKind value.
*
* @deprecated Use the {@link #fromString(String)} factory method.
*/
@Generated
@Deprecated
public AcsCallEndedByKind() {
}

/**
* Creates or finds a AcsCallEndedByKind from its string representation.
*
* @param name a name to look for.
* @return the corresponding AcsCallEndedByKind.
*/
@Generated
public static AcsCallEndedByKind fromString(String name) {
return fromString(name, AcsCallEndedByKind.class);
}

/**
* Gets known AcsCallEndedByKind values.
*
* @return known AcsCallEndedByKind values.
*/
@Generated
public static Collection<AcsCallEndedByKind> values() {
return values(AcsCallEndedByKind.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.messaging.eventgrid.systemevents;

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
* Schema of calling event endedby properties.
*/
@Immutable
public final class AcsCallEndedByProperties implements JsonSerializable<AcsCallEndedByProperties> {
/*
* The communication identifier of the call ended by
*/
@Generated
private final CommunicationIdentifierModel communicationIdentifier;

/*
* The type of call ended by.
*/
@Generated
private final AcsCallEndedByKind type;

/*
* The name of the call ended by.
*/
@Generated
private final String name;

/**
* Creates an instance of AcsCallEndedByProperties class.
*
* @param communicationIdentifier the communicationIdentifier value to set.
* @param type the type value to set.
* @param name the name value to set.
*/
@Generated
private AcsCallEndedByProperties(CommunicationIdentifierModel communicationIdentifier, AcsCallEndedByKind type,
String name) {
this.communicationIdentifier = communicationIdentifier;
this.type = type;
this.name = name;
}

/**
* Get the communicationIdentifier property: The communication identifier of the call ended by.
*
* @return the communicationIdentifier value.
*/
@Generated
public CommunicationIdentifierModel getCommunicationIdentifier() {
return this.communicationIdentifier;
}

/**
* Get the type property: The type of call ended by.
*
* @return the type value.
*/
@Generated
public AcsCallEndedByKind getType() {
return this.type;
}

/**
* Get the name property: The name of the call ended by.
*
* @return the name value.
*/
@Generated
public String getName() {
return this.name;
}

/**
* {@inheritDoc}
*/
@Generated
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("communicationIdentifier", this.communicationIdentifier);
jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
jsonWriter.writeStringField("name", this.name);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of AcsCallEndedByProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AcsCallEndedByProperties if the JsonReader was pointing to an instance of it, or null if
* it was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the AcsCallEndedByProperties.
*/
@Generated
public static AcsCallEndedByProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
CommunicationIdentifierModel communicationIdentifier = null;
AcsCallEndedByKind type = null;
String name = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("communicationIdentifier".equals(fieldName)) {
communicationIdentifier = CommunicationIdentifierModel.fromJson(reader);
} else if ("type".equals(fieldName)) {
type = AcsCallEndedByKind.fromString(reader.getString());
} else if ("name".equals(fieldName)) {
name = reader.getString();
} else {
reader.skipChildren();
}
}
return new AcsCallEndedByProperties(communicationIdentifier, type, name);
});
}
}
Loading