Skip to content

Commit

Permalink
Added Alpha3 Java Media Streaming Events (#40002)
Browse files Browse the repository at this point in the history
* Added Alpha3 Java Media Streaming Events

* updating readme to add the media streaming events to remove model

---------

Co-authored-by: Vinothini Dharmaraj <v-vdharmaraj@microsoft.com>
  • Loading branch information
v-durgeshs and v-vdharmaraj committed May 2, 2024
1 parent c6c520e commit 222f2d9
Show file tree
Hide file tree
Showing 15 changed files with 1,011 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
import com.azure.communication.callautomation.models.events.SendDtmfTonesCompleted;
import com.azure.communication.callautomation.models.events.SendDtmfTonesFailed;
import com.azure.communication.callautomation.models.events.TranscriptionUpdated;
import com.azure.communication.callautomation.models.events.MediaStreamingStarted;
import com.azure.communication.callautomation.models.events.MediaStreamingStopped;
import com.azure.communication.callautomation.models.events.MediaStreamingFailed;
import com.azure.core.models.CloudEvent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.core.JsonProcessingException;
Expand Down Expand Up @@ -190,6 +193,12 @@ private static CallAutomationEventBase parseSingleCloudEvent(String data, String
ret = mapper.convertValue(eventData, CreateCallFailed.class);
} else if (Objects.equals(eventType, "Microsoft.Communication.HoldFailed")) {
ret = mapper.convertValue(eventData, HoldFailed.class);
} else if (Objects.equals(eventType, "Microsoft.Communication.MediaStreamingStarted")) {
ret = mapper.convertValue(eventData, MediaStreamingStarted.class);
} else if (Objects.equals(eventType, "Microsoft.Communication.MediaStreamingStopped")) {
ret = mapper.convertValue(eventData, MediaStreamingStopped.class);
} else if (Objects.equals(eventType, "Microsoft.Communication.MediaStreamingFailed")) {
ret = mapper.convertValue(eventData, MediaStreamingFailed.class);
}
return ret;
} catch (RuntimeException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.communication.callautomation.implementation.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The MediaStreamingFailed model. */
@Immutable
public final class MediaStreamingFailed {
/*
* Used by customers when calling mid-call actions to correlate the request
* to the response event.
*/
@JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY)
private String operationContext;

/*
* Contains the resulting SIP code, sub-code and message.
*/
@JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY)
private ResultInformation resultInformation;

/*
* Defines the result for audio streaming update with the current status
* and the details about the status
*/
@JsonProperty(value = "mediaStreamingUpdate", access = JsonProperty.Access.WRITE_ONLY)
private MediaStreamingUpdate mediaStreamingUpdate;

/*
* Call connection ID.
*/
@JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY)
private String callConnectionId;

/*
* Server call ID.
*/
@JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY)
private String serverCallId;

/*
* Correlation ID for event to call correlation. Also called ChainId for
* skype chain ID.
*/
@JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY)
private String correlationId;

/**
* Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to
* the response event.
*
* @return the operationContext value.
*/
public String getOperationContext() {
return this.operationContext;
}

/**
* Get the resultInformation property: Contains the resulting SIP code, sub-code and message.
*
* @return the resultInformation value.
*/
public ResultInformation getResultInformation() {
return this.resultInformation;
}

/**
* Get the mediaStreamingUpdate property: Defines the result for audio streaming update with the current status and
* the details about the status.
*
* @return the mediaStreamingUpdate value.
*/
public MediaStreamingUpdate getMediaStreamingUpdate() {
return this.mediaStreamingUpdate;
}

/**
* Get the callConnectionId property: Call connection ID.
*
* @return the callConnectionId value.
*/
public String getCallConnectionId() {
return this.callConnectionId;
}

/**
* Get the serverCallId property: Server call ID.
*
* @return the serverCallId value.
*/
public String getServerCallId() {
return this.serverCallId;
}

