Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from xpouyat/dev
Browse files Browse the repository at this point in the history
Better doc, support for streaming endpoint scale and update
  • Loading branch information
xpouyat authored Dec 21, 2023
2 parents de8a2e1 + ae7ef83 commit ebfdbfd
Show file tree
Hide file tree
Showing 22 changed files with 306 additions and 172 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/publishnuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ defaults:
jobs:
create_nuget:
runs-on: windows-2019
needs: [ run_test ]

steps:
- uses: actions/checkout@v3
Expand All @@ -33,7 +32,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.x'
dotnet-version: '6.x'

# Create the NuGet package in the folder from the environment variable NuGetDirectory
- run: dotnet build MK.IO\MK.IO.csproj --configuration Release
Expand Down Expand Up @@ -69,7 +68,7 @@ jobs:
# You can update this logic if you want to manage releases differently
if: github.event_name == 'release'
runs-on: windows-latest
needs: [ create_nuget ]
needs: [ create_nuget, run_test ]
steps:
# Download the NuGet package created in the previous job
- uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion MK.IO.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleNetFramework4.8", "Sa
{D49EB09F-BB45-446F-8CC6-29E1C6E73EFB} = {D49EB09F-BB45-446F-8CC6-29E1C6E73EFB}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleCore3.1", "SampleCore3.1\SampleCore3.1.csproj", "{7E4DC505-6D8E-4210-9EB1-9A71F0754D60}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleCore3.1", "SampleCore3.1\SampleCore3.1.csproj", "{7E4DC505-6D8E-4210-9EB1-9A71F0754D60}"
ProjectSection(ProjectDependencies) = postProject
{D49EB09F-BB45-446F-8CC6-29E1C6E73EFB} = {D49EB09F-BB45-446F-8CC6-29E1C6E73EFB}
EndProjectSection
Expand Down
2 changes: 1 addition & 1 deletion MK.IO/AccountFilter/AccountFiltersOperations.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MK.IO.Models;
using Newtonsoft.Json;
#if NET45
#if NET462
using System.Net.Http;
#endif

Expand Down
2 changes: 1 addition & 1 deletion MK.IO/Asset/AssetsOperations.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using MK.IO.Models;
using Newtonsoft.Json;
using System.Net;
#if NET45
#if NET462
using System.Net.Http;
#endif

Expand Down
2 changes: 1 addition & 1 deletion MK.IO/AssetFilter/AssetFiltersOperations.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MK.IO.Models;
using Newtonsoft.Json;
#if NET45
#if NET462
using System.Net.Http;
#endif

Expand Down
3 changes: 1 addition & 2 deletions MK.IO/ContentKeyPolicy/ContentKeyPoliciesOperations.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#if NET45
#if NET462
using System.Net.Http;
#endif

namespace MK.IO
{
/// <summary>
Expand Down
46 changes: 46 additions & 0 deletions MK.IO/CsharpDotNet2/Model/StreamingEndpointScaleSchema.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System.Text;
using System.Runtime.Serialization;
using Newtonsoft.Json;

namespace MK.IO.Models
{

/// <summary>
///
/// </summary>
[DataContract]
public class StreamingEndpointScaleSchema
{
/// <summary>
/// The scale unit count for this streaming endpoint.
/// </summary>
/// <value>The scale unit count for this streaming endpoint.</value>
[DataMember(Name = "scaleUnit", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "scaleUnit")]
public int? ScaleUnit { get; set; }


/// <summary>
/// Get the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class StreamingEndpointScaleSchema {\n");
sb.Append(" ScaleUnit: ").Append(ScaleUnit).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Get the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, ConverterLE.Settings);
}

}
}
3 changes: 2 additions & 1 deletion MK.IO/Job/JobsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

using MK.IO.Models;
using Newtonsoft.Json;
#if NET45

#if NET462
using System.Net.Http;
#endif

Expand Down
32 changes: 16 additions & 16 deletions MK.IO/LiveEvent/ILiveEventsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ public interface ILiveEventsOperations
/// <summary>
/// Delete a live event.
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveEventName">The name of the live event.</param>
void Delete(string liveEventName);

