internal static string ToSerializedValue(this MediaJobState value) { switch (value) { case MediaJobState.Canceled: return("Canceled"); case MediaJobState.Canceling: return("Canceling"); case MediaJobState.Error: return("Error"); case MediaJobState.Finished: return("Finished"); case MediaJobState.Processing: return("Processing"); case MediaJobState.Queued: return("Queued"); case MediaJobState.Scheduled: return("Scheduled"); } return(null); }
/// <summary> /// Initializes a new instance of the /// MediaJobOutputStateChangeEventData class. /// </summary> /// <param name="previousState">The previous state of the Job. Possible /// values include: 'Canceled', 'Canceling', 'Error', 'Finished', /// 'Processing', 'Queued', 'Scheduled'</param> /// <param name="output">Gets the output.</param> /// <param name="jobCorrelationData">Gets the Job correlation /// data.</param> public MediaJobOutputStateChangeEventData(MediaJobState previousState = default(MediaJobState), MediaJobOutput output = default(MediaJobOutput), IDictionary <string, string> jobCorrelationData = default(IDictionary <string, string>)) { PreviousState = previousState; Output = output; JobCorrelationData = jobCorrelationData; CustomInit(); }
/// <summary> /// Initializes a new instance of the MediaJobStateChangeEventData /// class. /// </summary> /// <param name="previousState">The previous state of the Job. Possible /// values include: 'Canceled', 'Canceling', 'Error', 'Finished', /// 'Processing', 'Queued', 'Scheduled'</param> /// <param name="state">The new state of the Job. Possible values /// include: 'Canceled', 'Canceling', 'Error', 'Finished', /// 'Processing', 'Queued', 'Scheduled'</param> /// <param name="correlationData">Gets the Job correlation /// data.</param> public MediaJobStateChangeEventData(MediaJobState previousState = default(MediaJobState), MediaJobState state = default(MediaJobState), IDictionary <string, string> correlationData = default(IDictionary <string, string>)) { PreviousState = previousState; State = state; CorrelationData = correlationData; CustomInit(); }
internal MediaJobOutput(string odataType, MediaJobError error, string label, long progress, MediaJobState state) { OdataType = odataType; Error = error; Label = label; Progress = progress; State = state; }
/// <summary> /// Initializes a new instance of the MediaJobOutput class. /// </summary> /// <param name="progress">Gets the Job output progress.</param> /// <param name="state">Gets the Job output state. Possible values /// include: 'Canceled', 'Canceling', 'Error', 'Finished', /// 'Processing', 'Queued', 'Scheduled'</param> /// <param name="error">Gets the Job output error.</param> /// <param name="label">Gets the Job output label.</param> public MediaJobOutput(long progress, MediaJobState state, MediaJobError error = default(MediaJobError), string label = default(string)) { Error = error; Label = label; Progress = progress; State = state; CustomInit(); }
internal static MediaJobOutput DeserializeMediaJobOutput(JsonElement element) { if (element.TryGetProperty("@odata.type", out JsonElement discriminator)) { switch (discriminator.GetString()) { case "#Microsoft.Media.JobOutputAsset": return(MediaJobOutputAsset.DeserializeMediaJobOutputAsset(element)); } } string odataType = default; Optional <MediaJobError> error = default; Optional <string> label = default; long progress = default; MediaJobState state = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("error")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } error = MediaJobError.DeserializeMediaJobError(property.Value); continue; } if (property.NameEquals("label")) { label = property.Value.GetString(); continue; } if (property.NameEquals("progress")) { progress = property.Value.GetInt64(); continue; } if (property.NameEquals("state")) { state = property.Value.GetString().ToMediaJobState(); continue; } } return(new MediaJobOutput(odataType, error.Value, label.Value, progress, state)); }
internal static MediaJobOutputAsset DeserializeMediaJobOutputAsset(JsonElement element) { Optional <string> assetName = default; Optional <string> odataType = default; Optional <MediaJobError> error = default; Optional <string> label = default; long progress = default; MediaJobState state = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("assetName")) { assetName = property.Value.GetString(); continue; } if (property.NameEquals("@odata.type")) { odataType = property.Value.GetString(); continue; } if (property.NameEquals("error")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } error = MediaJobError.DeserializeMediaJobError(property.Value); continue; } if (property.NameEquals("label")) { label = property.Value.GetString(); continue; } if (property.NameEquals("progress")) { progress = property.Value.GetInt64(); continue; } if (property.NameEquals("state")) { state = property.Value.GetString().ToMediaJobState(); continue; } } return(new MediaJobOutputAsset(odataType.Value, error.Value, label.Value, progress, state, assetName.Value)); }
internal MediaJobOutput(long progress, MediaJobState state) { Progress = progress; State = state; }
/// <summary> /// Initializes a new instance of the MediaJobProcessingEventData /// class. /// </summary> /// <param name="previousState">The previous state of the Job. Possible /// values include: 'Canceled', 'Canceling', 'Error', 'Finished', /// 'Processing', 'Queued', 'Scheduled'</param> /// <param name="state">The new state of the Job. Possible values /// include: 'Canceled', 'Canceling', 'Error', 'Finished', /// 'Processing', 'Queued', 'Scheduled'</param> /// <param name="correlationData">Gets the Job correlation /// data.</param> public MediaJobProcessingEventData(MediaJobState previousState = default(MediaJobState), MediaJobState state = default(MediaJobState), IDictionary <string, string> correlationData = default(IDictionary <string, string>)) : base(previousState, state, correlationData) { CustomInit(); }
/// <summary> /// Initializes a new instance of the MediaJobOutputErroredEventData /// class. /// </summary> /// <param name="previousState">The previous state of the Job. Possible /// values include: 'Canceled', 'Canceling', 'Error', 'Finished', /// 'Processing', 'Queued', 'Scheduled'</param> /// <param name="output">Gets the output.</param> /// <param name="jobCorrelationData">Gets the Job correlation /// data.</param> public MediaJobOutputErroredEventData(MediaJobState previousState = default(MediaJobState), MediaJobOutput output = default(MediaJobOutput), IDictionary <string, string> jobCorrelationData = default(IDictionary <string, string>)) : base(previousState, output, jobCorrelationData) { CustomInit(); }
/// <summary> /// Initializes a new instance of the MediaJobFinishedEventData class. /// </summary> /// <param name="previousState">The previous state of the Job. Possible /// values include: 'Canceled', 'Canceling', 'Error', 'Finished', /// 'Processing', 'Queued', 'Scheduled'</param> /// <param name="state">The new state of the Job. Possible values /// include: 'Canceled', 'Canceling', 'Error', 'Finished', /// 'Processing', 'Queued', 'Scheduled'</param> /// <param name="correlationData">Gets the Job correlation /// data.</param> /// <param name="outputs">Gets the Job outputs.</param> public MediaJobFinishedEventData(MediaJobState previousState = default(MediaJobState), MediaJobState state = default(MediaJobState), IDictionary <string, string> correlationData = default(IDictionary <string, string>), IList <MediaJobOutput> outputs = default(IList <MediaJobOutput>)) : base(previousState, state, correlationData) { Outputs = outputs; CustomInit(); }
public static string ToSerialString(this MediaJobState value) => value switch {
internal MediaJobOutputAsset(string odataType, MediaJobError error, string label, long progress, MediaJobState state, string assetName) : base(odataType, error, label, progress, state) { AssetName = assetName; OdataType = odataType ?? "#Microsoft.Media.JobOutputAsset"; }
internal MediaJobOutputAsset(long progress, MediaJobState state) : base(progress, state) { OdataType = "#Microsoft.Media.JobOutputAsset"; }
/// <summary> /// Initializes a new instance of the MediaJobOutputAsset class. /// </summary> /// <param name="progress">Gets the Job output progress.</param> /// <param name="state">Gets the Job output state. Possible values /// include: 'Canceled', 'Canceling', 'Error', 'Finished', /// 'Processing', 'Queued', 'Scheduled'</param> /// <param name="error">Gets the Job output error.</param> /// <param name="label">Gets the Job output label.</param> /// <param name="assetName">Gets the Job output asset name.</param> public MediaJobOutputAsset(long progress, MediaJobState state, MediaJobError error = default(MediaJobError), string label = default(string), string assetName = default(string)) : base(progress, state, error, label) { AssetName = assetName; CustomInit(); }