/// <summary>
 /// Initializes a new instance of the <see cref="AssetConversionProperties"/> for mocking purposes.
 /// </summary>
 /// <param name="clientErrorDetails"> Information about the cause of a ClientError AssetConversionStatus. </param>
 /// <param name="serverErrorDetails"> Information about the cause of a ServerError AssetConversionStatus. </param>
 /// <param name="conversionErrorCode">The error code of the AOA asset conversion job.</param>
 /// <param name="jobId"> Identifier for the AOA Asset Conversion Job. </param>
 /// <param name="outputModelUri"> The URI for downloading the generated AOA Model. </param>
 /// <param name="assetConversionStatus"> The status of the AOA asset conversion job. </param>
 /// <param name="assetFileType"> The file type of the original 3D asset. Examples include: &quot;ply&quot;, &quot;obj&quot;, &quot;fbx&quot;, &quot;glb&quot;, &quot;gltf&quot;, etc. </param>
 /// <param name="uploadedInputAssetUri"> The Uri to the Asset to be ingested by the AOA Asset Conversion Service. This asset needs to have been uploaded to the service using an endpoint provided from a call to the GetUploadUri API. </param>
 /// <param name="accountId"> Identifier for the Account owning the AOA asset conversion Job. </param>
 /// <param name="assetConversionConfiguration"> The configuration of the AOA asset conversion job. </param>
 /// <param name="scaledAssetDimensions">The scaled dimensions of the asset.</param>
 /// <returns> A new instance of the <see cref="AssetConversionProperties"/> for mocking purposes. </returns>
 public static AssetConversionProperties AssetConversionProperties(
     string clientErrorDetails,
     string serverErrorDetails,
     ConversionErrorCode conversionErrorCode,
     Guid?jobId,
     Uri outputModelUri,
     AssetConversionStatus?assetConversionStatus,
     AssetFileType assetFileType,
     Uri uploadedInputAssetUri,
     Guid?accountId,
     AssetConversionConfiguration assetConversionConfiguration,
     System.Numerics.Vector3 scaledAssetDimensions)
 {
     return(new AssetConversionProperties(
                clientErrorDetails,
                serverErrorDetails,
                conversionErrorCode,
                jobId,
                outputModelUri.AbsoluteUri,
                assetConversionStatus,
                assetFileType.ToString(),
                uploadedInputAssetUri.AbsoluteUri,
                accountId,
                assetConversionConfiguration,
                new Vector3(scaledAssetDimensions)));
 }
Exemple #2
0
 internal AssetConversionProperties(string clientErrorDetails, string serverErrorDetails, Guid?jobIdInternal, string outputModelUriString, AssetConversionStatus?conversionStatus, string assetFileTypeString, string inputAssetUriString, Guid?accountIdInternal, AssetConversionConfiguration conversionConfiguration)
 {
     ClientErrorDetails      = clientErrorDetails;
     ServerErrorDetails      = serverErrorDetails;
     JobIdInternal           = jobIdInternal;
     OutputModelUriString    = outputModelUriString;
     ConversionStatus        = conversionStatus;
     AssetFileTypeString     = assetFileTypeString;
     InputAssetUriString     = inputAssetUriString;
     AccountIdInternal       = accountIdInternal;
     ConversionConfiguration = conversionConfiguration;
 }