/**
* Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain
* ID.
*
* @return the correlationId value.
*/
public String getCorrelationId() {
return this.correlationId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.communication.callautomation.implementation.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The MediaStreamingStarted model. */
@Immutable
public final class MediaStreamingStarted {
/*
* Used by customers when calling mid-call actions to correlate the request
* to the response event.
*/
@JsonProperty(value = "operationContext", access = JsonProperty.Access.WRITE_ONLY)
private String operationContext;

/*
* Contains the resulting SIP code, sub-code and message.
*/
@JsonProperty(value = "resultInformation", access = JsonProperty.Access.WRITE_ONLY)
private ResultInformation resultInformation;

/*
* Defines the result for audio streaming update with the current status
* and the details about the status
*/
@JsonProperty(value = "mediaStreamingUpdate", access = JsonProperty.Access.WRITE_ONLY)
private MediaStreamingUpdate mediaStreamingUpdate;

/*
* Call connection ID.
*/
@JsonProperty(value = "callConnectionId", access = JsonProperty.Access.WRITE_ONLY)
private String callConnectionId;

/*
* Server call ID.
*/
@JsonProperty(value = "serverCallId", access = JsonProperty.Access.WRITE_ONLY)
private String serverCallId;

/*
* Correlation ID for event to call correlation. Also called ChainId for
* skype chain ID.
*/
@JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY)
private String correlationId;

/**
* Get the operationContext property: Used by customers when calling mid-call actions to correlate the request to
* the response event.
*
* @return the operationContext value.
*/
public String getOperationContext() {
return this.operationContext;
}

/**
* Get the resultInformation property: Contains the resulting SIP code, sub-code and message.
*
* @return the resultInformation value.
*/
public ResultInformation getResultInformation() {
return this.resultInformation;
}

/**
* Get the mediaStreamingUpdate property: Defines the result for audio streaming update with the current status and
* the details about the status.
*
* @return the mediaStreamingUpdate value.
*/
public MediaStreamingUpdate getMediaStreamingUpdate() {
return this.mediaStreamingUpdate;
}

/**
* Get the callConnectionId property: Call connection ID.
*
* @return the callConnectionId value.
*/
public String getCallConnectionId() {
return this.callConnectionId;
}

/**
* Get the serverCallId property: Server call ID.
*
* @return the serverCallId value.
*/
public String getServerCallId() {
return this.serverCallId;
}

/**
* Get the correlationId property: Correlation ID for event to call correlation. Also called ChainId for skype chain
* ID.
*
* @return the correlationId value.
*/
public String getCorrelationId() {
return this.correlationId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.communication.callautomation.implementation.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** Defines values for MediaStreamingStatus. */
public final class MediaStreamingStatus extends ExpandableStringEnum<MediaStreamingStatus> {
/** Static value mediaStreamingStarted for MediaStreamingStatus. */
public static final MediaStreamingStatus MEDIA_STREAMING_STARTED = fromString("mediaStreamingStarted");

/** Static value mediaStreamingFailed for MediaStreamingStatus. */
public static final MediaStreamingStatus MEDIA_STREAMING_FAILED = fromString("mediaStreamingFailed");

/** Static value mediaStreamingStopped for MediaStreamingStatus. */
public static final MediaStreamingStatus MEDIA_STREAMING_STOPPED = fromString("mediaStreamingStopped");

/** Static value unspecifiedError for MediaStreamingStatus. */
public static final MediaStreamingStatus UNSPECIFIED_ERROR = fromString("unspecifiedError");

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

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

package com.azure.communication.callautomation.implementation.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** Defines values for MediaStreamingStatusDetails. */
public final class MediaStreamingStatusDetails extends ExpandableStringEnum<MediaStreamingStatusDetails> {
/** Static value subscriptionStarted for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails SUBSCRIPTION_STARTED = fromString("subscriptionStarted");

/** Static value streamConnectionReestablished for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails STREAM_CONNECTION_REESTABLISHED =
fromString("streamConnectionReestablished");

/** Static value streamConnectionUnsuccessful for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails STREAM_CONNECTION_UNSUCCESSFUL =
fromString("streamConnectionUnsuccessful");

/** Static value streamUrlMissing for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails STREAM_URL_MISSING = fromString("streamUrlMissing");

/** Static value serviceShutdown for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails SERVICE_SHUTDOWN = fromString("serviceShutdown");

/** Static value streamConnectionInterrupted for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails STREAM_CONNECTION_INTERRUPTED =
fromString("streamConnectionInterrupted");

/** Static value speechServicesConnectionError for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails SPEECH_SERVICES_CONNECTION_ERROR =
fromString("speechServicesConnectionError");

/** Static value subscriptionStopped for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails SUBSCRIPTION_STOPPED = fromString("subscriptionStopped");

/** Static value unspecifiedError for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails UNSPECIFIED_ERROR = fromString("unspecifiedError");

/** Static value authenticationFailure for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails AUTHENTICATION_FAILURE = fromString("authenticationFailure");

/** Static value badRequest for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails BAD_REQUEST = fromString("badRequest");

/** Static value tooManyRequests for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails TOO_MANY_REQUESTS = fromString("tooManyRequests");

/** Static value forbidden for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails FORBIDDEN = fromString("forbidden");

/** Static value serviceTimeout for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails SERVICE_TIMEOUT = fromString("serviceTimeout");

/** Static value initialWebSocketConnectionFailed for MediaStreamingStatusDetails. */
public static final MediaStreamingStatusDetails INITIAL_WEB_SOCKET_CONNECTION_FAILED =
fromString("initialWebSocketConnectionFailed");

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

/** @return known MediaStreamingStatusDetails values. */
public static Collection<MediaStreamingStatusDetails> values() {
return values(MediaStreamingStatusDetails.class);
}
}

0 comments on commit 222f2d9

Please sign in to comment.