//----------------------
// <auto-generated>
//     Generated using the NSwag toolchain v14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------

#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
#pragma warning disable 612 // Disable "CS0612 '...' is obsolete"
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter"
#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type"
#pragma warning disable CS8765 // Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes).

namespace ETSI.ARF.OpenAPI.WorldStorage
{
    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 WorldStorageClient 
    {
        private ETSI.ARF.OpenAPI.IHttpClient _httpClient;
        private static System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings, true);

    #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
        public WorldStorageClient(ETSI.ARF.OpenAPI.IHttpClient httpClient)
    #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
        {
            _httpClient = httpClient;
        }

        private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings()
        {
            var settings = new Newtonsoft.Json.JsonSerializerSettings();
            UpdateJsonSerializerSettings(settings);
            return settings;
        }

        protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } }

        static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);

        partial void PrepareRequest(ETSI.ARF.OpenAPI.IHttpClient client, System.Net.Http.HttpRequestMessage request, string url);
        partial void PrepareRequest(ETSI.ARF.OpenAPI.IHttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
        partial void ProcessResponse(ETSI.ARF.OpenAPI.IHttpClient client, System.Net.Http.HttpResponseMessage response);

        /// <summary>
        /// Test the server availability.
        /// </summary>
        /// <returns>Ok, returns a string message.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<string> GetPingAsync()
        {
            return GetPingAsync(System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Test the server availability.
        /// </summary>
        /// <returns>Ok, returns a string message.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual string GetPing()
        {
            return System.Threading.Tasks.Task.Run(async () => await GetPingAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Test the server availability.
        /// </summary>
        /// <returns>Ok, returns a string message.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<string> GetPingAsync(System.Threading.CancellationToken cancellationToken)
        {
            var client_ = _httpClient;
            var disposeClient_ = false;
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    request_.Method = new System.Net.Http.HttpMethod("GET");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));

                    var urlBuilder_ = new System.Text.StringBuilder();
                
                    // Operation Path: "ping"
                    urlBuilder_.Append("ping");

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Get the state of the server.
        /// </summary>
        /// <returns>OK, world storage server ready.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<string> GetAdminAsync()
        {
            return GetAdminAsync(System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Get the state of the server.
        /// </summary>
        /// <returns>OK, world storage server ready.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual string GetAdmin()
        {
            return System.Threading.Tasks.Task.Run(async () => await GetAdminAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Get the state of the server.
        /// </summary>
        /// <returns>OK, world storage server ready.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<string> GetAdminAsync(System.Threading.CancellationToken cancellationToken)
        {
            var client_ = _httpClient;
            var disposeClient_ = false;
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    request_.Method = new System.Net.Http.HttpMethod("GET");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));

                    var urlBuilder_ = new System.Text.StringBuilder();
                
                    // Operation Path: "admin"
                    urlBuilder_.Append("admin");

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Get the version of the ARF API.
        /// </summary>
        /// <returns>Current version.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<string> GetVersionAsync()
        {
            return GetVersionAsync(System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Get the version of the ARF API.
        /// </summary>
        /// <returns>Current version.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual string GetVersion()
        {
            return System.Threading.Tasks.Task.Run(async () => await GetVersionAsync(System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Get the version of the ARF API.
        /// </summary>
        /// <returns>Current version.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<string> GetVersionAsync(System.Threading.CancellationToken cancellationToken)
        {
            var client_ = _httpClient;
            var disposeClient_ = false;
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    request_.Method = new System.Net.Http.HttpMethod("GET");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));

                    var urlBuilder_ = new System.Text.StringBuilder();
                
                    // Operation Path: "version"
                    urlBuilder_.Append("version");

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Operation to retrieve all the relocalization information of one or severals WorldAnchors or Trackables.
        /// </summary>
        /// <param name="uuids">List of pairs consisting of UUIDs of requested World Anchors  or Trackables and a mode representing the context of the requested information</param>
        /// <param name="capabilities">the list of all trackables and his encoding structure associated representing the supported data of the User</param>
        /// <returns>Successful operation.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<Response> GetRelocalizationInformationAsync(string token, System.Collections.Generic.IEnumerable<Anonymous> uuids, System.Collections.Generic.IEnumerable<Capability> capabilities)
        {
            return GetRelocalizationInformationAsync(token, uuids, capabilities, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Operation to retrieve all the relocalization information of one or severals WorldAnchors or Trackables.
        /// </summary>
        /// <param name="uuids">List of pairs consisting of UUIDs of requested World Anchors  or Trackables and a mode representing the context of the requested information</param>
        /// <param name="capabilities">the list of all trackables and his encoding structure associated representing the supported data of the User</param>
        /// <returns>Successful operation.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual Response GetRelocalizationInformation(string token, System.Collections.Generic.IEnumerable<Anonymous> uuids, System.Collections.Generic.IEnumerable<Capability> capabilities)
        {
            return System.Threading.Tasks.Task.Run(async () => await GetRelocalizationInformationAsync(token, uuids, capabilities, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Operation to retrieve all the relocalization information of one or severals WorldAnchors or Trackables.
        /// </summary>
        /// <param name="uuids">List of pairs consisting of UUIDs of requested World Anchors  or Trackables and a mode representing the context of the requested information</param>
        /// <param name="capabilities">the list of all trackables and his encoding structure associated representing the supported data of the User</param>
        /// <returns>Successful operation.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<Response> GetRelocalizationInformationAsync(string token, System.Collections.Generic.IEnumerable<Anonymous> uuids, System.Collections.Generic.IEnumerable<Capability> capabilities, System.Threading.CancellationToken cancellationToken)
        {
            if (uuids == null)
                throw new System.ArgumentNullException("uuids");

            if (capabilities == null)
                throw new System.ArgumentNullException("capabilities");

            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));
                    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: "relocalizationInformation"
                    urlBuilder_.Append("relocalizationInformation");
                    urlBuilder_.Append('?');
                    foreach (var item_ in uuids) { urlBuilder_.Append(System.Uri.EscapeDataString("uuids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); }
                    foreach (var item_ in capabilities) { urlBuilder_.Append(System.Uri.EscapeDataString("capabilities")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); }
                    urlBuilder_.Length--;

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<Response>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            return objectResponse_.Object;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Invalid UUID supplied.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 404)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            throw new ApiException<Error>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Create a Trackable.
        /// </summary>
        /// <remarks>
        /// Create a new Trackable from a json object containing all the required information and add it to the world storage. &lt;br&gt;As a result you will get the ID of the newly created Trackable.
        /// </remarks>
        /// <param name="body">The Trackable to be added to the world storage.</param>
        /// <returns>OK, return the UUID of the Trackable defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<string> AddTrackableAsync(string token, Trackable body)
        {
            return AddTrackableAsync(token, body, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Create a Trackable.
        /// </summary>
        /// <remarks>
        /// Create a new Trackable from a json object containing all the required information and add it to the world storage. &lt;br&gt;As a result you will get the ID of the newly created Trackable.
        /// </remarks>
        /// <param name="body">The Trackable to be added to the world storage.</param>
        /// <returns>OK, return the UUID of the Trackable defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual string AddTrackable(string token, Trackable body)
        {
            return System.Threading.Tasks.Task.Run(async () => await AddTrackableAsync(token, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Create a Trackable.
        /// </summary>
        /// <remarks>
        /// Create a new Trackable from a json object containing all the required information and add it to the world storage. &lt;br&gt;As a result you will get the ID of the newly created Trackable.
        /// </remarks>
        /// <param name="body">The Trackable to be added to the world storage.</param>
        /// <returns>OK, return the UUID of the Trackable defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<string> AddTrackableAsync(string token, Trackable 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));
                    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("text/plain"));

                    var urlBuilder_ = new System.Text.StringBuilder();
                
                    // Operation Path: "trackables"
                    urlBuilder_.Append("trackables");

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        if (status_ == 201)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 409)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Invalid UUID, id must be a Nil value.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            throw new ApiException<Error>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Modify a Trackable.
        /// </summary>
        /// <remarks>
        /// Modify an existing Trackable given a json object containing all the required information. &lt;br&gt; **Please note that ID of the object is required in the JSON**
        /// </remarks>
        /// <param name="body">The Trackable to be modified in the world storage.</param>
        /// <returns>OK, return the UUID of the modified Trackable.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<string> ModifyTrackableAsync(string token, Trackable body)
        {
            return ModifyTrackableAsync(token, body, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Modify a Trackable.
        /// </summary>
        /// <remarks>
        /// Modify an existing Trackable given a json object containing all the required information. &lt;br&gt; **Please note that ID of the object is required in the JSON**
        /// </remarks>
        /// <param name="body">The Trackable to be modified in the world storage.</param>
        /// <returns>OK, return the UUID of the modified Trackable.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual string ModifyTrackable(string token, Trackable body)
        {
            return System.Threading.Tasks.Task.Run(async () => await ModifyTrackableAsync(token, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Modify a Trackable.
        /// </summary>
        /// <remarks>
        /// Modify an existing Trackable given a json object containing all the required information. &lt;br&gt; **Please note that ID of the object is required in the JSON**
        /// </remarks>
        /// <param name="body">The Trackable to be modified in the world storage.</param>
        /// <returns>OK, return the UUID of the modified Trackable.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<string> ModifyTrackableAsync(string token, Trackable 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));
                    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("text/plain"));

                    var urlBuilder_ = new System.Text.StringBuilder();
                
                    // Operation Path: "trackables"
                    urlBuilder_.Append("trackables");

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 404)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            throw new ApiException<Error>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Return all the Trackables.
        /// </summary>
        /// <remarks>
        /// Get all the Trackables currently being stored in the world storage.
        /// </remarks>
        /// <returns>OK, return all the Trackables defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<System.Collections.Generic.List<Trackable>> GetTrackablesAsync(string token)
        {
            return GetTrackablesAsync(token, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Return all the Trackables.
        /// </summary>
        /// <remarks>
        /// Get all the Trackables currently being stored in the world storage.
        /// </remarks>
        /// <returns>OK, return all the Trackables defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Collections.Generic.List<Trackable> GetTrackables(string token)
        {
            return System.Threading.Tasks.Task.Run(async () => await GetTrackablesAsync(token, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Return all the Trackables.
        /// </summary>
        /// <remarks>
        /// Get all the Trackables currently being stored in the world storage.
        /// </remarks>
        /// <returns>OK, return all the Trackables defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<System.Collections.Generic.List<Trackable>> GetTrackablesAsync(string token, 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));
                    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: "trackables"
                    urlBuilder_.Append("trackables");

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.List<Trackable>>(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_ == 201)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Null response.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            throw new ApiException<Error>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Find a Trackable by its UUID.
        /// </summary>
        /// <remarks>
        /// Get a single Trackable stored in the world storage from its ID.
        /// </remarks>
        /// <param name="trackableUUID">UUID of the Trackable to retrieve.</param>
        /// <returns>Successful operation.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<Trackable> GetTrackableByIdAsync(string token, System.Guid trackableUUID)
        {
            return GetTrackableByIdAsync(token, trackableUUID, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Find a Trackable by its UUID.
        /// </summary>
        /// <remarks>
        /// Get a single Trackable stored in the world storage from its ID.
        /// </remarks>
        /// <param name="trackableUUID">UUID of the Trackable to retrieve.</param>
        /// <returns>Successful operation.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual Trackable GetTrackableById(string token, System.Guid trackableUUID)
        {
            return System.Threading.Tasks.Task.Run(async () => await GetTrackableByIdAsync(token, trackableUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Find a Trackable by its UUID.
        /// </summary>
        /// <remarks>
        /// Get a single Trackable stored in the world storage from its ID.
        /// </remarks>
        /// <param name="trackableUUID">UUID of the Trackable to retrieve.</param>
        /// <returns>Successful operation.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<Trackable> GetTrackableByIdAsync(string token, System.Guid trackableUUID, System.Threading.CancellationToken cancellationToken)
        {
            if (trackableUUID == null)
                throw new System.ArgumentNullException("trackableUUID");

            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));
                    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: "trackables/{trackableUUID}"
                    urlBuilder_.Append("trackables/");
                    urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(trackableUUID, System.Globalization.CultureInfo.InvariantCulture)));

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<Trackable>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            return objectResponse_.Object;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Invalid UUID supplied.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 404)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Delete a Trackable.
        /// </summary>
        /// <remarks>
        /// Delete a single Trackable stored in the world storage from its ID.
        /// </remarks>
        /// <param name="trackableUUID">Trackable UUID to delete.</param>
        /// <returns>OK, delete successful.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<string> DeleteTrackableAsync(string token, System.Guid trackableUUID)
        {
            return DeleteTrackableAsync(token, trackableUUID, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Delete a Trackable.
        /// </summary>
        /// <remarks>
        /// Delete a single Trackable stored in the world storage from its ID.
        /// </remarks>
        /// <param name="trackableUUID">Trackable UUID to delete.</param>
        /// <returns>OK, delete successful.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual string DeleteTrackable(string token, System.Guid trackableUUID)
        {
            return System.Threading.Tasks.Task.Run(async () => await DeleteTrackableAsync(token, trackableUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Delete a Trackable.
        /// </summary>
        /// <remarks>
        /// Delete a single Trackable stored in the world storage from its ID.
        /// </remarks>
        /// <param name="trackableUUID">Trackable UUID to delete.</param>
        /// <returns>OK, delete successful.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<string> DeleteTrackableAsync(string token, System.Guid trackableUUID, System.Threading.CancellationToken cancellationToken)
        {
            if (trackableUUID == null)
                throw new System.ArgumentNullException("trackableUUID");

            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));
                    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: "trackables/{trackableUUID}"
                    urlBuilder_.Append("trackables/");
                    urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(trackableUUID, System.Globalization.CultureInfo.InvariantCulture)));

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Invalid UUID supplied.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 404)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Create a World Anchor.
        /// </summary>
        /// <remarks>
        /// Create a new World Anchor from a json object containing all the required information and add it to the world storage. &lt;br&gt;As a result you will get the ID of the newly created World Anchor.
        /// </remarks>
        /// <param name="body">The World Anchor to be added to the world storage.</param>
        /// <returns>OK, return the UUID of the World Anchor defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<string> AddWorldAnchorAsync(string token, WorldAnchor body)
        {
            return AddWorldAnchorAsync(token, body, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Create a World Anchor.
        /// </summary>
        /// <remarks>
        /// Create a new World Anchor from a json object containing all the required information and add it to the world storage. &lt;br&gt;As a result you will get the ID of the newly created World Anchor.
        /// </remarks>
        /// <param name="body">The World Anchor to be added to the world storage.</param>
        /// <returns>OK, return the UUID of the World Anchor defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual string AddWorldAnchor(string token, WorldAnchor body)
        {
            return System.Threading.Tasks.Task.Run(async () => await AddWorldAnchorAsync(token, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Create a World Anchor.
        /// </summary>
        /// <remarks>
        /// Create a new World Anchor from a json object containing all the required information and add it to the world storage. &lt;br&gt;As a result you will get the ID of the newly created World Anchor.
        /// </remarks>
        /// <param name="body">The World Anchor to be added to the world storage.</param>
        /// <returns>OK, return the UUID of the World Anchor defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<string> AddWorldAnchorAsync(string token, WorldAnchor 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));
                    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("text/plain"));

                    var urlBuilder_ = new System.Text.StringBuilder();
                
                    // Operation Path: "worldAnchors"
                    urlBuilder_.Append("worldAnchors");

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        if (status_ == 201)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 409)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Invalid UUID, id must be a Nil value.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            throw new ApiException<Error>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Modify a World Anchor.
        /// </summary>
        /// <remarks>
        /// Modify an existing World Anchor given a json object containing all the required information. &lt;br&gt; **Please note that ID of the object is required in the JSON**
        /// </remarks>
        /// <param name="body">The World Anchor to be modified in the world storage.</param>
        /// <returns>OK, return the UUID of the modified World Anchor.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<string> ModifyWorldAnchorAsync(string token, WorldAnchor body)
        {
            return ModifyWorldAnchorAsync(token, body, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Modify a World Anchor.
        /// </summary>
        /// <remarks>
        /// Modify an existing World Anchor given a json object containing all the required information. &lt;br&gt; **Please note that ID of the object is required in the JSON**
        /// </remarks>
        /// <param name="body">The World Anchor to be modified in the world storage.</param>
        /// <returns>OK, return the UUID of the modified World Anchor.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual string ModifyWorldAnchor(string token, WorldAnchor body)
        {
            return System.Threading.Tasks.Task.Run(async () => await ModifyWorldAnchorAsync(token, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Modify a World Anchor.
        /// </summary>
        /// <remarks>
        /// Modify an existing World Anchor given a json object containing all the required information. &lt;br&gt; **Please note that ID of the object is required in the JSON**
        /// </remarks>
        /// <param name="body">The World Anchor to be modified in the world storage.</param>
        /// <returns>OK, return the UUID of the modified World Anchor.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<string> ModifyWorldAnchorAsync(string token, WorldAnchor 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));
                    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("text/plain"));

                    var urlBuilder_ = new System.Text.StringBuilder();
                
                    // Operation Path: "worldAnchors"
                    urlBuilder_.Append("worldAnchors");

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 404)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            throw new ApiException<Error>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Return all the World Anchors.
        /// </summary>
        /// <remarks>
        /// Get all the World Anchors currently being stored in the world storage.
        /// </remarks>
        /// <returns>OK, return all the World Anchors defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<System.Collections.Generic.List<WorldAnchor>> GetWorldAnchorsAsync(string token)
        {
            return GetWorldAnchorsAsync(token, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Return all the World Anchors.
        /// </summary>
        /// <remarks>
        /// Get all the World Anchors currently being stored in the world storage.
        /// </remarks>
        /// <returns>OK, return all the World Anchors defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Collections.Generic.List<WorldAnchor> GetWorldAnchors(string token)
        {
            return System.Threading.Tasks.Task.Run(async () => await GetWorldAnchorsAsync(token, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Return all the World Anchors.
        /// </summary>
        /// <remarks>
        /// Get all the World Anchors currently being stored in the world storage.
        /// </remarks>
        /// <returns>OK, return all the World Anchors defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<System.Collections.Generic.List<WorldAnchor>> GetWorldAnchorsAsync(string token, 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));
                    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: "worldAnchors"
                    urlBuilder_.Append("worldAnchors");

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.List<WorldAnchor>>(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_ == 201)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Null response.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            throw new ApiException<Error>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Find a World Anchor by its UUID.
        /// </summary>
        /// <remarks>
        /// Get a single World Anchor stored in the world storage from its ID.
        /// </remarks>
        /// <param name="worldAnchorUUID">UUID of the World Anchor to retrieve.</param>
        /// <returns>Successful operation.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<WorldAnchor> GetWorldAnchorByIdAsync(string token, System.Guid worldAnchorUUID)
        {
            return GetWorldAnchorByIdAsync(token, worldAnchorUUID, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Find a World Anchor by its UUID.
        /// </summary>
        /// <remarks>
        /// Get a single World Anchor stored in the world storage from its ID.
        /// </remarks>
        /// <param name="worldAnchorUUID">UUID of the World Anchor to retrieve.</param>
        /// <returns>Successful operation.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual WorldAnchor GetWorldAnchorById(string token, System.Guid worldAnchorUUID)
        {
            return System.Threading.Tasks.Task.Run(async () => await GetWorldAnchorByIdAsync(token, worldAnchorUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Find a World Anchor by its UUID.
        /// </summary>
        /// <remarks>
        /// Get a single World Anchor stored in the world storage from its ID.
        /// </remarks>
        /// <param name="worldAnchorUUID">UUID of the World Anchor to retrieve.</param>
        /// <returns>Successful operation.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<WorldAnchor> GetWorldAnchorByIdAsync(string token, System.Guid worldAnchorUUID, System.Threading.CancellationToken cancellationToken)
        {
            if (worldAnchorUUID == null)
                throw new System.ArgumentNullException("worldAnchorUUID");

            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));
                    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: "worldAnchors/{worldAnchorUUID}"
                    urlBuilder_.Append("worldAnchors/");
                    urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(worldAnchorUUID, System.Globalization.CultureInfo.InvariantCulture)));

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<WorldAnchor>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            return objectResponse_.Object;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Invalid UUID supplied.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 404)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Delete a World Anchor.
        /// </summary>
        /// <remarks>
        /// Delete a single World Anchor stored in the world storage from its ID.
        /// </remarks>
        /// <param name="worldAnchorUUID">World Anchor UUID to delete.</param>
        /// <returns>OK, delete successful.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<string> DeleteWorldAnchorAsync(string token, System.Guid worldAnchorUUID)
        {
            return DeleteWorldAnchorAsync(token, worldAnchorUUID, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Delete a World Anchor.
        /// </summary>
        /// <remarks>
        /// Delete a single World Anchor stored in the world storage from its ID.
        /// </remarks>
        /// <param name="worldAnchorUUID">World Anchor UUID to delete.</param>
        /// <returns>OK, delete successful.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual string DeleteWorldAnchor(string token, System.Guid worldAnchorUUID)
        {
            return System.Threading.Tasks.Task.Run(async () => await DeleteWorldAnchorAsync(token, worldAnchorUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Delete a World Anchor.
        /// </summary>
        /// <remarks>
        /// Delete a single World Anchor stored in the world storage from its ID.
        /// </remarks>
        /// <param name="worldAnchorUUID">World Anchor UUID to delete.</param>
        /// <returns>OK, delete successful.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<string> DeleteWorldAnchorAsync(string token, System.Guid worldAnchorUUID, System.Threading.CancellationToken cancellationToken)
        {
            if (worldAnchorUUID == null)
                throw new System.ArgumentNullException("worldAnchorUUID");

            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));
                    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: "worldAnchors/{worldAnchorUUID}"
                    urlBuilder_.Append("worldAnchors/");
                    urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(worldAnchorUUID, System.Globalization.CultureInfo.InvariantCulture)));

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Invalid UUID supplied.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 404)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Create a World Link between elements (world anchors and/or trackables).
        /// </summary>
        /// <remarks>
        /// Create a new World Link from a json object containing all the required information and add it to the world storage. &lt;br&gt;As a result you will get the ID of the newly created World Link.
        /// </remarks>
        /// <param name="body">The link to be added to the world storage.</param>
        /// <returns>OK, return the UUID of the World Link defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<string> AddWorldLinkAsync(string token, WorldLink body)
        {
            return AddWorldLinkAsync(token, body, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Create a World Link between elements (world anchors and/or trackables).
        /// </summary>
        /// <remarks>
        /// Create a new World Link from a json object containing all the required information and add it to the world storage. &lt;br&gt;As a result you will get the ID of the newly created World Link.
        /// </remarks>
        /// <param name="body">The link to be added to the world storage.</param>
        /// <returns>OK, return the UUID of the World Link defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual string AddWorldLink(string token, WorldLink body)
        {
            return System.Threading.Tasks.Task.Run(async () => await AddWorldLinkAsync(token, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Create a World Link between elements (world anchors and/or trackables).
        /// </summary>
        /// <remarks>
        /// Create a new World Link from a json object containing all the required information and add it to the world storage. &lt;br&gt;As a result you will get the ID of the newly created World Link.
        /// </remarks>
        /// <param name="body">The link to be added to the world storage.</param>
        /// <returns>OK, return the UUID of the World Link defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<string> AddWorldLinkAsync(string token, WorldLink 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));
                    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("text/plain"));

                    var urlBuilder_ = new System.Text.StringBuilder();
                
                    // Operation Path: "worldLinks"
                    urlBuilder_.Append("worldLinks");

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        if (status_ == 201)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 409)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Invalid UUID, id must be a Nil value.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            throw new ApiException<Error>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Modify a World Link.
        /// </summary>
        /// <remarks>
        /// Modify an existing World Link given a json object containing all the required information. &lt;br&gt; **Please note that ID of the object is required in the JSON**
        /// </remarks>
        /// <param name="body">The World Link to be modified in the world storage.</param>
        /// <returns>OK, return the UUID of the modified World Link.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<string> ModifyWorldLinkAsync(string token, WorldLink body)
        {
            return ModifyWorldLinkAsync(token, body, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Modify a World Link.
        /// </summary>
        /// <remarks>
        /// Modify an existing World Link given a json object containing all the required information. &lt;br&gt; **Please note that ID of the object is required in the JSON**
        /// </remarks>
        /// <param name="body">The World Link to be modified in the world storage.</param>
        /// <returns>OK, return the UUID of the modified World Link.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual string ModifyWorldLink(string token, WorldLink body)
        {
            return System.Threading.Tasks.Task.Run(async () => await ModifyWorldLinkAsync(token, body, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Modify a World Link.
        /// </summary>
        /// <remarks>
        /// Modify an existing World Link given a json object containing all the required information. &lt;br&gt; **Please note that ID of the object is required in the JSON**
        /// </remarks>
        /// <param name="body">The World Link to be modified in the world storage.</param>
        /// <returns>OK, return the UUID of the modified World Link.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<string> ModifyWorldLinkAsync(string token, WorldLink 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));
                    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("text/plain"));

                    var urlBuilder_ = new System.Text.StringBuilder();
                
                    // Operation Path: "worldLinks"
                    urlBuilder_.Append("worldLinks");

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Bad request.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 404)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            throw new ApiException<Error>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Return all World Links.
        /// </summary>
        /// <remarks>
        /// Get all the World Links currently being stored in the world storage.
        /// </remarks>
        /// <returns>OK return all the World Links defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<System.Collections.Generic.List<WorldLink>> GetWorldLinksAsync(string token)
        {
            return GetWorldLinksAsync(token, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Return all World Links.
        /// </summary>
        /// <remarks>
        /// Get all the World Links currently being stored in the world storage.
        /// </remarks>
        /// <returns>OK return all the World Links defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Collections.Generic.List<WorldLink> GetWorldLinks(string token)
        {
            return System.Threading.Tasks.Task.Run(async () => await GetWorldLinksAsync(token, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Return all World Links.
        /// </summary>
        /// <remarks>
        /// Get all the World Links currently being stored in the world storage.
        /// </remarks>
        /// <returns>OK return all the World Links defined by the world storage.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<System.Collections.Generic.List<WorldLink>> GetWorldLinksAsync(string token, 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));
                    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: "worldLinks"
                    urlBuilder_.Append("worldLinks");

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.List<WorldLink>>(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_ == 201)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Null response.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<Error>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            throw new ApiException<Error>("Unexpected error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Find a World Link by its UUID.
        /// </summary>
        /// <remarks>
        /// Get a single World Link stored in the world storage from its ID.
        /// </remarks>
        /// <param name="worldLinkUUID">UUID of the World Link to retrieve.</param>
        /// <returns>Successful operation.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<WorldLink> GetWorldLinkByIdAsync(string token, System.Guid worldLinkUUID)
        {
            return GetWorldLinkByIdAsync(token, worldLinkUUID, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Find a World Link by its UUID.
        /// </summary>
        /// <remarks>
        /// Get a single World Link stored in the world storage from its ID.
        /// </remarks>
        /// <param name="worldLinkUUID">UUID of the World Link to retrieve.</param>
        /// <returns>Successful operation.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual WorldLink GetWorldLinkById(string token, System.Guid worldLinkUUID)
        {
            return System.Threading.Tasks.Task.Run(async () => await GetWorldLinkByIdAsync(token, worldLinkUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Find a World Link by its UUID.
        /// </summary>
        /// <remarks>
        /// Get a single World Link stored in the world storage from its ID.
        /// </remarks>
        /// <param name="worldLinkUUID">UUID of the World Link to retrieve.</param>
        /// <returns>Successful operation.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<WorldLink> GetWorldLinkByIdAsync(string token, System.Guid worldLinkUUID, System.Threading.CancellationToken cancellationToken)
        {
            if (worldLinkUUID == null)
                throw new System.ArgumentNullException("worldLinkUUID");

            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));
                    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: "worldLinks/{worldLinkUUID}"
                    urlBuilder_.Append("worldLinks/");
                    urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(worldLinkUUID, System.Globalization.CultureInfo.InvariantCulture)));

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var objectResponse_ = await ReadObjectResponseAsync<WorldLink>(response_, headers_, cancellationToken).ConfigureAwait(false);
                            if (objectResponse_.Object == null)
                            {
                                throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
                            }
                            return objectResponse_.Object;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Invalid UUID supplied.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 404)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Not found, could not find UUID in database.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
                        }
                    }
                    finally
                    {
                        if (disposeResponse_)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
                if (disposeClient_)
                    client_.Dispose();
            }
        }

        /// <summary>
        /// Delete a World Link.
        /// </summary>
        /// <remarks>
        /// Delete a single World Link stored in the world storage from its ID.
        /// </remarks>
        /// <param name="worldLinkUUID">World Link id to delete.</param>
        /// <returns>OK, delete successful.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual System.Threading.Tasks.Task<string> DeleteWorldLinkAsync(string token, System.Guid worldLinkUUID)
        {
            return DeleteWorldLinkAsync(token, worldLinkUUID, System.Threading.CancellationToken.None);
        }

        /// <summary>
        /// Delete a World Link.
        /// </summary>
        /// <remarks>
        /// Delete a single World Link stored in the world storage from its ID.
        /// </remarks>
        /// <param name="worldLinkUUID">World Link id to delete.</param>
        /// <returns>OK, delete successful.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual string DeleteWorldLink(string token, System.Guid worldLinkUUID)
        {
            return System.Threading.Tasks.Task.Run(async () => await DeleteWorldLinkAsync(token, worldLinkUUID, System.Threading.CancellationToken.None)).GetAwaiter().GetResult();
        }

        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <summary>
        /// Delete a World Link.
        /// </summary>
        /// <remarks>
        /// Delete a single World Link stored in the world storage from its ID.
        /// </remarks>
        /// <param name="worldLinkUUID">World Link id to delete.</param>
        /// <returns>OK, delete successful.</returns>
        /// <exception cref="ApiException">A server side error occurred.</exception>
        public virtual async System.Threading.Tasks.Task<string> DeleteWorldLinkAsync(string token, System.Guid worldLinkUUID, System.Threading.CancellationToken cancellationToken)
        {
            if (worldLinkUUID == null)
                throw new System.ArgumentNullException("worldLinkUUID");

            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));
                    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: "worldLinks/{worldLinkUUID}"
                    urlBuilder_.Append("worldLinks/");
                    urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(worldLinkUUID, System.Globalization.CultureInfo.InvariantCulture)));

                    PrepareRequest(client_, request_, urlBuilder_);

                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    var disposeResponse_ = true;
                    try
                    {
                        var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
                        foreach (var item_ in response_.Headers)
                            headers_[item_.Key] = item_.Value;
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = (int)response_.StatusCode;
                        if (status_ == 200)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            return result_;
                        }
                        else
                        if (status_ == 400)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Invalid UUID supplied.", status_, responseData_, headers_, result_, null);
                        }
                        else
                        if (status_ == 404)
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var result_ = (string)System.Convert.ChangeType(responseData_, typeof(string));
                            throw new ApiException<string>("Not found, could not find UUID in database.", 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();
            }
        }

        protected struct ObjectResponseResult<T>
        {
            public ObjectResponseResult(T responseObject, string responseText)
            {
                this.Object = responseObject;
                this.Text = responseText;
            }

            public T Object { get; }

            public string Text { get; }
        }

        public bool ReadResponseAsString { get; set; }

        protected virtual async System.Threading.Tasks.Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Threading.CancellationToken cancellationToken)
        {
            if (response == null || response.Content == null)
            {
                return new ObjectResponseResult<T>(default(T), string.Empty);
            }

            if (ReadResponseAsString)
            {
                var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
                try
                {
                    var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject<T>(responseText, JsonSerializerSettings);
                    return new ObjectResponseResult<T>(typedBody, responseText);
                }
                catch (Newtonsoft.Json.JsonException exception)
                {
                    var message = "Could not deserialize the response body string as " + typeof(T).FullName + ".";
                    throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception);
                }
            }
            else
            {
                try
                {
                    using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false))
                    using (var streamReader = new System.IO.StreamReader(responseStream))
                    using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader))
                    {
                        var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings);
                        var typedBody = serializer.Deserialize<T>(jsonTextReader);
                        return new ObjectResponseResult<T>(typedBody, string.Empty);
                    }
                }
                catch (Newtonsoft.Json.JsonException exception)
                {
                    var message = "Could not deserialize the response body stream as " + typeof(T).FullName + ".";
                    throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception);
                }
            }
        }

        private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo)
        {
            if (value == null)
            {
                return "";
            }

            if (value is System.Enum)
            {
                var name = System.Enum.GetName(value.GetType(), value);
                if (name != null)
                {
                    var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
                    if (field != null)
                    {
                        var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) 
                            as System.Runtime.Serialization.EnumMemberAttribute;
                        if (attribute != null)
                        {
                            return attribute.Value != null ? attribute.Value : name;
                        }
                    }

                    var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo));
                    return converted == null ? string.Empty : converted;
                }
            }
            else if (value is bool) 
            {
                return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant();
            }
            else if (value is byte[])
            {
                return System.Convert.ToBase64String((byte[]) value);
            }
            else if (value is string[])
            {
                return string.Join(",", (string[])value);
            }
            else if (value.GetType().IsArray)
            {
                var valueArray = (System.Array)value;
                var valueTextArray = new string[valueArray.Length];
                for (var i = 0; i < valueArray.Length; i++)
                {
                    valueTextArray[i] = ConvertToString(valueArray.GetValue(i), cultureInfo);
                }
                return string.Join(",", valueTextArray);
            }

            var result = System.Convert.ToString(value, cultureInfo);
            return result == null ? "" : result;
        }
    }

    /// <summary>
    /// An element representing all information needed in relation with a Trackable or a WorldAnchor.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class RelocalizationInformation
    {
        /// <summary>
        /// The UUID of the original WorldAnchor or the Trackable requested.
        /// </summary>
        [Newtonsoft.Json.JsonProperty("requestUUID", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Guid RequestUUID { get; set; }

        /// <summary>
        /// an array with trackables and their transforms linking them to the requestUUID element.
        /// </summary>
        [Newtonsoft.Json.JsonProperty("relocObjects", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Collections.Generic.ICollection<RelocObjects> RelocObjects { get; set; }

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [Newtonsoft.Json.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }

    /// <summary>
    /// An element representing a Trackable object in the real world.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class Trackable
    {
        /// <summary>
        /// An Universally Unique IDentifier identifying the Trackable (RFC 4122).
        /// </summary>
        [Newtonsoft.Json.JsonProperty("UUID", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Guid UUID { get; set; }

        /// <summary>
        /// A human readable name for the Trackable.
        /// </summary>
        [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)]
        public string Name { get; set; }

        /// <summary>
        /// An Universally Unique IDentifier identifying the creator of the Trackable (a person, a team or a company).
        /// </summary>
        [Newtonsoft.Json.JsonProperty("creatorUUID", Required = Newtonsoft.Json.Required.Always)]
        public System.Guid CreatorUUID { get; set; }

        /// <summary>
        /// Extensible list of Trackable types, possibly handled by complient world storage implementation.
        /// </summary>
        [Newtonsoft.Json.JsonProperty("trackableType", Required = Newtonsoft.Json.Required.Always)]
        [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
        public TrackableType TrackableType { get; set; }

        [Newtonsoft.Json.JsonProperty("trackableEncodingInformation", Required = Newtonsoft.Json.Required.Always)]
        public EncodingInformationStructure TrackableEncodingInformation { get; set; }

        /// <summary>
        /// The data provided to create the Trackable in a specific format handled by the world storage service.
        /// </summary>
        [Newtonsoft.Json.JsonProperty("trackablePayload", Required = Newtonsoft.Json.Required.Always)]
        public byte[] TrackablePayload { get; set; }

        [Newtonsoft.Json.JsonProperty("localCRS", Required = Newtonsoft.Json.Required.Always)]
        public Transform3D LocalCRS { get; set; } = new Transform3D();

        [Newtonsoft.Json.JsonProperty("unit", Required = Newtonsoft.Json.Required.Always)]
        [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
        public UnitSystem Unit { get; set; }

        [Newtonsoft.Json.JsonProperty("trackableSize", Required = Newtonsoft.Json.Required.Always)]
        public Size TrackableSize { get; set; } = new Size();

        [Newtonsoft.Json.JsonProperty("keyvalueTags", Required = Newtonsoft.Json.Required.Always)]
        public KeyvalueTagList KeyvalueTags { get; set; } = new KeyvalueTagList();

        [Newtonsoft.Json.JsonProperty("confidence", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public double Confidence { get; set; }

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [Newtonsoft.Json.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }

    /// <summary>
    /// An element describing a pose in the world graph.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class WorldAnchor
    {
        /// <summary>
        /// An Universally Unique IDentifier identifying the World Anchor (RFC 4122).
        /// </summary>
        [Newtonsoft.Json.JsonProperty("UUID", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Guid UUID { get; set; }

        /// <summary>
        /// A human readable name for the World Anchor.
        /// </summary>
        [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)]
        public string Name { get; set; }

        /// <summary>
        /// An Universally Unique IDentifier identifying the creator of the World Anchor.
        /// </summary>
        [Newtonsoft.Json.JsonProperty("creatorUUID", Required = Newtonsoft.Json.Required.Always)]
        public System.Guid CreatorUUID { get; set; }

        [Newtonsoft.Json.JsonProperty("localCRS", Required = Newtonsoft.Json.Required.Always)]
        public Transform3D LocalCRS { get; set; } = new Transform3D();

        [Newtonsoft.Json.JsonProperty("unit", Required = Newtonsoft.Json.Required.Always)]
        [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
        public UnitSystem Unit { get; set; }

        [Newtonsoft.Json.JsonProperty("worldAnchorSize", Required = Newtonsoft.Json.Required.Always)]
        public Size WorldAnchorSize { get; set; } = new Size();

        [Newtonsoft.Json.JsonProperty("keyvalueTags", Required = Newtonsoft.Json.Required.Always)]
        public KeyvalueTagList KeyvalueTags { get; set; } = new KeyvalueTagList();

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [Newtonsoft.Json.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }

    /// <summary>
    /// An object holding the info of a transform between two elements.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class WorldLink
    {
        /// <summary>
        /// An Universally Unique IDentifier identifying the World Link (RFC 4122).
        /// </summary>
        [Newtonsoft.Json.JsonProperty("UUID", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Guid UUID { get; set; }

        /// <summary>
        /// An Universally Unique IDentifier identifying the creator of the World Link.
        /// </summary>
        [Newtonsoft.Json.JsonProperty("creatorUUID", Required = Newtonsoft.Json.Required.Always)]
        public System.Guid CreatorUUID { get; set; }

        /// <summary>
        /// An Universally Unique IDentifier identifying a World Anchor or Trackable.
        /// </summary>
        [Newtonsoft.Json.JsonProperty("UUIDFrom", Required = Newtonsoft.Json.Required.Always)]
        public System.Guid UUIDFrom { get; set; }

        /// <summary>
        /// An Universally Unique IDentifier identifying a World Anchor or Trackable.
        /// </summary>
        [Newtonsoft.Json.JsonProperty("UUIDTo", Required = Newtonsoft.Json.Required.Always)]
        public System.Guid UUIDTo { get; set; }

        [Newtonsoft.Json.JsonProperty("typeFrom", Required = Newtonsoft.Json.Required.Always)]
        [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
        public TypeWorldStorage TypeFrom { get; set; }

        [Newtonsoft.Json.JsonProperty("typeTo", Required = Newtonsoft.Json.Required.Always)]
        [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
        public TypeWorldStorage TypeTo { get; set; }

        [Newtonsoft.Json.JsonProperty("transform", Required = Newtonsoft.Json.Required.Always)]
        public Transform3D Transform { get; set; } = new Transform3D();

        [Newtonsoft.Json.JsonProperty("unit", Required = Newtonsoft.Json.Required.Always)]
        [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
        public UnitSystem Unit { get; set; }

        [Newtonsoft.Json.JsonProperty("keyvalueTags", Required = Newtonsoft.Json.Required.Always)]
        public KeyvalueTagList KeyvalueTags { get; set; } = new KeyvalueTagList();

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [Newtonsoft.Json.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }

    /// <summary>
    /// List of additional parameters to be stored with the object.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class KeyvalueTagList : System.Collections.Generic.Dictionary<string, System.Collections.ObjectModel.Collection<string>>
    {

    }

    /// <summary>
    /// An object representing a supported capability of the World Analysis and its associated metadata
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class Capability
    {
        [Newtonsoft.Json.JsonProperty("trackableType", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
        public CapabilityTrackableType TrackableType { get; set; }

        [Newtonsoft.Json.JsonProperty("encodingInformation", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public EncodingInformationStructure EncodingInformation { get; set; }

        /// <summary>
        /// Number of frames per second the tracking of this type of trackable is performed by the World Analysis
        /// </summary>
        [Newtonsoft.Json.JsonProperty("framerate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public double Framerate { get; set; }

        /// <summary>
        /// Mean tracking latency in milliseconds for this type of trackable
        /// </summary>
        [Newtonsoft.Json.JsonProperty("latency", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public double Latency { get; set; }

        /// <summary>
        /// Accuracy score for the detection of this type of Trackable by the World Analysis
        /// </summary>
        [Newtonsoft.Json.JsonProperty("accuracy", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public double Accuracy { get; set; }

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [Newtonsoft.Json.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }

    /// <summary>
    /// An object holding the info of a Trackable`'`s encoding information `:` the data format and the version.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class EncodingInformationStructure
    {
        /// <summary>
        /// Identifier of the target framework.
        /// </summary>
        [Newtonsoft.Json.JsonProperty("dataFormat", Required = Newtonsoft.Json.Required.Always)]
        [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
        public EncodingInformationStructureDataFormat DataFormat { get; set; }

        /// <summary>
        /// The version of the format
        /// </summary>
        [Newtonsoft.Json.JsonProperty("version", Required = Newtonsoft.Json.Required.Always)]
        public string Version { get; set; }

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [Newtonsoft.Json.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class Error
    {
        [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.Always)]
        public int Code { get; set; }

        [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Always)]
        public string Message { get; set; }

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [Newtonsoft.Json.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }

    /// <summary>
    /// Mode representing the context of the relocalization information (AR device to WorldAnchor/Trackable or WorldAnchor/Trackable to AR device)
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public enum Mode_WorldStorage
    {

        [System.Runtime.Serialization.EnumMember(Value = @"TRACKABLES_TO_REQUEST")]
        TRACKABLES_TO_REQUEST = 0,

        [System.Runtime.Serialization.EnumMember(Value = @"REQUEST_TO_TRACKABLES")]
        REQUEST_TO_TRACKABLES = 1,

    }

    /// <summary>
    /// Size object in format {width, length, depth}.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class Size : System.Collections.ObjectModel.Collection<double>
    {

    }

    /// <summary>
    /// Coordinate reference system of the world anchor, a 4*4 matrix (rowmajor) represented by a float vector.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class Transform3D : System.Collections.ObjectModel.Collection<float>
    {

    }

    /// <summary>
    /// Trackable or Anchor
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public enum TypeWorldStorage
    {

        [System.Runtime.Serialization.EnumMember(Value = @"TRACKABLE")]
        TRACKABLE = 0,

        [System.Runtime.Serialization.EnumMember(Value = @"ANCHOR")]
        ANCHOR = 1,

    }

    /// <summary>
    /// Unit of length.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public enum UnitSystem
    {

        [System.Runtime.Serialization.EnumMember(Value = @"MM")]
        MM = 0,

        [System.Runtime.Serialization.EnumMember(Value = @"CM")]
        CM = 1,

        [System.Runtime.Serialization.EnumMember(Value = @"DM")]
        DM = 2,

        [System.Runtime.Serialization.EnumMember(Value = @"M")]
        M = 3,

        [System.Runtime.Serialization.EnumMember(Value = @"DAM")]
        DAM = 4,

        [System.Runtime.Serialization.EnumMember(Value = @"HM")]
        HM = 5,

        [System.Runtime.Serialization.EnumMember(Value = @"KM")]
        KM = 6,

        [System.Runtime.Serialization.EnumMember(Value = @"INCH")]
        INCH = 7,

        [System.Runtime.Serialization.EnumMember(Value = @"FOOT")]
        FOOT = 8,

        [System.Runtime.Serialization.EnumMember(Value = @"YARD")]
        YARD = 9,

        [System.Runtime.Serialization.EnumMember(Value = @"MILE")]
        MILE = 10,

    }

    [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.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Guid Uuid { get; set; }

        [Newtonsoft.Json.JsonProperty("mode", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
        public Mode_WorldStorage Mode { get; set; }

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [Newtonsoft.Json.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class Response
    {
        [Newtonsoft.Json.JsonProperty("RelocInfo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Collections.Generic.ICollection<RelocalizationInformation> RelocInfo { get; set; }

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [Newtonsoft.Json.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class RelocObjects
    {
        [Newtonsoft.Json.JsonProperty("trackable", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public Trackable Trackable { get; set; }

        [Newtonsoft.Json.JsonProperty("Transform3D", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public Transform3D Transform3D { get; set; }

        [Newtonsoft.Json.JsonProperty("mode", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
        public Mode_WorldStorage Mode { get; set; }

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [Newtonsoft.Json.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public 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 = @"MAP")]
        MAP = 2,

        [System.Runtime.Serialization.EnumMember(Value = @"GEOPOSE")]
        GEOPOSE = 3,

        [System.Runtime.Serialization.EnumMember(Value = @"OTHER")]
        OTHER = 4,

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public enum CapabilityTrackableType
    {

        [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 = @"MAP")]
        MAP = 2,

        [System.Runtime.Serialization.EnumMember(Value = @"GEOPOSE")]
        GEOPOSE = 3,

        [System.Runtime.Serialization.EnumMember(Value = @"OTHER")]
        OTHER = 4,

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public enum EncodingInformationStructureDataFormat
    {

        [System.Runtime.Serialization.EnumMember(Value = @"HOLOLENS")]
        HOLOLENS = 0,

        [System.Runtime.Serialization.EnumMember(Value = @"ARKIT")]
        ARKIT = 1,

        [System.Runtime.Serialization.EnumMember(Value = @"ARCORE")]
        ARCORE = 2,

        [System.Runtime.Serialization.EnumMember(Value = @"VUFORIA")]
        VUFORIA = 3,

        [System.Runtime.Serialization.EnumMember(Value = @"ARUCO")]
        ARUCO = 4,

        [System.Runtime.Serialization.EnumMember(Value = @"OTHER")]
        OTHER = 5,

    }



    [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class ApiException : System.Exception
    {
        public int StatusCode { get; private set; }

        public string Response { get; private set; }

        public System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; }

        public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Exception innerException)
            : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException)
        {
            StatusCode = statusCode;
            Response = response;
            Headers = headers;
        }

        public override string ToString()
        {
            return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString());
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.7.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
    public partial class ApiException<TResult> : ApiException
    {
        public TResult Result { get; private set; }

        public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result, System.Exception innerException)
            : base(message, statusCode, response, headers, innerException)
        {
            Result = result;
        }
    }

}

#pragma warning restore  108
#pragma warning restore  114
#pragma warning restore  472
#pragma warning restore  612
#pragma warning restore 1573
#pragma warning restore 1591
#pragma warning restore 8073
#pragma warning restore 3016
#pragma warning restore 8603
#pragma warning restore 8604
#pragma warning restore 8625