/// <summary>
/// Delete a live event.
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveEventName">The name of the live event.</param>
/// <returns></returns>
Task DeleteAsync(string liveEventName);

/// <summary>
/// Returns a single live event.
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveEventName">The name of the live event.</param>
/// <returns></returns>
LiveEventSchema Get(string liveEventName);

Expand All @@ -47,11 +47,11 @@ public interface ILiveEventsOperations
/// <returns></returns>
Task<LiveEventSchema> GetAsync(string liveEventName);

#if NET6_0_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
/// <summary>
/// Update a live event
/// </summary>
/// <param name="liveEventName">The name of the live event</param>
/// <param name="liveEventName">The name of the live event.</param>
/// <param name="location">The location of the live event. This must match the configured location for your account.</param>
/// <param name="properties">The properties of the live event.</param>
/// <param name="tags">A dictionary of tags associated with the live event. Maximum number of tags: 16. Maximum length of a tag: 256 characters.</param>
Expand All @@ -61,7 +61,7 @@ public interface ILiveEventsOperations
/// <summary>
/// Update a live event
/// </summary>
/// <param name="liveEventName">The name of the live event</param>
/// <param name="liveEventName">The name of the live event.</param>
/// <param name="location">The location of the live event. This must match the configured location for your account.</param>
/// <param name="properties">The properties of the live event.</param>
/// <param name="tags">A dictionary of tags associated with the live event. Maximum number of tags: 16. Maximum length of a tag: 256 characters.</param>
Expand All @@ -72,7 +72,7 @@ public interface ILiveEventsOperations
/// <summary>
/// Create a single live event
/// </summary>
/// <param name="liveEventName">The name of the live event</param>
/// <param name="liveEventName">The name of the live event.</param>
/// <param name="location">The location of the live event. This must match the configured location for your account.</param>
/// <param name="properties">The properties of the live event.</param>
/// <param name="tags">A dictionary of tags associated with the live event. Maximum number of tags: 16. Maximum length of a tag: 256 characters.</param>
Expand All @@ -82,7 +82,7 @@ public interface ILiveEventsOperations
/// <summary>
/// Create a single live event
/// </summary>
/// <param name="liveEventName">The name of the live event</param>
/// <param name="liveEventName">The name of the live event.</param>
/// <param name="location">The location of the live event. This must match the configured location for your account.</param>
/// <param name="properties">The properties of the live event.</param>
/// <param name="tags">A dictionary of tags associated with the live event. Maximum number of tags: 16. Maximum length of a tag: 256 characters.</param>
Expand All @@ -92,51 +92,51 @@ public interface ILiveEventsOperations
/// <summary>
/// Allocates resources for a Live Event. A live event is in StandBy state after allocation completes, and is ready to start.
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveEventName">The name of the live event.</param>
void Allocate(string liveEventName);

/// <summary>
/// Allocates resources for a Live Event. A live event is in StandBy state after allocation completes, and is ready to start.
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveEventName">The name of the live event.</param>
Task AllocateAsync(string liveEventName);

/// <summary>
/// Resets a Live Event. All live outputs for the live event are deleted and the live event is stopped and will be started again.
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveEventName">The name of the live event.</param>
void Reset(string liveEventName);

/// <summary>
/// Resets a Live Event. All live outputs for the live event are deleted and the live event is stopped and will be started again.
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveEventName">The name of the live event.</param>
/// <returns></returns>
Task ResetAsync(string liveEventName);

/// <summary>
/// Start Live Events. This operation transitions your Live Event into a running state
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveEventName">The name of the live event.</param>
void Start(string liveEventName);

/// <summary>
/// Start Live Events. This operation transitions your Live Event into a running state
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveEventName">The name of the live event.</param>
/// <returns></returns>
Task StartAsync(string liveEventName);

/// <summary>
/// Stops a Live Event. Any active playback sessions will be interrupted.
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveEventName">The name of the live event.</param>
void Stop(string liveEventName);

/// <summary>
/// Stops a Live Event. Any active playback sessions will be interrupted.
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveEventName">The name of the live event.</param>
/// <returns></returns>
Task StopAsync(string liveEventName);
}
Expand Down
5 changes: 2 additions & 3 deletions MK.IO/LiveEvent/LiveEventsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

using MK.IO.Models;
using Newtonsoft.Json;
#if NET45
#if NET462
using System.Net.Http;
#endif

namespace MK.IO
{
/// <summary>
Expand Down Expand Up @@ -75,7 +74,7 @@ public async Task<LiveEventSchema> GetAsync(string liveEventName)
return JsonConvert.DeserializeObject<LiveEventSchema>(responseContent, ConverterLE.Settings) ?? throw new Exception("Error with live event deserialization");
}

#if NET6_0_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
/// <inheritdoc/>
public LiveEventSchema Update(string liveEventName, string location, LiveEventProperties properties, Dictionary<string, string>? tags = null)
{
Expand Down
30 changes: 16 additions & 14 deletions MK.IO/LiveOutput/ILiveOutputsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,63 @@ public interface ILiveOutputsOperations
/// <summary>
/// Returns a list of Live Outputs for a Live Event.
/// </summary>
/// <param name="liveEventName">The name of the live event.</param>
/// <returns></returns>
List<LiveOutputSchema> List(string liveEventName);

/// <summary>
/// Returns a list of Live Outputs for a Live Event.
/// </summary>
/// <param name="liveEventName">The name of the live event.</param>
/// <returns></returns>
Task<List<LiveOutputSchema>> ListAsync(string liveEventName);

/// <summary>
/// Deletes a Live Output.
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveOutputName"></param>
/// <param name="liveEventName">The name of the live event.</param>
/// <param name="liveOutputName">The name of the live output.</param>
void Delete(string liveEventName, string liveOutputName);

/// <summary>
///
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveOutputName"></param>
/// <param name="liveEventName">The name of the live event.</param>
/// <param name="liveOutputName">The name of the live output.</param>
/// <returns></returns>
Task DeleteAsync(string liveEventName, string liveOutputName);

/// <summary>
/// Returns a single Live Output.
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveOutputName"></param>
/// <param name="liveEventName">The name of the live event.</param>
/// <param name="liveOutputName">The name of the live output.</param>
/// <returns></returns>
LiveOutputSchema Get(string liveEventName, string liveOutputName);

/// <summary>
/// Returns a single Live Output.
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveOutputName"></param>
/// <param name="liveEventName">The name of the live event.</param>
/// <param name="liveOutputName">The name of the live output.</param>
/// <returns></returns>
Task<LiveOutputSchema> GetAsync(string liveEventName, string liveOutputName);

/// <summary>
/// Creates a Live Output
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveOutputName"></param>
/// <param name="properties"></param>
/// <param name="liveEventName">The name of the live event.</param>
/// <param name="liveOutputName">The name of the live output.</param>
/// <param name="properties">The properties of the live output.</param>
/// <returns></returns>
LiveOutputSchema Create(string liveEventName, string liveOutputName, LiveOutputProperties properties);

/// <summary>
/// Creates a Live Output
/// </summary>
/// <param name="liveEventName"></param>
/// <param name="liveOutputName"></param>
/// <param name="properties"></param>
/// <param name="liveEventName">The name of the live event.</param>
/// <param name="liveOutputName">The name of the live output.</param>
/// <param name="properties">The properties of the live output.</param>
/// <returns></returns>
Task<LiveOutputSchema> CreateAsync(string liveEventName, string liveOutputName, LiveOutputProperties properties);
}
Expand Down
3 changes: 1 addition & 2 deletions MK.IO/LiveOutput/LiveOutputsOperations.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.


using MK.IO.Models;
using Newtonsoft.Json;
#if NET45
#if NET462
using System.Net.Http;
#endif

Expand Down
Loading

0 comments on commit ebfdbfd

Please sign in to comment.