From afcbac72fce09747a0ce39d236c09461695524fe Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sun, 14 Jan 2024 21:28:06 +0100 Subject: [PATCH] Update packages. --- cli/Squidex.CLI/Directory.Build.props | 2 +- .../Implementation/AI/AIContentGenerator.cs | 2 +- .../Implementation/Sync/SyncService.cs | 5 +- .../Squidex.CLI.Core/Squidex.CLI.Core.csproj | 11 +- .../Squidex.CLI.Tests.csproj | 8 +- .../TestDataGeneratorTests.cs | 2 +- .../Squidex.CLI/Commands/App_Backup.cs | 6 + .../Squidex.CLI/Squidex.CLI.csproj | 10 +- .../Client.Class.ProcessResponse.liquid | 72 - .../Client.Class.ReadObjectResponse.liquid | 58 - .../CodeGeneration/Client.Class.liquid | 195 +- .../CodeGeneration/CodeGeneration.csproj | 9 +- .../CustomPropertyNameGenerator.cs | 9 +- .../CodeGeneration/CustomValueGenerator.cs | 2 +- .../CodeGeneration/Program.cs | 1 + .../CodeGeneration/SchemaCleaner.cs | 6 +- .../Directory.Build.props | 2 +- ...dex.ClientLibrary.ServiceExtensions.csproj | 8 +- .../SquidexClientLibraryServiceExtensions.cs | 2 + .../AssetFolderTreeTests.cs | 2 +- .../EnrichedEvents/EnrichedEventsTests.cs | 1 - .../Squidex.ClientLibrary.Tests.csproj | 12 +- .../Squidex.ClientLibrary/Generated.cs | 4594 +++++++++++------ .../Squidex.ClientLibrary.csproj | 4 +- 24 files changed, 3082 insertions(+), 1941 deletions(-) delete mode 100644 csharp/Squidex.ClientLibrary/CodeGeneration/Client.Class.ProcessResponse.liquid delete mode 100644 csharp/Squidex.ClientLibrary/CodeGeneration/Client.Class.ReadObjectResponse.liquid diff --git a/cli/Squidex.CLI/Directory.Build.props b/cli/Squidex.CLI/Directory.Build.props index a8f5da2c..d77101cd 100644 --- a/cli/Squidex.CLI/Directory.Build.props +++ b/cli/Squidex.CLI/Directory.Build.props @@ -15,6 +15,6 @@ Squidex HeadlessCMS true snupkg - 12.2 + 13.0 diff --git a/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/AI/AIContentGenerator.cs b/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/AI/AIContentGenerator.cs index e79732c9..45ef1410 100644 --- a/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/AI/AIContentGenerator.cs +++ b/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/AI/AIContentGenerator.cs @@ -70,7 +70,7 @@ private async Task MakeRequestAsync(string descrip private static GeneratedContent ParseResult(string? schemaName, ChatCompletionCreateResponse cachedResponse) { - var parsed = Markdown.Parse(cachedResponse.Choices[0].Message.Content); + var parsed = Markdown.Parse(cachedResponse.Choices[0].Message.Content ?? string.Empty); var codeBlocks = parsed.OfType().ToList(); if (codeBlocks.Count != 3) diff --git a/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/SyncService.cs b/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/SyncService.cs index 08798146..8b867f8e 100644 --- a/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/SyncService.cs +++ b/cli/Squidex.CLI/Squidex.CLI.Core/Commands/Implementation/Sync/SyncService.cs @@ -13,6 +13,7 @@ using NJsonSchema.Generation; using NJsonSchema.Generation.TypeMappers; using NJsonSchema.Infrastructure; +using NJsonSchema.NewtonsoftJson.Generation; using Squidex.CLI.Commands.Implementation.FileSystem; using Squidex.ClientLibrary; @@ -53,7 +54,7 @@ public SyncService(IFileSystem fileSystem, ISession session) jsonSerializerSettings.Formatting = Formatting.Indented; jsonSerializerSettings.NullValueHandling = NullValueHandling.Ignore; - jsonSchemaGeneratorSettings = new JsonSchemaGeneratorSettings + jsonSchemaGeneratorSettings = new NewtonsoftJsonSchemaGeneratorSettings { FlattenInheritanceHierarchy = true, SchemaType = NJsonSchema.SchemaType.JsonSchema, @@ -87,7 +88,7 @@ public T Read(IFile file, ILogger log) var errors = jsonSchema.Validate(jsonText); - if (errors.Any()) + if (errors.Count != 0) { log.WriteLine("File {0} is not valid", file.FullName); diff --git a/cli/Squidex.CLI/Squidex.CLI.Core/Squidex.CLI.Core.csproj b/cli/Squidex.CLI/Squidex.CLI.Core/Squidex.CLI.Core.csproj index 0c6ba7bd..cc1f8eca 100644 --- a/cli/Squidex.CLI/Squidex.CLI.Core/Squidex.CLI.Core.csproj +++ b/cli/Squidex.CLI/Squidex.CLI.Core/Squidex.CLI.Core.csproj @@ -8,10 +8,10 @@ true - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -19,10 +19,11 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + + - + diff --git a/cli/Squidex.CLI/Squidex.CLI.Tests/Squidex.CLI.Tests.csproj b/cli/Squidex.CLI/Squidex.CLI.Tests/Squidex.CLI.Tests.csproj index 0f9c372c..bf85ad50 100644 --- a/cli/Squidex.CLI/Squidex.CLI.Tests/Squidex.CLI.Tests.csproj +++ b/cli/Squidex.CLI/Squidex.CLI.Tests/Squidex.CLI.Tests.csproj @@ -6,8 +6,8 @@ net8.0 - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -15,8 +15,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/cli/Squidex.CLI/Squidex.CLI.Tests/TestDataGeneratorTests.cs b/cli/Squidex.CLI/Squidex.CLI.Tests/TestDataGeneratorTests.cs index b8d037bc..4c8f5d0a 100644 --- a/cli/Squidex.CLI/Squidex.CLI.Tests/TestDataGeneratorTests.cs +++ b/cli/Squidex.CLI/Squidex.CLI.Tests/TestDataGeneratorTests.cs @@ -533,7 +533,7 @@ private static HashSet> CreateManyStringTags(FieldPropertiesDto fie Name = "field", Properties = field, Partitioning = "invariant" - } + }, ] }; diff --git a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs index ecb3923a..905d6b0d 100644 --- a/cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs +++ b/cli/Squidex.CLI/Squidex.CLI/Commands/App_Backup.cs @@ -38,7 +38,9 @@ public async Task Create(CreateArguments arguments) { while (!tcs.Token.IsCancellationRequested) { +#pragma warning disable CS0612 // Type or member is obsolete var backups = await session.Client.Backups.GetBackupsAsync(tcs.Token); +#pragma warning restore CS0612 // Type or member is obsolete var backup = backups.Items.Find(x => x.Started >= backupStarted); if (backup?.Stopped != null) @@ -61,7 +63,9 @@ public async Task Create(CreateArguments arguments) await using (var fs = new FileStream(arguments.File, FileMode.CreateNew)) { +#pragma warning disable CS0612 // Type or member is obsolete using (var download = await session.Client.Backups.GetBackupContentAsync(foundBackup.Id)) +#pragma warning restore CS0612 // Type or member is obsolete { await download.Stream.CopyToAsync(fs); } @@ -71,7 +75,9 @@ public async Task Create(CreateArguments arguments) { log.WriteLine("Removing backup from app"); +#pragma warning disable CS0612 // Type or member is obsolete await session.Client.Backups.DeleteBackupAsync(foundBackup.Id); +#pragma warning restore CS0612 // Type or member is obsolete } log.Completed("Backup Download completed."); diff --git a/cli/Squidex.CLI/Squidex.CLI/Squidex.CLI.csproj b/cli/Squidex.CLI/Squidex.CLI/Squidex.CLI.csproj index 2a318fdd..7e5c2c06 100644 --- a/cli/Squidex.CLI/Squidex.CLI/Squidex.CLI.csproj +++ b/cli/Squidex.CLI/Squidex.CLI/Squidex.CLI.csproj @@ -14,21 +14,21 @@ - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + diff --git a/csharp/Squidex.ClientLibrary/CodeGeneration/Client.Class.ProcessResponse.liquid b/csharp/Squidex.ClientLibrary/CodeGeneration/Client.Class.ProcessResponse.liquid deleted file mode 100644 index 045bb3dc..00000000 --- a/csharp/Squidex.ClientLibrary/CodeGeneration/Client.Class.ProcessResponse.liquid +++ /dev/null @@ -1,72 +0,0 @@ -{% if response.HasType -%} -{% if response.IsFile -%} -{% if response.IsSuccess -%} -var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); -var fileResponse_ = new FileResponse(status_, headers_, responseStream_, {% if InjectHttpClient or DisposeHttpClient == false %}null{% else %}client_{% endif %}, response_); -disposeResponse_ = false; // response and client are disposed by FileResponse -return fileResponse_; -{% else -%} -var objectResponse_ = await ReadObjectResponseAsync<{{ response.Type }}>(response_, headers_, cancellationToken).ConfigureAwait(false); -throw new {{ ExceptionClass }}<{{ response.Type }}>("{{ response.ExceptionDescription }}", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); -{% endif -%} -{% elsif response.IsPlainText -%} -var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); -var result_ = ({{ response.Type }})System.Convert.ChangeType(responseData_, typeof({{ response.Type }})); -{% if response.IsSuccess -%} -{% if operation.WrapResponse -%} -return new {{ ResponseClass }}<{{ operation.UnwrappedResultType }}>(status_, headers_, result_); -{% else -%} -return result_; -{% endif -%} -{% else -%} -throw new {{ ExceptionClass }}<{{ response.Type }}>("{{ response.ExceptionDescription }}", status_, responseData_, headers_, result_, null); -{% endif -%} -{% else -%} -var objectResponse_ = await ReadObjectResponseAsync<{{ response.Type }}>(response_, headers_, cancellationToken).ConfigureAwait(false); -{% if response.IsNullable == false -%} -if (objectResponse_.Object == null) -{ - throw new {{ ExceptionClass }}("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); -} -{% endif -%} -{% if response.IsSuccess -%} -{% if operation.WrapResponse -%} -return new {{ ResponseClass }}<{{ operation.UnwrappedResultType }}>(status_, headers_, objectResponse_.Object); -{% else -%} -return objectResponse_.Object; -{% endif -%} -{% endif -%} -{% if response.IsSuccess == false -%} -{% if response.InheritsExceptionSchema -%} -var responseObject_ = objectResponse_.Object != null ? objectResponse_.Object : new {{ response.Type }}(); -responseObject_.Data.Add("HttpStatus", status_.ToString()); -responseObject_.Data.Add("HttpHeaders", headers_); -responseObject_.Data.Add("HttpResponse", objectResponse_.Text); -{% if WrapDtoExceptions -%} -throw new {{ ExceptionClass }}("{{ response.ExceptionDescription }}", status_, objectResponse_.Text, headers_, responseObject_); -{% else -%} -throw responseObject_; -{% endif -%} -{% else -%} -throw new {{ ExceptionClass }}<{{ response.Type }}>("{{ response.ExceptionDescription }}", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); -{% endif -%} -{% endif -%} -{% endif -%} -{% elsif response.IsSuccess -%} -{% if operation.HasResultType -%} -{% if operation.WrapResponse -%} -return new {{ ResponseClass }}<{{ operation.UnwrappedResultType }}>(status_, headers_, {{ operation.UnwrappedResultDefaultValue }}); -{% else -%} -return {{ operation.UnwrappedResultDefaultValue }}; -{% endif -%} -{% else -%} -{% if operation.WrapResponse -%} -return new {{ ResponseClass }}(status_, headers_); -{% else -%} -return; -{% endif -%} -{% endif -%} -{% else -%}{% comment %} implied: `if !response.HasType` so just read it as text {% endcomment %} -string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); -throw new {{ ExceptionClass }}("{{ response.ExceptionDescription }}", status_, responseText_, headers_, null); -{% endif %} \ No newline at end of file diff --git a/csharp/Squidex.ClientLibrary/CodeGeneration/Client.Class.ReadObjectResponse.liquid b/csharp/Squidex.ClientLibrary/CodeGeneration/Client.Class.ReadObjectResponse.liquid deleted file mode 100644 index de0451c5..00000000 --- a/csharp/Squidex.ClientLibrary/CodeGeneration/Client.Class.ReadObjectResponse.liquid +++ /dev/null @@ -1,58 +0,0 @@ -protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) -{ - if (response == null || response.Content == null) - { -{%- if GenerateNullableReferenceTypes -%} - return new ObjectResponseResult(default(T)!, string.Empty); -{%- else -%} - return new ObjectResponseResult(default(T), string.Empty); -{%- endif -%} - } - - if (_options.ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = {% if UseSystemTextJson %}System.Text.Json.JsonSerializer.Deserialize{% else %}Newtonsoft.Json.JsonConvert.DeserializeObject{% endif %}(responseText, {% if UseRequestAndResponseSerializationSettings %}Response{% endif %}JsonSerializerSettings); -{%- if GenerateNullableReferenceTypes -%} - return new ObjectResponseResult(typedBody!, responseText); -{%- else -%} - return new ObjectResponseResult(typedBody, responseText); -{%- endif -%} - } - catch ({% if UseSystemTextJson %}System.Text.Json.JsonException{% else %}Newtonsoft.Json.JsonException{% endif %} exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new {{ ExceptionClass }}(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) -{%- if UseSystemTextJson -%} - { - var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, {% if UseRequestAndResponseSerializationSettings %}Response{% endif %}JsonSerializerSettings, cancellationToken).ConfigureAwait(false); -{%- else -%} - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create({% if UseRequestAndResponseSerializationSettings %}Response{% endif %}JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); -{%- endif -%} -{%- if GenerateNullableReferenceTypes -%} - return new ObjectResponseResult(typedBody!, string.Empty); -{%- else -%} - return new ObjectResponseResult(typedBody, string.Empty); -{%- endif -%} - } - } - catch ({% if UseSystemTextJson %}System.Text.Json.JsonException{% else %}Newtonsoft.Json.JsonException{% endif %} exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new {{ ExceptionClass }}(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } -} \ No newline at end of file diff --git a/csharp/Squidex.ClientLibrary/CodeGeneration/Client.Class.liquid b/csharp/Squidex.ClientLibrary/CodeGeneration/Client.Class.liquid index 0cd3a64a..1745f693 100644 --- a/csharp/Squidex.ClientLibrary/CodeGeneration/Client.Class.liquid +++ b/csharp/Squidex.ClientLibrary/CodeGeneration/Client.Class.liquid @@ -2,32 +2,74 @@ [System.CodeDom.Compiler.GeneratedCode("NSwag", "{{ ToolchainVersion }}")] {{ ClientClassAccessModifier }} partial class {{ Class }} {% if HasBaseType %}: {% endif %}{% if HasBaseClass %}{{ BaseClass }}{% if GenerateClientInterfaces %}, {% endif %}{% endif %}{% if GenerateClientInterfaces %}I{{ Class }}{% endif %} { + private Squidex.ClientLibrary.SquidexOptions _options; {% if UseBaseUrl and GenerateBaseUrlProperty -%} - private string _baseUrl = "{{ BaseUrl }}"; +#pragma warning disable 8618 // Set by constructor via BaseUrl property + private string _baseUrl; +#pragma warning restore 8618 // Set by constructor via BaseUrl property +{% endif -%} +{% if InjectHttpClient -%} + private {{ HttpClientType }} _httpClient; {% endif -%} - private Squidex.ClientLibrary.SquidexOptions _options; {% if UseRequestAndResponseSerializationSettings -%} - private System.Lazy<{{ JsonSerializerSettingsType }}> _requestSettings; - private System.Lazy<{{ JsonSerializerSettingsType }}> _responseSettings; + private static System.Lazy<{{ JsonSerializerSettingsType }}> _requestSettings = new System.Lazy<{{ JsonSerializerSettingsType }}>(() => CreateSerializerSettings(true), true); + private static System.Lazy<{{ JsonSerializerSettingsType }}> _responseSettings = new System.Lazy<{{ JsonSerializerSettingsType }}>(() => CreateSerializerSettings(false), true); {% else -%} - private System.Lazy<{{ JsonSerializerSettingsType }}> _settings; + private static System.Lazy<{{ JsonSerializerSettingsType }}> _settings = new System.Lazy<{{ JsonSerializerSettingsType }}>(CreateSerializerSettings, true); {% endif -%} +{% assign constructorParameters = "" -%} +{% if HasConfigurationClass -%} +{% assign constructorParameters = ConfigurationClass | append: " configuration" -%} +{% endif -%} +{% if UseBaseUrl and HasBaseUrl == false and HasConfigurationClass == false -%} +{% unless constructorParameters == "" -%}{% assign constructorParameters = constructorParameters | append: ", " -%}{% endunless -%} +{% assign constructorParameters = constructorParameters | append: "string baseUrl" -%} +{% endif -%} +{% if InjectHttpClient -%} +{% unless constructorParameters == "" -%}{% assign constructorParameters = constructorParameters | append: ", " -%}{% endunless -%} +{% assign constructorParameters = constructorParameters | append: HttpClientType | append: " httpClient" -%} +{% endif -%} public {{ Class }}(Squidex.ClientLibrary.SquidexOptions options) { _options = options; -{% if UseRequestAndResponseSerializationSettings -%} - _requestSettings = new System.Lazy<{{ JsonSerializerSettingsType }}>(() => CreateSerializerSettings(true)); - _responseSettings = new System.Lazy<{{ JsonSerializerSettingsType }}>(() => CreateSerializerSettings(false)); -{% else -%} - _settings = new System.Lazy<{{ JsonSerializerSettingsType }}>(CreateSerializerSettings); -{% endif -%} - {% template Client.Class.Constructor %} +{% if UseBaseUrl -%} +{% if HasBaseUrl -%} +{% if GenerateBaseUrlProperty -%} + BaseUrl = "{{ BaseUrl }}"; +{% else -%} +{% if BaseUrl != "" -%} +{% assign baseUrlLength = BaseUrl | size -%} +{% assign lastUrlCharIndex = baseUrlLength | minus: 1 -%} +{% assign lastUrlChar = BaseUrl | slice: lastUrlCharIndex, 1 -%} +{% if lastUrlChar == "/" -%} + _baseUrl = "{{ BaseUrl }}"; +{% else -%} + _baseUrl = "{{ BaseUrl }}/"; +{% endif -%} +{% endif -%} +{% endif -%} +{% else -%} +{% if GenerateBaseUrlProperty -%} + BaseUrl = baseUrl; +{% else -%} +{% if HasConfigurationClass == false -%} + _baseUrl = (string.IsNullOrEmpty(baseUrl) || baseUrl.EndsWith("/")) + ? baseUrl + : baseUrl + "/"; +{% endif -%} +{% endif -%} +{% endif -%} +{% endif -%} +{% if InjectHttpClient -%} + _httpClient = httpClient; +{% endif -%} + {% template Client.Class.Constructor %} } - private {{ JsonSerializerSettingsType }} CreateSerializerSettings({% if UseRequestAndResponseSerializationSettings %}bool isRequest{% endif %}) + private static {{ JsonSerializerSettingsType }} CreateSerializerSettings({% if UseRequestAndResponseSerializationSettings %}bool isRequest{% endif %}) { - var settings = _options.SerializerSettings; + var settings = {{ JsonSerializerParameterCode }}; {% if UseSystemTextJson == false and SerializeTypeInformation -%} settings.TypeNameHandling = Newtonsoft.Json.TypeNameHandling.Auto; {% endif -%} @@ -44,7 +86,12 @@ public string BaseUrl { get { return _baseUrl; } - set { _baseUrl = value; } + set + { + _baseUrl = value; + if (!string.IsNullOrEmpty(_baseUrl) && !_baseUrl.EndsWith("/")) + _baseUrl += '/'; + } } {% endif -%} @@ -62,9 +109,9 @@ {% if GenerateUpdateJsonSerializerSettingsMethod -%} {% if UseRequestAndResponseSerializationSettings -%} - partial void UpdateJsonSerializerSettings({{ JsonSerializerSettingsType }} settings, bool isRequest); + static partial void UpdateJsonSerializerSettings({{ JsonSerializerSettingsType }} settings, bool isRequest); {% else -%} - partial void UpdateJsonSerializerSettings({{ JsonSerializerSettingsType }} settings); + static partial void UpdateJsonSerializerSettings({{ JsonSerializerSettingsType }} settings); {% endif -%} {% endif -%} @@ -117,34 +164,8 @@ throw new System.ArgumentNullException("{{ operation.ContentParameter.VariableName }}"); {% endif -%} - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append({% if UseBaseUrl %}BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/{% else %}"{% endif %}{{ operation.Path }}{% if operation.HasQueryParameters %}?{% endif %}"); - urlBuilder_.Replace("{app}", _options.AppName); -{% for parameter in operation.PathParameters -%} -{% if parameter.IsOptional -%} - if ({{ parameter.VariableName }} != null) - {% template Client.Class.PathParameter %} - else - urlBuilder_.Replace("/{{ "{" }}{{ parameter.Name }}}", string.Empty); -{% else -%} - {% template Client.Class.PathParameter %} -{% endif -%} -{% endfor -%} -{% for parameter in operation.QueryParameters -%} -{% if parameter.IsOptional -%} - if ({{ parameter.VariableName }} != null) - { - {% template Client.Class.QueryParameter %} - } -{% else -%} - {% template Client.Class.QueryParameter %} -{% endif -%} -{% endfor -%} -{% if operation.HasQueryParameters -%} - urlBuilder_.Length--; -{% endif -%} - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { {% if UseHttpRequestMessageCreationMethod -%} @@ -176,16 +197,16 @@ var content_ = new System.Net.Http.StringContent({{ operation.ContentParameter.VariableName }}); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("{{ operation.Consumes }}"); {% elsif operation.ConsumesFormUrlEncoded -%} - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject({{ operation.ContentParameter.VariableName }}, _settings.Value); - var dictionary_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(json_, _settings.Value); + var json_ = {% if UseSystemTextJson %}System.Text.Json.JsonSerializer.SerializeToUtf8Bytes{% else %}Newtonsoft.Json.JsonConvert.SerializeObject{% endif %}({{ operation.ContentParameter.VariableName }}, _settings.Value); + var dictionary_ = {% if UseSystemTextJson %}System.Text.Json.JsonSerializer.Deserialize{% else %}Newtonsoft.Json.JsonConvert.DeserializeObject{% endif %}>(json_, _settings.Value); var content_ = new System.Net.Http.FormUrlEncodedContent(dictionary_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("{{ operation.Consumes }}"); {% elsif operation.HasPlainTextBodyParameter -%} var content_ = new System.Net.Http.StringContent({{ operation.ContentParameter.VariableName }}); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("{{ operation.Consumes }}"); {% else -%} - var json_ = {% if UseSystemTextJson %}System.Text.Json.JsonSerializer.Serialize{% else %}Newtonsoft.Json.JsonConvert.SerializeObject{% endif %}({{ operation.ContentParameter.VariableName }}, {% if SerializeTypeInformation %}typeof({{ operation.ContentParameter.Type }}), {% endif %}{% if UseRequestAndResponseSerializationSettings %}_requestSettings{% else %}_settings{% endif %}.Value); - var content_ = new System.Net.Http.StringContent(json_); + var json_ = {% if UseSystemTextJson %}System.Text.Json.JsonSerializer.SerializeToUtf8Bytes{% else %}Newtonsoft.Json.JsonConvert.SerializeObject{% endif %}({{ operation.ContentParameter.VariableName }}, {% if SerializeTypeInformation %}typeof({{ operation.ContentParameter.Type }}), {% endif %}{% if UseRequestAndResponseSerializationSettings %}_requestSettings{% else %}_settings{% endif %}.Value); + var content_ = new System.Net.Http.{% if UseSystemTextJson %}ByteArrayContent{% else %}StringContent{% endif %}(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("{{ operation.Consumes }}"); {% endif -%} request_.Content = content_; @@ -239,8 +260,8 @@ content_.Add(new System.Net.Http.StringContent(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture)), "{{ parameter.Name }}"); } {% elsif parameter.IsObject -%} - var json_ = {% if UseSystemTextJson %}System.Text.Json.JsonSerializer.Serialize{% else %}Newtonsoft.Json.JsonConvert.SerializeObject{% endif %}({{ parameter.VariableName }}, {% if UseRequestAndResponseSerializationSettings %}_requestSettings{% else %}_settings{% endif %}.Value); - content_.Add(new System.Net.Http.StringContent(json_), "{{ parameter.Name }}"); + var json_ = {% if UseSystemTextJson %}System.Text.Json.JsonSerializer.SerializeToUtf8Bytes{% else %}Newtonsoft.Json.JsonConvert.SerializeObject{% endif %}({{ parameter.VariableName }}, {% if UseRequestAndResponseSerializationSettings %}_requestSettings{% else %}_settings{% endif %}.Value); + content_.Add(new System.Net.Http.{% if UseSystemTextJson %}ByteArrayContent(json_{% else %}StringContent(json_, System.Text.Encoding.UTF8, "application/json"{% endif %}), "{{ parameter.Name }}"); {% else -%} content_.Add(new System.Net.Http.StringContent(ConvertToString({{ parameter.VariableName }}, System.Globalization.CultureInfo.InvariantCulture)), "{{ parameter.Name }}"); {% endif -%} @@ -257,6 +278,70 @@ request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("{{ operation.Produces }}")); {% endif -%} + var urlBuilder_ = new System.Text.StringBuilder(); + {% if UseBaseUrl %}if (!string.IsNullOrEmpty(BaseUrl)) urlBuilder_.Append(BaseUrl);{% endif %} + // Operation Path: "{{ operation.Path }}" +{% if operation.Path contains "{" -%} +{% assign pathParts = operation.Path | split: "{" -%} +{% for pathPart in pathParts -%} +{% if pathPart contains "}" -%} +{% assign pathParameterParts = pathPart | split: "}" -%} +{% assign pathParameterFound = true -%} +{% if pathParameterParts[0] == "app" -%} + urlBuilder_.Append(_options.AppName); +{% endif -%} +{% for parameter in operation.PathParameters -%} +{% if parameter.Name == pathParameterParts[0] -%} +{% if parameter.IsOptional -%} +{% assign pathParameterFound = false -%} + else if ({{ parameter.VariableName }} != null) + { + {% template Client.Class.PathParameter %} + } + else + if (urlBuilder_.Length > 0) urlBuilder_.Length--; +{% else -%} + {% template Client.Class.PathParameter %} +{% endif -%} +{% endif -%} +{% endfor -%} +{% comment -%} >>> just in case {% endcomment -%} +{% unless pathParameterFound -%} + urlBuilder_.Append("{{ '{' }}{{ pathParameterParts[0] }}{{ '}' }}"); +{% endunless -%} +{% comment -%} <<< just in case {% endcomment -%} +{% assign nonParameterPartLengh = pathParameterParts[1] | size -%} +{% if nonParameterPartLengh == 1 -%} + urlBuilder_.Append('{{ pathParameterParts[1] }}'); +{% elsif nonParameterPartLengh > 0 -%} + urlBuilder_.Append("{{ pathParameterParts[1] }}"); +{% endif -%} +{% else -%} +{% unless pathPart == "" -%} + urlBuilder_.Append("{{ pathPart }}"); +{% endunless -%} +{% endif -%} +{% endfor -%} +{% else -%} +{% unless operation.Path == "" -%} + urlBuilder_.Append("{{ operation.Path }}"); +{% endunless -%} +{% endif -%} +{% if operation.HasQueryParameters -%} + urlBuilder_.Append('?'); +{% for parameter in operation.QueryParameters -%} +{% if parameter.IsOptional -%} + if ({{ parameter.VariableName }} != null) + { + {% template Client.Class.QueryParameter %} + } +{% else -%} + {% template Client.Class.QueryParameter %} +{% endif -%} +{% endfor -%} + urlBuilder_.Length--; +{% endif -%} + {% if GeneratePrepareRequestAndProcessResponseAsAsyncMethods %} await PrepareRequestAsync(client_, request_, urlBuilder_, cancellationToken).ConfigureAwait(false); {% else -%} @@ -277,7 +362,9 @@ var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -292,11 +379,7 @@ var status_ = (int)response_.StatusCode; {% for response in operation.Responses -%} -{% if response.StatusCode == '200' or response.StatusCode == '201' -%} - if (status_ == 200 || status_ == 201{% if response.CheckChunkedStatusCode %} || status_ == 206{% endif %}) -{% else -%} if (status_ == {{ response.StatusCode }}{% if response.CheckChunkedStatusCode %} || status_ == 206{% endif %}) -{% endif -%} { {% template Client.Class.ProcessResponse %} } @@ -381,4 +464,4 @@ {% template Client.Class.ConvertToString %} {% template Client.Class.Body %} -} +} \ No newline at end of file diff --git a/csharp/Squidex.ClientLibrary/CodeGeneration/CodeGeneration.csproj b/csharp/Squidex.ClientLibrary/CodeGeneration/CodeGeneration.csproj index 0fc7dbbf..cc6df416 100644 --- a/csharp/Squidex.ClientLibrary/CodeGeneration/CodeGeneration.csproj +++ b/csharp/Squidex.ClientLibrary/CodeGeneration/CodeGeneration.csproj @@ -8,11 +8,11 @@ - + all - + all @@ -23,14 +23,11 @@ - + Always Always - - Always - diff --git a/csharp/Squidex.ClientLibrary/CodeGeneration/CustomPropertyNameGenerator.cs b/csharp/Squidex.ClientLibrary/CodeGeneration/CustomPropertyNameGenerator.cs index d4b228d4..a5ef6c65 100644 --- a/csharp/Squidex.ClientLibrary/CodeGeneration/CustomPropertyNameGenerator.cs +++ b/csharp/Squidex.ClientLibrary/CodeGeneration/CustomPropertyNameGenerator.cs @@ -6,19 +6,22 @@ // ========================================================================== using NJsonSchema; +using NJsonSchema.CodeGeneration; using NJsonSchema.CodeGeneration.CSharp; namespace CodeGeneration; -public sealed class CustomPropertyNameGenerator : CSharpPropertyNameGenerator +public sealed class CustomPropertyNameGenerator : IPropertyNameGenerator { - public override string Generate(JsonSchemaProperty property) + private readonly CSharpPropertyNameGenerator inner = new CSharpPropertyNameGenerator(); + + public string Generate(JsonSchemaProperty property) { if (property.Name == "_links") { return "Links"; } - return base.Generate(property); + return inner.Generate(property); } } diff --git a/csharp/Squidex.ClientLibrary/CodeGeneration/CustomValueGenerator.cs b/csharp/Squidex.ClientLibrary/CodeGeneration/CustomValueGenerator.cs index 386f13a9..d5797e51 100644 --- a/csharp/Squidex.ClientLibrary/CodeGeneration/CustomValueGenerator.cs +++ b/csharp/Squidex.ClientLibrary/CodeGeneration/CustomValueGenerator.cs @@ -18,7 +18,7 @@ public CustomValueGenerator(CSharpGeneratorSettings settings) { } - public override string GetDefaultValue(JsonSchema schema, bool allowsNull, string targetType, string typeNameHint, bool useSchemaDefault, TypeResolverBase typeResolver) + public override string? GetDefaultValue(JsonSchema schema, bool allowsNull, string targetType, string? typeNameHint, bool useSchemaDefault, TypeResolverBase typeResolver) { if (!string.IsNullOrWhiteSpace(schema.ActualDiscriminator)) { diff --git a/csharp/Squidex.ClientLibrary/CodeGeneration/Program.cs b/csharp/Squidex.ClientLibrary/CodeGeneration/Program.cs index 3bbcab3e..afda20ed 100644 --- a/csharp/Squidex.ClientLibrary/CodeGeneration/Program.cs +++ b/csharp/Squidex.ClientLibrary/CodeGeneration/Program.cs @@ -57,6 +57,7 @@ private static string GenerateCode(OpenApiDocument document) generatorSettings.ExceptionClass = "SquidexException"; generatorSettings.GenerateClientInterfaces = true; generatorSettings.GenerateOptionalParameters = true; + generatorSettings.InjectHttpClient = false; generatorSettings.OperationNameGenerator = new CustomTagNameGenerator(); generatorSettings.UseBaseUrl = false; diff --git a/csharp/Squidex.ClientLibrary/CodeGeneration/SchemaCleaner.cs b/csharp/Squidex.ClientLibrary/CodeGeneration/SchemaCleaner.cs index ad92dba1..00598920 100644 --- a/csharp/Squidex.ClientLibrary/CodeGeneration/SchemaCleaner.cs +++ b/csharp/Squidex.ClientLibrary/CodeGeneration/SchemaCleaner.cs @@ -17,7 +17,7 @@ public static void AddExtensions(OpenApiDocument document) { static void AddExtensions(OpenApiOperation operation) { - operation.ExtensionData ??= new Dictionary(); + operation.ExtensionData ??= new Dictionary(); operation.ExtensionData["x-fern-sdk-group-name"] = operation.Tags[0].ToCamelCase(); operation.ExtensionData["x-fern-sdk-method-name"] = operation.OperationId.Split('_').Last().ToCamelCase(); @@ -25,7 +25,7 @@ static void AddExtensions(OpenApiOperation operation) { if (parameter.Kind == OpenApiParameterKind.Path && parameter.Name == "app") { - parameter.ExtensionData ??= new Dictionary(); + parameter.ExtensionData ??= new Dictionary(); parameter.ExtensionData["x-fern-sdk-variable"] = "appName"; } } @@ -36,7 +36,7 @@ static void AddExtensions(OpenApiOperation operation) AddExtensions(description.Operation); } - document.ExtensionData ??= new Dictionary(); + document.ExtensionData ??= new Dictionary(); document.ExtensionData["x-fern-sdk-variables"] = new { appName = new diff --git a/csharp/Squidex.ClientLibrary/Directory.Build.props b/csharp/Squidex.ClientLibrary/Directory.Build.props index 45746c38..ad8f43ec 100644 --- a/csharp/Squidex.ClientLibrary/Directory.Build.props +++ b/csharp/Squidex.ClientLibrary/Directory.Build.props @@ -15,7 +15,7 @@ Squidex HeadlessCMS true snupkg - 18.0.0 + 19.0.0 diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.ServiceExtensions/Squidex.ClientLibrary.ServiceExtensions.csproj b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.ServiceExtensions/Squidex.ClientLibrary.ServiceExtensions.csproj index ce092a4e..c0dd667f 100644 --- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.ServiceExtensions/Squidex.ClientLibrary.ServiceExtensions.csproj +++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.ServiceExtensions/Squidex.ClientLibrary.ServiceExtensions.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -26,9 +26,9 @@ - - - + + + diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.ServiceExtensions/SquidexClientLibraryServiceExtensions.cs b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.ServiceExtensions/SquidexClientLibraryServiceExtensions.cs index 22361814..46136410 100644 --- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.ServiceExtensions/SquidexClientLibraryServiceExtensions.cs +++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.ServiceExtensions/SquidexClientLibraryServiceExtensions.cs @@ -111,6 +111,7 @@ public static IHttpClientBuilder AddSquidexHttpClient(this IServiceCollection se handlers.Add(new AuthenticatingHttpMessageHandler(options)); }); #else +#pragma warning disable CS0618 // Type or member is obsolete builder.ConfigureHttpMessageHandlerBuilder(builder => { var options = builder.Services.GetRequiredService>().Value; @@ -120,6 +121,7 @@ public static IHttpClientBuilder AddSquidexHttpClient(this IServiceCollection se AddSquidexAuthenticatorAsAdditionalHandler(builder); } }); +#pragma warning restore CS0618 // Type or member is obsolete #endif return builder; } diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/AssetFolderTreeTests.cs b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/AssetFolderTreeTests.cs index d0590c47..efd5cc77 100644 --- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/AssetFolderTreeTests.cs +++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/AssetFolderTreeTests.cs @@ -28,7 +28,7 @@ public AssetFolderTreeTests() [InlineData(".")] [InlineData("./")] [InlineData("\\")] - public async Task Should_provide_null_if_for_root_path(string path) + public async Task Should_provide_null_if_for_root_path(string? path) { var id = await sut.GetIdAsync(path); diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/EnrichedEvents/EnrichedEventsTests.cs b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/EnrichedEvents/EnrichedEventsTests.cs index 1f7786d0..e8366a9d 100644 --- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/EnrichedEvents/EnrichedEventsTests.cs +++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/EnrichedEvents/EnrichedEventsTests.cs @@ -13,7 +13,6 @@ namespace Squidex.ClientLibrary.Tests.EnrichedEvents; [UsesVerify] public class EnrichedEventsTests { - private readonly SquidexOptions options = new SquidexOptions(); public class SchemaData diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/Squidex.ClientLibrary.Tests.csproj b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/Squidex.ClientLibrary.Tests.csproj index 7263ea5c..d66f323d 100644 --- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/Squidex.ClientLibrary.Tests.csproj +++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary.Tests/Squidex.ClientLibrary.Tests.csproj @@ -9,13 +9,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -23,9 +23,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Generated.cs b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Generated.cs index cf01bd9b..0b16674b 100644 --- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Generated.cs +++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Generated.cs @@ -1,6 +1,6 @@ //---------------------- // -// Generated using the NSwag toolchain v13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) +// Generated using the NSwag toolchain v14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) // //---------------------- @@ -14,12 +14,13 @@ #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" namespace Squidex.ClientLibrary { using System = global::System; - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IUserManagementClient { @@ -91,28 +92,27 @@ public partial interface IUserManagementClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UserManagementClient : IUserManagementClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public UserManagementClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -129,31 +129,34 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetUsersAsync(string query = null, int? skip = null, int? take = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/user-management?"); - urlBuilder_.Replace("{app}", _options.AppName); + var client_ = _options.ClientProvider.Get(); + 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("application/json")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/user-management" + urlBuilder_.Append("api/user-management"); + urlBuilder_.Append('?'); if (query != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("query") + "=").Append(System.Uri.EscapeDataString(ConvertToString(query, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("query")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(query, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (skip != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("skip") + "=").Append(System.Uri.EscapeDataString(ConvertToString(skip, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("skip")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(skip, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (take != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("take") + "=").Append(System.Uri.EscapeDataString(ConvertToString(take, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("take")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(take, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); - 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("application/json")); - PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -165,7 +168,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -175,7 +180,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -224,11 +229,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/user-management"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -240,6 +242,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/user-management" + urlBuilder_.Append("api/user-management"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -251,7 +258,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -261,7 +270,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -320,12 +329,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/user-management/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -333,6 +338,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/user-management/{id}" + urlBuilder_.Append("api/user-management/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -344,7 +355,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -354,7 +367,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -413,12 +426,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/user-management/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -430,6 +439,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/user-management/{id}" + urlBuilder_.Append("api/user-management/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -441,7 +456,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -451,7 +468,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -516,18 +533,20 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/user-management/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("DELETE"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/user-management/{id}" + urlBuilder_.Append("api/user-management/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -539,7 +558,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -619,12 +640,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/user-management/{id}/lock"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -633,6 +650,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/user-management/{id}/lock" + urlBuilder_.Append("api/user-management/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/lock"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -644,7 +668,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -654,7 +680,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -729,12 +755,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/user-management/{id}/unlock"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -743,6 +765,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/user-management/{id}/unlock" + urlBuilder_.Append("api/user-management/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/unlock"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -754,7 +783,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -764,7 +795,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -840,6 +871,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -847,7 +880,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -917,10 +950,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -928,7 +970,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IUsersClient { @@ -981,28 +1023,27 @@ public partial interface IUsersClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UsersClient : IUsersClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public UsersClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -1016,11 +1057,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetUserResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1028,6 +1066,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api" + urlBuilder_.Append("api"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1039,7 +1082,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -1049,7 +1094,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -1098,11 +1143,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/user"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1113,6 +1155,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/user" + urlBuilder_.Append("api/user"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1124,7 +1171,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -1188,16 +1237,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetUsersAsync(string query = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/users?"); - urlBuilder_.Replace("{app}", _options.AppName); - if (query != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("query") + "=").Append(System.Uri.EscapeDataString(ConvertToString(query, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1205,6 +1246,17 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/users" + urlBuilder_.Append("api/users"); + urlBuilder_.Append('?'); + if (query != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("query")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(query, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1216,7 +1268,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -1226,7 +1280,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -1275,12 +1329,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/users/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1288,6 +1338,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/users/{id}" + urlBuilder_.Append("api/users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1299,7 +1355,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -1309,7 +1367,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -1364,12 +1422,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/users/{id}/picture"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1377,6 +1431,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("GET"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/octet-stream")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/users/{id}/picture" + urlBuilder_.Append("api/users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/picture"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1388,7 +1449,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -1398,11 +1461,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201 || status_ == 206) + if (status_ == 200 || status_ == 206) { var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeResponse_ = false; // response and client are disposed by FileResponse + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else @@ -1452,6 +1515,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -1459,7 +1524,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -1529,10 +1594,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -1540,7 +1614,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface ITranslationsClient { @@ -1564,28 +1638,27 @@ public partial interface ITranslationsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TranslationsClient : ITranslationsClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public TranslationsClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -1603,11 +1676,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/translations"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1619,6 +1689,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/translations" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/translations"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1630,7 +1707,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -1640,7 +1719,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -1699,11 +1778,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/ask"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1715,6 +1791,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/ask" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/ask"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1726,7 +1809,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -1736,7 +1821,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -1796,6 +1881,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -1803,7 +1890,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -1873,10 +1960,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -1884,7 +1980,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface ITemplatesClient { @@ -1907,28 +2003,27 @@ public partial interface ITemplatesClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TemplatesClient : ITemplatesClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public TemplatesClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -1942,11 +2037,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetTemplatesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/templates"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1954,6 +2046,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/templates" + urlBuilder_.Append("api/templates"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1965,7 +2062,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -1975,7 +2074,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -2024,12 +2123,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (name == null) throw new System.ArgumentNullException("name"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/templates/{name}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{name}", System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2037,6 +2132,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/templates/{name}" + urlBuilder_.Append("api/templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2048,7 +2149,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -2058,7 +2161,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -2114,6 +2217,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -2121,7 +2226,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -2191,10 +2296,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -2202,7 +2316,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface ITeamsClient { @@ -2290,28 +2404,27 @@ public partial interface ITeamsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TeamsClient : ITeamsClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public TeamsClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -2329,12 +2442,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (team == null) throw new System.ArgumentNullException("team"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}/contributors"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2342,6 +2451,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/teams/{team}/contributors" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/contributors"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2353,7 +2469,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -2363,7 +2481,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -2422,12 +2540,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}/contributors"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2439,6 +2553,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/teams/{team}/contributors" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/contributors"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2450,7 +2571,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -2460,7 +2583,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -2525,12 +2648,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (team == null) throw new System.ArgumentNullException("team"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}/contributors/me"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2538,6 +2657,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("DELETE"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/teams/{team}/contributors/me" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/contributors/me"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2549,7 +2675,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -2559,7 +2687,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -2628,13 +2756,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}/contributors/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2642,6 +2765,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("DELETE"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/teams/{team}/contributors/{id}" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/contributors/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2653,7 +2784,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -2663,7 +2796,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -2728,11 +2861,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetTeamsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2740,6 +2870,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/teams" + urlBuilder_.Append("api/teams"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2751,7 +2886,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -2761,7 +2898,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -2814,11 +2951,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2830,6 +2964,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/teams" + urlBuilder_.Append("api/teams"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2841,7 +2980,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -2851,7 +2992,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -2920,12 +3061,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (team == null) throw new System.ArgumentNullException("team"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2933,6 +3070,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/teams/{team}" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2944,7 +3087,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -2954,7 +3099,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -3013,12 +3158,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3030,6 +3171,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/teams/{team}" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3041,7 +3188,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -3051,7 +3200,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -3117,6 +3266,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -3124,7 +3275,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -3194,10 +3345,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -3205,7 +3365,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IStatisticsClient { @@ -3278,28 +3438,27 @@ public partial interface IStatisticsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class StatisticsClient : IStatisticsClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public StatisticsClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -3313,11 +3472,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetLogAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/usages/log"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3325,6 +3481,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/usages/log" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/usages/log"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3336,7 +3499,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -3346,7 +3511,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -3405,13 +3570,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (toDate == null) throw new System.ArgumentNullException("toDate"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/usages/calls/{fromDate}/{toDate}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{fromDate}", System.Uri.EscapeDataString(fromDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{toDate}", System.Uri.EscapeDataString(toDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3419,6 +3579,16 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/usages/calls/{fromDate}/{toDate}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/usages/calls/"); + urlBuilder_.Append(System.Uri.EscapeDataString(fromDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(toDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3430,7 +3600,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -3440,7 +3612,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -3503,14 +3675,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (toDate == null) throw new System.ArgumentNullException("toDate"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}/usages/calls/{fromDate}/{toDate}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{fromDate}", System.Uri.EscapeDataString(fromDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{toDate}", System.Uri.EscapeDataString(toDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3518,6 +3684,16 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/teams/{team}/usages/calls/{fromDate}/{toDate}" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/usages/calls/"); + urlBuilder_.Append(System.Uri.EscapeDataString(fromDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(toDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3529,7 +3705,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -3539,7 +3717,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -3590,11 +3768,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetCurrentStorageSizeAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/usages/storage/today"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3602,6 +3777,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/usages/storage/today" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/usages/storage/today"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3613,7 +3795,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -3623,7 +3807,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -3678,12 +3862,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (team == null) throw new System.ArgumentNullException("team"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}/usages/storage/today"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3691,6 +3871,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/teams/{team}/usages/storage/today" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/usages/storage/today"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3702,7 +3889,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -3712,7 +3901,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -3771,13 +3960,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (toDate == null) throw new System.ArgumentNullException("toDate"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/usages/storage/{fromDate}/{toDate}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{fromDate}", System.Uri.EscapeDataString(fromDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{toDate}", System.Uri.EscapeDataString(toDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3785,6 +3969,16 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/usages/storage/{fromDate}/{toDate}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/usages/storage/"); + urlBuilder_.Append(System.Uri.EscapeDataString(fromDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(toDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3796,7 +3990,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -3806,7 +4002,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -3869,14 +4065,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (toDate == null) throw new System.ArgumentNullException("toDate"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}/usages/storage/{fromDate}/{toDate}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{fromDate}", System.Uri.EscapeDataString(fromDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{toDate}", System.Uri.EscapeDataString(toDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3884,6 +4074,16 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/teams/{team}/usages/storage/{fromDate}/{toDate}" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/usages/storage/"); + urlBuilder_.Append(System.Uri.EscapeDataString(fromDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(toDate.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3895,7 +4095,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -3905,7 +4107,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -3961,6 +4163,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -3968,7 +4172,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -4038,10 +4242,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -4049,7 +4262,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface ISearchClient { @@ -4064,28 +4277,27 @@ public partial interface ISearchClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SearchClient : ISearchClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public SearchClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -4100,16 +4312,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetSearchResultsAsync(string query = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/search?"); - urlBuilder_.Replace("{app}", _options.AppName); - if (query != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("query") + "=").Append(System.Uri.EscapeDataString(ConvertToString(query, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -4117,6 +4321,19 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/search" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/search"); + urlBuilder_.Append('?'); + if (query != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("query")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(query, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -4128,7 +4345,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -4138,7 +4357,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -4194,6 +4413,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -4201,7 +4422,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -4271,10 +4492,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -4282,7 +4512,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface ISchemasClient { @@ -4632,28 +4862,27 @@ public partial interface ISchemasClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SchemasClient : ISchemasClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public SchemasClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -4675,12 +4904,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -4692,6 +4917,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -4703,7 +4937,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -4713,7 +4949,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -4796,13 +5032,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{parentId}/nested"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{parentId}", System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -4814,6 +5045,17 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{parentId}/nested" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/nested"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -4825,7 +5067,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -4835,7 +5079,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -4914,12 +5158,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/ui"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -4931,6 +5171,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/ui" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/ui"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -4942,7 +5191,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -4952,7 +5203,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -5021,12 +5272,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/ordering"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5038,6 +5285,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/ordering" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/ordering"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5049,7 +5305,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -5059,7 +5317,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -5132,13 +5390,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/ordering"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{parentId}", System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5150,6 +5403,17 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/ordering" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/nested/ordering"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5161,7 +5425,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -5171,7 +5437,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -5244,13 +5510,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5262,6 +5523,16 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5273,7 +5544,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -5283,7 +5556,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -5352,13 +5625,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5366,6 +5634,16 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("DELETE"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5377,7 +5655,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -5387,7 +5667,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -5464,14 +5744,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{parentId}", System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5483,6 +5757,18 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/nested/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5494,7 +5780,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -5504,7 +5792,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -5577,14 +5865,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{parentId}", System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5592,6 +5874,18 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("DELETE"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/nested/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5603,7 +5897,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -5613,7 +5909,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -5685,13 +5981,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{id}/lock"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5700,6 +5991,17 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{id}/lock" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/lock"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5711,7 +6013,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -5721,7 +6025,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -5797,14 +6101,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}/lock"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{parentId}", System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5813,6 +6111,19 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}/lock" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/nested/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/lock"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5824,7 +6135,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -5834,7 +6147,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -5906,13 +6219,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{id}/hide"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5921,6 +6229,17 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{id}/hide" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/hide"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5932,7 +6251,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -5942,7 +6263,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -6018,14 +6339,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}/hide"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{parentId}", System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6034,6 +6349,19 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}/hide" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/nested/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/hide"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -6045,7 +6373,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -6055,7 +6385,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -6127,13 +6457,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{id}/show"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6142,6 +6467,17 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{id}/show" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/show"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -6153,7 +6489,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -6163,7 +6501,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -6239,14 +6577,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}/show"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{parentId}", System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6255,6 +6587,19 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}/show" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/nested/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/show"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -6266,7 +6611,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -6276,7 +6623,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -6348,13 +6695,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{id}/enable"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6363,6 +6705,17 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{id}/enable" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/enable"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -6374,7 +6727,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -6384,7 +6739,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -6460,14 +6815,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}/enable"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{parentId}", System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6476,6 +6825,19 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}/enable" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/nested/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/enable"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -6487,7 +6849,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -6497,7 +6861,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -6569,13 +6933,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{id}/disable"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6584,6 +6943,17 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{id}/disable" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/disable"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -6595,7 +6965,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -6605,7 +6977,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -6681,14 +7053,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}/disable"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{parentId}", System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6697,6 +7063,19 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/fields/{parentId}/nested/{id}/disable" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/fields/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/nested/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/disable"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -6708,7 +7087,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -6718,7 +7099,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -6779,11 +7160,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetSchemasAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6791,6 +7169,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/schemas" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -6802,7 +7187,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -6812,7 +7199,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -6867,11 +7254,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6883,6 +7267,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -6894,7 +7285,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -6904,7 +7297,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -6973,12 +7366,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (schema == null) throw new System.ArgumentNullException("schema"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6986,6 +7375,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/schemas/{schema}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -6997,7 +7394,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -7007,7 +7406,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -7066,12 +7465,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -7083,6 +7478,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -7094,7 +7497,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -7104,7 +7509,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -7169,18 +7574,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (schema == null) throw new System.ArgumentNullException("schema"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("DELETE"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -7192,7 +7601,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -7266,12 +7677,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/sync"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -7283,6 +7690,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/sync" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/sync"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -7294,7 +7710,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -7304,7 +7722,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -7373,12 +7791,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/category"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -7390,6 +7804,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/category" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/category"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -7401,7 +7824,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -7411,7 +7836,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -7480,12 +7905,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/preview-urls"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -7497,6 +7918,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/preview-urls" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/preview-urls"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -7508,7 +7938,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -7518,7 +7950,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -7587,12 +8019,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/scripts"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -7604,6 +8032,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/scripts" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/scripts"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -7615,7 +8052,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -7625,7 +8064,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -7694,12 +8133,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/rules"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -7711,6 +8146,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/rules" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/rules"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -7722,7 +8166,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -7732,7 +8178,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -7797,12 +8243,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (schema == null) throw new System.ArgumentNullException("schema"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/publish"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -7811,6 +8253,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/publish" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/publish"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -7822,7 +8273,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -7832,7 +8285,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -7897,12 +8350,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (schema == null) throw new System.ArgumentNullException("schema"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/schemas/{schema}/unpublish"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{schema}", System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -7911,6 +8360,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/schemas/{schema}/unpublish" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/schemas/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(schema, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/unpublish"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -7922,7 +8380,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -7932,7 +8392,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -7998,6 +8458,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -8005,7 +8467,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -8075,10 +8537,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -8086,7 +8557,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IRulesClient { @@ -8262,28 +8733,27 @@ public partial interface IRulesClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RulesClient : IRulesClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public RulesClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -8297,11 +8767,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetActionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/rules/actions"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -8309,6 +8776,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/rules/actions" + urlBuilder_.Append("api/rules/actions"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8320,7 +8792,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -8330,7 +8804,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -8375,11 +8849,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetRulesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -8387,6 +8858,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/rules" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8398,7 +8876,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -8408,7 +8888,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -8463,11 +8943,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -8479,6 +8956,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8490,7 +8974,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -8500,7 +8986,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -8561,17 +9047,21 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task DeleteRuleRunAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/run"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("DELETE"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/run" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/run"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8583,7 +9073,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -8651,12 +9143,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -8668,6 +9156,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8679,7 +9175,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -8689,7 +9187,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -8754,18 +9252,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("DELETE"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8777,7 +9279,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -8847,12 +9351,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/{id}/enable"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -8861,6 +9361,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/{id}/enable" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/enable"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8872,7 +9381,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -8882,7 +9393,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -8947,12 +9458,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/{id}/disable"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -8961,6 +9468,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/{id}/disable" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/disable"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8972,7 +9488,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -8982,7 +9500,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -9047,12 +9565,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/{id}/trigger"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9060,6 +9574,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); request_.Method = new System.Net.Http.HttpMethod("PUT"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/{id}/trigger" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/trigger"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9071,7 +9594,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -9142,17 +9667,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/{id}/run?"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - if (fromSnapshots != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fromSnapshots") + "=").Append(System.Uri.EscapeDataString(ConvertToString(fromSnapshots, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9160,6 +9676,21 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); request_.Method = new System.Net.Http.HttpMethod("PUT"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/{id}/run" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/run"); + urlBuilder_.Append('?'); + if (fromSnapshots != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("fromSnapshots")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(fromSnapshots, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9171,7 +9702,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -9235,18 +9768,23 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/{id}/events"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("DELETE"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/{id}/events" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/events"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9258,7 +9796,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -9322,11 +9862,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/simulate"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9338,6 +9875,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/simulate" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/simulate"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9349,7 +9893,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -9359,7 +9905,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -9424,12 +9970,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/{id}/simulate"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9437,6 +9979,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/rules/{id}/simulate" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/simulate"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9448,7 +9999,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -9458,7 +10011,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -9512,31 +10065,36 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetEventsAsync(string ruleId = null, int? skip = null, int? take = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/events?"); - urlBuilder_.Replace("{app}", _options.AppName); + var client_ = _options.ClientProvider.Get(); + 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("application/json")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/events" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/events"); + urlBuilder_.Append('?'); if (ruleId != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("ruleId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ruleId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("ruleId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(ruleId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (skip != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("skip") + "=").Append(System.Uri.EscapeDataString(ConvertToString(skip, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("skip")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(skip, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (take != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("take") + "=").Append(System.Uri.EscapeDataString(ConvertToString(take, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("take")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(take, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); - 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("application/json")); - PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9548,7 +10106,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -9558,7 +10118,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -9609,17 +10169,21 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task DeleteEventsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/events"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("DELETE"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/events" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/events"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9631,7 +10195,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -9695,12 +10261,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/events/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9708,6 +10270,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); request_.Method = new System.Net.Http.HttpMethod("PUT"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/events/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/events/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9719,7 +10289,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -9789,18 +10361,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/rules/events/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("DELETE"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/rules/events/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/rules/events/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9812,7 +10388,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -9878,11 +10456,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetEventTypesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/rules/eventtypes"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9890,6 +10465,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/rules/eventtypes" + urlBuilder_.Append("api/rules/eventtypes"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9901,7 +10481,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -9911,7 +10493,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -9960,12 +10542,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (type == null) throw new System.ArgumentNullException("type"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/rules/eventtypes/{type}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{type}", System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9973,6 +10551,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/rules/eventtypes/{type}" + urlBuilder_.Append("api/rules/eventtypes/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9984,7 +10568,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -9994,7 +10580,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -10050,6 +10636,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -10057,7 +10645,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -10127,10 +10715,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -10138,7 +10735,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IPlansClient { @@ -10180,28 +10777,27 @@ public partial interface IPlansClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class PlansClient : IPlansClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public PlansClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -10215,11 +10811,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetPlansAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/plans"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -10227,6 +10820,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/plans" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/plans"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10238,7 +10838,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -10248,7 +10850,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -10303,11 +10905,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/plan"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -10319,6 +10918,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/plan" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/plan"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10330,7 +10936,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -10340,7 +10948,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -10405,12 +11013,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (team == null) throw new System.ArgumentNullException("team"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}/plans"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -10418,6 +11022,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/teams/{team}/plans" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/plans"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10429,7 +11040,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -10439,7 +11052,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -10498,12 +11111,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}/plan"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -10515,6 +11124,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/teams/{team}/plan" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/plan"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10526,7 +11142,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -10536,7 +11154,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -10602,6 +11220,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -10609,7 +11229,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -10679,10 +11299,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -10690,7 +11319,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IPingClient { @@ -10726,28 +11355,27 @@ public partial interface IPingClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class PingClient : IPingClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public PingClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -10761,11 +11389,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/info"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -10773,6 +11398,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/info" + urlBuilder_.Append("api/info"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10784,7 +11414,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -10794,7 +11426,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -10842,17 +11474,19 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetPingAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/ping"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("GET"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/ping" + urlBuilder_.Append("api/ping"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10864,7 +11498,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -10917,17 +11553,20 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetAppPingAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/ping/{app}"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("GET"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/ping/{app}" + urlBuilder_.Append("api/ping/"); + urlBuilder_.Append(_options.AppName); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10939,7 +11578,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -10994,6 +11635,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -11001,7 +11644,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -11071,10 +11714,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -11082,7 +11734,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface INewsClient { @@ -11097,28 +11749,27 @@ public partial interface INewsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class NewsClient : INewsClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public NewsClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -11133,16 +11784,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetNewsAsync(int? version = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/news/features?"); - urlBuilder_.Replace("{app}", _options.AppName); - if (version != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("version") + "=").Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -11150,6 +11793,17 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/news/features" + urlBuilder_.Append("api/news/features"); + urlBuilder_.Append('?'); + if (version != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("version")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -11161,7 +11815,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -11171,7 +11827,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -11221,6 +11877,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -11228,7 +11886,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -11298,10 +11956,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -11309,7 +11976,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface ILanguagesClient { @@ -11326,28 +11993,27 @@ public partial interface ILanguagesClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class LanguagesClient : ILanguagesClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public LanguagesClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -11364,11 +12030,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetLanguagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/languages"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -11376,6 +12039,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/languages" + urlBuilder_.Append("api/languages"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -11387,7 +12055,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -11397,7 +12067,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -11447,6 +12117,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -11454,7 +12126,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -11524,10 +12196,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -11535,7 +12216,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IJobsClient { @@ -11544,51 +12225,51 @@ public partial interface IJobsClient /// Get the job content. /// /// The ID of the job. + /// The ID of the app. /// Job found and content returned. /// A server side error occurred. - System.Threading.Tasks.Task GetJobContentAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task GetJobContentAsync(string id, string appId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Delete a job. + /// Get all jobs. /// - /// The ID of the jobs to delete. - /// Job deleted. + /// Jobs returned. /// A server side error occurred. - System.Threading.Tasks.Task DeleteJobAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task GetJobsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Get all jobs. + /// Delete a job. /// - /// Jobs returned. + /// The ID of the jobs to delete. + /// Job deleted. /// A server side error occurred. - System.Threading.Tasks.Task GetJobsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task DeleteJobAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class JobsClient : IJobsClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public JobsClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -11599,19 +12280,16 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// Get the job content. /// /// The ID of the job. + /// The ID of the app. /// Job found and content returned. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetJobContentAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetJobContentAsync(string id, string appId = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/jobs/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -11619,6 +12297,18 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("GET"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/octet-stream")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/jobs/{id}" + urlBuilder_.Append("api/apps/jobs/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('?'); + if (appId != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("appId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -11630,7 +12320,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -11640,11 +12332,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201 || status_ == 206) + if (status_ == 200 || status_ == 206) { var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeResponse_ = false; // response and client are disposed by FileResponse + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else @@ -11683,27 +12375,27 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Delete a job. + /// Get all jobs. /// - /// The ID of the jobs to delete. - /// Job deleted. + /// Jobs returned. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteJobAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetJobsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/jobs/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); + 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: "api/apps/{app}/jobs" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/jobs"); PrepareRequest(client_, request_, urlBuilder_); @@ -11716,7 +12408,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -11726,25 +12420,20 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 204) + if (status_ == 200) { - return; + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new SquidexException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; } else if (status_ == 404) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SquidexException("Job or app not found.", status_, responseText_, headers_, null); - } - else - if (status_ == 400) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SquidexException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new SquidexException("Validation error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + throw new SquidexException("App not found.", status_, responseText_, headers_, null); } else if (status_ == 500) @@ -11776,23 +12465,31 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// - /// Get all jobs. + /// Delete a job. /// - /// Jobs returned. + /// The ID of the jobs to delete. + /// Job deleted. /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetJobsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task DeleteJobAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/jobs"); - urlBuilder_.Replace("{app}", _options.AppName); + if (id == null) + throw new System.ArgumentNullException("id"); var client_ = _options.ClientProvider.Get(); + 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("application/json")); + request_.Method = new System.Net.Http.HttpMethod("DELETE"); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/jobs/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/jobs/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); PrepareRequest(client_, request_, urlBuilder_); @@ -11805,7 +12502,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -11815,20 +12514,25 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 204) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SquidexException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; + return; } else if (status_ == 404) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SquidexException("App not found.", status_, responseText_, headers_, null); + throw new SquidexException("Job or app not found.", status_, responseText_, headers_, null); + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new SquidexException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new SquidexException("Validation error.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); } else if (status_ == 500) @@ -11871,6 +12575,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -11878,7 +12584,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -11948,10 +12654,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -11959,7 +12674,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IHistoryClient { @@ -11984,28 +12699,27 @@ public partial interface IHistoryClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class HistoryClient : IHistoryClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public HistoryClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -12020,16 +12734,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetAppHistoryAsync(string channel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/history?"); - urlBuilder_.Replace("{app}", _options.AppName); - if (channel != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("channel") + "=").Append(System.Uri.EscapeDataString(ConvertToString(channel, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12037,6 +12743,19 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/history" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/history"); + urlBuilder_.Append('?'); + if (channel != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("channel")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(channel, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12048,7 +12767,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -12058,7 +12779,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -12114,17 +12835,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (team == null) throw new System.ArgumentNullException("team"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}/history?"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - if (channel != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("channel") + "=").Append(System.Uri.EscapeDataString(ConvertToString(channel, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12132,6 +12844,19 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/teams/{team}/history" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/history"); + urlBuilder_.Append('?'); + if (channel != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("channel")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(channel, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12143,7 +12868,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -12153,7 +12880,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -12209,6 +12936,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -12216,7 +12945,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -12286,10 +13015,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -12297,7 +13035,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IEventConsumersClient { @@ -12338,28 +13076,27 @@ public partial interface IEventConsumersClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class EventConsumersClient : IEventConsumersClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public EventConsumersClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -12373,11 +13110,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetEventConsumersAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/event-consumers"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12385,6 +13119,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/event-consumers" + urlBuilder_.Append("api/event-consumers"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12396,7 +13135,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -12406,7 +13147,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -12455,12 +13196,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (consumerName == null) throw new System.ArgumentNullException("consumerName"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/event-consumers/{consumerName}/start"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{consumerName}", System.Uri.EscapeDataString(ConvertToString(consumerName, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12469,6 +13206,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/event-consumers/{consumerName}/start" + urlBuilder_.Append("api/event-consumers/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(consumerName, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/start"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12480,7 +13224,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -12490,7 +13236,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -12555,12 +13301,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (consumerName == null) throw new System.ArgumentNullException("consumerName"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/event-consumers/{consumerName}/stop"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{consumerName}", System.Uri.EscapeDataString(ConvertToString(consumerName, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12569,6 +13311,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/event-consumers/{consumerName}/stop" + urlBuilder_.Append("api/event-consumers/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(consumerName, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/stop"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12580,7 +13329,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -12590,7 +13341,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -12655,12 +13406,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (consumerName == null) throw new System.ArgumentNullException("consumerName"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/event-consumers/{consumerName}/reset"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{consumerName}", System.Uri.EscapeDataString(ConvertToString(consumerName, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12669,6 +13416,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/event-consumers/{consumerName}/reset" + urlBuilder_.Append("api/event-consumers/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(consumerName, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/reset"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12680,7 +13434,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -12690,7 +13446,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -12756,6 +13512,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -12763,7 +13521,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -12833,10 +13591,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -12844,7 +13611,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IDiagnosticsClient { @@ -12866,28 +13633,27 @@ public partial interface IDiagnosticsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class DiagnosticsClient : IDiagnosticsClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public DiagnosticsClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -12901,17 +13667,19 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetDumpAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/diagnostics/dump"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("GET"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/diagnostics/dump" + urlBuilder_.Append("api/diagnostics/dump"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12923,7 +13691,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -12983,17 +13753,19 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetGCDumpAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/diagnostics/gcdump"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("GET"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/diagnostics/gcdump" + urlBuilder_.Append("api/diagnostics/gcdump"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -13005,7 +13777,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -13070,6 +13844,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -13077,7 +13853,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -13147,10 +13923,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -13158,7 +13943,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IBackupsClient { @@ -13230,28 +14015,27 @@ public partial interface IBackupsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class BackupsClient : IBackupsClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public BackupsClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -13270,12 +14054,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/backups/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13283,6 +14063,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("GET"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/octet-stream")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/backups/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/backups/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -13294,7 +14082,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -13304,11 +14094,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201 || status_ == 206) + if (status_ == 200 || status_ == 206) { var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeResponse_ = false; // response and client are disposed by FileResponse + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else @@ -13358,18 +14148,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/backups/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("DELETE"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/backups/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/backups/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -13381,7 +14175,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -13454,21 +14250,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/backups/{id}?"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - if (appId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("appId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (app != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("app") + "=").Append(System.Uri.EscapeDataString(ConvertToString(app, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13476,6 +14259,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("GET"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/octet-stream")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/backups/{id}" + urlBuilder_.Append("api/apps/backups/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('?'); + if (appId != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("appId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (app != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("app")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(app, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -13487,7 +14286,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -13497,11 +14298,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201 || status_ == 206) + if (status_ == 200 || status_ == 206) { var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeResponse_ = false; // response and client are disposed by FileResponse + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else @@ -13547,11 +14348,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() [System.Obsolete] public virtual async System.Threading.Tasks.Task GetBackupsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/backups"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13559,6 +14357,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/backups" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/backups"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -13570,7 +14375,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -13580,7 +14387,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -13631,11 +14438,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task PostBackupAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/backups"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13643,6 +14447,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); request_.Method = new System.Net.Http.HttpMethod("POST"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/backups" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/backups"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -13654,7 +14465,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -13720,11 +14533,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetRestoreJobAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/restore"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13732,6 +14542,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/restore" + urlBuilder_.Append("api/apps/restore"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -13743,7 +14558,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -13753,7 +14570,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -13802,11 +14619,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/restore"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13817,6 +14631,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/restore" + urlBuilder_.Append("api/apps/restore"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -13828,7 +14647,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -13893,6 +14714,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -13900,7 +14723,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -13970,10 +14793,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -13981,7 +14813,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IAssetsClient { @@ -14232,28 +15064,27 @@ public partial interface IAssetsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AssetsClient : IAssetsClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public AssetsClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -14290,81 +15121,87 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (more == null) throw new System.ArgumentNullException("more"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/assets/{app}/{idOrSlug}/{more}?"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{idOrSlug}", System.Uri.EscapeDataString(ConvertToString(idOrSlug, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{more}", System.Uri.EscapeDataString(ConvertToString(more, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _options.ClientProvider.Get(); + 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("application/octet-stream")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/assets/{app}/{idOrSlug}/{more}" + urlBuilder_.Append("api/assets/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(idOrSlug, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(more, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('?'); if (version != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("version") + "=").Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("version")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (cache != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("cache") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cache, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("cache")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cache, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (download != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("download") + "=").Append(System.Uri.EscapeDataString(ConvertToString(download, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("download")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(download, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (width != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("width") + "=").Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (height != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("height") + "=").Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (quality != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("quality") + "=").Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (mode != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("mode") + "=").Append(System.Uri.EscapeDataString(ConvertToString(mode, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("mode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (bg != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("bg") + "=").Append(System.Uri.EscapeDataString(ConvertToString(bg, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("bg")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(bg, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (focusX != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("focusX") + "=").Append(System.Uri.EscapeDataString(ConvertToString(focusX, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("focusX")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(focusX, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (focusY != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("focusY") + "=").Append(System.Uri.EscapeDataString(ConvertToString(focusY, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("focusY")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(focusY, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (nofocus != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("nofocus") + "=").Append(System.Uri.EscapeDataString(ConvertToString(nofocus, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("nofocus")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nofocus, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (auto != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("auto") + "=").Append(System.Uri.EscapeDataString(ConvertToString(auto, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("auto")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(auto, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (force != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("force") + "=").Append(System.Uri.EscapeDataString(ConvertToString(force, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("force")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(force, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (deleted != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("deleted") + "=").Append(System.Uri.EscapeDataString(ConvertToString(deleted, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("deleted")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deleted, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (format != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("format") + "=").Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); - 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("application/octet-stream")); - PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -14376,7 +15213,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -14386,11 +15225,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201 || status_ == 206) + if (status_ == 200 || status_ == 206) { var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeResponse_ = false; // response and client are disposed by FileResponse + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else @@ -14455,80 +15294,83 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/assets/{id}?"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _options.ClientProvider.Get(); + 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("application/octet-stream")); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/assets/{id}" + urlBuilder_.Append("api/assets/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('?'); if (version != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("version") + "=").Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("version")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(version, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (cache != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("cache") + "=").Append(System.Uri.EscapeDataString(ConvertToString(cache, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("cache")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(cache, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (download != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("download") + "=").Append(System.Uri.EscapeDataString(ConvertToString(download, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("download")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(download, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (width != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("width") + "=").Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("width")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(width, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (height != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("height") + "=").Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("height")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(height, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (quality != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("quality") + "=").Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("quality")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(quality, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (mode != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("mode") + "=").Append(System.Uri.EscapeDataString(ConvertToString(mode, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("mode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(mode, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (bg != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("bg") + "=").Append(System.Uri.EscapeDataString(ConvertToString(bg, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("bg")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(bg, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (focusX != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("focusX") + "=").Append(System.Uri.EscapeDataString(ConvertToString(focusX, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("focusX")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(focusX, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (focusY != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("focusY") + "=").Append(System.Uri.EscapeDataString(ConvertToString(focusY, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("focusY")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(focusY, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (nofocus != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("nofocus") + "=").Append(System.Uri.EscapeDataString(ConvertToString(nofocus, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("nofocus")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(nofocus, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (auto != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("auto") + "=").Append(System.Uri.EscapeDataString(ConvertToString(auto, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("auto")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(auto, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (force != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("force") + "=").Append(System.Uri.EscapeDataString(ConvertToString(force, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("force")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(force, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (deleted != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("deleted") + "=").Append(System.Uri.EscapeDataString(ConvertToString(deleted, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("deleted")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deleted, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (format != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("format") + "=").Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("format")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(format, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); - 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("application/octet-stream")); - PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -14540,7 +15382,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -14550,11 +15394,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201 || status_ == 206) + if (status_ == 200 || status_ == 206) { var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeResponse_ = false; // response and client are disposed by FileResponse + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else @@ -14604,20 +15448,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetAssetFoldersAsync(string parentId = null, AssetFolderScope? scope = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/folders?"); - urlBuilder_.Replace("{app}", _options.AppName); - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (scope != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("scope") + "=").Append(System.Uri.EscapeDataString(ConvertToString(scope, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -14625,6 +15457,23 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/assets/folders" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/folders"); + urlBuilder_.Append('?'); + if (parentId != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (scope != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("scope")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(scope, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -14636,7 +15485,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -14646,7 +15497,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -14701,11 +15552,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/folders"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -14717,6 +15565,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/folders" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/folders"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -14728,7 +15583,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -14738,7 +15595,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -14807,12 +15664,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/folders/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -14824,6 +15677,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/folders/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/folders/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -14835,7 +15696,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -14845,7 +15708,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -14910,18 +15773,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/folders/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("DELETE"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/folders/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/folders/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -14933,7 +15800,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -15007,12 +15876,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/folders/{id}/parent"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -15024,6 +15889,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/folders/{id}/parent" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/folders/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/parent"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -15035,7 +15909,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -15045,7 +15921,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -15109,11 +15985,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetTagsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/tags"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -15121,6 +15994,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/assets/tags" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/tags"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -15132,7 +16012,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -15142,7 +16024,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -15201,12 +16083,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/tags/{name}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{name}", System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -15218,6 +16096,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/tags/{name}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/tags/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -15229,7 +16115,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -15239,7 +16127,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -15312,53 +16200,58 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetAssetsAsync(string parentId = null, string ids = null, string q = null, double? top = null, double? skip = null, string orderby = null, string filter = null, bool? x_NoTotal = null, bool? x_NoSlowTotal = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets?"); - urlBuilder_.Replace("{app}", _options.AppName); + var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (x_NoTotal != null) + request_.Headers.TryAddWithoutValidation("X-NoTotal", ConvertToString(x_NoTotal, System.Globalization.CultureInfo.InvariantCulture)); + + if (x_NoSlowTotal != null) + request_.Headers.TryAddWithoutValidation("X-NoSlowTotal", ConvertToString(x_NoSlowTotal, 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: "api/apps/{app}/assets" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets"); + urlBuilder_.Append('?'); if (parentId != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (ids != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("ids") + "=").Append(System.Uri.EscapeDataString(ConvertToString(ids, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("ids")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(ids, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (q != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("q") + "=").Append(System.Uri.EscapeDataString(ConvertToString(q, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("q")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(q, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (top != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("$top") + "=").Append(System.Uri.EscapeDataString(ConvertToString(top, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("$top")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(top, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (skip != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("$skip") + "=").Append(System.Uri.EscapeDataString(ConvertToString(skip, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("$skip")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(skip, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (orderby != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("$orderby") + "=").Append(System.Uri.EscapeDataString(ConvertToString(orderby, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("$orderby")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(orderby, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (filter != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("$filter") + "=").Append(System.Uri.EscapeDataString(ConvertToString(filter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("$filter")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(filter, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - - if (x_NoTotal != null) - request_.Headers.TryAddWithoutValidation("X-NoTotal", ConvertToString(x_NoTotal, System.Globalization.CultureInfo.InvariantCulture)); - - if (x_NoSlowTotal != null) - request_.Headers.TryAddWithoutValidation("X-NoSlowTotal", ConvertToString(x_NoSlowTotal, System.Globalization.CultureInfo.InvariantCulture)); - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -15370,7 +16263,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -15380,7 +16275,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -15437,24 +16332,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task PostAssetAsync(string parentId = null, string id = null, bool? duplicate = null, FileParameter file = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets?"); - urlBuilder_.Replace("{app}", _options.AppName); - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (id != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("id") + "=").Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (duplicate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("duplicate") + "=").Append(System.Uri.EscapeDataString(ConvertToString(duplicate, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -15477,6 +16356,27 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets"); + urlBuilder_.Append('?'); + if (parentId != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (id != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("id")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (duplicate != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("duplicate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(duplicate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -15488,7 +16388,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -15498,7 +16400,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -15578,11 +16480,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (query == null) throw new System.ArgumentNullException("query"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/query"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -15600,6 +16499,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/query" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/query"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -15611,7 +16517,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -15621,7 +16529,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -15686,12 +16594,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -15699,6 +16603,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/assets/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -15710,7 +16622,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -15720,7 +16634,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -15780,21 +16694,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/{id}?"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - if (parentId != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("parentId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (duplicate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("duplicate") + "=").Append(System.Uri.EscapeDataString(ConvertToString(duplicate, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -15817,6 +16718,24 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('?'); + if (parentId != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("parentId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(parentId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + if (duplicate != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("duplicate")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(duplicate, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -15828,7 +16747,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -15838,7 +16759,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -15917,12 +16838,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -15934,6 +16851,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -15945,7 +16870,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -15955,7 +16882,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -16022,27 +16949,32 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/{id}?"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("DELETE"); + + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('?'); if (checkReferrers != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("checkReferrers") + "=").Append(System.Uri.EscapeDataString(ConvertToString(checkReferrers, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("checkReferrers")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(checkReferrers, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (permanent != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("permanent") + "=").Append(System.Uri.EscapeDataString(ConvertToString(permanent, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("permanent")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(permanent, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } urlBuilder_.Length--; - var client_ = _options.ClientProvider.Get(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -16054,7 +16986,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -16124,11 +17058,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/bulk"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -16140,6 +17071,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/bulk" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/bulk"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -16151,7 +17089,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -16161,7 +17101,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -16229,12 +17169,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/{id}/content"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -16257,6 +17193,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/{id}/content" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/content"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -16268,7 +17213,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -16278,7 +17225,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -16357,12 +17304,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/{id}/parent"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -16374,6 +17317,15 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/{id}/parent" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/parent"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -16385,7 +17337,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -16395,7 +17349,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -16461,6 +17415,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -16468,7 +17424,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -16538,10 +17494,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -16549,7 +17514,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial interface IAppsClient { @@ -16884,28 +17849,27 @@ public partial interface IAppsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AppsClient : IAppsClient { private Squidex.ClientLibrary.SquidexOptions _options; - private System.Lazy _settings; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public AppsClient(Squidex.ClientLibrary.SquidexOptions options) { _options = options; - _settings = new System.Lazy(CreateSerializerSettings); } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { - var settings = _options.SerializerSettings; + var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); return settings; } protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + static partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); @@ -16919,11 +17883,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetAssetScriptsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/scripts"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -16931,6 +17892,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/assets/scripts" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/scripts"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -16942,7 +17910,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -16952,7 +17922,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -17007,11 +17977,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/assets/scripts"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -17023,6 +17990,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/assets/scripts" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/assets/scripts"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -17034,7 +18008,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -17044,7 +18020,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -17108,11 +18084,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetClientsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/clients"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -17120,6 +18093,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/clients" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/clients"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -17131,7 +18111,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -17141,7 +18123,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -17200,11 +18182,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/clients"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -17216,6 +18195,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/clients" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/clients"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -17227,7 +18213,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -17237,7 +18225,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -17309,12 +18297,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/clients/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -17326,6 +18310,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/clients/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/clients/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -17337,7 +18329,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -17347,7 +18341,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -17415,12 +18409,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/clients/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -17428,6 +18418,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("DELETE"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/clients/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/clients/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -17439,7 +18437,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -17449,7 +18449,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -17510,11 +18510,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetContributorsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/contributors"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -17522,6 +18519,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/contributors" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/contributors"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -17533,7 +18537,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -17543,7 +18549,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -17598,11 +18604,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/contributors"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -17614,6 +18617,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/contributors" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/contributors"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -17625,7 +18635,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -17635,7 +18647,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -17696,11 +18708,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task DeleteMyselfAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/contributors/me"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -17708,6 +18717,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("DELETE"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/contributors/me" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/contributors/me"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -17719,7 +18735,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -17729,7 +18747,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -17794,12 +18812,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/contributors/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -17807,6 +18821,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("DELETE"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/contributors/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/contributors/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -17818,7 +18840,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -17828,7 +18852,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -17889,11 +18913,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetImageAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/image"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -17901,6 +18922,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("GET"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/octet-stream")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/image" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/image"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -17912,7 +18940,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -17922,11 +18952,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201 || status_ == 206) + if (status_ == 200 || status_ == 206) { var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeResponse_ = false; // response and client are disposed by FileResponse + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else @@ -17971,11 +19001,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task UploadImageAsync(FileParameter file = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/image"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -17998,6 +19025,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/image" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/image"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -18009,7 +19043,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -18019,7 +19055,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -18080,11 +19116,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task DeleteImageAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/image"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -18092,6 +19125,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("DELETE"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/image" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/image"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -18103,7 +19143,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -18113,7 +19155,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -18174,11 +19216,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetLanguagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/languages"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -18186,6 +19225,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/languages" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/languages"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -18197,7 +19243,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -18207,7 +19255,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -18262,11 +19310,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/languages"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -18278,6 +19323,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/languages" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/languages"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -18289,7 +19341,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -18299,7 +19353,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -18368,12 +19422,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/languages/{language}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{language}", System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -18385,6 +19435,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/languages/{language}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/languages/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -18396,7 +19454,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -18406,7 +19466,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -18471,12 +19531,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (language == null) throw new System.ArgumentNullException("language"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/languages/{language}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{language}", System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -18484,6 +19540,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("DELETE"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/languages/{language}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/languages/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -18495,7 +19559,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -18505,7 +19571,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -18566,11 +19632,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetRolesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/roles"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -18578,6 +19641,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/roles" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/roles"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -18589,7 +19659,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -18599,7 +19671,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -18654,11 +19726,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/roles"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -18670,6 +19739,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/roles" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/roles"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -18681,7 +19757,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -18691,7 +19769,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -18752,11 +19830,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetPermissionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/roles/permissions"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -18764,6 +19839,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/roles/permissions" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/roles/permissions"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -18775,7 +19857,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -18785,7 +19869,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -18844,12 +19928,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/roles/{roleName}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{roleName}", System.Uri.EscapeDataString(ConvertToString(roleName, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -18861,6 +19941,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/roles/{roleName}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/roles/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(roleName, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -18872,7 +19960,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -18882,7 +19972,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -18947,12 +20037,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (roleName == null) throw new System.ArgumentNullException("roleName"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/roles/{roleName}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{roleName}", System.Uri.EscapeDataString(ConvertToString(roleName, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -18960,6 +20046,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("DELETE"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/roles/{roleName}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/roles/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(roleName, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -18971,7 +20065,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -18981,7 +20077,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -19046,11 +20142,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetAppsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -19058,6 +20151,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps" + urlBuilder_.Append("api/apps"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -19069,7 +20167,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -19079,7 +20179,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -19132,11 +20232,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -19148,6 +20245,11 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps" + urlBuilder_.Append("api/apps"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -19159,7 +20261,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -19169,7 +20273,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 201) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -19242,12 +20346,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (team == null) throw new System.ArgumentNullException("team"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/teams/{team}/apps"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{team}", System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -19255,6 +20355,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/teams/{team}/apps" + urlBuilder_.Append("api/teams/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(team, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/apps"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -19266,7 +20373,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -19276,7 +20385,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -19321,11 +20430,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetAppAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -19333,6 +20439,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -19344,7 +20456,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -19354,7 +20468,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -19409,11 +20523,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -19425,6 +20536,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -19436,7 +20553,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -19446,7 +20565,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -19507,17 +20626,20 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task DeleteAppAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { request_.Method = new System.Net.Http.HttpMethod("DELETE"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -19529,7 +20651,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -19599,11 +20723,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/team"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -19615,6 +20736,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/team" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/team"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -19626,7 +20754,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -19636,7 +20766,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -19697,11 +20827,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetSettingsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/settings"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -19709,6 +20836,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/settings" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/settings"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -19720,7 +20854,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -19730,7 +20866,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -19785,11 +20921,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/settings"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -19801,6 +20934,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/settings" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/settings"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -19812,7 +20952,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -19822,7 +20964,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -19883,11 +21025,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetWorkflowsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/workflows"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -19895,6 +21034,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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: "api/apps/{app}/workflows" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/workflows"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -19906,7 +21052,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -19916,7 +21064,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -19971,11 +21119,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/workflows"); - urlBuilder_.Replace("{app}", _options.AppName); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -19987,6 +21132,13 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("POST"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/workflows" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/workflows"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -19998,7 +21150,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -20008,7 +21162,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -20077,12 +21231,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/workflows/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -20094,6 +21244,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("PUT"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/workflows/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/workflows/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -20105,7 +21263,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -20115,7 +21275,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -20180,12 +21340,8 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{app}/workflows/{id}"); - urlBuilder_.Replace("{app}", _options.AppName); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _options.ClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -20193,6 +21349,14 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() request_.Method = new System.Net.Http.HttpMethod("DELETE"); request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{app}/workflows/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(_options.AppName); + urlBuilder_.Append("/workflows/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -20204,7 +21368,9 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() var disposeResponse_ = true; try { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + var headers_ = new System.Collections.Generic.Dictionary>(); + foreach (var item_ in response_.Headers) + headers_[item_.Key] = item_.Value; if (response_.Content != null && response_.Content.Headers != null) { foreach (var item_ in response_.Content.Headers) @@ -20214,7 +21380,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 201) + if (status_ == 200) { var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) @@ -20280,6 +21446,8 @@ public ObjectResponseResult(T responseObject, string responseText) public string Text { get; } } + public bool ReadResponseAsString { get; set; } + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) { if (response == null || response.Content == null) @@ -20287,7 +21455,7 @@ protected virtual async System.Threading.Tasks.Task> Rea return new ObjectResponseResult(default(T), string.Empty); } - if (_options.ReadResponseAsString) + if (ReadResponseAsString) { var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -20357,10 +21525,19 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu { return System.Convert.ToBase64String((byte[]) value); } + else if (value is string[]) + { + return string.Join(",", (string[])value); + } else if (value.GetType().IsArray) { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + 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); @@ -20368,7 +21545,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ErrorDto { /// @@ -20410,7 +21587,7 @@ public partial class ErrorDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UserProperty { [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -20423,7 +21600,7 @@ public partial class UserProperty } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateSettingDto { /// @@ -20435,7 +21612,7 @@ public partial class UpdateSettingDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UsersDto : Resource { /// @@ -20453,7 +21630,7 @@ public partial class UsersDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UserDto : Resource { /// @@ -20492,7 +21669,7 @@ public partial class UserDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public abstract partial class Resource { /// @@ -20504,7 +21681,7 @@ public abstract partial class Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ResourceLink { /// @@ -20529,7 +21706,7 @@ public partial class ResourceLink } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CreateUserDto { /// @@ -20562,7 +21739,7 @@ public partial class CreateUserDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateUserDto { /// @@ -20594,13 +21771,13 @@ public partial class UpdateUserDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ResourcesDto : Resource { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateProfileDto { /// @@ -20611,7 +21788,7 @@ public partial class UpdateProfileDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TranslationDto { /// @@ -20639,7 +21816,7 @@ public partial class TranslationDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum TranslationStatus { @@ -20663,7 +21840,7 @@ public enum TranslationStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TranslateDto { /// @@ -20677,7 +21854,7 @@ public partial class TranslateDto /// The target language. /// [Newtonsoft.Json.JsonProperty("targetLanguage", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string TargetLanguage { get; set; } /// @@ -20688,7 +21865,7 @@ public partial class TranslateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AskDto { /// @@ -20700,7 +21877,7 @@ public partial class AskDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TemplatesDto : Resource { /// @@ -20712,7 +21889,7 @@ public partial class TemplatesDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TemplateDto : Resource { /// @@ -20744,7 +21921,7 @@ public partial class TemplateDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TemplateDetailsDto : Resource { /// @@ -20756,7 +21933,7 @@ public partial class TemplateDetailsDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ContributorsDto : Resource { /// @@ -20780,7 +21957,7 @@ public partial class ContributorsDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ContributorDto : Resource { /// @@ -20812,7 +21989,7 @@ public partial class ContributorDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ContributorsMetadata { /// @@ -20824,7 +22001,7 @@ public partial class ContributorsMetadata } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AssignContributorDto { /// @@ -20848,7 +22025,7 @@ public partial class AssignContributorDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TeamDto : Resource { /// @@ -20893,7 +22070,7 @@ public partial class TeamDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CreateTeamDto { /// @@ -20905,7 +22082,7 @@ public partial class CreateTeamDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateTeamDto { /// @@ -20917,7 +22094,7 @@ public partial class UpdateTeamDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class LogDownloadDto { /// @@ -20928,7 +22105,7 @@ public partial class LogDownloadDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CallsUsageDtoDto { /// @@ -20988,7 +22165,7 @@ public partial class CallsUsageDtoDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CallsUsagePerDateDto { /// @@ -21019,7 +22196,7 @@ public partial class CallsUsagePerDateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CurrentStorageDto { /// @@ -21036,7 +22213,7 @@ public partial class CurrentStorageDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class StorageUsagePerDateDto { /// @@ -21061,7 +22238,7 @@ public partial class StorageUsagePerDateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SearchResultDto : Resource { /// @@ -21087,7 +22264,7 @@ public partial class SearchResultDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum SearchResultType { @@ -21111,7 +22288,7 @@ public enum SearchResultType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SchemaDto : Resource { /// @@ -21125,14 +22302,14 @@ public partial class SchemaDto : Resource /// The user that has created the schema. /// [Newtonsoft.Json.JsonProperty("createdBy", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string CreatedBy { get; set; } /// /// The user that has updated the schema. /// [Newtonsoft.Json.JsonProperty("lastModifiedBy", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string LastModifiedBy { get; set; } /// @@ -21241,7 +22418,7 @@ public partial class SchemaDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum SchemaType { @@ -21256,7 +22433,7 @@ public enum SchemaType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SchemaPropertiesDto { /// @@ -21317,7 +22494,7 @@ public partial class SchemaPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SchemaScriptsDto { /// @@ -21358,7 +22535,7 @@ public partial class SchemaScriptsDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class FieldRuleDto { /// @@ -21384,7 +22561,7 @@ public partial class FieldRuleDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum FieldRuleAction { @@ -21399,7 +22576,7 @@ public enum FieldRuleAction } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class FieldDto : Resource { /// @@ -21471,7 +22648,7 @@ public partial class FieldDto : Resource [JsonInheritanceAttribute("String", typeof(StringFieldPropertiesDto))] [JsonInheritanceAttribute("Tags", typeof(TagsFieldPropertiesDto))] [JsonInheritanceAttribute("UI", typeof(UIFieldPropertiesDto))] - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public abstract partial class FieldPropertiesDto { /// @@ -21527,7 +22704,7 @@ public abstract partial class FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ArrayFieldPropertiesDto : FieldPropertiesDto { /// @@ -21557,7 +22734,7 @@ public partial class ArrayFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum ArrayCalculatedDefaultValue { @@ -21569,7 +22746,7 @@ public enum ArrayCalculatedDefaultValue } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AssetsFieldPropertiesDto : FieldPropertiesDto { /// @@ -21704,7 +22881,7 @@ public partial class AssetsFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum AssetPreviewMode { @@ -21719,13 +22896,13 @@ public enum AssetPreviewMode } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class LocalizedValueOfReadonlyListOfString : System.Collections.Generic.Dictionary> { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum AssetType { @@ -21743,7 +22920,7 @@ public enum AssetType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class BooleanFieldPropertiesDto : FieldPropertiesDto { /// @@ -21773,13 +22950,13 @@ public partial class BooleanFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class LocalizedValueOfNullableBoolean : System.Collections.Generic.Dictionary { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum BooleanFieldEditor { @@ -21791,7 +22968,7 @@ public enum BooleanFieldEditor } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ComponentFieldPropertiesDto : FieldPropertiesDto { /// @@ -21802,7 +22979,7 @@ public partial class ComponentFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ComponentsFieldPropertiesDto : FieldPropertiesDto { /// @@ -21838,7 +23015,7 @@ public partial class ComponentsFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class DateTimeFieldPropertiesDto : FieldPropertiesDto { /// @@ -21887,13 +23064,13 @@ public partial class DateTimeFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class LocalizedValueOfNullableInstant : System.Collections.Generic.Dictionary { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum DateTimeFieldEditor { @@ -21905,7 +23082,7 @@ public enum DateTimeFieldEditor } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum DateTimeCalculatedDefaultValue { @@ -21917,7 +23094,7 @@ public enum DateTimeCalculatedDefaultValue } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class GeolocationFieldPropertiesDto : FieldPropertiesDto { /// @@ -21929,7 +23106,7 @@ public partial class GeolocationFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum GeolocationFieldEditor { @@ -21938,7 +23115,7 @@ public enum GeolocationFieldEditor } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class JsonFieldPropertiesDto : FieldPropertiesDto { /// @@ -21949,7 +23126,7 @@ public partial class JsonFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class NumberFieldPropertiesDto : FieldPropertiesDto { /// @@ -22003,13 +23180,13 @@ public partial class NumberFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class LocalizedValueOfNullableDouble : System.Collections.Generic.Dictionary { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum NumberFieldEditor { @@ -22027,7 +23204,7 @@ public enum NumberFieldEditor } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ReferencesFieldPropertiesDto : FieldPropertiesDto { /// @@ -22093,7 +23270,7 @@ public partial class ReferencesFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum ReferencesFieldEditor { @@ -22114,7 +23291,7 @@ public enum ReferencesFieldEditor } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RichTextFieldPropertiesDto : FieldPropertiesDto { /// @@ -22173,7 +23350,7 @@ public partial class RichTextFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class StringFieldPropertiesDto : FieldPropertiesDto { /// @@ -22300,13 +23477,13 @@ public partial class StringFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class LocalizedValueOfString : System.Collections.Generic.Dictionary { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum StringContentType { @@ -22321,7 +23498,7 @@ public enum StringContentType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum StringFieldEditor { @@ -22357,7 +23534,7 @@ public enum StringFieldEditor } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TagsFieldPropertiesDto : FieldPropertiesDto { /// @@ -22405,7 +23582,7 @@ public partial class TagsFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum TagsFieldEditor { @@ -22420,7 +23597,7 @@ public enum TagsFieldEditor } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UIFieldPropertiesDto : FieldPropertiesDto { /// @@ -22432,7 +23609,7 @@ public partial class UIFieldPropertiesDto : FieldPropertiesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum UIFieldEditor { @@ -22441,7 +23618,7 @@ public enum UIFieldEditor } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class NestedFieldDto : Resource { /// @@ -22485,7 +23662,7 @@ public partial class NestedFieldDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AddFieldDto { /// @@ -22511,7 +23688,7 @@ public partial class AddFieldDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ConfigureUIFieldsDto { /// @@ -22528,7 +23705,7 @@ public partial class ConfigureUIFieldsDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ReorderFieldsDto { /// @@ -22540,7 +23717,7 @@ public partial class ReorderFieldsDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateFieldDto { /// @@ -22552,7 +23729,7 @@ public partial class UpdateFieldDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SchemasDto : Resource { /// @@ -22564,7 +23741,7 @@ public partial class SchemasDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CreateSchemaDto : UpsertSchemaDto { /// @@ -22591,7 +23768,7 @@ public partial class CreateSchemaDto : UpsertSchemaDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public abstract partial class UpsertSchemaDto { /// @@ -22650,7 +23827,7 @@ public abstract partial class UpsertSchemaDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpsertSchemaFieldDto { /// @@ -22700,7 +23877,7 @@ public partial class UpsertSchemaFieldDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpsertSchemaNestedFieldDto { /// @@ -22738,7 +23915,7 @@ public partial class UpsertSchemaNestedFieldDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateSchemaDto { /// @@ -22787,7 +23964,7 @@ public partial class UpdateSchemaDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SynchronizeSchemaDto : UpsertSchemaDto { /// @@ -22804,7 +23981,7 @@ public partial class SynchronizeSchemaDto : UpsertSchemaDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ChangeCategoryDto { /// @@ -22815,13 +23992,13 @@ public partial class ChangeCategoryDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ConfigurePreviewUrlsDto : System.Collections.Generic.Dictionary { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ConfigureFieldRulesDto { /// @@ -22832,7 +24009,7 @@ public partial class ConfigureFieldRulesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RuleElementDto { /// @@ -22882,7 +24059,7 @@ public partial class RuleElementDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RuleElementPropertyDto { /// @@ -22933,7 +24110,7 @@ public partial class RuleElementPropertyDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum RuleFieldEditor { @@ -22966,7 +24143,7 @@ public enum RuleFieldEditor } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RulesDto : Resource { /// @@ -22984,7 +24161,7 @@ public partial class RulesDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RuleDto : Resource { /// @@ -23082,13 +24259,13 @@ public partial class RuleDto : Resource [JsonInheritanceAttribute("Manual", typeof(ManualRuleTriggerDto))] [JsonInheritanceAttribute("SchemaChanged", typeof(SchemaChangedRuleTriggerDto))] [JsonInheritanceAttribute("Usage", typeof(UsageRuleTriggerDto))] - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public abstract partial class RuleTriggerDto { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AssetChangedRuleTriggerDto : RuleTriggerDto { /// @@ -23099,7 +24276,7 @@ public partial class AssetChangedRuleTriggerDto : RuleTriggerDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CommentRuleTriggerDto : RuleTriggerDto { /// @@ -23110,7 +24287,7 @@ public partial class CommentRuleTriggerDto : RuleTriggerDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ContentChangedRuleTriggerDto : RuleTriggerDto { /// @@ -23133,7 +24310,7 @@ public partial class ContentChangedRuleTriggerDto : RuleTriggerDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SchemaCondition { [Newtonsoft.Json.JsonProperty("schemaId", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -23145,13 +24322,13 @@ public partial class SchemaCondition } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ManualRuleTriggerDto : RuleTriggerDto { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SchemaChangedRuleTriggerDto : RuleTriggerDto { /// @@ -23162,7 +24339,7 @@ public partial class SchemaChangedRuleTriggerDto : RuleTriggerDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UsageRuleTriggerDto : RuleTriggerDto { /// @@ -23199,13 +24376,13 @@ public partial class UsageRuleTriggerDto : RuleTriggerDto [JsonInheritanceAttribute("Tweet", typeof(TweetRuleActionDto))] [JsonInheritanceAttribute("Typesense", typeof(TypesenseRuleActionDto))] [JsonInheritanceAttribute("Webhook", typeof(WebhookRuleActionDto))] - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public abstract partial class RuleActionDto { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AlgoliaRuleActionDto : RuleActionDto { /// @@ -23243,7 +24420,7 @@ public partial class AlgoliaRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AzureQueueRuleActionDto : RuleActionDto { /// @@ -23268,7 +24445,7 @@ public partial class AzureQueueRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CommentRuleActionDto : RuleActionDto { /// @@ -23286,7 +24463,7 @@ public partial class CommentRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CreateContentRuleActionDto : RuleActionDto { /// @@ -23318,7 +24495,7 @@ public partial class CreateContentRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class DiscourseRuleActionDto : RuleActionDto { /// @@ -23369,7 +24546,7 @@ public partial class DiscourseRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ElasticSearchRuleActionDto : RuleActionDto { /// @@ -23412,7 +24589,7 @@ public partial class ElasticSearchRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class EmailRuleActionDto : RuleActionDto { /// @@ -23472,7 +24649,7 @@ public partial class EmailRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class FastlyRuleActionDto : RuleActionDto { /// @@ -23491,7 +24668,7 @@ public partial class FastlyRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class MediumRuleActionDto : RuleActionDto { /// @@ -23541,7 +24718,7 @@ public partial class MediumRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class NotificationRuleActionDto : RuleActionDto { /// @@ -23572,7 +24749,7 @@ public partial class NotificationRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class OpenSearchRuleActionDto : RuleActionDto { /// @@ -23615,7 +24792,7 @@ public partial class OpenSearchRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class PrerenderRuleActionDto : RuleActionDto { /// @@ -23634,7 +24811,7 @@ public partial class PrerenderRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ScriptRuleActionDto : RuleActionDto { /// @@ -23646,7 +24823,7 @@ public partial class ScriptRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SignalRRuleActionDto : RuleActionDto { /// @@ -23693,7 +24870,7 @@ public partial class SignalRRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum ActionTypeEnum { @@ -23708,7 +24885,7 @@ public enum ActionTypeEnum } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SlackRuleActionDto : RuleActionDto { /// @@ -23727,7 +24904,7 @@ public partial class SlackRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TweetRuleActionDto : RuleActionDto { /// @@ -23753,7 +24930,7 @@ public partial class TweetRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TypesenseRuleActionDto : RuleActionDto { /// @@ -23791,7 +24968,7 @@ public partial class TypesenseRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class WebhookRuleActionDto : RuleActionDto { /// @@ -23835,7 +25012,7 @@ public partial class WebhookRuleActionDto : RuleActionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum WebhookMethod { @@ -23856,7 +25033,7 @@ public enum WebhookMethod } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CreateRuleDto { /// @@ -23875,7 +25052,7 @@ public partial class CreateRuleDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateRuleDto { /// @@ -23904,7 +25081,7 @@ public partial class UpdateRuleDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SimulatedRuleEventsDto : Resource { /// @@ -23922,7 +25099,7 @@ public partial class SimulatedRuleEventsDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SimulatedRuleEventDto { /// @@ -23986,7 +25163,7 @@ public partial class SimulatedRuleEventDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] [System.Flags] public enum SkipReason { @@ -24026,7 +25203,7 @@ public enum SkipReason } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RuleEventsDto : Resource { /// @@ -24044,7 +25221,7 @@ public partial class RuleEventsDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RuleEventDto : Resource { /// @@ -24111,7 +25288,7 @@ public partial class RuleEventDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum RuleResult { @@ -24129,7 +25306,7 @@ public enum RuleResult } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum RuleJobResult { @@ -24150,7 +25327,7 @@ public enum RuleJobResult } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class PlansDto { /// @@ -24194,7 +25371,7 @@ public partial class PlansDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class PlanDto { /// @@ -24268,7 +25445,7 @@ public partial class PlanDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ReferralInfo { [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -24285,7 +25462,7 @@ public partial class ReferralInfo } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum PlansLockedReason { @@ -24303,7 +25480,7 @@ public enum PlansLockedReason } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class PlanChangedDto { /// @@ -24314,7 +25491,7 @@ public partial class PlanChangedDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ChangePlanDto { /// @@ -24326,13 +25503,13 @@ public partial class ChangePlanDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ExposedValues : System.Collections.Generic.Dictionary { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class FeaturesDto { /// @@ -24350,7 +25527,7 @@ public partial class FeaturesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class FeatureDto { /// @@ -24369,7 +25546,7 @@ public partial class FeatureDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class LanguageDto { /// @@ -24395,7 +25572,7 @@ public partial class LanguageDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class JobsDto : Resource { /// @@ -24407,7 +25584,7 @@ public partial class JobsDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class JobDto : Resource { /// @@ -24474,7 +25651,7 @@ public partial class JobDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum JobStatus { @@ -24495,7 +25672,7 @@ public enum JobStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class JobLogMessageDto { /// @@ -24514,7 +25691,7 @@ public partial class JobLogMessageDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class HistoryEventDto { /// @@ -24560,7 +25737,7 @@ public partial class HistoryEventDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class EventConsumersDto : Resource { /// @@ -24572,7 +25749,7 @@ public partial class EventConsumersDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class EventConsumerDto : Resource { /// @@ -24614,13 +25791,13 @@ public partial class EventConsumerDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ContentFieldData : System.Collections.Generic.Dictionary { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class QueryDto { /// @@ -24649,7 +25826,7 @@ public partial class QueryDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class BulkResultDto { /// @@ -24679,7 +25856,7 @@ public partial class BulkResultDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class BackupJobsDto : Resource { /// @@ -24691,7 +25868,7 @@ public partial class BackupJobsDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class BackupJobDto : Resource { /// @@ -24736,7 +25913,7 @@ public partial class BackupJobDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RestoreJobDto { /// @@ -24776,7 +25953,7 @@ public partial class RestoreJobDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RestoreRequestDto { /// @@ -24795,7 +25972,7 @@ public partial class RestoreRequestDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum ResizeMode { @@ -24822,7 +25999,7 @@ public enum ResizeMode } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum ImageFormat { @@ -24852,7 +26029,7 @@ public enum ImageFormat } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AssetFoldersDto : Resource { /// @@ -24877,7 +26054,7 @@ public partial class AssetFoldersDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AssetFolderDto : Resource { /// @@ -24909,7 +26086,7 @@ public partial class AssetFolderDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum AssetFolderScope { @@ -24924,7 +26101,7 @@ public enum AssetFolderScope } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CreateAssetFolderDto { /// @@ -24942,7 +26119,7 @@ public partial class CreateAssetFolderDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RenameAssetFolderDto { /// @@ -24954,7 +26131,7 @@ public partial class RenameAssetFolderDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class MoveAssetFolderDto { /// @@ -24965,7 +26142,7 @@ public partial class MoveAssetFolderDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RenameTagDto { /// @@ -24977,7 +26154,7 @@ public partial class RenameTagDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AssetsDto : Resource { /// @@ -24995,7 +26172,7 @@ public partial class AssetsDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AssetDto : Resource { /// @@ -25161,7 +26338,7 @@ public partial class AssetDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AssetMeta { /// @@ -25173,7 +26350,7 @@ public partial class AssetMeta } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class BulkUpdateAssetsDto { /// @@ -25202,7 +26379,7 @@ public partial class BulkUpdateAssetsDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class BulkUpdateAssetsJobDto { /// @@ -25268,7 +26445,7 @@ public partial class BulkUpdateAssetsJobDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public enum BulkUpdateAssetType { @@ -25283,7 +26460,7 @@ public enum BulkUpdateAssetType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AnnotateAssetDto { /// @@ -25318,7 +26495,7 @@ public partial class AnnotateAssetDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class MoveAssetDto { /// @@ -25329,7 +26506,7 @@ public partial class MoveAssetDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AssetScriptsDto : Resource { /// @@ -25382,7 +26559,7 @@ public partial class AssetScriptsDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateAssetScriptsDto { /// @@ -25429,7 +26606,7 @@ public partial class UpdateAssetScriptsDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ClientsDto : Resource { /// @@ -25441,7 +26618,7 @@ public partial class ClientsDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class ClientDto : Resource { /// @@ -25491,7 +26668,7 @@ public partial class ClientDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CreateClientDto { /// @@ -25504,7 +26681,7 @@ public partial class CreateClientDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateClientDto { /// @@ -25540,7 +26717,7 @@ public partial class UpdateClientDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AppLanguagesDto : Resource { /// @@ -25552,7 +26729,7 @@ public partial class AppLanguagesDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AppLanguageDto : Resource { /// @@ -25590,19 +26767,19 @@ public partial class AppLanguageDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AddLanguageDto { /// /// The language to add. /// [Newtonsoft.Json.JsonProperty("language", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string Language { get; set; } } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateLanguageDto { /// @@ -25625,7 +26802,7 @@ public partial class UpdateLanguageDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RolesDto : Resource { /// @@ -25637,7 +26814,7 @@ public partial class RolesDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class RoleDto : Resource { /// @@ -25681,7 +26858,7 @@ public partial class RoleDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AddRoleDto { /// @@ -25693,7 +26870,7 @@ public partial class AddRoleDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateRoleDto { /// @@ -25711,7 +26888,7 @@ public partial class UpdateRoleDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AppDto : Resource { /// @@ -25802,7 +26979,7 @@ public partial class AppDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class CreateAppDto { /// @@ -25821,7 +26998,7 @@ public partial class CreateAppDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateAppDto { /// @@ -25838,7 +27015,7 @@ public partial class UpdateAppDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class TransferToTeamDto { /// @@ -25849,7 +27026,7 @@ public partial class TransferToTeamDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AppSettingsDto : Resource { /// @@ -25886,7 +27063,7 @@ public partial class AppSettingsDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class PatternDto { /// @@ -25911,7 +27088,7 @@ public partial class PatternDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class EditorDto { /// @@ -25930,7 +27107,7 @@ public partial class EditorDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateAppSettingsDto { /// @@ -25961,7 +27138,7 @@ public partial class UpdateAppSettingsDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class WorkflowsDto : Resource { /// @@ -25980,7 +27157,7 @@ public partial class WorkflowsDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class WorkflowDto : Resource { /// @@ -26018,7 +27195,7 @@ public partial class WorkflowDto : Resource } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class WorkflowStepDto { /// @@ -26059,7 +27236,7 @@ public partial class WorkflowStepDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class WorkflowTransitionDto { /// @@ -26076,7 +27253,7 @@ public partial class WorkflowTransitionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class AddWorkflowDto { /// @@ -26088,7 +27265,7 @@ public partial class AddWorkflowDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class UpdateWorkflowDto { /// @@ -26114,12 +27291,12 @@ public partial class UpdateWorkflowDto /// The initial step. /// [Newtonsoft.Json.JsonProperty("initial", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.Required] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] public string Initial { get; set; } } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple = true)] internal class JsonInheritanceAttribute : System.Attribute { @@ -26134,7 +27311,7 @@ public JsonInheritanceAttribute(string key, System.Type type) public System.Type Type { get; } } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] internal class DateFormatConverter : Newtonsoft.Json.Converters.IsoDateTimeConverter { public DateFormatConverter() @@ -26143,7 +27320,7 @@ public DateFormatConverter() } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class FileParameter { public FileParameter(System.IO.Stream data) @@ -26170,7 +27347,7 @@ public FileParameter(System.IO.Stream data, string fileName, string contentType) public string ContentType { get; private set; } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class FileResponse : System.IDisposable { private System.IDisposable _client; @@ -26207,7 +27384,7 @@ public void Dispose() } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SquidexException : System.Exception { public int StatusCode { get; private set; } @@ -26230,7 +27407,7 @@ public override string ToString() } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.1.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class SquidexException : SquidexException { public TResult Result { get; private set; } @@ -26253,4 +27430,5 @@ public SquidexException(string message, int statusCode, string response, System. #pragma warning restore 8073 #pragma warning restore 3016 #pragma warning restore 8603 -#pragma warning restore 8604 \ No newline at end of file +#pragma warning restore 8604 +#pragma warning restore 8625 \ No newline at end of file diff --git a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Squidex.ClientLibrary.csproj b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Squidex.ClientLibrary.csproj index 92c1f5a3..56db701b 100644 --- a/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Squidex.ClientLibrary.csproj +++ b/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Squidex.ClientLibrary.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -19,7 +19,7 @@ - + all