Exemple #3
0
 internal AssetConversionProperties(string clientErrorDetails, string serverErrorDetails, ConversionErrorCode errorCode, Guid?jobIdInternal, string outputModelUriString, AssetConversionStatus?conversionStatus, string assetFileTypeString, string inputAssetUriString, Guid?accountIdInternal, AssetConversionConfiguration conversionConfiguration, Vector3 scaledAssetDimensionsWrapper)
 {
     ClientErrorDetails           = clientErrorDetails;
     ServerErrorDetails           = serverErrorDetails;
     ErrorCode                    = errorCode;
     JobIdInternal                = jobIdInternal;
     OutputModelUriString         = outputModelUriString;
     ConversionStatus             = conversionStatus;
     AssetFileTypeString          = assetFileTypeString;
     InputAssetUriString          = inputAssetUriString;
     AccountIdInternal            = accountIdInternal;
     ConversionConfiguration      = conversionConfiguration;
     ScaledAssetDimensionsWrapper = scaledAssetDimensionsWrapper;
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AssetConversionProperties"/> for mocking purposes.
 /// </summary>
 /// <param name="clientErrorDetails"> Information about the cause of a ClientError AssetConversionStatus. </param>
 /// <param name="serverErrorDetails"> Information about the cause of a ServerError AssetConversionStatus. </param>
 /// <param name="jobId"> Identifier for the AOA Asset Conversion Job. </param>
 /// <param name="outputModelUri"> The URI for downloading the generated AOA Model. </param>
 /// <param name="assetConversionStatus"> The status of the AOA asset conversion job </param>
 /// <param name="assetFileType"> The file type of the original 3D asset. Examples include: &quot;ply&quot;, &quot;obj&quot;, &quot;fbx&quot;, &quot;glb&quot;, &quot;gltf&quot;, etc. </param>
 /// <param name="uploadedInputAssetUri"> The Uri to the Asset to be ingested by the AOA Asset Conversion Service. This asset needs to have been uploaded to the service using an endpoint provided from a call to the GetUploadUri API. </param>
 /// <param name="accountId"> Identifier for the Account owning the AOA asset conversion Job. </param>
 /// <param name="assetConversionConfiguration"> The configuration of the AOA asset conversion job </param>
 /// <returns> A new instance of the <see cref="AssetConversionProperties"/> for mocking purposes. </returns>
 public static AssetConversionProperties AssetConversionProperties(
     string clientErrorDetails,
     string serverErrorDetails,
     Guid?jobId,
     Uri outputModelUri,
     AssetConversionStatus?assetConversionStatus,
     AssetFileType assetFileType,
     Uri uploadedInputAssetUri,
     Guid?accountId,
     AssetConversionConfiguration assetConversionConfiguration)
 {
     return(new AssetConversionProperties(
                clientErrorDetails,
                serverErrorDetails,
                jobId,
                outputModelUri.AbsoluteUri,
                assetConversionStatus,
                assetFileType.ToString(),
                uploadedInputAssetUri.AbsoluteUri,
                accountId,
                assetConversionConfiguration));
 }
        internal static AssetConversionProperties DeserializeAssetConversionProperties(JsonElement element)
        {
            Optional <string> clientErrorDetails     = default;
            Optional <string> serverErrorDetails     = default;
            Optional <ConversionErrorCode> errorCode = default;
            Optional <Guid>   jobId                    = default;
            Optional <string> outputModelUri           = default;
            Optional <AssetConversionStatus> jobStatus = default;
            Optional <string> assetFileType            = default;
            Optional <string> inputAssetUri            = default;
            Optional <Guid>   accountId                = default;
            Optional <AssetConversionConfiguration> ingestionConfiguration = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("clientErrorDetails"))
                {
                    clientErrorDetails = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("serverErrorDetails"))
                {
                    serverErrorDetails = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("errorCode"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    errorCode = new ConversionErrorCode(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("jobId"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    jobId = property.Value.GetGuid();
                    continue;
                }
                if (property.NameEquals("outputModelUri"))
                {
                    outputModelUri = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("jobStatus"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    jobStatus = property.Value.GetString().ToAssetConversionStatus();
                    continue;
                }
                if (property.NameEquals("assetFileType"))
                {
                    assetFileType = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("inputAssetUri"))
                {
                    inputAssetUri = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("accountId"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    accountId = property.Value.GetGuid();
                    continue;
                }
                if (property.NameEquals("ingestionConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    ingestionConfiguration = AssetConversionConfiguration.DeserializeAssetConversionConfiguration(property.Value);
                    continue;
                }
            }
            return(new AssetConversionProperties(clientErrorDetails.Value, serverErrorDetails.Value, errorCode, Optional.ToNullable(jobId), outputModelUri.Value, Optional.ToNullable(jobStatus), assetFileType.Value, inputAssetUri.Value, Optional.ToNullable(accountId), ingestionConfiguration.Value));
        }
Exemple #6
0
 public static AssetConversionProperties AssetConversionProperties(string clientErrorDetails = default, string serverErrorDetails = default, ConversionErrorCode errorCode = default, Guid?jobIdInternal = default, string outputModelUriString = default, AssetConversionStatus?conversionStatus = default, string assetFileTypeString = default, string inputAssetUriString = default, Guid?accountIdInternal = default, AssetConversionConfiguration conversionConfiguration = default)
 {
     return(new AssetConversionProperties(clientErrorDetails, serverErrorDetails, errorCode, jobIdInternal, outputModelUriString, conversionStatus, assetFileTypeString, inputAssetUriString, accountIdInternal, conversionConfiguration));
 }