Skip to content
Merged
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 @@ -566,6 +566,24 @@ public void ConsumeMediaJobOutputScheduledEvent()
Assert.True(eventData.Output is MediaJobOutputAsset);
}

[Fact]
public void ConsumeMediaJobOutputProgressEvent()
{
string requestContent = "[{ \"topic\": \"/subscriptions/{subscription id}/resourceGroups/{resource group}/providers/Microsoft.Media/mediaservices/{account name}\", \"subject\": \"transforms/VideoAnalyzerTransform/jobs/job-2ac2fe75-6557-4de5-ab25-5713b74a6981\", \"eventType\": \"Microsoft.Media.JobOutputProgress\", \"eventTime\": \"2018-10-12T15:14:11.2244618\", \"id\": \"635ca6ea-5306-4590-b2e1-22f172759336\", \"data\": { \"jobCorrelationData\": { \"Field1\": \"test1\", \"Field2\": \"test2\" }, \"label\": \"TestLabel\", \"progress\": 50 }, \"dataVersion\": \"1.0\", \"metadataVersion\": \"1\"}]";

var events = this.eventGridSubscriber.DeserializeEventGridEvents(requestContent);

Assert.NotNull(events);
Assert.True(events[0].Data is MediaJobOutputProgressEventData);
MediaJobOutputProgressEventData eventData = (MediaJobOutputProgressEventData)events[0].Data;
Assert.Equal("TestLabel", eventData.Label);
Assert.Equal(50, eventData.Progress);
Assert.True(eventData.JobCorrelationData.ContainsKey("Field1"));
Assert.Equal("test1", eventData.JobCorrelationData["Field1"]);
Assert.True(eventData.JobCorrelationData.ContainsKey("Field2"));
Assert.Equal("test2", eventData.JobCorrelationData["Field2"]);
}

[Fact]
public void ConsumeMediaLiveEventEncoderConnectedEvent()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class EventTypes
public const string MediaJobOutputFinishedEvent = "Microsoft.Media.JobOutputFinished";
public const string MediaJobOutputProcessingEvent = "Microsoft.Media.JobOutputProcessing";
public const string MediaJobOutputScheduledEvent = "Microsoft.Media.JobOutputScheduled";
public const string MediaJobOutputProgressEvent = "Microsoft.Media.JobOutputProgress";
public const string MediaLiveEventEncoderConnectedEvent = "Microsoft.Media.LiveEventEncoderConnected";
public const string MediaLiveEventConnectionRejectedEvent = "Microsoft.Media.LiveEventConnectionRejected";
public const string MediaLiveEventEncoderDisconnectedEvent = "Microsoft.Media.LiveEventEncoderDisconnected";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ internal static class SystemEventTypeMappings
{ EventTypes.MediaJobOutputFinishedEvent, typeof(MediaJobOutputFinishedEventData) },
{ EventTypes.MediaJobOutputProcessingEvent, typeof(MediaJobOutputProcessingEventData) },
{ EventTypes.MediaJobOutputScheduledEvent, typeof(MediaJobOutputScheduledEventData) },
{ EventTypes.MediaJobOutputProgressEvent, typeof(MediaJobOutputProgressEventData) },
{ EventTypes.MediaLiveEventEncoderConnectedEvent, typeof(MediaLiveEventEncoderConnectedEventData) },
{ EventTypes.MediaLiveEventConnectionRejectedEvent, typeof(MediaLiveEventConnectionRejectedEventData) },
{ EventTypes.MediaLiveEventEncoderDisconnectedEvent, typeof(MediaLiveEventEncoderDisconnectedEventData) },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.EventGrid.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// Job Output Progress Event Data.
/// </summary>
public partial class MediaJobOutputProgressEventData
{
/// <summary>
/// Initializes a new instance of the MediaJobOutputProgressEventData
/// class.
/// </summary>
public MediaJobOutputProgressEventData()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the MediaJobOutputProgressEventData
/// class.
/// </summary>
/// <param name="label">Gets the Job output label.</param>
/// <param name="progress">Gets the Job output progress.</param>
/// <param name="jobCorrelationData">Gets the Job correlation
/// data.</param>
public MediaJobOutputProgressEventData(string label = default(string), long? progress = default(long?), IDictionary<string, string> jobCorrelationData = default(IDictionary<string, string>))
{
Label = label;
Progress = progress;
JobCorrelationData = jobCorrelationData;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets the Job output label.
/// </summary>
[JsonProperty(PropertyName = "label")]
public string Label { get; set; }

/// <summary>
/// Gets the Job output progress.
/// </summary>
[JsonProperty(PropertyName = "progress")]
public long? Progress { get; set; }

/// <summary>
/// Gets the Job correlation data.
/// </summary>
[JsonProperty(PropertyName = "jobCorrelationData")]
public IDictionary<string, string> JobCorrelationData { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<PropertyGroup>
<PackageId>Microsoft.Azure.EventGrid</PackageId>
<Description>This library can be used to publish events to Azure Event Grid and to consume events delivered by EventGrid. It also defines the event schemas for the events published to EventGrid by various Azure services. </Description>
<Version>3.0.0</Version>
<Version>3.1.0</Version>
<AssemblyName>Microsoft.Azure.EventGrid</AssemblyName>
<PackageTags>Microsoft Azure EventGrid;Event Grid;Event Grid Publishing;</PackageTags>
<PackageReleaseNotes>Added support for the new Azure Media Services event types for tracking state changes of Media Jobs and Media JobOutputs. The existing MediaJobStateChangeEvent can be used to get all state change events for a Job but there are now separate events for each state like MediaJobScheduledEvent, MediaJobFinishedEvent, etc. These allow subscribing for just the desired events. Likewise a MediaJobOutputStateChangeEvent was added to get events for all MediaJobOutput state changes along with individual events for each JobOutput state. This change also adds support for events related to Media LiveEvents to get notifications related to the ingestion of live streams (encoder connected, encoder disconnected, discontinuity, chunk dropped, etc). Note JobState was renamed to MediaJobState to follow the Media prefix that all of the other Media Services Event classes use. This is a breaking change, albeit a small one.</PackageReleaseNotes>
<PackageReleaseNotes>Added support for the new Azure Media Services event types for tracking state changes of Media Jobs and Media JobOutputs. The existing MediaJobStateChangeEvent can be used to get all state change events for a Job but there are now separate events for each state like MediaJobScheduledEvent, MediaJobFinishedEvent, etc. These allow subscribing for just the desired events. Likewise a MediaJobOutputStateChangeEvent was added to get events for all MediaJobOutput state changes along with individual events for each JobOutput state. MediaJobOutputProgressEvent was added to get events for Job output progress value, label and correlation data. This change also adds support for events related to Media LiveEvents to get notifications related to the ingestion of live streams (encoder connected, encoder disconnected, discontinuity, chunk dropped, etc). Note JobState was renamed to MediaJobState to follow the Media prefix that all of the other Media Services Event classes use. This is a breaking change, albeit a small one.</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net452;netstandard1.4</TargetFrameworks>
Expand Down
6 changes: 3 additions & 3 deletions src/SDKs/_metadata/eventgrid_data-plane.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\github\azure-sdk-for-net-qb\src\SDKs
2018-10-23 13:09:57 UTC
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\Users\jinshang\Desktop\azure-sdk-for-net\azure-sdk-for-net\src\SDKs
2019-01-18 21:30:32 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 15095b486206899c2ec77d2abddbaee9480021e3
Commit: 17b815413d93945f0248bfdb678432a80037cefa
AutoRest information
Requested version: latest
Bootstrapper version: autorest@2.0.4283