diff --git a/Editor.meta b/Editor.meta new file mode 100644 index 0000000000000000000000000000000000000000..363cd45b6d64e0808e8496fe90146bb6238c081b --- /dev/null +++ b/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: de0dace988a3dcf47a6cfc58c32ecd9f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/Scripts.meta b/Editor/Scripts.meta new file mode 100644 index 0000000000000000000000000000000000000000..da7950c188e345e48e15cbb876fd0f647613dacf --- /dev/null +++ b/Editor/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a34305f3eae6b2d499b718ad93f3a907 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/etsi.isg.arf.worldanalysis.Editor.asmdef b/Editor/etsi.isg.arf.worldanalysis.Editor.asmdef new file mode 100644 index 0000000000000000000000000000000000000000..c2c8eec20a1e73e468df06cbff1f44bde91822ca --- /dev/null +++ b/Editor/etsi.isg.arf.worldanalysis.Editor.asmdef @@ -0,0 +1,18 @@ +{ + "name": "etsi.isg.arf.worldanalysis.editor", + "rootNamespace": "", + "references": [ + "GUID:065e856e9f9becb49abdf0cb6855a039" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Editor/etsi.isg.arf.worldanalysis.Editor.asmdef.meta b/Editor/etsi.isg.arf.worldanalysis.Editor.asmdef.meta new file mode 100644 index 0000000000000000000000000000000000000000..7364e90e15a7b69775dcd07f383b02eb4114e943 --- /dev/null +++ b/Editor/etsi.isg.arf.worldanalysis.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4fc4600071c62664ca9f647e6fa3e3f0 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..369a2512139f698ce91876fe56d973ad63690d21 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2022 ETSI + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/LICENSE.meta b/LICENSE.meta new file mode 100644 index 0000000000000000000000000000000000000000..30d9dced38cdb6c0be83ae118eaa757869d50c49 --- /dev/null +++ b/LICENSE.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0636f5d83c2da494196211fbfb1b42d4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000000000000000000000000000000000000..531a669e6f17fa75792b8de9775baafa1e4e06f8 --- /dev/null +++ b/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b025ab62e19fc964db1e7e58fe44759a +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime.meta b/Runtime.meta new file mode 100644 index 0000000000000000000000000000000000000000..b3d7178bdc16a6c29141edc0208afe483bad470c --- /dev/null +++ b/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2dc2b17d3284d724ab96bc5866d12795 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts.meta b/Runtime/Scripts.meta new file mode 100644 index 0000000000000000000000000000000000000000..cd544b4692381b9edc3153c3f84be7b0fc2d6a2e --- /dev/null +++ b/Runtime/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 14b182e22e592d747acc320631374657 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/OpenAPI.meta b/Runtime/Scripts/OpenAPI.meta new file mode 100644 index 0000000000000000000000000000000000000000..1bc22e37f1159dace62afd0f2dd3171ffc359fba --- /dev/null +++ b/Runtime/Scripts/OpenAPI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 74af4e202254d064580bd571c888d5d6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/OpenAPI/Generated.meta b/Runtime/Scripts/OpenAPI/Generated.meta new file mode 100644 index 0000000000000000000000000000000000000000..94686a3734477e797d1a4b946f0fc83d605c5bc3 --- /dev/null +++ b/Runtime/Scripts/OpenAPI/Generated.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 97c993be3d515c6469f8c20e809cf266 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/OpenAPI/Generated/WorldAnalysisOpenAPI.cs b/Runtime/Scripts/OpenAPI/Generated/WorldAnalysisOpenAPI.cs new file mode 100644 index 0000000000000000000000000000000000000000..5879309fd4e5b4203d4de2469d840a658ce258d1 --- /dev/null +++ b/Runtime/Scripts/OpenAPI/Generated/WorldAnalysisOpenAPI.cs @@ -0,0 +1,2496 @@ +//---------------------- +// <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) +// </auto-generated> +//---------------------- + +#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." +#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 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?'" +#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" +#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). + +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))")] + public partial class WorldAnalysisClient + { + private ETSI.ARF.OpenAPI.IHttpClient _httpClient; + private static System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings, true); + + #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.IHttpClient httpClient) + #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. + { + _httpClient = httpClient; + } + + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + { + var settings = new Newtonsoft.Json.JsonSerializerSettings(); + UpdateJsonSerializerSettings(settings); + return settings; + } + + protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } + + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + + partial void PrepareRequest(ETSI.ARF.OpenAPI.IHttpClient client, System.Net.Http.HttpRequestMessage request, string url); + partial void PrepareRequest(ETSI.ARF.OpenAPI.IHttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); + partial void ProcessResponse(ETSI.ARF.OpenAPI.IHttpClient client, System.Net.Http.HttpResponseMessage response); + + /// <summary> + /// Test the server availability. + /// </summary> + /// <returns>Ok, returns a string message.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual System.Threading.Tasks.Task<string> GetPingAsync() + { + return GetPingAsync(System.Threading.CancellationToken.None); + } + + /// <summary> + /// Test the server availability. + /// </summary> + /// <returns>Ok, returns a string message.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual string GetPing() + { + return System.Threading.Tasks.Task.Run(async () => await GetPingAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> + /// <summary> + /// Test the server availability. + /// </summary> + /// <returns>Ok, returns a string message.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual async System.Threading.Tasks.Task<string> GetPingAsync(System.Threading.CancellationToken cancellationToken) + { + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "ping" + urlBuilder_.Append("ping"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + 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_; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// <summary> + /// Get the state of the server. + /// </summary> + /// <returns>OK, world storage server ready.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual System.Threading.Tasks.Task<string> GetAdminAsync() + { + return GetAdminAsync(System.Threading.CancellationToken.None); + } + + /// <summary> + /// Get the state of the server. + /// </summary> + /// <returns>OK, world storage server ready.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual string GetAdmin() + { + return System.Threading.Tasks.Task.Run(async () => await GetAdminAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> + /// <summary> + /// Get the state of the server. + /// </summary> + /// <returns>OK, world storage server ready.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual async System.Threading.Tasks.Task<string> GetAdminAsync(System.Threading.CancellationToken cancellationToken) + { + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "admin" + urlBuilder_.Append("admin"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + 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_; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// <summary> + /// Get the version of the ARF API. + /// </summary> + /// <returns>Current version.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual System.Threading.Tasks.Task<string> GetVersionAsync() + { + return GetVersionAsync(System.Threading.CancellationToken.None); + } + + /// <summary> + /// Get the version of the ARF API. + /// </summary> + /// <returns>Current version.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual string GetVersion() + { + return System.Threading.Tasks.Task.Run(async () => await GetVersionAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> + /// <summary> + /// Get the version of the ARF API. + /// </summary> + /// <returns>Current version.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual async System.Threading.Tasks.Task<string> GetVersionAsync(System.Threading.CancellationToken cancellationToken) + { + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "version" + urlBuilder_.Append("version"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + 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_; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// <summary> + /// Specify the a minimum frame rate for pose estimation for Trackable types + /// </summary> + /// <remarks> + /// Operation to set the minimum frame rate for pose estimation required for the different Trackable Types + /// </remarks> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual System.Threading.Tasks.Task ConfigureFramerateAsync(string token, string sessionID, PoseConfiguration body) + { + return ConfigureFramerateAsync(token, sessionID, body, System.Threading.CancellationToken.None); + } + + /// <summary> + /// Specify the a minimum frame rate for pose estimation for Trackable types + /// </summary> + /// <remarks> + /// Operation to set the minimum frame rate for pose estimation required for the different Trackable Types + /// </remarks> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual void ConfigureFramerate(string token, string sessionID, PoseConfiguration body) + { + System.Threading.Tasks.Task.Run(async () => await ConfigureFramerateAsync(token, sessionID, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> + /// <summary> + /// Specify the a minimum frame rate for pose estimation for Trackable types + /// </summary> + /// <remarks> + /// Operation to set the minimum frame rate for pose estimation required for the different Trackable Types + /// </remarks> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual async System.Threading.Tasks.Task ConfigureFramerateAsync(string token, string sessionID, PoseConfiguration body, System.Threading.CancellationToken cancellationToken) + { + if (body == null) + throw new System.ArgumentNullException("body"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (token != null) + request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); + + if (sessionID != null) + request_.Headers.TryAddWithoutValidation("sessionID", ConvertToString(sessionID, System.Globalization.CultureInfo.InvariantCulture)); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "pose/configure/framerate" + urlBuilder_.Append("pose/configure/framerate"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + return; + } + 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); + } + else + { + 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>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// <summary> + /// Request the last pose of a single Anchor or Trackable + /// </summary> + /// <remarks> + /// Operation to retrieve the pose of an AR device in relation to a WorldAnchor or a Trackable (AR device pose), or conversely a Trackable or WorldAnchor in relation to the AR device (object pose). + /// </remarks> + /// <param name="trackableOrAnchorUUID">UUID of the Trackable or Anchor to request</param> + /// <param name="mode">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<Pose> GetPoseAsync(string token, string sessionID, System.Guid trackableOrAnchorUUID, Mode_WorldAnalysis mode) + { + return GetPoseAsync(token, sessionID, trackableOrAnchorUUID, mode, System.Threading.CancellationToken.None); + } + + /// <summary> + /// Request the last pose of a single Anchor or Trackable + /// </summary> + /// <remarks> + /// Operation to retrieve the pose of an AR device in relation to a WorldAnchor or a Trackable (AR device pose), or conversely a Trackable or WorldAnchor in relation to the AR device (object pose). + /// </remarks> + /// <param name="trackableOrAnchorUUID">UUID of the Trackable or Anchor to request</param> + /// <param name="mode">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 Pose GetPose(string token, string sessionID, System.Guid trackableOrAnchorUUID, Mode_WorldAnalysis mode) + { + return System.Threading.Tasks.Task.Run(async () => await GetPoseAsync(token, sessionID, trackableOrAnchorUUID, mode, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> + /// <summary> + /// Request the last pose of a single Anchor or Trackable + /// </summary> + /// <remarks> + /// Operation to retrieve the pose of an AR device in relation to a WorldAnchor or a Trackable (AR device pose), or conversely a Trackable or WorldAnchor in relation to the AR device (object pose). + /// </remarks> + /// <param name="trackableOrAnchorUUID">UUID of the Trackable or Anchor to request</param> + /// <param name="mode">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<Pose> GetPoseAsync(string token, string sessionID, System.Guid trackableOrAnchorUUID, Mode_WorldAnalysis mode, System.Threading.CancellationToken cancellationToken) + { + if (trackableOrAnchorUUID == null) + throw new System.ArgumentNullException("trackableOrAnchorUUID"); + + if (mode == null) + throw new System.ArgumentNullException("mode"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (token != null) + request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); + + if (sessionID != null) + request_.Headers.TryAddWithoutValidation("sessionID", ConvertToString(sessionID, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "pose/{trackableOrAnchorUUID}" + urlBuilder_.Append("pose/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(trackableOrAnchorUUID, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('?'); + urlBuilder_.Append(System.Uri.EscapeDataString("mode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + urlBuilder_.Length--; + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync<Pose>(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); + } + 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); + } + 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); + } + 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); + } + else + { + 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>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// <summary> + /// Request the last pose of a batch of Anchor or Trackable + /// </summary> + /// <remarks> + /// Operation to retrieve the pose of an AR device in relation to a batch of WorldAnchor or a Trackable (AR device pose), or conversely a batch of Trackable or WorldAnchor in relation to the AR device (object pose). + /// </remarks> + /// <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) + { + return GetPosesAsync(token, sessionID, uuid, System.Threading.CancellationToken.None); + } + + /// <summary> + /// Request the last pose of a batch of Anchor or Trackable + /// </summary> + /// <remarks> + /// Operation to retrieve the pose of an AR device in relation to a batch of WorldAnchor or a Trackable (AR device pose), or conversely a batch of Trackable or WorldAnchor in relation to the AR device (object pose). + /// </remarks> + /// <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) + { + return System.Threading.Tasks.Task.Run(async () => await GetPosesAsync(token, sessionID, uuid, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> + /// <summary> + /// Request the last pose of a batch of Anchor or Trackable + /// </summary> + /// <remarks> + /// Operation to retrieve the pose of an AR device in relation to a batch of WorldAnchor or a Trackable (AR device pose), or conversely a batch of Trackable or WorldAnchor in relation to the AR device (object pose). + /// </remarks> + /// <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) + { + if (uuid == null) + throw new System.ArgumentNullException("uuid"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (token != null) + request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); + + if (sessionID != null) + request_.Headers.TryAddWithoutValidation("sessionID", ConvertToString(sessionID, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "poses" + urlBuilder_.Append("poses"); + urlBuilder_.Append('?'); + foreach (var item_ in uuid) { urlBuilder_.Append(System.Uri.EscapeDataString("uuid")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } + urlBuilder_.Length--; + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync<Response>(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); + } + 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); + } + 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); + } + 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); + } + else + { + 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>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// <summary> + /// Subscribe to collect the pose of an AR device, an Anchor or a Trackable + /// </summary> + /// <remarks> + /// Subscription to collect the pose of an AR device in relation to a WorldAnchor or a Trackable (AR device pose), or conversely a Trackable or WorldAnchor in relation to the AR device (object pose). Notifications are sent either using a provided webhook or a dynamically generated websocket endpoints. + /// </remarks> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual System.Threading.Tasks.Task<SubscriptionSingle> SubscribeToPoseAsync(string token, string sessionID, SubscriptionSingleRequest body) + { + return SubscribeToPoseAsync(token, sessionID, body, System.Threading.CancellationToken.None); + } + + /// <summary> + /// Subscribe to collect the pose of an AR device, an Anchor or a Trackable + /// </summary> + /// <remarks> + /// Subscription to collect the pose of an AR device in relation to a WorldAnchor or a Trackable (AR device pose), or conversely a Trackable or WorldAnchor in relation to the AR device (object pose). Notifications are sent either using a provided webhook or a dynamically generated websocket endpoints. + /// </remarks> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual SubscriptionSingle SubscribeToPose(string token, string sessionID, SubscriptionSingleRequest body) + { + return System.Threading.Tasks.Task.Run(async () => await SubscribeToPoseAsync(token, sessionID, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> + /// <summary> + /// Subscribe to collect the pose of an AR device, an Anchor or a Trackable + /// </summary> + /// <remarks> + /// Subscription to collect the pose of an AR device in relation to a WorldAnchor or a Trackable (AR device pose), or conversely a Trackable or WorldAnchor in relation to the AR device (object pose). Notifications are sent either using a provided webhook or a dynamically generated websocket endpoints. + /// </remarks> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual async System.Threading.Tasks.Task<SubscriptionSingle> SubscribeToPoseAsync(string token, string sessionID, SubscriptionSingleRequest body, System.Threading.CancellationToken cancellationToken) + { + if (body == null) + throw new System.ArgumentNullException("body"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (token != null) + request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); + + if (sessionID != null) + request_.Headers.TryAddWithoutValidation("sessionID", ConvertToString(sessionID, System.Globalization.CultureInfo.InvariantCulture)); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "pose/subscriptions" + urlBuilder_.Append("pose/subscriptions"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync<SubscriptionSingle>(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); + } + 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); + } + 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); + } + 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); + } + else + { + 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>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// <summary> + /// Get information about a subscription + /// </summary> + /// <remarks> + /// Get the subscription and the associated callback for collecting a given pose + /// </remarks> + /// <param name="subscriptionUUID">Subscription UUID to retrieve.</param> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual System.Threading.Tasks.Task<SubscriptionSingle> GetSubscriptionAsync(string token, string sessionID, System.Guid subscriptionUUID) + { + return GetSubscriptionAsync(token, sessionID, subscriptionUUID, System.Threading.CancellationToken.None); + } + + /// <summary> + /// Get information about a subscription + /// </summary> + /// <remarks> + /// Get the subscription and the associated callback for collecting a given pose + /// </remarks> + /// <param name="subscriptionUUID">Subscription UUID to retrieve.</param> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual SubscriptionSingle GetSubscription(string token, string sessionID, System.Guid subscriptionUUID) + { + return System.Threading.Tasks.Task.Run(async () => await GetSubscriptionAsync(token, sessionID, subscriptionUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> + /// <summary> + /// Get information about a subscription + /// </summary> + /// <remarks> + /// Get the subscription and the associated callback for collecting a given pose + /// </remarks> + /// <param name="subscriptionUUID">Subscription UUID to retrieve.</param> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual async System.Threading.Tasks.Task<SubscriptionSingle> GetSubscriptionAsync(string token, string sessionID, System.Guid subscriptionUUID, System.Threading.CancellationToken cancellationToken) + { + if (subscriptionUUID == null) + throw new System.ArgumentNullException("subscriptionUUID"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (token != null) + request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); + + if (sessionID != null) + request_.Headers.TryAddWithoutValidation("sessionID", ConvertToString(sessionID, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "pose/subscriptions/{subscriptionUUID}" + urlBuilder_.Append("pose/subscriptions/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(subscriptionUUID, System.Globalization.CultureInfo.InvariantCulture))); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync<SubscriptionSingle>(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); + } + 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); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// <summary> + /// Update a subscription + /// </summary> + /// <remarks> + /// Update an existing subscription + /// </remarks> + /// <param name="subscriptionUUID">Subscription UUID to delete.</param> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual System.Threading.Tasks.Task<SubscriptionSingle> UpdateSubscriptionAsync(string token, string sessionID, System.Guid subscriptionUUID, Body body) + { + return UpdateSubscriptionAsync(token, sessionID, subscriptionUUID, body, System.Threading.CancellationToken.None); + } + + /// <summary> + /// Update a subscription + /// </summary> + /// <remarks> + /// Update an existing subscription + /// </remarks> + /// <param name="subscriptionUUID">Subscription UUID to delete.</param> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual SubscriptionSingle UpdateSubscription(string token, string sessionID, System.Guid subscriptionUUID, Body body) + { + return System.Threading.Tasks.Task.Run(async () => await UpdateSubscriptionAsync(token, sessionID, subscriptionUUID, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> + /// <summary> + /// Update a subscription + /// </summary> + /// <remarks> + /// Update an existing subscription + /// </remarks> + /// <param name="subscriptionUUID">Subscription UUID to delete.</param> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual async System.Threading.Tasks.Task<SubscriptionSingle> UpdateSubscriptionAsync(string token, string sessionID, System.Guid subscriptionUUID, Body body, System.Threading.CancellationToken cancellationToken) + { + if (subscriptionUUID == null) + throw new System.ArgumentNullException("subscriptionUUID"); + + if (body == null) + throw new System.ArgumentNullException("body"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (token != null) + request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); + + if (sessionID != null) + request_.Headers.TryAddWithoutValidation("sessionID", ConvertToString(sessionID, System.Globalization.CultureInfo.InvariantCulture)); + var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value); + var content_ = new System.Net.Http.StringContent(json_); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("PUT"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "pose/subscriptions/{subscriptionUUID}" + urlBuilder_.Append("pose/subscriptions/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(subscriptionUUID, System.Globalization.CultureInfo.InvariantCulture))); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync<SubscriptionSingle>(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); + } + 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); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// <summary> + /// Remove a subscription to a given pose + /// </summary> + /// <remarks> + /// 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> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual System.Threading.Tasks.Task<string> UnsubscribeFromPoseAsync(string token, string sessionID, System.Guid subscriptionUUID) + { + return UnsubscribeFromPoseAsync(token, sessionID, subscriptionUUID, System.Threading.CancellationToken.None); + } + + /// <summary> + /// Remove a subscription to a given pose + /// </summary> + /// <remarks> + /// 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> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual string 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(); + } + + /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> + /// <summary> + /// Remove a subscription to a given pose + /// </summary> + /// <remarks> + /// 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> + /// <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) + { + if (subscriptionUUID == null) + throw new System.ArgumentNullException("subscriptionUUID"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (token != null) + request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); + + 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")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "pose/subscriptions/{subscriptionUUID}" + urlBuilder_.Append("pose/subscriptions/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(subscriptionUUID, System.Globalization.CultureInfo.InvariantCulture))); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + 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_; + } + 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); + } + 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); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// <summary> + /// Get the supported capabilities of the World Analysis + /// </summary> + /// <remarks> + /// Operation to retrieve information the capabilities of the World Analysis for pose estimation ( (e.g. frame rate, latency, accuracy or Trackable types supported for the pose estimation) + /// </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) + { + return GetCapabilitiesAsync(token, sessionID, System.Threading.CancellationToken.None); + } + + /// <summary> + /// Get the supported capabilities of the World Analysis + /// </summary> + /// <remarks> + /// Operation to retrieve information the capabilities of the World Analysis for pose estimation ( (e.g. frame rate, latency, accuracy or Trackable types supported for the pose estimation) + /// </remarks> + /// <returns>Successful operation.</returns> + /// <exception cref="ApiException">A server side error occurred.</exception> + public virtual Response2 GetCapabilities(string token, string sessionID) + { + return System.Threading.Tasks.Task.Run(async () => await GetCapabilitiesAsync(token, sessionID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> + /// <summary> + /// Get the supported capabilities of the World Analysis + /// </summary> + /// <remarks> + /// Operation to retrieve information the capabilities of the World Analysis for pose estimation ( (e.g. frame rate, latency, accuracy or Trackable types supported for the pose estimation) + /// </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) + { + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (token != null) + request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); + + if (sessionID != null) + request_.Headers.TryAddWithoutValidation("sessionID", ConvertToString(sessionID, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "capabilities" + urlBuilder_.Append("capabilities"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync<Response2>(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 + { + 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>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// <summary> + /// For a given trackable or anchor, get its support information + /// </summary> + /// <remarks> + /// Operation to retrieve information the capabilities of the World Analysis for pose estimation ( (e.g. frame rate, latency, accuracy or Trackable types supported for the pose estimation) + /// </remarks> + /// <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) + { + return GetSupportAsync(token, sessionID, trackableOrAnchorUUID, System.Threading.CancellationToken.None); + } + + /// <summary> + /// For a given trackable or anchor, get its support information + /// </summary> + /// <remarks> + /// Operation to retrieve information the capabilities of the World Analysis for pose estimation ( (e.g. frame rate, latency, accuracy or Trackable types supported for the pose estimation) + /// </remarks> + /// <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) + { + return System.Threading.Tasks.Task.Run(async () => await GetSupportAsync(token, sessionID, trackableOrAnchorUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> + /// <summary> + /// For a given trackable or anchor, get its support information + /// </summary> + /// <remarks> + /// Operation to retrieve information the capabilities of the World Analysis for pose estimation ( (e.g. frame rate, latency, accuracy or Trackable types supported for the pose estimation) + /// </remarks> + /// <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) + { + if (trackableOrAnchorUUID == null) + throw new System.ArgumentNullException("trackableOrAnchorUUID"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (token != null) + request_.Headers.TryAddWithoutValidation("token", ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture)); + + if (sessionID != null) + request_.Headers.TryAddWithoutValidation("sessionID", ConvertToString(sessionID, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "capabilities/{trackableOrAnchorUUID}" + urlBuilder_.Append("capabilities/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(trackableOrAnchorUUID, System.Globalization.CultureInfo.InvariantCulture))); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync<Response3>(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); + } + 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); + } + 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); + } + 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); + } + else + { + 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>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + protected struct ObjectResponseResult<T> + { + public ObjectResponseResult(T responseObject, string responseText) + { + this.Object = responseObject; + this.Text = responseText; + } + + public T Object { get; } + + public string Text { get; } + } + + public bool ReadResponseAsString { get; set; } + + protected virtual async System.Threading.Tasks.Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Threading.CancellationToken cancellationToken) + { + if (response == null || response.Content == null) + { + return new ObjectResponseResult<T>(default(T), string.Empty); + } + + if (ReadResponseAsString) + { + var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject<T>(responseText, JsonSerializerSettings); + return new ObjectResponseResult<T>(typedBody, responseText); + } + catch (Newtonsoft.Json.JsonException exception) + { + var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; + throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception); + } + } + else + { + try + { + using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + using (var streamReader = new System.IO.StreamReader(responseStream)) + using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) + { + var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); + var typedBody = serializer.Deserialize<T>(jsonTextReader); + return new ObjectResponseResult<T>(typedBody, string.Empty); + } + } + catch (Newtonsoft.Json.JsonException exception) + { + var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; + throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception); + } + } + } + + private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) + { + if (value == null) + { + return ""; + } + + if (value is System.Enum) + { + var name = System.Enum.GetName(value.GetType(), value); + if (name != null) + { + var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field != null) + { + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + as System.Runtime.Serialization.EnumMemberAttribute; + if (attribute != null) + { + return attribute.Value != null ? attribute.Value : name; + } + } + + var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); + return converted == null ? string.Empty : converted; + } + } + else if (value is bool) + { + return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); + } + else if (value is byte[]) + { + return System.Convert.ToBase64String((byte[]) value); + } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } + else if (value.GetType().IsArray) + { + var valueArray = (System.Array)value; + var valueTextArray = new string[valueArray.Length]; + for (var i = 0; i < valueArray.Length; i++) + { + valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo); + } + return string.Join(",", valueTextArray); + } + + var result = System.Convert.ToString(value, cultureInfo); + return result == null ? "" : result; + } + } + + /// <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))")] + public partial class Pose + { + /// <summary> + /// UUID of the associated Anchor or Trackable + /// </summary> + [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Guid Uuid { get; set; } + + /// <summary> + /// Extensible List of possible states of the pose estimation + /// </summary> + [Newtonsoft.Json.JsonProperty("estimationState", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public PoseEstimationState EstimationState { get; set; } + + /// <summary> + /// A message detailing the context of the pose estimation + /// </summary> + [Newtonsoft.Json.JsonProperty("instructionInfo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string InstructionInfo { get; set; } + + /// <summary> + /// Capture time of the pose as number of milliseconds since unix epoch + /// </summary> + [Newtonsoft.Json.JsonProperty("timestamp", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int Timestamp { get; set; } + + /// <summary> + /// A score representing the confidence concerning the accuracy of the pose estimated + /// </summary> + [Newtonsoft.Json.JsonProperty("confidence", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Confidence { get; set; } + + /// <summary> + /// Mode 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.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public Mode_WorldAnalysis Mode { get; set; } + + /// <summary> + /// The pose value + /// </summary> + [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public MatrixPoseValue Value { get; set; } + + /// <summary> + /// The URL to use for subscription (if available), see [/pose/subscriptions] + /// </summary> + [Newtonsoft.Json.JsonProperty("subscriptionUrl", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string SubscriptionUrl { 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> + /// 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))")] + public partial class PoseValue + { + /// <summary> + /// Encoding type of the Pose + /// </summary> + [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public PoseValueType Type { 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> + /// 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))")] + public partial class MatrixPoseValue : PoseValue + { + /// <summary> + /// Transor data + /// </summary> + [Newtonsoft.Json.JsonProperty("transform", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Transform3D Transform { get; set; } + + /// <summary> + /// Unit system of the pose + /// </summary> + [Newtonsoft.Json.JsonProperty("unit", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public UnitSystem Unit { get; set; } + + } + + /// <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))")] + public partial class VectorQuaternionPoseValue : PoseValue + { + /// <summary> + /// Pose Position + /// </summary> + [Newtonsoft.Json.JsonProperty("position", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Vector3 Position { get; set; } + + /// <summary> + /// Pose Rotation + /// </summary> + [Newtonsoft.Json.JsonProperty("rotation", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Quaternion Rotation { get; set; } + + /// <summary> + /// Unit system of the pose + /// </summary> + [Newtonsoft.Json.JsonProperty("unit", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public UnitSystem Unit { get; set; } + + } + + /// <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))")] + public partial class GeodeticPoseValue : PoseValue + { + [Newtonsoft.Json.JsonProperty("altitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Altitude { get; set; } + + [Newtonsoft.Json.JsonProperty("longitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Longitude { get; set; } + + [Newtonsoft.Json.JsonProperty("latitude", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Latitude { get; set; } + + /// <summary> + /// Pose Rotation + /// </summary> + [Newtonsoft.Json.JsonProperty("rotation", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Quaternion Rotation { get; set; } + + /// <summary> + /// Associated geodetic system of the pose + /// </summary> + [Newtonsoft.Json.JsonProperty("geodeticsystem", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Geodeticsystem { get; set; } + + /// <summary> + /// Coordinate system of the rotation + /// </summary> + [Newtonsoft.Json.JsonProperty("rotationTarget", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public GeodeticPoseValueRotationTarget RotationTarget { get; set; } + + } + + /// <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))")] + public partial class PoseConfiguration + { + [Newtonsoft.Json.JsonProperty("trackableType", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public PoseConfigurationTrackableType TrackableType { get; set; } + + [Newtonsoft.Json.JsonProperty("encodingInformation", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public EncodingInformationStructure EncodingInformation { get; set; } + + /// <summary> + /// Number of frames per second the tracking expected for this type of trackable is performed by the World Analysis + /// </summary> + [Newtonsoft.Json.JsonProperty("framerate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Framerate { 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> + /// 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))")] + public partial class SubscriptionSingleRequest + { + /// <summary> + /// UUID of the Trackable or Anchor to subscribe + /// </summary> + [Newtonsoft.Json.JsonProperty("target", Required = Newtonsoft.Json.Required.Always)] + public System.Guid Target { get; set; } + + /// <summary> + /// Mode 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)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public Mode_WorldAnalysis Mode { get; set; } + + /// <summary> + /// Subscription validity delay in millisecond + /// </summary> + [Newtonsoft.Json.JsonProperty("validity", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int Validity { get; set; } + + /// <summary> + /// Optional URL of your listening webhook for collecting the poses + /// </summary> + [Newtonsoft.Json.JsonProperty("webhookUrl", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string WebhookUrl { 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> + /// 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))")] + 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>(); + + /// <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>(); + + /// <summary> + /// Subscription validity delay in millisecond + /// </summary> + [Newtonsoft.Json.JsonProperty("validity", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int Validity { get; set; } + + /// <summary> + /// Optional URL of your listening webhook for collecting the poses + /// </summary> + [Newtonsoft.Json.JsonProperty("webhookUrl", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string WebhookUrl { 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> + /// 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))")] + public partial class SubscriptionSingle + { + /// <summary> + /// UUID of the subscription + /// </summary> + [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Guid Uuid { get; set; } + + /// <summary> + /// UUID of the Trackable or Anchor associated with the subscription + /// </summary> + [Newtonsoft.Json.JsonProperty("target", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Guid Target { get; set; } + + /// <summary> + /// Mode 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.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public Mode_WorldAnalysis Mode { get; set; } + + [Newtonsoft.Json.JsonProperty("validity", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int Validity { get; set; } + + /// <summary> + /// Optional URL of the listening webhook that collect the poses + /// </summary> + [Newtonsoft.Json.JsonProperty("webhookUrl", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string WebhookUrl { get; set; } + + /// <summary> + /// Optional dynamically generated websocket url in case of no webhook provided in the request body + /// </summary> + [Newtonsoft.Json.JsonProperty("websocketUrl", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string WebsocketUrl { 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> + /// 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))")] + public partial class SubscriptionMultiple + { + [Newtonsoft.Json.JsonProperty("subscriptions", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection<SubscriptionSingle> Subscriptions { 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> + /// 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))")] + public partial class Capability + { + [Newtonsoft.Json.JsonProperty("trackableType", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public TrackableType TrackableType { get; set; } + + [Newtonsoft.Json.JsonProperty("encodingInformation", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public EncodingInformationStructure EncodingInformation { get; set; } + + /// <summary> + /// Number of frames per second the tracking of this type of trackable is performed by the World Analysis + /// </summary> + [Newtonsoft.Json.JsonProperty("framerate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Framerate { get; set; } + + /// <summary> + /// Mean tracking latency in milliseconds for this type of trackable + /// </summary> + [Newtonsoft.Json.JsonProperty("latency", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Latency { get; set; } + + /// <summary> + /// Accuracy score for the detection of this type of Trackable by the World Analysis + /// </summary> + [Newtonsoft.Json.JsonProperty("accuracy", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Accuracy { 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> + /// 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))")] + public partial class EncodingInformationStructure + { + /// <summary> + /// Identifier of the target framework. + /// </summary> + [Newtonsoft.Json.JsonProperty("dataFormat", Required = Newtonsoft.Json.Required.Always)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public EncodingInformationStructureDataFormat DataFormat { get; set; } + + /// <summary> + /// The version of the format + /// </summary> + [Newtonsoft.Json.JsonProperty("version", Required = Newtonsoft.Json.Required.Always)] + public string Version { 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; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.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)] + 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> + /// 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))")] + public enum Mode_WorldAnalysis + { + + [System.Runtime.Serialization.EnumMember(Value = @"TRACKABLES_TO_DEVICE")] + TRACKABLES_TO_DEVICE = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"DEVICE_TO_TRACKABLES")] + DEVICE_TO_TRACKABLES = 1, + + } + + /// <summary> + /// A quaternion + /// </summary> + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class Quaternion : System.Collections.ObjectModel.Collection<float> + { + + } + + /// <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))")] + public enum TrackableType + { + + [System.Runtime.Serialization.EnumMember(Value = @"FIDUCIAL_MARKER")] + FIDUCIAL_MARKER = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"IMAGE_MARKER")] + IMAGE_MARKER = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"MESH")] + MESH = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"MAP")] + MAP = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"GEOPOSE")] + GEOPOSE = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"OTHER")] + OTHER = 5, + + } + + /// <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))")] + public partial class Transform3D : System.Collections.ObjectModel.Collection<float> + { + + } + + /// <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))")] + public enum TypeWorldStorage + { + + [System.Runtime.Serialization.EnumMember(Value = @"TRACKABLE")] + TRACKABLE = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"ANCHOR")] + ANCHOR = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"UNKNOWN")] + UNKNOWN = 2, + + } + + /// <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))")] + public enum UnitSystem + { + + [System.Runtime.Serialization.EnumMember(Value = @"MM")] + MM = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"CM")] + CM = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"DM")] + DM = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"M")] + M = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"DAM")] + DAM = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"HM")] + HM = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"KM")] + KM = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"INCH")] + INCH = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"FOOT")] + FOOT = 8, + + [System.Runtime.Serialization.EnumMember(Value = @"YARD")] + YARD = 9, + + [System.Runtime.Serialization.EnumMember(Value = @"MILE")] + MILE = 10, + + } + + /// <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))")] + 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 + { + [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.Always)] + public System.Guid Uuid { get; set; } + + /// <summary> + /// Mode 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)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public Mode_WorldAnalysis Mode { 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; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class Body + { + /// <summary> + /// Mode 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.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public Mode_WorldAnalysis Mode { get; set; } + + /// <summary> + /// Subscription validity delay in millisecond + /// </summary> + [Newtonsoft.Json.JsonProperty("validity", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int Validity { get; set; } + + /// <summary> + /// Optional URL of your listening webhook for collecting the poses + /// </summary> + [Newtonsoft.Json.JsonProperty("webhookUrl", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string WebhookUrl { 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; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class Response + { + [Newtonsoft.Json.JsonProperty("poses", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection<Pose> Poses { 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; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class Response2 + { + [Newtonsoft.Json.JsonProperty("capabilities", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection<Capability> Capabilities { 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; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class Response3 + { + [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public TypeWorldStorage Type { get; set; } + + [Newtonsoft.Json.JsonProperty("capability", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Capability Capability { 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; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum PoseEstimationState + { + + [System.Runtime.Serialization.EnumMember(Value = @"OK")] + OK = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"FAILURE")] + FAILURE = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum PoseValueType + { + + [System.Runtime.Serialization.EnumMember(Value = @"MATRIX")] + MATRIX = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"VECTOR_QUATERNION")] + VECTOR_QUATERNION = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"GEODETIC")] + GEODETIC = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum GeodeticPoseValueRotationTarget + { + + [System.Runtime.Serialization.EnumMember(Value = @"EASTUPSOUTH")] + EASTUPSOUTH = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"WESTUPNORTH")] + WESTUPNORTH = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum PoseConfigurationTrackableType + { + + [System.Runtime.Serialization.EnumMember(Value = @"FIDUCIAL_MARKER")] + FIDUCIAL_MARKER = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"IMAGE_MARKER")] + IMAGE_MARKER = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"MESH")] + MESH = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"MAP")] + MAP = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"GEOPOSE")] + GEOPOSE = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"OTHER")] + OTHER = 5, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum EncodingInformationStructureDataFormat + { + + [System.Runtime.Serialization.EnumMember(Value = @"HOLOLENS")] + HOLOLENS = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"ARKIT")] + ARKIT = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"ARCORE")] + ARCORE = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"VUFORIA")] + VUFORIA = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"ARUCO")] + ARUCO = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"OTHER")] + OTHER = 5, + + } + + + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class ApiException : System.Exception + { + public int StatusCode { get; private set; } + + public string Response { get; private set; } + + public System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; } + + public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Exception innerException) + : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) + { + StatusCode = statusCode; + Response = response; + Headers = headers; + } + + public override string ToString() + { + return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class ApiException<TResult> : ApiException + { + public TResult Result { get; private set; } + + public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result, System.Exception innerException) + : base(message, statusCode, response, headers, innerException) + { + Result = result; + } + } + +} + +#pragma warning restore 108 +#pragma warning restore 114 +#pragma warning restore 472 +#pragma warning restore 612 +#pragma warning restore 1573 +#pragma warning restore 1591 +#pragma warning restore 8073 +#pragma warning restore 3016 +#pragma warning restore 8603 +#pragma warning restore 8604 +#pragma warning restore 8625 \ No newline at end of file diff --git a/Runtime/Scripts/OpenAPI/Generated/WorldAnalysisOpenAPI.cs.meta b/Runtime/Scripts/OpenAPI/Generated/WorldAnalysisOpenAPI.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..d368ba0bf3f8312f90bbbf56037c6311ee5c26eb --- /dev/null +++ b/Runtime/Scripts/OpenAPI/Generated/WorldAnalysisOpenAPI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 07f2559a21939c64ea37e4b456450f76 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/WorldAnalysisInterface.cs b/Runtime/Scripts/WorldAnalysisInterface.cs new file mode 100644 index 0000000000000000000000000000000000000000..24f1b3b3d8251b23636c56d3a3b609465b5b64ac --- /dev/null +++ b/Runtime/Scripts/WorldAnalysisInterface.cs @@ -0,0 +1,181 @@ +using ETSI.ARF.OpenAPI.WorldAnalysis; + +public interface WorldAnalysisInterface +{ + public static WorldAnalysisInterface Instance; + + #region ResponseCode + + /// <summary> + /// Ask framerate result + /// </summary> + public enum AskFrameRateResult + { + OK, // subscription ok + NOT_SUPPORTED, /// trackable type not supported on that platform + FRAMERATE_NOT_SUPPORTED, // framerate cannot be reached RQ-AR8-007 The WA function shall provide the pose at the minimum frame rate requested by the SM function, or shall notify the SM function if the requested minimum frame rate cannot be supported + NONE // unknown + } + + /// <summary> + /// Result of the process of a pose estimation + /// </summary> + public enum PoseEstimationResult + { + OK, + UNKNOWN_ID, + NOT_ALLOWED, + NOT_SUPPORTED, + FAILURE, // RQ-AR8-005 The WA function shall have the ability to send a notification to the SM function in case of a pose estimation failure. + NONE + } + + + /// <summary> + /// Callback for receiving a pose + /// </summary> + /// <param name="estimationResult">last pose estimation result</param> + /// <param name="pose">last pose</param> + public delegate void PoseCallback(PoseEstimationResult estimationResult, Pose pose); + + /// <summary> + /// Result of the process of an operation on the subscription to to the pose of a trackable or anchor + /// </summary> + public enum InformationSubscriptionResult + { + OK, // subscription operation ok + UNKNOWN_ID, // trackable or anchor is unknown + NOT_ALLOWED, // trackable or anchor is not allowed for that user + NOT_SUPPORTED, /// trackable not supported on that platform + NONE // unknown + } + + /// <summary> + /// Result when getting information about capabilities + /// </summary> + public enum CapabilityResult + { + OK, + FAIL, + UNKNOWN_ID, + NOT_ALLOWED + } + + #endregion + + #region Pose + /// <summary> + /// Ask the world analysis to estimate the pose of a given trackable type at a given framerate + /// </summary> + /// <param name="token">manage access rights RQ-AR8-010 When access control is required by the WA function, the SM function shall provide the WA function with identification information to manage access rights</param> + /// <param name="type">type of trackable</param> + /// <param name="encodingInformation"> Encoding information of the trackable type</param> + /// <param name="minimumFramerate">asked minimum framerate RQ-AR8-006 The WA function should allow the SM function to specify a minimum frame rate for pose estimation. </param> + /// <returns>Result of the set framerate estimation</returns> + public AskFrameRateResult SetPoseEstimationFramerate(string token, PoseConfigurationTrackableType type, EncodingInformationStructure encodingInformation, int minimumFramerate); + + /// <summary> + /// Pull the most recent pose of a given trackable or anchor + /// RQ-AR8-004 The SM function shall have the ability to request the pose for one or several World Anchors or Trackables from the WA function. + /// </summary> + /// <param name="token">manage access rights RQ-AR8-010 When access control is required by the WA function, the SM function shall provide the WA function with identification information to manage access rights</param> + /// <param name="uuid">id of the trackable or the anchor</param> + /// <param name="mode">trackable/anchor to ar device or opposite RQ-AR8-001 The WA function shall provide the SM function with a pose of either an AR device in relation to a WorldAnchor or a Trackable, or conversely a Trackable or World Anchor in relation to the AR device. </param> + /// <param name="pose">Last estimated pose</param> + /// <returns>The last state of the estimation of this pose</returns> + public PoseEstimationResult GetLastPose(string token, string uuid, Mode_WorldAnalysis mode, out Pose pose); + + /// <summary> + /// Pull the most recent pose of a multiple trackables and anchors + /// RQ-AR8-004 The SM function shall have the ability to request the pose for one or several World Anchors or Trackables from the WA function. + /// </summary> + /// <param name="token">manage access rights RQ-AR8-010 When access control is required by the WA function, the SM function shall provide the WA function with identification information to manage access rights</param> + /// <param name="uuid">list of ids of trackables and anchors</param> + /// <param name="mode">list of trackable/anchor to ar device or opposite RQ-AR8-001 The WA function shall provide the SM function with a pose of either an AR device in relation to a WorldAnchor or a Trackable, or conversely a Trackable or World Anchor in relation to the AR device. </param> + /// <param name="poses">Last estimated pose</param> + /// <returns>The last state of the estimation of this pose</returns> + public PoseEstimationResult[] GetLastPoses(string token, string[] uuids, Mode_WorldAnalysis [] modes, out Pose [] poses); + + /// <summary> + /// Subscribe to receive the pose data of a given trackable or anchor + /// RQ-AR8-004 The SM function shall have the ability to request the pose for one or several World Anchors or Trackables from the WA function. + /// </summary> + /// <param name="token">manage access rights RQ-AR8-010 When access control is required by the WA function, the SM function shall provide the WA function with identification information to manage access rights</param> + /// <param name="uuid">unique identifier of the trackable or anchors</param> + /// <param name="mode">trackable/anchor to ar device or opposite RQ-AR8-001 The WA function shall provide the SM function with a pose of either an AR device in relation to a WorldAnchor or a Trackable, or conversely a Trackable or World Anchor in relation to the AR device. </param> + /// <param name="callback">function that is called with the pose</param> + /// <param name="validity">Subscription validity delay in millisecond</param> + /// <param name="subscriptionUUID "> id of the callback</param> + /// <returns>Result of the subscription</returns> + public InformationSubscriptionResult SubscribeToPose(string token, string uuid, Mode_WorldAnalysis mode, PoseCallback callback, ref int validity, out string subscriptionUUID); + + /// <summary> + /// Subscribe to receive the pose data of a multiple trackables and anchors + /// RQ-AR8-004 The SM function shall have the ability to request the pose for one or several World Anchors or Trackables from the WA function. + /// </summary> + /// <param name="token">manage access rights RQ-AR8-010 When access control is required by the WA function, the SM function shall provide the WA function with identification information to manage access rights</param> + /// <param name="uuids">list of unique identifiers of trackable and anchors</param> + /// <param name="modes">list of trackable/anchor to ar device or opposite RQ-AR8-001 The WA function shall provide the SM function with a pose of either an AR device in relation to a WorldAnchor or a Trackable, or conversely a Trackable or World Anchor in relation to the AR device.</param> + /// <param name="callback">function that is called with the pose</param> + /// <param name="validity">Subscription validity delay in millisecond</param> + /// <param name="subscriptionUUIDs"> id of the callback</param> + /// <returns>List of subscription result</returns> + public InformationSubscriptionResult[] SubscribeToPoses(string token, string[] uuids, Mode_WorldAnalysis [] modes, PoseCallback callback, ref int validity, out string[] subscriptionUUIDs); + + /// <summary> + /// Get the subscription and the associated callback for collecting a given pose + /// </summary> + /// <param name="token">manage access rights</param> + /// <param name="subscriptionUUID">Subscription UUID to retrieve</param> + /// <param name="callback">Pose callback</param> + /// <param name="target">UUID of the Trackable or Anchor associated with the subscription</param> + /// <param name="mode">Mode representing the context of the relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device)</param> + /// <param name="validity">Remaining Subscription validity delay in millisecond</param> + /// <returns>The subscription exists or not</returns> + public InformationSubscriptionResult GetSubsription(string token, string subscriptionUUID, out PoseCallback callback, out string target, out Mode_WorldAnalysis mode, out int validity); + + /// <summary> + /// Update an existing subscription + /// </summary> + /// <param name="token">manage access rights</param> + /// <param name="subscriptionUUID">Subscription UUID to update</param> + /// <param name="mode">Mode representing the context of the relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device)</param> + /// <param name="validity">new validity of the subscription</param> + /// <param name="callback">new callback to use</param> + /// <returns>The subscription has been updated or not</returns> + public InformationSubscriptionResult UpdateSubscription(string token, string subscriptionUUID, Mode_WorldAnalysis mode, int validity, PoseCallback callback); + + /// <summary> + /// Unsubscribe to a pose + /// </summary> + /// <param name="subscriptionUUID">id of the subscription</param> + /// /// <returns>The unsubscription has been performed or not</returns> + public InformationSubscriptionResult UnSubscribeToPose(string subscriptionUUID); + + #endregion + + #region Capabilities + + /// <summary> + /// Get the capabilities of the world analysis + /// RQ-AR8-009 The WA function shall provide the SM function with information about its capabilities (e.g. frame rate, latency, accuracy or Trackable types supported for the pose estimation). + /// </summary> + /// <param name="token">manage access rights RQ-AR8-010 When access control is required by the WA function, the SM function shall provide the WA function with identification information to manage access rights</param> + /// <param name="capabilities">for the list of supported capabilites and associated metadata. A capability not included in the list is not supported</param> + /// <returns>Capabilities have correctly identified or not</returns> + public CapabilityResult GetCapabilities(string token, out Capability[] capabilities); + + /// <summary> + /// For a given trackable or anchor, get its support information + /// RQ-AR8-009 The WA function shall provide the SM function with information about its capabilities (e.g. frame rate, latency, accuracy or Trackable types supported for the pose estimation). + /// </summary> + /// <param name="token">manage access rights RQ-AR8-010 When access control is required by the WA function, the SM function shall provide the WA function with identification information to manage access rights</param> + /// <param name="uuid">id of the trackable or anchor</param> + /// <param name="isSupported">trackable or anchor can be estimated on current system</param> + /// <param name="type">the specified id corresponds to an anchor or trackable</param> + /// <param name="capability">metadata associated with the pose estimation of this element</param> + /// <returns>Capabilities have correctly identified or not</returns> + public CapabilityResult GetCapability(string token, string uuid, out bool isSupported, out TypeWorldStorage type, out Capability capability); + + #endregion +} \ No newline at end of file diff --git a/Runtime/Scripts/WorldAnalysisInterface.cs.meta b/Runtime/Scripts/WorldAnalysisInterface.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..eb579332070f3d3a3970895c1c2834fa30747e27 --- /dev/null +++ b/Runtime/Scripts/WorldAnalysisInterface.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2c645dadbfa4a9c44bf37772a68d50d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/etsi.isg.arf.worldanalysis.asmdef b/Runtime/etsi.isg.arf.worldanalysis.asmdef new file mode 100644 index 0000000000000000000000000000000000000000..0ba14de1e6135294d81f4c54588cf07049219ece --- /dev/null +++ b/Runtime/etsi.isg.arf.worldanalysis.asmdef @@ -0,0 +1,16 @@ +{ + "name": "etsi.isg.arf.worldanalysis", + "rootNamespace": "", + "references": [ + "GUID:99fdaa6f193b69346bfc8863615f98f0" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Runtime/etsi.isg.arf.worldanalysis.asmdef.meta b/Runtime/etsi.isg.arf.worldanalysis.asmdef.meta new file mode 100644 index 0000000000000000000000000000000000000000..160058111dbdcd6fa6646aa9388fd11f9f30b440 --- /dev/null +++ b/Runtime/etsi.isg.arf.worldanalysis.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 065e856e9f9becb49abdf0cb6855a039 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3a969c6cd9efc56e3492cdedd2730ebec73f1017 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "author": "ETSI-ISG-ARF", + "name": "etsi.isg.arf.worldanalysis", + "version": "0.0.1", + "displayName": "ISG-ARF World Analysis Package", + "description": "REST Wrapper for the World Analysis of the Augmented Reality Framework", + "unity": "2021.3", + "dependencies": { + "com.unity.nuget.newtonsoft-json" : "3.1.0", + "etsi.isg.arf.worldstorage" : "0.0.2" + }, + "keywords": [] +} \ No newline at end of file diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000000000000000000000000000000000000..11ccac4cd83f9cd24ecdb54ffaf61b23df4ad742 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 638e2a50a5d14774198689b0d4ed072e +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: