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

Commit

Permalink
New enum for JobState
Browse files Browse the repository at this point in the history
  • Loading branch information
xpouyat committed Nov 16, 2023
1 parent 2802c13 commit 19cc743
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 13 deletions.
2 changes: 1 addition & 1 deletion MK.IO/CsharpDotNet2/Model/JobProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class JobProperties
/// <value>The current state of the job.</value>
[DataMember(Name = "state", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "state")]
public string State { get; set; }
public JobState State { get; set; }


/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions MK.IO/Job/Models/AbsoluteClipTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ namespace MK.IO
/// </summary>
public class AbsoluteClipTime : JobInputTime
{
public AbsoluteClipTime(TimeSpan time)
{
Time = time;
}

[JsonProperty("@odata.type")]
internal string OdataType => "#Microsoft.Media.AbsoluteClipTime";

Check warning on line 19 in MK.IO/Job/Models/AbsoluteClipTime.cs

View workflow job for this annotation

GitHub Actions / create_nuget

'AbsoluteClipTime.OdataType' hides inherited member 'JobInputTime.OdataType'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword.

Expand Down
33 changes: 24 additions & 9 deletions MK.IO/Job/Models/JobState.cs
Original file line number Diff line number Diff line change
@@ -1,47 +1,62 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Runtime.Serialization;

namespace MK.IO
{
/// <summary> Defines values for JobState. </summary>
public readonly partial struct JobState
/// <summary>
/// The current state of the job.
/// </summary>
/// <value>The current state of the job.</value>
[JsonConverter(typeof(StringEnumConverter))]
public enum JobState
{
//
// Summary:
// The job was canceled. This is a final state for the job.
public static readonly string Canceled = "Canceled";
[EnumMember(Value = "Canceled")]
Canceled = 1,

//
// Summary:
// The job is in the process of being canceled. This is a transient state for the
// job.
public static readonly string Canceling = "Canceling";
[EnumMember(Value = "Canceling")]
Canceling = 2,

//
// Summary:
// The job has encountered an error. This is a final state for the job.
public static readonly string Error = "Error";
[EnumMember(Value = "Error")]
Error = 3,

//
// Summary:
// The job is finished. This is a final state for the job.
public static readonly string Finished = "Finished";
[EnumMember(Value = "Finished")]
Finished = 4,

//
// Summary:
// The job is processing. This is a transient state for the job.
public static readonly string Processing = "Processing";
[EnumMember(Value = "Processing")]
Processing = 5,

//
// Summary:
// The job is in a queued state, waiting for resources to become available. This
// is a transient state.
public static readonly string Queued = "Queued";
[EnumMember(Value = "Queued")]
Queued = 6,

//
// Summary:
// The job is being scheduled to run on an available resource. This is a transient
// state, between queued and processing states.
public static readonly string Scheduled = "Scheduled";
[EnumMember(Value = "Scheduled")]
Scheduled = 7
}
}
6 changes: 6 additions & 0 deletions MK.IO/Job/Models/UtcClipTime.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using MK.IO.Models;
using Newtonsoft.Json;
using System.Runtime.Serialization;
using System.Text;
Expand All @@ -10,6 +11,11 @@ namespace MK.IO
/// </summary>
public class UtcClipTime : JobInputTime
{
public UtcClipTime(DateTime time)
{
Time = time;
}

[JsonProperty("@odata.type")]
internal string OdataType => "#Microsoft.Media.UtcClipTime";

Check warning on line 20 in MK.IO/Job/Models/UtcClipTime.cs

View workflow job for this annotation

GitHub Actions / create_nuget

'UtcClipTime.OdataType' hides inherited member 'JobInputTime.OdataType'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword.

Expand Down
6 changes: 3 additions & 3 deletions MK.IO/MK.IO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<Description>A client library for MediaKind MK/IO.</Description>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Version>1.0.5</Version>
<Version>1.0.6</Version>
<RepositoryUrl>https://github.com/xpouyat/MK.IO</RepositoryUrl>
<PackageProjectUrl>https://github.com/xpouyat/MK.IO/blob/master/README.md</PackageProjectUrl>
<AssemblyVersion>1.0.5.0</AssemblyVersion>
<FileVersion>1.0.5.0</FileVersion>
<AssemblyVersion>1.0.6.0</AssemblyVersion>
<FileVersion>1.0.6.0</FileVersion>
<Title>A client library for MediaKind MK/IO.</Title>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down

0 comments on commit 19cc743

Please sign in to comment.