Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • arf/world-analysis-api-helpers/unity-world-analysis-package
1 result
Show changes
Commits on Source (3)
Showing
with 890 additions and 319 deletions
fileFormatVersion: 2
guid: 953b8657509a139449794a24f2147730
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 4af05175caa96bb43844e080f1d8701b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
File added
fileFormatVersion: 2
guid: 1494d109bc218c346ab7622ed734ea86
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9d5dbed810c34cc4db0fe224cda88d0b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: bddbf4bf9ff11da4885638979b82efb2
labels:
- NuGetForUnity
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>websocket-sharp-latest</id>
<version>1.0.2</version>
<authors>websocket-sharp-latest</authors>
<license type="expression">MIT</license>
<licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
<icon>websocket-sharp_icon.png</icon>
<description>Package Description</description>
<releaseNotes>https://github.com/garbles-labs/websocket-sharp/releases</releaseNotes>
<repository type="git" />
<dependencies>
<group targetFramework=".NETStandard2.0" />
</dependencies>
</metadata>
</package>
\ No newline at end of file
fileFormatVersion: 2
guid: a9d61c123a66f5b4a8d236c2972a3609
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b3235afb951bf0a4f9e21db48a0937f6
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
......@@ -24,9 +24,15 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
Name = name;
}
public string ToJson() { return JsonUtility.ToJson(this); }
public string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this); }
}
//public class MatrixPose : Pose
//{
// [Newtonsoft.Json.JsonProperty("matrixValue", Required = Newtonsoft.Json.Required.AllowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
// public MatrixPoseValue MatrixValue { get; set; }
//}
//
// Implement here some constructors
//
......@@ -37,6 +43,6 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
Uuid = Guid.NewGuid();
}
public string ToJson() { return JsonUtility.ToJson(this); }
public string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this); }
}
}
\ No newline at end of file
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// Generated using the NSwag toolchain v14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------
......@@ -8,6 +8,7 @@
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
#pragma warning disable 612 // Disable "CS0612 '...' is obsolete"
#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null"
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
......@@ -15,23 +16,25 @@
#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter"
#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type"
#pragma warning disable CS8765 // Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes).
#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)."
namespace ETSI.ARF.OpenAPI.WorldAnalysis
{
using System = global::System;
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class WorldAnalysisClient
{
private ETSI.ARF.OpenAPI.WorldAnalysis.IHttpClient _httpClient;
private static System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings, true);
private Newtonsoft.Json.JsonSerializerSettings _instanceSettings;
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
public WorldAnalysisClient(ETSI.ARF.OpenAPI.WorldAnalysis.IHttpClient httpClient)
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
{
_httpClient = httpClient;
Initialize();
}
private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings()
......@@ -41,10 +44,12 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
return settings;
}
protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } }
protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _instanceSettings ?? _settings.Value; } }
static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
partial void Initialize();
partial void PrepareRequest(ETSI.ARF.OpenAPI.WorldAnalysis.IHttpClient client, System.Net.Http.HttpRequestMessage request, string url);
partial void PrepareRequest(ETSI.ARF.OpenAPI.WorldAnalysis.IHttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
partial void ProcessResponse(ETSI.ARF.OpenAPI.WorldAnalysis.IHttpClient client, System.Net.Http.HttpResponseMessage response);
......@@ -374,7 +379,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
if (sessionID != null)
request_.Headers.TryAddWithoutValidation("sessionID", ConvertToString(sessionID, System.Globalization.CultureInfo.InvariantCulture));
var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings);
var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
......@@ -415,9 +420,22 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
else
if (status_ == 405)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not supported.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not supported.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 511)
{
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
......@@ -551,30 +569,52 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
else
if (status_ == 400)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 403)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not allowed.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 404)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not found.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 405)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not supported.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not supported.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 511)
{
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
......@@ -609,7 +649,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <param name="uuid">List of UUIDs of the Trackables and Anchors to request with the mode representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device)</param>
/// <returns>Successful operation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<Response> GetPosesAsync(string token, string sessionID, System.Collections.Generic.IEnumerable<Anonymous> uuid)
public virtual System.Threading.Tasks.Task<Poses> GetPosesAsync(string token, string sessionID, System.Collections.Generic.IEnumerable<UuidAndMode> uuid)
{
return GetPosesAsync(token, sessionID, uuid, System.Threading.CancellationToken.None);
}
......@@ -623,7 +663,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <param name="uuid">List of UUIDs of the Trackables and Anchors to request with the mode representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device)</param>
/// <returns>Successful operation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual Response GetPoses(string token, string sessionID, System.Collections.Generic.IEnumerable<Anonymous> uuid)
public virtual Poses GetPoses(string token, string sessionID, System.Collections.Generic.IEnumerable<UuidAndMode> uuid)
{
return System.Threading.Tasks.Task.Run(async () => await GetPosesAsync(token, sessionID, uuid, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
}
......@@ -638,7 +678,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <param name="uuid">List of UUIDs of the Trackables and Anchors to request with the mode representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device)</param>
/// <returns>Successful operation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<Response> GetPosesAsync(string token, string sessionID, System.Collections.Generic.IEnumerable<Anonymous> uuid, System.Threading.CancellationToken cancellationToken)
public virtual async System.Threading.Tasks.Task<Poses> GetPosesAsync(string token, string sessionID, System.Collections.Generic.IEnumerable<UuidAndMode> uuid, System.Threading.CancellationToken cancellationToken)
{
if (uuid == null)
throw new System.ArgumentNullException("uuid");
......@@ -691,7 +731,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<Response>(response_, headers_, cancellationToken).ConfigureAwait(false);
var objectResponse_ = await ReadObjectResponseAsync<Poses>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
......@@ -701,30 +741,52 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
else
if (status_ == 400)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 403)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not allowed.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 404)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not found.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 405)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not supported.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not supported.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 511)
{
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
......@@ -802,7 +864,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
if (sessionID != null)
request_.Headers.TryAddWithoutValidation("sessionID", ConvertToString(sessionID, System.Globalization.CultureInfo.InvariantCulture));
var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings);
var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
......@@ -849,30 +911,52 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
else
if (status_ == 400)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 403)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not allowed.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 404)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not found.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 405)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not supported.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not supported.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 511)
{
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
......@@ -997,16 +1081,32 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
else
if (status_ == 400)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 404)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not found.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 511)
{
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
......@@ -1086,7 +1186,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
if (sessionID != null)
request_.Headers.TryAddWithoutValidation("sessionID", ConvertToString(sessionID, System.Globalization.CultureInfo.InvariantCulture));
var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, JsonSerializerSettings);
var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
......@@ -1134,16 +1234,32 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
else
if (status_ == 400)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 404)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not found.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 511)
{
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
......@@ -1172,9 +1288,9 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// End the subscription and the associated callback for collecting a given pose
/// </remarks>
/// <param name="subscriptionUUID">Subscription UUID to delete.</param>
/// <returns>OK, unsubcription successful.</returns>
/// <returns>Success request.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<string> UnsubscribeFromPoseAsync(string token, string sessionID, System.Guid subscriptionUUID)
public virtual System.Threading.Tasks.Task<Success> UnsubscribeFromPoseAsync(string token, string sessionID, System.Guid subscriptionUUID)
{
return UnsubscribeFromPoseAsync(token, sessionID, subscriptionUUID, System.Threading.CancellationToken.None);
}
......@@ -1186,9 +1302,9 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// End the subscription and the associated callback for collecting a given pose
/// </remarks>
/// <param name="subscriptionUUID">Subscription UUID to delete.</param>
/// <returns>OK, unsubcription successful.</returns>
/// <returns>Success request.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual string UnsubscribeFromPose(string token, string sessionID, System.Guid subscriptionUUID)
public virtual Success UnsubscribeFromPose(string token, string sessionID, System.Guid subscriptionUUID)
{
return System.Threading.Tasks.Task.Run(async () => await UnsubscribeFromPoseAsync(token, sessionID, subscriptionUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
}
......@@ -1201,9 +1317,9 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// End the subscription and the associated callback for collecting a given pose
/// </remarks>
/// <param name="subscriptionUUID">Subscription UUID to delete.</param>
/// <returns>OK, unsubcription successful.</returns>
/// <returns>Success request.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<string> UnsubscribeFromPoseAsync(string token, string sessionID, System.Guid subscriptionUUID, System.Threading.CancellationToken cancellationToken)
public virtual async System.Threading.Tasks.Task<Success> UnsubscribeFromPoseAsync(string token, string sessionID, System.Guid subscriptionUUID, System.Threading.CancellationToken cancellationToken)
{
if (subscriptionUUID == null)
throw new System.ArgumentNullException("subscriptionUUID");
......@@ -1221,7 +1337,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
if (sessionID != null)
request_.Headers.TryAddWithoutValidation("sessionID", ConvertToString(sessionID, System.Globalization.CultureInfo.InvariantCulture));
request_.Method = new System.Net.Http.HttpMethod("DELETE");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));
var urlBuilder_ = new System.Text.StringBuilder();
......@@ -1254,23 +1370,42 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
return result_;
var objectResponse_ = await ReadObjectResponseAsync<Success>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
if (status_ == 400)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 404)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not found.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 511)
{
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
......@@ -1300,7 +1435,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// </remarks>
/// <returns>Successful operation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<Response2> GetCapabilitiesAsync(string token, string sessionID)
public virtual System.Threading.Tasks.Task<Capabilities> GetCapabilitiesAsync(string token, string sessionID)
{
return GetCapabilitiesAsync(token, sessionID, System.Threading.CancellationToken.None);
}
......@@ -1313,7 +1448,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// </remarks>
/// <returns>Successful operation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual Response2 GetCapabilities(string token, string sessionID)
public virtual Capabilities GetCapabilities(string token, string sessionID)
{
return System.Threading.Tasks.Task.Run(async () => await GetCapabilitiesAsync(token, sessionID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
}
......@@ -1327,7 +1462,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// </remarks>
/// <returns>Successful operation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<Response2> GetCapabilitiesAsync(string token, string sessionID, System.Threading.CancellationToken cancellationToken)
public virtual async System.Threading.Tasks.Task<Capabilities> GetCapabilitiesAsync(string token, string sessionID, System.Threading.CancellationToken cancellationToken)
{
var client_ = _httpClient;
var disposeClient_ = false;
......@@ -1374,7 +1509,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<Response2>(response_, headers_, cancellationToken).ConfigureAwait(false);
var objectResponse_ = await ReadObjectResponseAsync<Capabilities>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
......@@ -1382,6 +1517,16 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
return objectResponse_.Object;
}
else
if (status_ == 511)
{
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
......@@ -1414,7 +1559,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <param name="trackableOrAnchorUUID">UUID of the Trackable or Anchor to check support</param>
/// <returns>Successful operation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<Response3> GetSupportAsync(string token, string sessionID, System.Guid trackableOrAnchorUUID)
public virtual System.Threading.Tasks.Task<Supports> GetSupportAsync(string token, string sessionID, System.Guid trackableOrAnchorUUID)
{
return GetSupportAsync(token, sessionID, trackableOrAnchorUUID, System.Threading.CancellationToken.None);
}
......@@ -1428,7 +1573,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <param name="trackableOrAnchorUUID">UUID of the Trackable or Anchor to check support</param>
/// <returns>Successful operation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual Response3 GetSupport(string token, string sessionID, System.Guid trackableOrAnchorUUID)
public virtual Supports GetSupport(string token, string sessionID, System.Guid trackableOrAnchorUUID)
{
return System.Threading.Tasks.Task.Run(async () => await GetSupportAsync(token, sessionID, trackableOrAnchorUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
}
......@@ -1443,7 +1588,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <param name="trackableOrAnchorUUID">UUID of the Trackable or Anchor to check support</param>
/// <returns>Successful operation.</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<Response3> GetSupportAsync(string token, string sessionID, System.Guid trackableOrAnchorUUID, System.Threading.CancellationToken cancellationToken)
public virtual async System.Threading.Tasks.Task<Supports> GetSupportAsync(string token, string sessionID, System.Guid trackableOrAnchorUUID, System.Threading.CancellationToken cancellationToken)
{
if (trackableOrAnchorUUID == null)
throw new System.ArgumentNullException("trackableOrAnchorUUID");
......@@ -1494,7 +1639,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<Response3>(response_, headers_, cancellationToken).ConfigureAwait(false);
var objectResponse_ = await ReadObjectResponseAsync<Supports>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
......@@ -1504,30 +1649,52 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
else
if (status_ == 400)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Bad request.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 403)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not allowed.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not allowed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 404)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not found.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not found.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 405)
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
throw new ApiException<string>("Not supported.", status_, responseData_, headers_, result_, null);
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("Not supported.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
if (status_ == 511)
{
var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<Error>("The secret token is not valid. Please ask an ISG ARF team member for a valid token.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
......@@ -1668,7 +1835,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// An element representing the result of the pose estimation of an AR device, a Trackable or a WorldAnchor by the World Analysis
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Pose
{
/// <summary>
......@@ -1712,7 +1879,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// The pose value
/// </summary>
[Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.AllowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public PoseValue Value { get; set; }
/// <summary>
......@@ -1735,7 +1902,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// Base type to define the pose value
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class PoseValue
{
/// <summary>
......@@ -1759,7 +1926,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// A pose value that is described with a 4*4 matrix
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class MatrixPoseValue : PoseValue
{
/// <summary>
......@@ -1780,7 +1947,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// A pose value that is described with a position and a rotation
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class VectorQuaternionPoseValue : PoseValue
{
/// <summary>
......@@ -1807,7 +1974,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// A pose value in a geodetic coordinate system
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class GeodeticPoseValue : PoseValue
{
[Newtonsoft.Json.JsonProperty("altitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
......@@ -1843,7 +2010,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// An object representing the framerate that the World Analysis needs to reach for a given Trackable Type
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class PoseConfiguration
{
[Newtonsoft.Json.JsonProperty("trackableType", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
......@@ -1873,7 +2040,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// Request when subscribing for pose update of a Trackable or a WorldAnchor
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class SubscriptionSingleRequest
{
/// <summary>
......@@ -1915,20 +2082,20 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// Request when subscribing for pose update of multiple Trackable or a WorldAnchor
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class SubscriptionMultipleRequest
{
/// <summary>
/// List of UUID of the Trackable or Anchor to subscribe
/// </summary>
[Newtonsoft.Json.JsonProperty("targets", Required = Newtonsoft.Json.Required.Always)]
public System.Collections.Generic.ICollection<object> Targets { get; set; } = new System.Collections.ObjectModel.Collection<object>();
public System.Collections.Generic.ICollection<System.Guid> Targets { get; set; } = new System.Collections.ObjectModel.Collection<System.Guid>();
/// <summary>
/// List of modes representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device)
/// </summary>
[Newtonsoft.Json.JsonProperty("mode", Required = Newtonsoft.Json.Required.Always, ItemConverterType = typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public System.Collections.Generic.ICollection<Mode_WorldAnalysis> Mode { get; set; } = new System.Collections.ObjectModel.Collection<Mode_WorldAnalysis>();
[Newtonsoft.Json.JsonProperty("modes", Required = Newtonsoft.Json.Required.Always, ItemConverterType = typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
public System.Collections.Generic.ICollection<Mode_WorldAnalysis> Modes { get; set; } = new System.Collections.ObjectModel.Collection<Mode_WorldAnalysis>();
/// <summary>
/// Subscription validity delay in millisecond
......@@ -1956,7 +2123,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// Response when subscribing for pose update of a Trackable or a WorldAnchor
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class SubscriptionSingle
{
/// <summary>
......@@ -2007,7 +2174,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// Response when subscribing for pose update of multiple Trackable or a WorldAnchor
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class SubscriptionMultiple
{
[Newtonsoft.Json.JsonProperty("subscriptions", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
......@@ -2027,7 +2194,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// An object representing a supported capability of the World Analysis and its associated metadata
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Capability
{
[Newtonsoft.Json.JsonProperty("trackableType", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
......@@ -2069,7 +2236,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// An object holding the info of a Trackable`'`s encoding information `:` the data format and the version.
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class EncodingInformationStructure
{
/// <summary>
......@@ -2096,13 +2263,10 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Error
{
[Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.Always)]
public int Code { get; set; }
[Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Always)]
[Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Message { get; set; }
private System.Collections.Generic.IDictionary<string, object> _additionalProperties;
......@@ -2119,7 +2283,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// Mode representing the context of the relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device)
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public enum Mode_WorldAnalysis
{
......@@ -2134,16 +2298,33 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// A quaternion
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Quaternion : System.Collections.ObjectModel.Collection<float>
{
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Success
{
[Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Message { get; set; }
private System.Collections.Generic.IDictionary<string, object> _additionalProperties;
[Newtonsoft.Json.JsonExtensionData]
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
{
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
set { _additionalProperties = value; }
}
}
/// <summary>
/// Type for trackable
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public enum TrackableType
{
......@@ -2170,7 +2351,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// Coordinate reference system of the world anchor, a 4*4 matrix (rowmajor) represented by a float vector.
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Transform3D : System.Collections.ObjectModel.Collection<float>
{
......@@ -2179,7 +2360,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// Trackable or Anchor
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public enum TypeWorldStorage
{
......@@ -2197,7 +2378,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// Unit of length.
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public enum UnitSystem
{
......@@ -2239,14 +2420,14 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
/// <summary>
/// A 3 coordinates vector
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Vector3 : System.Collections.ObjectModel.Collection<float>
{
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Anonymous
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class UuidAndMode
{
[Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.Always)]
public System.Guid Uuid { get; set; }
......@@ -2269,7 +2450,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Body
{
/// <summary>
......@@ -2302,11 +2483,11 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Response
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Poses
{
[Newtonsoft.Json.JsonProperty("poses", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<Pose> Poses { get; set; }
public System.Collections.Generic.ICollection<Pose> Poses1 { get; set; }
private System.Collections.Generic.IDictionary<string, object> _additionalProperties;
......@@ -2319,11 +2500,11 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Response2
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Capabilities
{
[Newtonsoft.Json.JsonProperty("capabilities", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<Capability> Capabilities { get; set; }
public System.Collections.Generic.ICollection<Capability> Capabilities1 { get; set; }
private System.Collections.Generic.IDictionary<string, object> _additionalProperties;
......@@ -2336,8 +2517,8 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Response3
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class Supports
{
[Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
......@@ -2357,7 +2538,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public enum PoseEstimationState
{
......@@ -2369,7 +2550,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public enum PoseValueType
{
......@@ -2384,7 +2565,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public enum GeodeticPoseValueRotationTarget
{
......@@ -2396,7 +2577,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public enum PoseConfigurationTrackableType
{
......@@ -2420,7 +2601,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public enum EncodingInformationStructureDataFormat
{
......@@ -2446,7 +2627,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class ApiException : System.Exception
{
public int StatusCode { get; private set; }
......@@ -2469,7 +2650,7 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
}
}
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class ApiException<TResult> : ApiException
{
public TResult Result { get; private set; }
......
......@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Last change: June 2024
// Last change: September 2024
//
// Depends on UniTask to support cancellation token and GetAwaiter: https://github.com/Cysharp/UniTask
......@@ -101,6 +101,21 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
private readonly HttpClient _httpClient = new HttpClient();
private void AppendARFHeaders(HttpRequestMessage message, UnityWebRequest webRequest)
{
// Add some ARF headers
foreach (var item in message.Headers)
{
try
{
List<string> li = item.Value as List<string>;
if (item.Key == "token") webRequest.SetRequestHeader(item.Key, li[0].ToString()); // add it
if (item.Key == "sessionID") webRequest.SetRequestHeader(item.Key, li[0].ToString()); // add it
}
catch { } // ignore it
}
}
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage message, HttpCompletionOption option, CancellationToken token)
{
var content = await (message.Content?.ReadAsStringAsync() ?? Task.FromResult(""));
......@@ -108,6 +123,9 @@ namespace ETSI.ARF.OpenAPI.WorldAnalysis
AppendHeaders(webRequest);
// Add the ARF API headers
AppendARFHeaders(message, webRequest);
Debug.Log("[HTTP] Request " + webRequest.uri.ToString());
try
{
......
......@@ -29,6 +29,18 @@ namespace ETSI.ARF.WorldAnalysis.REST
{
public class AdminRequest : RequestBase<string>
{
#region Test methods
static public void CheckServer(WorldAnalysisServer wa)
{
string ping = AdminRequest.PingSync(wa);
string state = AdminRequest.AdminSync(wa);
string ver = AdminRequest.VersionSync(wa);
Debug.Log("[REST] WA Ping: " + ping);
Debug.Log("[REST] WA State: " + state);
Debug.Log("[REST] WA Version: " + ver);
}
#endregion
//
// Wrapper for the endpoints
//
......
......@@ -151,7 +151,7 @@ public interface WorldAnalysisInterface
/// </summary>
/// <param name="subscriptionUUID">id of the subscription</param>
/// /// <returns>The unsubscription has been performed or not</returns>
public InformationSubscriptionResult UnSubscribeToPose(Guid subscriptionUUID);
public InformationSubscriptionResult UnsubscribeFromPose(Guid subscriptionUUID);
#endregion
......
......@@ -7,20 +7,28 @@ using ETSI.ARF.WorldAnalysis;
using static WorldAnalysisInterface;
using ETSI.ARF.WorldAnalysis.REST;
using WebSocketSharp;
using UnityEngine.Events;
//Implementation of the WorldAnalysis interface
public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
public partial class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
{
[Serializable]
public class StringEvent : UnityEvent<string> { }
//
// Inspector variables
//
// Name to register the client to the World Analysis
public string modulename = "UnityValidationApp";
/// <summary>
/// WorldSAnalysisServer
/// </summary>
public WorldAnalysisServer waServer;
public string token = "ETSI-ARF-STF";
public string sessionID = "RESTful-API";
public string sessionID = "ARF-STF669";
[Space(8)]
public bool isDebug = false;
......@@ -30,8 +38,6 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
//
private WorldAnalysisClient apiClient; // For sync calls
private WorldAnalysisClient apiClientAsync; // For async calls
private WebSocketSharp.WebSocket webSocket; // For WebSockets
private bool websocketConnected = false;
//
// Management of subscriptions
......@@ -39,14 +45,15 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
/// <summary>
/// Dictionnary of susbscription informations for poses, for each item, stored using the UUID of the item (anchor/trackable)
/// </summary>
private Dictionary<Guid, SubscriptionInfo> m_subscriptionsPoses;
private Dictionary<Guid, SubscriptionInfo> subscriptionsPoses;
public struct SubscriptionInfo
{
public ETSI.ARF.OpenAPI.WorldAnalysis.Pose pose;
public Guid uuid; // id of subscription (id is defined by the WA server)
public Guid uuidTarget; // id trackable or anchor
public float timeValidity; //The duration of the validity of the subscription
public ETSI.ARF.OpenAPI.WorldAnalysis.Pose pose;
public PoseCallback callback;
}
......@@ -60,7 +67,7 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
Instance = this;
//m_relocalizationInformations = new Dictionary<Guid, ETSI.ARF.OpenAPI.WorldStorage.RelocalizationInformation>();
//m_computedPoses = new Dictionary<Guid, ETSI.ARF.OpenAPI.WorldAnalysis.Pose>();
m_subscriptionsPoses = new Dictionary<Guid, SubscriptionInfo>();
subscriptionsPoses = new Dictionary<Guid, SubscriptionInfo>();
// sync
var httpClient = new BasicHTTPClient(waServer.URI);
......@@ -86,24 +93,19 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
ManageSubscriptionValidity();
// todo: Call subscription callback(s) here or in the websocket?!?
foreach (KeyValuePair<Guid, SubscriptionInfo> subPose in m_subscriptionsPoses)
foreach (KeyValuePair<Guid, SubscriptionInfo> subPose in subscriptionsPoses)
{
}
}
#endregion
#region Test methods
public void CheckServer()
private void OnDestroy()
{
string ping = AdminRequest.PingSync(waServer);
string state = AdminRequest.AdminSync(waServer);
string ver = AdminRequest.VersionSync(waServer);
Debug.Log("[REST] WA Ping: " + ping);
Debug.Log("[REST] WA State: " + state);
Debug.Log("[REST] WA Version: " + ver);
WebSocketClient_Close();
}
#endregion
#region Test methods
public void PrintCapabilities(Capability[] capabilities)
{
string res = "";
......@@ -117,105 +119,16 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
}
#endregion
#region Communication system
private void CreateWebHookServer()
{
throw new Exception("[REST] CreateWebHookServer(): Not implemented!");
}
private void DestroyWebHookServer()
{
return;
}
public WebSocket OpenWebSocketClient(string url)
{
webSocket = new WebSocketSharp.WebSocket(url);
//
// Define standard callbacks
//
webSocket.OnOpen += (sender, e) =>
{
Debug.Log("[WS] Connected");
websocketConnected = true;
webSocket.Send("RegisterClient:UnitySceneManagement");
};
webSocket.OnClose += (sender, e) =>
{
Debug.Log("[WS] Disconnected");
websocketConnected = false;
};
webSocket.OnError += (sender, e) => Debug.Log("[WS] Error!");
webSocket.OnMessage += (sender, e) => HandleWebSocketClient(e.Data);
webSocket.Connect();
return webSocket;
}
private void OnDestroy()
{
// State: red
CloseWebSocketClient();
}
private void CloseWebSocketClient()
{
if (websocketConnected)
{
webSocket.Send("UnregisterClient");
webSocket.Close();
}
}
bool ok = false;
public void HandleWebSocketClient(string data)
{
Debug.Log("[WS] Receiving: " + data);
if (data.Contains("You are now registered"))
{
ok = true;
if (isDebug) webSocket.Send("PoseStart:10"); // test
}
else if (data == "PoseStop")
{
//SetColor(Color.yellow);
}
else if (ok)
{
if (data.Contains("estimationState"))
{
// Handle pose
ETSI.ARF.OpenAPI.WorldAnalysis.Pose p = JsonUtility.FromJson<ETSI.ARF.OpenAPI.WorldAnalysis.Pose>(data);
Debug.Log("[WS][Pose] State: " + p.EstimationState.ToString());
PoseEstimationResult res = p.EstimationState == PoseEstimationState.OK ? PoseEstimationResult.OK : PoseEstimationResult.FAILURE;
// Search the corresponding callbacks
foreach (var item in m_subscriptionsPoses.Values)
{
if (p.Uuid == item.uuidTarget)
{
item.callback(res, p);
}
}
}
}
}
#endregion
#region Lifecycle
/// <summary>
/// Check the validity of all subscriptions and delete one if needed
/// </summary>
protected void ManageSubscriptionValidity()
{
if (m_subscriptionsPoses.Count == 0) return;
if (subscriptionsPoses.Count == 0) return;
List<Guid> subscriptionToDelete = new List<Guid>();
foreach (KeyValuePair<Guid, SubscriptionInfo> sub in m_subscriptionsPoses)
foreach (KeyValuePair<Guid, SubscriptionInfo> sub in subscriptionsPoses)
{
float validity = sub.Value.timeValidity;
if (Time.time > validity)
......@@ -226,7 +139,7 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
foreach (Guid s in subscriptionToDelete)
{
Debug.Log("ETSI ARF : Subscription deleted " + s);
m_subscriptionsPoses.Remove(s);
subscriptionsPoses.Remove(s);
}
}
#endregion
......@@ -262,16 +175,16 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
}
PoseEstimationResult[] resul = new PoseEstimationResult[uuids.Length];
poses = new ETSI.ARF.OpenAPI.WorldAnalysis.Pose[uuids.Length];
List<Anonymous> uuidList = new List<Anonymous>();
Response poses_ = apiClient.GetPoses(token, sessionID, uuidList.ToArray());
List<ETSI.ARF.OpenAPI.WorldAnalysis.Pose> posesList = poses_.Poses as List<ETSI.ARF.OpenAPI.WorldAnalysis.Pose>;
List<UuidAndMode> uuidList = new List<UuidAndMode>();
Poses poses_ = apiClient.GetPoses(token, sessionID, uuidList.ToArray());
List<ETSI.ARF.OpenAPI.WorldAnalysis.Pose> posesList = poses_.Poses1 as List<ETSI.ARF.OpenAPI.WorldAnalysis.Pose>;
if (poses_ != null && posesList != null && posesList.Count > 0)
{
for (int i = 0; i < uuids.Length; i++)
{
PoseEstimationResult poseResul = new PoseEstimationResult();
resul[i] = poseResul;
PoseEstimationResult poseResult = new PoseEstimationResult();
resul[i] = poseResult;
poses[i] = posesList[i];
}
return resul;
......@@ -283,6 +196,19 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
}
}
private string CreateWebsocket_URL(string originalURL)
{
string uri = originalURL;
//
// Overwrite server setting for testing local/extra servers
//
//if (isDebug) uri = "ws://localhost:61788/ws"; // for tests
//if (isDebug) uri = "wss://localhost:44301/ws"; // for tests
return uri;
}
public InformationSubscriptionResult SubscribeToPose(string token, Guid uuid, Mode_WorldAnalysis mode, PoseCallback callback, ref int validity, out Guid subscriptionUUID)
{
// Todo: Maintain the callback to the subscription id
......@@ -293,45 +219,54 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
body.Target = uuid;
body.Mode = mode;
body.Validity = validity;
body.WebhookUrl = callback == null ? "" : "https:\\..."; // empty -> app will use websockets (client)!
body.WebhookUrl = callback != null ? "" : "https:\\..."; // empty -> app will use websockets (client)!
// Get subscription info from the REST server
SubscriptionSingle response = apiClient.SubscribeToPose(token, sessionID, body);
subscriptionUUID = response.Uuid;
validity = response.Validity;
//SubscriptionMultipleRequest body_m = new SubscriptionMultipleRequest();
//body_m.Targets = new List<object>();
//body_m.Mode = new List<Mode_WorldAnalysis>();
//body_m.Validity = validity;
//body_m.WebhookUrl = callback == null ? "" : "https:\\..."; // empty -> app will use websockets (client)!
//SubscriptionMultiple response = apiClient.SubscribeToPose(token, sessionID, body_m);
// We add the subscription
SubscriptionInfo sub = new SubscriptionInfo();
sub.uuid = response.Uuid;
sub.uuid = subscriptionUUID;
sub.uuidTarget = uuid;
sub.timeValidity = Time.time + (validity / 1000.0f);
sub.callback = callback;
sub.pose = new ETSI.ARF.OpenAPI.WorldAnalysis.Pose();
sub.pose.Mode = mode;
sub.uuidTarget = uuid;
sub.callback = callback;
m_subscriptionsPoses.Add(sub.uuid, sub);
subscriptionsPoses.Add(sub.uuid, sub);
if (!string.IsNullOrEmpty(response.WebhookUrl))
{
CloseWebSocketClient();
// Create a REST server so that the WA server can send pose update to it
string webhookUrl = response.WebhookUrl;
// Close other communication channel
WebSocketClient_Close();
// todo: create a REST server so that the WA server can send pose update to it
// How to auto-generate the C# REST server for pose for Unity?
CreateWebHookServer();
// How to auto-generate the C# REST webhook server for pose for Unity?
WebHookServer_Create(webhookUrl);
}
else
else if (!string.IsNullOrEmpty(response.WebsocketUrl))
{
DestroyWebHookServer();
// Create the WebSockets client here (NOT in the scene scripts)
// todo: Open the websocket?
string websocketUrl = response.WebsocketUrl;
if (isDebug) websocketUrl = "ws://localhost:61788/ws"; // for tests
// Close other communication channel
WebHookServer_Close();
if (string.IsNullOrEmpty(websocketUrl))
{
// Create the WebSockets client here (NOT in the scene scripts)
if (!websocketConnected) OpenWebSocketClient(websocketUrl);
}
else throw new Exception("[REST] No valid WebSockets URL in server reponse.");
// Open the websocket
if (webSocket == null) WebSocketClient_Create(CreateWebsocket_URL(response.WebsocketUrl)); // only one instance
}
else throw new Exception("[REST] No valid URL in server reponse.");
return InformationSubscriptionResult.OK;
}
......@@ -363,7 +298,7 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
mode = Mode_WorldAnalysis.TRACKABLES_TO_DEVICE;
validity = 0;
if (m_subscriptionsPoses.ContainsKey(subscriptionUUID))
if (subscriptionsPoses.ContainsKey(subscriptionUUID))
{
// Check the server subscription
SubscriptionSingle sub = apiClient.GetSubscription(token, sessionID, subscriptionUUID);
......@@ -371,7 +306,7 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
// Check local one
if (sub.Uuid == subscriptionUUID)
{
SubscriptionInfo subInfo = m_subscriptionsPoses[subscriptionUUID];
SubscriptionInfo subInfo = subscriptionsPoses[subscriptionUUID];
callback = subInfo.callback;
target = subInfo.uuidTarget;
mode = subInfo.pose.Mode;
......@@ -395,18 +330,18 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
mode = Mode_WorldAnalysis.TRACKABLES_TO_DEVICE;
validity = 0;
if (m_subscriptionsPoses.ContainsKey(subscriptionUUID))
if (subscriptionsPoses.ContainsKey(subscriptionUUID))
{
SubscriptionInfo sub = m_subscriptionsPoses[subscriptionUUID];
SubscriptionInfo sub = subscriptionsPoses[subscriptionUUID];
PoseCallback oldCB = sub.callback;
Body body = new Body();
body.Mode = mode;
body.Validity = validity;
body.WebhookUrl = callback == null ? "" : "https:\\..."; // empty -> app will use websockets (client)!
Body newSub = new Body();
newSub.Mode = mode;
newSub.Validity = validity;
newSub.WebhookUrl = callback == null ? "" : "https:\\..."; // empty -> app will use websockets (client)!
// Update subscription info in the REST server
SubscriptionSingle response = apiClient.UpdateSubscription(token, sessionID, subscriptionUUID, body);
SubscriptionSingle response = apiClient.UpdateSubscription(token, sessionID, subscriptionUUID, newSub);
// Update local data
sub.pose.Mode = response.Mode;
......@@ -418,44 +353,43 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
//
if (oldCB != null && callback == null && !string.IsNullOrEmpty(response.WebhookUrl))
{
CloseWebSocketClient();
// Create a REST server so that the WA server can send pose update to it
string webhookUrl = response.WebhookUrl;
// Close other communication channel
WebSocketClient_Close();
// todo: create a REST server so that the WA server can send pose update to it
// How to auto-generate the C# REST server for pose for Unity?
CreateWebHookServer();
WebHookServer_Create(webhookUrl);
}
else if (oldCB == null && callback != null && string.IsNullOrEmpty(response.WebhookUrl))
else if (oldCB == null && callback != null && !string.IsNullOrEmpty(response.WebsocketUrl))
{
DestroyWebHookServer();
// todo: Open the websocket?
string websocketUrl = response.WebsocketUrl;
if (isDebug) websocketUrl = "ws://localhost:61788/ws"; // for tests
if (string.IsNullOrEmpty(websocketUrl))
{
// Create the WebSockets client here (NOT in the scene scripts)
if (!websocketConnected) OpenWebSocketClient(websocketUrl);
}
else throw new Exception("[REST] No valid WebSockets URL in server reponse.");
// Create the WebSockets client here (NOT in the scene scripts)
// Close other communication channel
WebHookServer_Close();
// Open the websocket?
if (webSocket == null) WebSocketClient_Create(CreateWebsocket_URL(response.WebsocketUrl));
}
else throw new Exception("[REST] No valid URL in server reponse.");
return InformationSubscriptionResult.OK;
}
return InformationSubscriptionResult.UNKNOWN_ID;
}
public InformationSubscriptionResult UnSubscribeToPose(Guid subscriptionUUID)
public InformationSubscriptionResult UnsubscribeFromPose(Guid subscriptionUUID)
{
if (m_subscriptionsPoses.ContainsKey(subscriptionUUID))
if (subscriptionsPoses.ContainsKey(subscriptionUUID))
{
apiClient.UnsubscribeFromPose(token, sessionID, subscriptionUUID);
m_subscriptionsPoses.Remove(subscriptionUUID);
subscriptionsPoses.Remove(subscriptionUUID);
if (m_subscriptionsPoses.Count == 0)
if (subscriptionsPoses.Count == 0)
{
// Close the connection via websockets
CloseWebSocketClient();
WebSocketClient_Close();
}
return InformationSubscriptionResult.OK;
}
......@@ -464,16 +398,16 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
public CapabilityResult GetCapabilities(string token, out Capability[] capabilities)
{
Response2 cap = apiClient.GetCapabilities(token, sessionID);
if (cap == null || cap.Capabilities == null || cap.Capabilities.Count == 0)
Capabilities cap = apiClient.GetCapabilities(token, sessionID);
if (cap == null || cap.Capabilities1 == null || cap.Capabilities1.Count == 0)
{
capabilities = null;
return CapabilityResult.FAIL;
}
else
{
capabilities = new Capability[cap.Capabilities.Count];
cap.Capabilities.CopyTo(capabilities, 0);
capabilities = new Capability[cap.Capabilities1.Count];
cap.Capabilities1.CopyTo(capabilities, 0);
return CapabilityResult.OK;
}
}
......@@ -484,7 +418,7 @@ public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface
type = TypeWorldStorage.UNKNOWN;
capability = null;
Response3 cap = apiClient.GetSupport(token, sessionID, uuid);
Supports cap = apiClient.GetSupport(token, sessionID, uuid);
if (cap == null || cap.Capabilities == null || cap.Capabilities.Count == 0)
{
isSupported = false;
......
#define IS_HHI_LAN
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Newtonsoft.Json;
using WebSocketSharp;
using ETSI.ARF.OpenAPI.WorldAnalysis;
using static WorldAnalysisInterface;
//Implementation of the WorldAnalysis interface
public partial class WorldAnalysisREST
{
//
// Inspector variables
//
public StringEvent webSocketMessage;
//
// Private members
//
private WebSocketSharp.WebSocket webSocket = null; // For WebSockets
#region Communication system for WebSockets
public WebSocket WebSocketClient_Create(string url)
{
if (webSocket != null) return webSocket;
string _url = url;
#if IS_HHI_LAN
_url = "ws://192.168.20.29:8084/ws";
Debug.LogWarning("[WS] Changing the websocket URL to: " + _url + " (local network VM, HHI)");
#endif
webSocket = new WebSocketSharp.WebSocket(_url);
//
// Define standard callbacks
//
webSocket.OnOpen += (sender, e) =>
{
Debug.Log("[WS] Connected");
webSocket.Send("RegisterClient=" + modulename);
};
webSocket.OnClose += (sender, e) =>
{
Debug.Log("[WS] Disconnected");
};
webSocket.OnMessage += (sender, e) => WebSocketClient_OnReceive(e.Data);
webSocket.OnError += (sender, e) => Debug.Log("[WS] Websocket error!");
webSocket.Connect();
return webSocket;
}
private void WebSocketClient_Close()
{
if (webSocket != null)
{
webSocket.Send("UnregisterClient=" + modulename);
webSocket.Close();
webSocket = null;
}
}
public void WebSocketClient_Send(string msg)
{
webSocket?.Send(msg);
}
bool isRegistered = false;
public void WebSocketClient_OnReceive(string serverMessage)
{
//Debug.Log("[WS] Receiving: " + data);
if (serverMessage.Contains("You are now registered"))
{
isRegistered = true;
Debug.Log($"[WS] {serverMessage }");
//Debug.Log($"[WS] Registration of { modulename } was succesfull.");
}
else if (isRegistered)
{
if (serverMessage == "PoseStop")
{
//SetColor(Color.yellow);
}
else if (serverMessage == "PoseIsNowSubscribed")
{
}
else if (serverMessage == "PoseIsNowUnubscribed")
{
}
else if (serverMessage.StartsWith("NewPose=") && serverMessage.Contains("estimationState"))
{
// Handle the new pose
string _str = serverMessage.Substring("NewPose=".Length);
ETSI.ARF.OpenAPI.WorldAnalysis.Pose pose = JsonConvert.DeserializeObject<ETSI.ARF.OpenAPI.WorldAnalysis.Pose>(_str);
//Debug.Log("[WS] JSON - my new pose : " + pose.ToJson());
// to check: p.Confidence?
PoseEstimationResult res = pose.EstimationState == PoseEstimationState.OK ? PoseEstimationResult.OK : PoseEstimationResult.FAILURE;
// Look for the corresponding callbacks
foreach (var item in subscriptionsPoses.Values)
{
if (item.uuidTarget == pose.Uuid)
{
item.pose.Value = pose.Value;
item.callback(res, pose);
}
}
}
else webSocketMessage?.Invoke(serverMessage);
}
}
#endregion
}
\ No newline at end of file
fileFormatVersion: 2
guid: 7b7bcc535a949e24283db7e23c51dc46
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ETSI.ARF.OpenAPI.WorldAnalysis;
using ETSI.ARF.WorldAnalysis;
using ETSI.ARF.WorldAnalysis.REST;
//Implementation of the WorldAnalysis interface
public partial class WorldAnalysisREST
{
//
// Inspector variables
//
public StringEvent webhookMessage;
private bool webhookRunning = false;
#region Communication system for WebHooks
private void WebHookServer_Create(string url)
{
webhookRunning = true;
throw new Exception("[API] WebHookServer_Create(): Not implemented!");
}
private void WebHookServer_Close()
{
if (webhookRunning)
{
webhookRunning = false;
throw new Exception("[API] WebHookServer_Close(): Not implemented!");
}
}
private object WebHookServer_OnReceive()
{
throw new Exception("[API] WebHookServer_OnReceive(): Not implemented!");
}
private void WebHookServer_Send(object message)
{
throw new Exception("[API] WebHookServer_Send(): Not implemented!");
}
#endregion
}
\ No newline at end of file
fileFormatVersion: 2
guid: 67d4b99a5f7593e4a857b6c88249d564
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: