internal AssetConversion(string conversionId, AssetConversionOptions options, AssetConversionOutput output, RemoteRenderingServiceError error, AssetConversionStatus status, DateTimeOffset createdOn) { ConversionId = conversionId; Options = options; Output = output; Error = error; Status = status; CreatedOn = createdOn; }
internal static AssetConversion DeserializeAssetConversion(JsonElement element) { string id = default; AssetConversionOptions settings = default; Optional <AssetConversionOutput> output = default; RemoteRenderingServiceError error = default; AssetConversionStatus status = default; DateTimeOffset creationTime = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) { id = property.Value.GetString(); continue; } if (property.NameEquals("settings")) { settings = AssetConversionOptions.DeserializeAssetConversionOptions(property.Value); continue; } if (property.NameEquals("output")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } output = AssetConversionOutput.DeserializeAssetConversionOutput(property.Value); continue; } if (property.NameEquals("error")) { if (property.Value.ValueKind == JsonValueKind.Null) { error = null; continue; } error = RemoteRenderingServiceError.DeserializeRemoteRenderingServiceError(property.Value); continue; } if (property.NameEquals("status")) { status = new AssetConversionStatus(property.Value.GetString()); continue; } if (property.NameEquals("creationTime")) { creationTime = property.Value.GetDateTimeOffset("O"); continue; } } return(new AssetConversion(id, settings, output.Value, error, status, creationTime)); }
internal AssetConversion(string conversionId, AssetConversionOptions options, RemoteRenderingServiceError error, AssetConversionStatus status, DateTimeOffset createdOn) { if (conversionId == null) { throw new ArgumentNullException(nameof(conversionId)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } ConversionId = conversionId; Options = options; Error = error; Status = status; CreatedOn = createdOn; }
/// <summary> /// Initializes a new instance of the <see cref="AssetConversion"/> class for mocking purposes. /// </summary> public static AssetConversion AssetConversion(string conversionId, AssetConversionOptions options, AssetConversionOutput output, RemoteRenderingServiceError error, AssetConversionStatus status, DateTimeOffset createdOn) => new AssetConversion(conversionId, options, output, error, status, createdOn);
public static AssetConversion AssetConversion(string conversionId = default, AssetConversionOptions options = default, AssetConversionOutput output = default, RemoteRenderingServiceError error = default, AssetConversionStatus status = default, DateTimeOffset createdOn = default) { return(new AssetConversion(conversionId, options, output, error, status, createdOn)); }