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..d9ac029a49a0168ec25aba84e3b9d7179aef420b --- /dev/null +++ b/Runtime/Scripts/OpenAPI/Generated/WorldAnalysisOpenAPI.cs @@ -0,0 +1,2496 @@ +//---------------------- +// +// Generated using the NSwag toolchain v14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) +// +//---------------------- + +#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 _settings = new System.Lazy(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); + + /// + /// Test the server availability. + /// + /// Ok, returns a string message. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetPingAsync() + { + return GetPingAsync(System.Threading.CancellationToken.None); + } + + /// + /// Test the server availability. + /// + /// Ok, returns a string message. + /// A server side error occurred. + public virtual string GetPing() + { + return System.Threading.Tasks.Task.Run(async () => await GetPingAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Test the server availability. + /// + /// Ok, returns a string message. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task 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>(); + 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(); + } + } + + /// + /// Get the state of the server. + /// + /// OK, world storage server ready. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetAdminAsync() + { + return GetAdminAsync(System.Threading.CancellationToken.None); + } + + /// + /// Get the state of the server. + /// + /// OK, world storage server ready. + /// A server side error occurred. + public virtual string GetAdmin() + { + return System.Threading.Tasks.Task.Run(async () => await GetAdminAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the state of the server. + /// + /// OK, world storage server ready. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task 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>(); + 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(); + } + } + + /// + /// Get the version of the ARF API. + /// + /// Current version. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetVersionAsync() + { + return GetVersionAsync(System.Threading.CancellationToken.None); + } + + /// + /// Get the version of the ARF API. + /// + /// Current version. + /// A server side error occurred. + public virtual string GetVersion() + { + return System.Threading.Tasks.Task.Run(async () => await GetVersionAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the version of the ARF API. + /// + /// Current version. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task 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>(); + 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(); + } + } + + /// + /// Specify the a minimum frame rate for pose estimation for Trackable types + /// + /// + /// Operation to set the minimum frame rate for pose estimation required for the different Trackable Types + /// + /// Successful operation. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task ConfigureFramerateAsync(string token, string sessionID, PoseConfiguration body) + { + return ConfigureFramerateAsync(token, sessionID, body, System.Threading.CancellationToken.None); + } + + /// + /// Specify the a minimum frame rate for pose estimation for Trackable types + /// + /// + /// Operation to set the minimum frame rate for pose estimation required for the different Trackable Types + /// + /// Successful operation. + /// A server side error occurred. + 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(); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Specify the a minimum frame rate for pose estimation for Trackable types + /// + /// + /// Operation to set the minimum frame rate for pose estimation required for the different Trackable Types + /// + /// Successful operation. + /// A server side error occurred. + 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>(); + 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("Not supported.", status_, responseData_, headers_, result_, null); + } + else + { + var objectResponse_ = await ReadObjectResponseAsync(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("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Request the last pose of a single Anchor or Trackable + /// + /// + /// 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). + /// + /// UUID of the Trackable or Anchor to request + /// Mode representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) + /// Successful operation. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetPoseAsync(string token, string sessionID, System.Guid trackableOrAnchorUUID, Mode_WorldAnalysis mode) + { + return GetPoseAsync(token, sessionID, trackableOrAnchorUUID, mode, System.Threading.CancellationToken.None); + } + + /// + /// Request the last pose of a single Anchor or Trackable + /// + /// + /// 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). + /// + /// UUID of the Trackable or Anchor to request + /// Mode representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) + /// Successful operation. + /// A server side error occurred. + 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(); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Request the last pose of a single Anchor or Trackable + /// + /// + /// 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). + /// + /// UUID of the Trackable or Anchor to request + /// Mode representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) + /// Successful operation. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task 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>(); + 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_, 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("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("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("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("Not supported.", status_, responseData_, headers_, result_, null); + } + else + { + var objectResponse_ = await ReadObjectResponseAsync(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("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Request the last pose of a batch of Anchor or Trackable + /// + /// + /// 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). + /// + /// 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) + /// Successful operation. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetPosesAsync(string token, string sessionID, System.Collections.Generic.IEnumerable uuid) + { + return GetPosesAsync(token, sessionID, uuid, System.Threading.CancellationToken.None); + } + + /// + /// Request the last pose of a batch of Anchor or Trackable + /// + /// + /// 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). + /// + /// 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) + /// Successful operation. + /// A server side error occurred. + public virtual Response GetPoses(string token, string sessionID, System.Collections.Generic.IEnumerable uuid) + { + return System.Threading.Tasks.Task.Run(async () => await GetPosesAsync(token, sessionID, uuid, System.Threading.CancellationToken.None)).GetAwaiter().GetResult(); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Request the last pose of a batch of Anchor or Trackable + /// + /// + /// 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). + /// + /// 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) + /// Successful operation. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task GetPosesAsync(string token, string sessionID, System.Collections.Generic.IEnumerable 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>(); + 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_, 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("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("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("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("Not supported.", status_, responseData_, headers_, result_, null); + } + else + { + var objectResponse_ = await ReadObjectResponseAsync(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("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Subscribe to collect the pose of an AR device, an Anchor or a Trackable + /// + /// + /// 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. + /// + /// Successful operation. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task SubscribeToPoseAsync(string token, string sessionID, SubscriptionSingleRequest body) + { + return SubscribeToPoseAsync(token, sessionID, body, System.Threading.CancellationToken.None); + } + + /// + /// Subscribe to collect the pose of an AR device, an Anchor or a Trackable + /// + /// + /// 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. + /// + /// Successful operation. + /// A server side error occurred. + 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(); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Subscribe to collect the pose of an AR device, an Anchor or a Trackable + /// + /// + /// 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. + /// + /// Successful operation. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task 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>(); + 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_, 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("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("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("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("Not supported.", status_, responseData_, headers_, result_, null); + } + else + { + var objectResponse_ = await ReadObjectResponseAsync(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("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// Get information about a subscription + /// + /// + /// Get the subscription and the associated callback for collecting a given pose + /// + /// Subscription UUID to retrieve. + /// Successful operation. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetSubscriptionAsync(string token, string sessionID, System.Guid subscriptionUUID) + { + return GetSubscriptionAsync(token, sessionID, subscriptionUUID, System.Threading.CancellationToken.None); + } + + /// + /// Get information about a subscription + /// + /// + /// Get the subscription and the associated callback for collecting a given pose + /// + /// Subscription UUID to retrieve. + /// Successful operation. + /// A server side error occurred. + 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(); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get information about a subscription + /// + /// + /// Get the subscription and the associated callback for collecting a given pose + /// + /// Subscription UUID to retrieve. + /// Successful operation. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task 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>(); + 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_, 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("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("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(); + } + } + + /// + /// Update a subscription + /// + /// + /// Update an existing subscription + /// + /// Subscription UUID to delete. + /// Successful operation. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task UpdateSubscriptionAsync(string token, string sessionID, System.Guid subscriptionUUID, Body body) + { + return UpdateSubscriptionAsync(token, sessionID, subscriptionUUID, body, System.Threading.CancellationToken.None); + } + + /// + /// Update a subscription + /// + /// + /// Update an existing subscription + /// + /// Subscription UUID to delete. + /// Successful operation. + /// A server side error occurred. + 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(); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Update a subscription + /// + /// + /// Update an existing subscription + /// + /// Subscription UUID to delete. + /// Successful operation. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task 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>(); + 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_, 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("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("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(); + } + } + + /// + /// Remove a subscription to a given pose + /// + /// + /// End the subscription and the associated callback for collecting a given pose + /// + /// Subscription UUID to delete. + /// OK, unsubcription successful. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task UnsubscribeFromPoseAsync(string token, string sessionID, System.Guid subscriptionUUID) + { + return UnsubscribeFromPoseAsync(token, sessionID, subscriptionUUID, System.Threading.CancellationToken.None); + } + + /// + /// Remove a subscription to a given pose + /// + /// + /// End the subscription and the associated callback for collecting a given pose + /// + /// Subscription UUID to delete. + /// OK, unsubcription successful. + /// A server side error occurred. + 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(); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Remove a subscription to a given pose + /// + /// + /// End the subscription and the associated callback for collecting a given pose + /// + /// Subscription UUID to delete. + /// OK, unsubcription successful. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task 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>(); + 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("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("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(); + } + } + + /// + /// Get the supported capabilities of the World Analysis + /// + /// + /// 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) + /// + /// Successful operation. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetCapabilitiesAsync(string token, string sessionID) + { + return GetCapabilitiesAsync(token, sessionID, System.Threading.CancellationToken.None); + } + + /// + /// Get the supported capabilities of the World Analysis + /// + /// + /// 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) + /// + /// Successful operation. + /// A server side error occurred. + 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(); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the supported capabilities of the World Analysis + /// + /// + /// 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) + /// + /// Successful operation. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task 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>(); + 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_, 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(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("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// + /// For a given trackable or anchor, get its support information + /// + /// + /// 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) + /// + /// UUID of the Trackable or Anchor to check support + /// Successful operation. + /// A server side error occurred. + public virtual System.Threading.Tasks.Task GetSupportAsync(string token, string sessionID, System.Guid trackableOrAnchorUUID) + { + return GetSupportAsync(token, sessionID, trackableOrAnchorUUID, System.Threading.CancellationToken.None); + } + + /// + /// For a given trackable or anchor, get its support information + /// + /// + /// 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) + /// + /// UUID of the Trackable or Anchor to check support + /// Successful operation. + /// A server side error occurred. + 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(); + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// For a given trackable or anchor, get its support information + /// + /// + /// 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) + /// + /// UUID of the Trackable or Anchor to check support + /// Successful operation. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task 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>(); + 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_, 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("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("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("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("Not supported.", status_, responseData_, headers_, result_, null); + } + else + { + var objectResponse_ = await ReadObjectResponseAsync(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("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + protected struct ObjectResponseResult + { + 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> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) + { + if (response == null || response.Content == null) + { + return new ObjectResponseResult(default(T), string.Empty); + } + + if (ReadResponseAsString) + { + var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); + return new ObjectResponseResult(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(jsonTextReader); + return new ObjectResponseResult(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; + } + } + + /// + /// An element representing the result of the pose estimation of an AR device, a Trackable or a WorldAnchor by the World Analysis + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class Pose + { + /// + /// UUID of the associated Anchor or Trackable + /// + [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Guid Uuid { get; set; } + + /// + /// Extensible List of possible states of the pose estimation + /// + [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; } + + /// + /// A message detailing the context of the pose estimation + /// + [Newtonsoft.Json.JsonProperty("instructionInfo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string InstructionInfo { get; set; } + + /// + /// Capture time of the pose as number of milliseconds since unix epoch + /// + [Newtonsoft.Json.JsonProperty("timestamp", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int Timestamp { get; set; } + + /// + /// A score representing the confidence concerning the accuracy of the pose estimated + /// + [Newtonsoft.Json.JsonProperty("confidence", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Confidence { get; set; } + + /// + /// Mode representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) + /// + [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; } + + /// + /// The pose value + /// + [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public PoseValue Value { get; set; } + + /// + /// The URL to use for subscription (if available), see [/pose/subscriptions] + /// + [Newtonsoft.Json.JsonProperty("subscriptionUrl", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string SubscriptionUrl { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Base type to define the pose value + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class PoseValue + { + /// + /// Encoding type of the Pose + /// + [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 _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// A pose value that is described with a 4*4 matrix + /// + [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 + { + /// + /// Transor data + /// + [Newtonsoft.Json.JsonProperty("transform", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Transform3D Transform { get; set; } + + /// + /// Unit system of the pose + /// + [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; } + + } + + /// + /// A pose value that is described with a position and a rotation + /// + [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 + { + /// + /// Pose Position + /// + [Newtonsoft.Json.JsonProperty("position", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Vector3 Position { get; set; } + + /// + /// Pose Rotation + /// + [Newtonsoft.Json.JsonProperty("rotation", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Quaternion Rotation { get; set; } + + /// + /// Unit system of the pose + /// + [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; } + + } + + /// + /// A pose value in a geodetic coordinate system + /// + [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; } + + /// + /// Pose Rotation + /// + [Newtonsoft.Json.JsonProperty("rotation", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public Quaternion Rotation { get; set; } + + /// + /// Associated geodetic system of the pose + /// + [Newtonsoft.Json.JsonProperty("geodeticsystem", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Geodeticsystem { get; set; } + + /// + /// Coordinate system of the rotation + /// + [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; } + + } + + /// + /// An object representing the framerate that the World Analysis needs to reach for a given Trackable Type + /// + [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; } + + /// + /// Number of frames per second the tracking expected for this type of trackable is performed by the World Analysis + /// + [Newtonsoft.Json.JsonProperty("framerate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Framerate { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Request when subscribing for pose update of a Trackable or a WorldAnchor + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class SubscriptionSingleRequest + { + /// + /// UUID of the Trackable or Anchor to subscribe + /// + [Newtonsoft.Json.JsonProperty("target", Required = Newtonsoft.Json.Required.Always)] + public System.Guid Target { get; set; } + + /// + /// Mode representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) + /// + [Newtonsoft.Json.JsonProperty("mode", Required = Newtonsoft.Json.Required.Always)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public Mode_WorldAnalysis Mode { get; set; } + + /// + /// Subscription validity delay in millisecond + /// + [Newtonsoft.Json.JsonProperty("validity", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int Validity { get; set; } + + /// + /// Optional URL of your listening webhook for collecting the poses + /// + [Newtonsoft.Json.JsonProperty("webhookUrl", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string WebhookUrl { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Request when subscribing for pose update of multiple Trackable or a WorldAnchor + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class SubscriptionMultipleRequest + { + /// + /// List of UUID of the Trackable or Anchor to subscribe + /// + [Newtonsoft.Json.JsonProperty("targets", Required = Newtonsoft.Json.Required.Always)] + public System.Collections.Generic.ICollection Targets { get; set; } = new System.Collections.ObjectModel.Collection(); + + /// + /// List of modes representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) + /// + [Newtonsoft.Json.JsonProperty("mode", Required = Newtonsoft.Json.Required.Always, ItemConverterType = typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public System.Collections.Generic.ICollection Mode { get; set; } = new System.Collections.ObjectModel.Collection(); + + /// + /// Subscription validity delay in millisecond + /// + [Newtonsoft.Json.JsonProperty("validity", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int Validity { get; set; } + + /// + /// Optional URL of your listening webhook for collecting the poses + /// + [Newtonsoft.Json.JsonProperty("webhookUrl", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string WebhookUrl { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Response when subscribing for pose update of a Trackable or a WorldAnchor + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class SubscriptionSingle + { + /// + /// UUID of the subscription + /// + [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Guid Uuid { get; set; } + + /// + /// UUID of the Trackable or Anchor associated with the subscription + /// + [Newtonsoft.Json.JsonProperty("target", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Guid Target { get; set; } + + /// + /// Mode representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) + /// + [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; } + + /// + /// Optional URL of the listening webhook that collect the poses + /// + [Newtonsoft.Json.JsonProperty("webhookUrl", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string WebhookUrl { get; set; } + + /// + /// Optional dynamically generated websocket url in case of no webhook provided in the request body + /// + [Newtonsoft.Json.JsonProperty("websocketUrl", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string WebsocketUrl { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Response when subscribing for pose update of multiple Trackable or a WorldAnchor + /// + [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 Subscriptions { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// An object representing a supported capability of the World Analysis and its associated metadata + /// + [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; } + + /// + /// Number of frames per second the tracking of this type of trackable is performed by the World Analysis + /// + [Newtonsoft.Json.JsonProperty("framerate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Framerate { get; set; } + + /// + /// Mean tracking latency in milliseconds for this type of trackable + /// + [Newtonsoft.Json.JsonProperty("latency", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Latency { get; set; } + + /// + /// Accuracy score for the detection of this type of Trackable by the World Analysis + /// + [Newtonsoft.Json.JsonProperty("accuracy", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double Accuracy { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// An object holding the info of a Trackable`'`s encoding information `:` the data format and the version. + /// + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class EncodingInformationStructure + { + /// + /// Identifier of the target framework. + /// + [Newtonsoft.Json.JsonProperty("dataFormat", Required = Newtonsoft.Json.Required.Always)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public EncodingInformationStructureDataFormat DataFormat { get; set; } + + /// + /// The version of the format + /// + [Newtonsoft.Json.JsonProperty("version", Required = Newtonsoft.Json.Required.Always)] + public string Version { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + 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 _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + set { _additionalProperties = value; } + } + + } + + /// + /// Mode representing the context of the relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) + /// + [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, + + } + + /// + /// A quaternion + /// + [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 + { + + } + + /// + /// Type for trackable + /// + [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, + + } + + /// + /// Coordinate reference system of the world anchor, a 4*4 matrix (rowmajor) represented by a float vector. + /// + [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 + { + + } + + /// + /// Trackable or Anchor + /// + [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, + + } + + /// + /// Unit of length. + /// + [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, + + } + + /// + /// A 3 coordinates vector + /// + [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 + { + + } + + [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; } + + /// + /// Mode representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) + /// + [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 _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + 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 + { + /// + /// Mode representing the context of the Relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) + /// + [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; } + + /// + /// Subscription validity delay in millisecond + /// + [Newtonsoft.Json.JsonProperty("validity", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int Validity { get; set; } + + /// + /// Optional URL of your listening webhook for collecting the poses + /// + [Newtonsoft.Json.JsonProperty("webhookUrl", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string WebhookUrl { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + 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 Poses { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + 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 Capabilities { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + 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("capabilities", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection Capabilities { get; set; } + + private System.Collections.Generic.IDictionary _additionalProperties; + + [Newtonsoft.Json.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary()); } + 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> Headers { get; private set; } + + public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> 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 : ApiException + { + public TResult Result { get; private set; } + + public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> 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..1efeacdad1832e8406ed9ec7c9d57c21e32dfc3f --- /dev/null +++ b/Runtime/Scripts/WorldAnalysisInterface.cs @@ -0,0 +1,182 @@ +using ETSI.ARF.OpenAPI.WorldAnalysis; +using System; + +public interface WorldAnalysisInterface +{ + public static WorldAnalysisInterface Instance; + + #region ResponseCode + + /// + /// Ask framerate result + /// + 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 + } + + /// + /// Result of the process of a pose estimation + /// + 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 + } + + + /// + /// Callback for receiving a pose + /// + /// last pose estimation result + /// last pose + public delegate void PoseCallback(PoseEstimationResult estimationResult, Pose pose); + + /// + /// Result of the process of an operation on the subscription to to the pose of a trackable or anchor + /// + 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 + } + + /// + /// Result when getting information about capabilities + /// + public enum CapabilityResult + { + OK, + FAIL, + UNKNOWN_ID, + NOT_ALLOWED + } + + #endregion + + #region Pose + /// + /// Ask the world analysis to estimate the pose of a given trackable type at a given framerate + /// + /// 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 + /// type of trackable + /// Encoding information of the trackable type + /// asked minimum framerate RQ-AR8-006 The WA function should allow the SM function to specify a minimum frame rate for pose estimation. + /// Result of the set framerate estimation + public AskFrameRateResult SetPoseEstimationFramerate(string token, PoseConfigurationTrackableType type, EncodingInformationStructure encodingInformation, int minimumFramerate); + + /// + /// 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. + /// + /// 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 + /// id of the trackable or the anchor + /// 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. + /// Last estimated pose + /// The last state of the estimation of this pose + public PoseEstimationResult GetLastPose(string token, Guid uuid, Mode_WorldAnalysis mode, out Pose pose); + + /// + /// 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. + /// + /// 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 + /// list of ids of trackables and anchors + /// 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. + /// Last estimated pose + /// The last state of the estimation of this pose + public PoseEstimationResult[] GetLastPoses(string token, Guid[] uuids, Mode_WorldAnalysis [] modes, out Pose [] poses); + + /// + /// 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. + /// + /// 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 + /// unique identifier of the trackable or anchors + /// 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. + /// function that is called with the pose + /// Subscription validity delay in millisecond + /// id of the callback + /// Result of the subscription + public InformationSubscriptionResult SubscribeToPose(string token, Guid uuid, Mode_WorldAnalysis mode, PoseCallback callback, ref int validity, out Guid subscriptionUUID); + + /// + /// 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. + /// + /// 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 + /// list of unique identifiers of trackable and anchors + /// 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. + /// function that is called with the pose + /// Subscription validity delay in millisecond + /// id of the callback + /// List of subscription result + public InformationSubscriptionResult[] SubscribeToPoses(string token, Guid[] uuids, Mode_WorldAnalysis [] modes, PoseCallback callback, ref int validity, out Guid[] subscriptionUUIDs); + + /// + /// Get the subscription and the associated callback for collecting a given pose + /// + /// manage access rights + /// Subscription UUID to retrieve + /// Pose callback + /// UUID of the Trackable or Anchor associated with the subscription + /// Mode representing the context of the relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) + /// Remaining Subscription validity delay in millisecond + /// The subscription exists or not + public InformationSubscriptionResult GetSubsription(string token, Guid subscriptionUUID, out PoseCallback callback, out Guid target, out Mode_WorldAnalysis mode, out int validity); + + /// + /// Update an existing subscription + /// + /// manage access rights + /// Subscription UUID to update + /// Mode representing the context of the relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device) + /// new validity of the subscription + /// new callback to use + /// The subscription has been updated or not + public InformationSubscriptionResult UpdateSubscription(string token, Guid subscriptionUUID, Mode_WorldAnalysis mode, int validity, PoseCallback callback); + + /// + /// Unsubscribe to a pose + /// + /// id of the subscription + /// /// The unsubscription has been performed or not + public InformationSubscriptionResult UnSubscribeToPose(Guid subscriptionUUID); + + #endregion + + #region Capabilities + + /// + /// 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). + /// + /// 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 + /// for the list of supported capabilites and associated metadata. A capability not included in the list is not supported + /// Capabilities have correctly identified or not + public CapabilityResult GetCapabilities(string token, out Capability[] capabilities); + + /// + /// 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). + /// + /// 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 + /// id of the trackable or anchor + /// trackable or anchor can be estimated on current system + /// the specified id corresponds to an anchor or trackable + /// list metadata associated with the pose estimation of this element + /// Capabilities have correctly identified or not + public CapabilityResult GetCapability(string token, Guid 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/Scripts/WorldAnalysisREST.cs b/Runtime/Scripts/WorldAnalysisREST.cs new file mode 100644 index 0000000000000000000000000000000000000000..5c18cebd58911b541edc3ef1a2809d7ac73a6b1a --- /dev/null +++ b/Runtime/Scripts/WorldAnalysisREST.cs @@ -0,0 +1,102 @@ +using UnityEngine; +using ETSI.ARF.OpenAPI.WorldAnalysis; +using static WorldAnalysisInterface; +using System; + +//Implementation of the WorldAnalysis interface +public class WorldAnalysisREST : MonoBehaviour, WorldAnalysisInterface +{ + + #region Unity_Methods + + /// + /// Unity Awake Method + /// + protected void Awake() + { + } + + /// + /// Unity Start Method + /// + protected void Start() + { + } + + /// + /// Unity Update Method + /// + protected void Update() + { + } + + #endregion + + + #region ARF_API + + public AskFrameRateResult SetPoseEstimationFramerate(string token, PoseConfigurationTrackableType type, EncodingInformationStructure encodingInformation, int minimumFramerate) + { + return AskFrameRateResult.NOT_SUPPORTED; ///We cannot set any framerate for tracking on ARKit and ARCore + } + + public PoseEstimationResult GetLastPose(string token, Guid uuid, Mode_WorldAnalysis mode, out ETSI.ARF.OpenAPI.WorldAnalysis.Pose pose) + { + pose = null; + return PoseEstimationResult.OK; + } + + + public PoseEstimationResult[] GetLastPoses(string token, Guid[] uuids, Mode_WorldAnalysis [] modes, out ETSI.ARF.OpenAPI.WorldAnalysis.Pose[] poses) + { + poses = null; + return null; + } + + public InformationSubscriptionResult SubscribeToPose(string token, Guid uuid, Mode_WorldAnalysis mode, PoseCallback callback, ref int validity, out Guid subscriptionUUID) + { + subscriptionUUID = Guid.Empty; + return InformationSubscriptionResult.OK; + } + + public InformationSubscriptionResult[] SubscribeToPoses(string token, Guid[] uuids, Mode_WorldAnalysis [] modes, PoseCallback callback, ref int validity, out Guid[] subscriptionUUIDs) + { + subscriptionUUIDs = null; + return null; + } + + public InformationSubscriptionResult GetSubsription(string token, Guid subscriptionUUID, out PoseCallback callback, out Guid target, out Mode_WorldAnalysis mode, out int validity) + { + callback = null; + target = Guid.Empty; + mode = Mode_WorldAnalysis.TRACKABLES_TO_DEVICE; + validity = 0; + return InformationSubscriptionResult.OK; + } + + public InformationSubscriptionResult UpdateSubscription(string token, Guid subscriptionUUID, Mode_WorldAnalysis mode, int validity, PoseCallback callback) + { + return InformationSubscriptionResult.OK; + } + + public InformationSubscriptionResult UnSubscribeToPose(Guid subscriptionUUID) + { + return InformationSubscriptionResult.OK; + } + + public CapabilityResult GetCapabilities(string token, out Capability[] capabilities) + { + capabilities = null; + return CapabilityResult.OK; + } + + public CapabilityResult GetCapability(string token, Guid uuid, out bool isSupported, out TypeWorldStorage type, out Capability [] capability) + { + isSupported = false; + type = TypeWorldStorage.UNKNOWN; + capability = null; + return CapabilityResult.OK; + } + + #endregion +} \ No newline at end of file diff --git a/Runtime/Scripts/WorldAnalysisREST.cs.meta b/Runtime/Scripts/WorldAnalysisREST.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..deeb2e10e21b0664c0cf9a6d5dc699852c6cf1aa --- /dev/null +++ b/Runtime/Scripts/WorldAnalysisREST.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0885b8471e62a34599778bb8e199c52 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Scripts/WorldAnalysisUnityHelper.cs b/Runtime/Scripts/WorldAnalysisUnityHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..b6f5b21805dbfb4d1023890eca2dd69465f7a570 --- /dev/null +++ b/Runtime/Scripts/WorldAnalysisUnityHelper.cs @@ -0,0 +1,180 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +public class WorldAnalysisUnityHelper +{ + /// + /// Convert a float array of length 3 to a Vector3 + /// + /// the values to convert + /// Converted Unity Vector3 + /// + public static Vector3 ConvertETSIVector3ToUnity(ETSI.ARF.OpenAPI.WorldAnalysis.Vector3 value) + { + if (value.Count == 3) return new Vector3(value[0], value[1], value[2]); + throw new ArgumentException("The numer of floats in the value parameter must be 3!"); + } + + /// + /// Convert a float array of length 4 to a Quaternion + /// + /// the values to convert + /// Converted Unity Quaternion + /// + public static Quaternion ConvertETSIARFQuaternionToUnity(ETSI.ARF.OpenAPI.WorldAnalysis.Quaternion value) + { + if (value.Count == 4) return new Quaternion(value[0], value[1], value[2], value[3]); + throw new ArgumentException("The numer of floats in the value parameter must be 4!"); + } + + /// + /// Convert a float array of length 16 to a Matrix + /// + /// the values to convert + /// Converted Unity Matrix + public static Matrix4x4 ConvertETSIARFTransform3DToUnity(ETSI.ARF.OpenAPI.WorldStorage.Transform3D value) + { + if (value.Count == 16) + { + Matrix4x4 resul = new Matrix4x4(); + resul[0, 0] = value[0]; + resul[0, 1] = value[1]; + resul[0, 2] = value[2]; + resul[0, 3] = value[3]; + + resul[1, 0] = value[4]; + resul[1, 1] = value[5]; + resul[1, 2] = value[6]; + resul[1, 3] = value[7]; + + resul[2, 0] = value[8]; + resul[2, 1] = value[9]; + resul[2, 2] = value[10]; + resul[2, 3] = value[11]; + + resul[3, 0] = value[12]; + resul[3, 1] = value[13]; + resul[3, 2] = value[14]; + resul[3, 3] = value[15]; + + return resul; + } + else + { + throw new ArgumentException("The numer of floats in the value parameter must be 16!"); + } + } + + /// + /// Function to extract translation from a Matrix4x4 + /// + /// + /// + public static Vector3 ExtractTranslationFromMatrix(Matrix4x4 matrix) + { + return matrix.GetColumn(3); + } + + /// + /// Function to extract rotation from a Matrix4x4 + /// + /// + /// + public static Quaternion ExtractRotationFromMatrix(Matrix4x4 matrix) + { + // Convert the matrix to a Quaternion + return Quaternion.LookRotation(matrix.GetColumn(2), matrix.GetColumn(1)); + } + + /// + /// Duplicated generated code means that we need conversion between similar types + /// + /// world storage capability + /// clone + public static ETSI.ARF.OpenAPI.WorldAnalysis.Capability ConvertWorldStorageCapability(ETSI.ARF.OpenAPI.WorldStorage.Capability value) + { + ETSI.ARF.OpenAPI.WorldAnalysis.Capability resul = new ETSI.ARF.OpenAPI.WorldAnalysis.Capability(); + + resul.TrackableType = (ETSI.ARF.OpenAPI.WorldAnalysis.TrackableType)((int)value.TrackableType); + resul.EncodingInformation = ConvertWorldStorageEncodingInformation(value.EncodingInformation); + resul.Framerate = value.Framerate; + resul.Latency = value.Latency; + resul.Accuracy = value.Accuracy; + resul.AdditionalProperties = value.AdditionalProperties; // need copy? + + return resul; + } + + /// + /// Duplicated generated code means that we need conversion between similar types + /// + /// world storage encodinginformation + /// clone + public static ETSI.ARF.OpenAPI.WorldAnalysis.EncodingInformationStructure ConvertWorldStorageEncodingInformation(ETSI.ARF.OpenAPI.WorldStorage.EncodingInformationStructure value) + { + ETSI.ARF.OpenAPI.WorldAnalysis.EncodingInformationStructure resul = new ETSI.ARF.OpenAPI.WorldAnalysis.EncodingInformationStructure(); + resul.DataFormat = (ETSI.ARF.OpenAPI.WorldAnalysis.EncodingInformationStructureDataFormat)((int)value.DataFormat); + resul.Version = value.Version; + resul.AdditionalProperties = value.AdditionalProperties; // need copy ? + return resul; + } + + /// + /// Duplicated generated code means that we need conversion between similar types + /// + /// world storage capability + /// clone + public static ETSI.ARF.OpenAPI.WorldStorage.Capability ConvertWorldAnalysisCapability(ETSI.ARF.OpenAPI.WorldAnalysis.Capability value) + { + ETSI.ARF.OpenAPI.WorldStorage.Capability resul = new ETSI.ARF.OpenAPI.WorldStorage.Capability(); + resul.TrackableType = (ETSI.ARF.OpenAPI.WorldStorage.TrackableType)((int)value.TrackableType); + resul.EncodingInformation = ConvertWorldAnalysisEncodingInformation(value.EncodingInformation); + + resul.Framerate = value.Framerate; + resul.Latency = value.Latency; + resul.Accuracy = value.Accuracy; + + resul.AdditionalProperties = value.AdditionalProperties; // need copy? + return resul; + } + + + /// + /// Duplicated generated code means that we need conversion between similar types + /// + /// world analysis encodinginformation + /// clone + public static ETSI.ARF.OpenAPI.WorldStorage.EncodingInformationStructure ConvertWorldAnalysisEncodingInformation(ETSI.ARF.OpenAPI.WorldAnalysis.EncodingInformationStructure value) + { + ETSI.ARF.OpenAPI.WorldStorage.EncodingInformationStructure resul = new ETSI.ARF.OpenAPI.WorldStorage.EncodingInformationStructure(); + resul.DataFormat = (ETSI.ARF.OpenAPI.WorldStorage.EncodingInformationStructureDataFormat)((int)value.DataFormat); + resul.Version = value.Version; + resul.AdditionalProperties = value.AdditionalProperties; // need copy ? + return resul; + } + +} + +namespace ETSI.ARF.OpenAPI.WorldAnalysis + { + /// + /// Override generated Vector3 constructor + /// + public partial class Vector3 : System.Collections.ObjectModel.Collection + { + public Vector3(float x, float y, float z) : base(new List { x, y, z }) + { + } + } + + /// + /// Override generated Quaternion constructor + /// + public partial class Quaternion : System.Collections.ObjectModel.Collection + { + public Quaternion(float x, float y, float z, float w) : base(new List { x, y, z, w}) + { + } + } +} \ No newline at end of file diff --git a/Runtime/Scripts/WorldAnalysisUnityHelper.cs.meta b/Runtime/Scripts/WorldAnalysisUnityHelper.cs.meta new file mode 100644 index 0000000000000000000000000000000000000000..56b4a1ced622b28034432dc0f32a082832c8ebb3 --- /dev/null +++ b/Runtime/Scripts/WorldAnalysisUnityHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa241d7ddbd18184dae8dbe6b8c75a7f +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: