public CreateConversionSettings(AssetConversionOptions settings) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } Settings = settings; }
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)); }
#pragma warning restore CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable. #region Conversions /// <summary> /// Creates a conversion using an asset stored in an Azure Blob Storage account. /// If the remote rendering account has been linked with the storage account no Shared Access Signatures (storageContainerReadListSas, storageContainerWriteSas) for storage access need to be provided. /// Documentation how to link your Azure Remote Rendering account with the Azure Blob Storage account can be found in the [documentation](https://docs.microsoft.com/azure/remote-rendering/how-tos/create-an-account#link-storage-accounts). /// All files in the input container starting with the blobPrefix will be retrieved to perform the conversion. To cut down on conversion times only necessary files should be available under the blobPrefix. /// . /// </summary> /// <param name="conversionId"> An ID uniquely identifying the conversion for the given account. The ID is case sensitive, can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 256 characters. </param> /// <param name="options"> The settings for an asset conversion. </param> /// <param name="cancellationToken"> The cancellation token to use. </param> /// <exception cref="ArgumentNullException"> <paramref name="conversionId"/> or <paramref name="options"/> is null. </exception> public virtual AssetConversionOperation StartConversion(string conversionId, AssetConversionOptions options, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(RemoteRenderingClient)}.{nameof(StartConversion)}"); scope.AddAttribute(nameof(conversionId), conversionId); scope.Start(); try { var result = _restClient.CreateConversion(_accountId, conversionId, new CreateConversionSettings(options), cancellationToken); return(new AssetConversionOperation(this, result)); } catch (Exception ex) { scope.Failed(ex); throw; } }
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)); }