From 94adb97d396174b30a65330d3db871c5e8f58820 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 12 Jan 2024 13:10:03 +0100 Subject: [PATCH 1/4] Update OpenIdDictCore and NSwag --- ...fo.Domain.Integrations.Abstractions.csproj | 2 +- .../Notifo.Domain.Integrations.csproj | 18 +- .../src/Notifo.Domain/Notifo.Domain.csproj | 14 +- .../IdentityServiceExtensions.cs | 2 +- .../InMemory/ImmutableApplication.cs | 14 +- .../InMemory/InMemoryApplicationStore.cs | 39 +- .../Notifo.Identity/InMemoryConfiguration.cs | 2 +- .../Notifo.Identity/Notifo.Identity.csproj | 10 +- .../Notifo.Identity/TokenStoreInitializer.cs | 6 +- .../Notifo.Infrastructure.csproj | 40 +- .../Areas/Api/OpenApi/CommonProcessor.cs | 2 +- .../Api/OpenApi/OpenApiServiceExtensions.cs | 14 +- .../Areas/Api/OpenApi/ReflectionServices.cs | 2 +- backend/src/Notifo/Notifo.csproj | 34 +- backend/tests/Benchmarks/Benchmarks.csproj | 6 +- .../Notifo.Domain.Tests.csproj | 10 +- .../Notifo.Identity.Tests.csproj | 8 +- .../Notifo.Infrastructure.Tests.csproj | 10 +- frontend/src/app/service/service.ts | 38 +- .../Client.Class.ProcessResponse.liquid | 72 - tools/sdk/CodeGenerator/Client.Class.liquid | 187 +- tools/sdk/CodeGenerator/CodeGenerator.csproj | 9 +- tools/sdk/CodeGenerator/Program.cs | 9 +- .../Notifo.SDK.Tests/Notifo.SDK.Tests.csproj | 4 +- tools/sdk/Notifo.SDK/Generated.cs | 2948 ++++++++++------- tools/sdk/Notifo.SDK/Notifo.SDK.csproj | 2 +- 26 files changed, 2089 insertions(+), 1413 deletions(-) delete mode 100644 tools/sdk/CodeGenerator/Client.Class.ProcessResponse.liquid diff --git a/backend/src/Notifo.Domain.Integrations.Abstractions/Notifo.Domain.Integrations.Abstractions.csproj b/backend/src/Notifo.Domain.Integrations.Abstractions/Notifo.Domain.Integrations.Abstractions.csproj index f341a57f..64021121 100644 --- a/backend/src/Notifo.Domain.Integrations.Abstractions/Notifo.Domain.Integrations.Abstractions.csproj +++ b/backend/src/Notifo.Domain.Integrations.Abstractions/Notifo.Domain.Integrations.Abstractions.csproj @@ -10,7 +10,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/backend/src/Notifo.Domain.Integrations/Notifo.Domain.Integrations.csproj b/backend/src/Notifo.Domain.Integrations/Notifo.Domain.Integrations.csproj index a9d25113..73600dbb 100644 --- a/backend/src/Notifo.Domain.Integrations/Notifo.Domain.Integrations.csproj +++ b/backend/src/Notifo.Domain.Integrations/Notifo.Domain.Integrations.csproj @@ -9,31 +9,31 @@ - + - + - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - + diff --git a/backend/src/Notifo.Domain/Notifo.Domain.csproj b/backend/src/Notifo.Domain/Notifo.Domain.csproj index 9655b65a..9f40f242 100644 --- a/backend/src/Notifo.Domain/Notifo.Domain.csproj +++ b/backend/src/Notifo.Domain/Notifo.Domain.csproj @@ -19,20 +19,20 @@ - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + diff --git a/backend/src/Notifo.Identity/IdentityServiceExtensions.cs b/backend/src/Notifo.Identity/IdentityServiceExtensions.cs index 82149a5c..97630b81 100644 --- a/backend/src/Notifo.Identity/IdentityServiceExtensions.cs +++ b/backend/src/Notifo.Identity/IdentityServiceExtensions.cs @@ -119,7 +119,7 @@ public static void AddMyMongoDbIdentity(this IServiceCollection services) services.AddOpenIddict() .AddCore(builder => { - builder.UseMongoDb(); + builder.UseMongoDb(); builder.SetDefaultScopeEntity(); diff --git a/backend/src/Notifo.Identity/InMemory/ImmutableApplication.cs b/backend/src/Notifo.Identity/InMemory/ImmutableApplication.cs index f29bca24..9899c20d 100644 --- a/backend/src/Notifo.Identity/InMemory/ImmutableApplication.cs +++ b/backend/src/Notifo.Identity/InMemory/ImmutableApplication.cs @@ -8,6 +8,7 @@ using System.Collections.Immutable; using System.Globalization; using System.Text.Json; +using Microsoft.IdentityModel.Tokens; using OpenIddict.Abstractions; namespace Notifo.Identity.InMemory; @@ -20,11 +21,15 @@ public sealed class ImmutableApplication public string? ClientSecret { get; } + public string? ClientType { get; } + public string? ConsentType { get; } public string? DisplayName { get; } - public string? Type { get; } + public string? ApplicationType { get; } + + public JsonWebKeySet? JsonWebKeySet { get; } public ImmutableDictionary DisplayNames { get; } @@ -38,19 +43,24 @@ public sealed class ImmutableApplication public ImmutableDictionary Properties { get; } + public ImmutableDictionary Settings { get; } + public ImmutableApplication(string id, OpenIddictApplicationDescriptor descriptor) { Id = id; + ApplicationType = descriptor.ApplicationType; ClientId = descriptor.ClientId; ClientSecret = descriptor.ClientSecret; + ClientType = descriptor.ClientType; ConsentType = descriptor.ConsentType; DisplayName = descriptor.DisplayName; DisplayNames = descriptor.DisplayNames.ToImmutableDictionary(); + JsonWebKeySet = descriptor.JsonWebKeySet; Permissions = descriptor.Permissions.ToImmutableArray(); PostLogoutRedirectUris = descriptor.PostLogoutRedirectUris.Select(x => x.ToString()).ToImmutableArray(); Properties = descriptor.Properties.ToImmutableDictionary(); RedirectUris = descriptor.RedirectUris.Select(x => x.ToString()).ToImmutableArray(); Requirements = descriptor.Requirements.ToImmutableArray(); - Type = descriptor.Type; + Settings = descriptor.Settings.ToImmutableDictionary(); } } diff --git a/backend/src/Notifo.Identity/InMemory/InMemoryApplicationStore.cs b/backend/src/Notifo.Identity/InMemory/InMemoryApplicationStore.cs index 89d8895b..236896c9 100644 --- a/backend/src/Notifo.Identity/InMemory/InMemoryApplicationStore.cs +++ b/backend/src/Notifo.Identity/InMemory/InMemoryApplicationStore.cs @@ -9,6 +9,7 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Text.Json; +using Microsoft.IdentityModel.Tokens; using OpenIddict.Abstractions; namespace Notifo.Identity.InMemory; @@ -128,7 +129,7 @@ public virtual async IAsyncEnumerable ListAsync(Func GetClientTypeAsync(ImmutableApplication application, CancellationToken cancellationToken) { - return application.Type.AsValueTask(); + return application.ClientType.AsValueTask(); } public virtual ValueTask GetConsentTypeAsync(ImmutableApplication application, @@ -179,6 +180,24 @@ public virtual ValueTask> GetProperties return application.Properties.AsValueTask(); } + public ValueTask GetApplicationTypeAsync(ImmutableApplication application, + CancellationToken cancellationToken) + { + return application.ApplicationType.AsValueTask(); + } + + public ValueTask GetJsonWebKeySetAsync(ImmutableApplication application, + CancellationToken cancellationToken) + { + return application.JsonWebKeySet.AsValueTask(); + } + + public ValueTask> GetSettingsAsync(ImmutableApplication application, + CancellationToken cancellationToken) + { + return application.Settings.AsValueTask(); + } + public virtual ValueTask CreateAsync(ImmutableApplication application, CancellationToken cancellationToken) { @@ -268,4 +287,22 @@ public virtual ValueTask SetRequirementsAsync(ImmutableApplication application, { throw new NotSupportedException(); } + + public ValueTask SetApplicationTypeAsync(ImmutableApplication application, string? type, + CancellationToken cancellationToken) + { + throw new NotSupportedException(); + } + + public ValueTask SetJsonWebKeySetAsync(ImmutableApplication application, JsonWebKeySet? set, + CancellationToken cancellationToken) + { + throw new NotSupportedException(); + } + + public ValueTask SetSettingsAsync(ImmutableApplication application, ImmutableDictionary settings, + CancellationToken cancellationToken) + { + throw new NotSupportedException(); + } } diff --git a/backend/src/Notifo.Identity/InMemoryConfiguration.cs b/backend/src/Notifo.Identity/InMemoryConfiguration.cs index 98832243..1baf96e0 100644 --- a/backend/src/Notifo.Identity/InMemoryConfiguration.cs +++ b/backend/src/Notifo.Identity/InMemoryConfiguration.cs @@ -103,7 +103,7 @@ public Applications(IUrlGenerator urlGenerator, IOptions DisplayName = "React Frontend Application", ClientId = Constants.FrontendClient, ClientSecret = null, - Type = ClientTypes.Public, + ClientType = ClientTypes.Public, PostLogoutRedirectUris = { new Uri(urlGenerator.BuildUrl("authentication/logout-callback", false)) diff --git a/backend/src/Notifo.Identity/Notifo.Identity.csproj b/backend/src/Notifo.Identity/Notifo.Identity.csproj index c2fe8609..4658440e 100644 --- a/backend/src/Notifo.Identity/Notifo.Identity.csproj +++ b/backend/src/Notifo.Identity/Notifo.Identity.csproj @@ -10,14 +10,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + diff --git a/backend/src/Notifo.Identity/TokenStoreInitializer.cs b/backend/src/Notifo.Identity/TokenStoreInitializer.cs index 5b72caa8..6cf49687 100644 --- a/backend/src/Notifo.Identity/TokenStoreInitializer.cs +++ b/backend/src/Notifo.Identity/TokenStoreInitializer.cs @@ -62,11 +62,11 @@ private async Task SetupIndexAsync( { var database = await scope.ServiceProvider.GetRequiredService().GetDatabaseAsync(ct); - var collection = database.GetCollection>(options.TokensCollectionName); + var collection = database.GetCollection(options.TokensCollectionName); await collection.Indexes.CreateOneAsync( - new CreateIndexModel>( - Builders>.IndexKeys + new CreateIndexModel( + Builders.IndexKeys .Ascending(x => x.ReferenceId)), cancellationToken: ct); } diff --git a/backend/src/Notifo.Infrastructure/Notifo.Infrastructure.csproj b/backend/src/Notifo.Infrastructure/Notifo.Infrastructure.csproj index f3385f45..b374fb8c 100644 --- a/backend/src/Notifo.Infrastructure/Notifo.Infrastructure.csproj +++ b/backend/src/Notifo.Infrastructure/Notifo.Infrastructure.csproj @@ -9,8 +9,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -20,29 +20,29 @@ - + - + - + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/backend/src/Notifo/Areas/Api/OpenApi/CommonProcessor.cs b/backend/src/Notifo/Areas/Api/OpenApi/CommonProcessor.cs index 25e2adac..ab9803db 100644 --- a/backend/src/Notifo/Areas/Api/OpenApi/CommonProcessor.cs +++ b/backend/src/Notifo/Areas/Api/OpenApi/CommonProcessor.cs @@ -17,7 +17,7 @@ public void Process(DocumentProcessorContext context) context.Document.Info.Title = "Notifo API"; context.Document.BasePath = "/api"; context.Document.Info.Version = "1.0.0"; - context.Document.Info.ExtensionData = new Dictionary + context.Document.Info.ExtensionData = new Dictionary { ["x-logo"] = new { diff --git a/backend/src/Notifo/Areas/Api/OpenApi/OpenApiServiceExtensions.cs b/backend/src/Notifo/Areas/Api/OpenApi/OpenApiServiceExtensions.cs index 62989946..7b1b994b 100644 --- a/backend/src/Notifo/Areas/Api/OpenApi/OpenApiServiceExtensions.cs +++ b/backend/src/Notifo/Areas/Api/OpenApi/OpenApiServiceExtensions.cs @@ -33,18 +33,20 @@ public static void AddMyOpenApi(this IServiceCollection services) services.AddOpenApiDocument(settings => { - settings.AllowReferencesWithProperties = true; - settings.DefaultReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull; - settings.DefaultDictionaryValueReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull; - settings.SchemaProcessors.Add(new RequiredSchemaProcessor()); + var schemaSettings = settings.SchemaSettings; - settings.TypeMappers = new List + schemaSettings.AllowReferencesWithProperties = true; + schemaSettings.DefaultReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull; + schemaSettings.DefaultDictionaryValueReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull; + schemaSettings.SchemaProcessors.Add(new RequiredSchemaProcessor()); + + schemaSettings.TypeMappers = new List { CreateStringMap(JsonFormatStrings.DateTime), CreateStringMap() }; - settings.ReflectionService = new ReflectionServices(); + schemaSettings.ReflectionService = new ReflectionServices(); }); } diff --git a/backend/src/Notifo/Areas/Api/OpenApi/ReflectionServices.cs b/backend/src/Notifo/Areas/Api/OpenApi/ReflectionServices.cs index 71b68973..d00c728d 100644 --- a/backend/src/Notifo/Areas/Api/OpenApi/ReflectionServices.cs +++ b/backend/src/Notifo/Areas/Api/OpenApi/ReflectionServices.cs @@ -11,7 +11,7 @@ namespace Notifo.Areas.Api.OpenApi; -public sealed class ReflectionServices : DefaultReflectionService +public sealed class ReflectionServices : SystemTextJsonReflectionService { protected override bool IsArrayType(ContextualType contextualType) { diff --git a/backend/src/Notifo/Notifo.csproj b/backend/src/Notifo/Notifo.csproj index ea4dda4c..a4b4251c 100644 --- a/backend/src/Notifo/Notifo.csproj +++ b/backend/src/Notifo/Notifo.csproj @@ -9,31 +9,31 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + - + - - - - - - - + + + + + + + - + - + diff --git a/backend/tests/Benchmarks/Benchmarks.csproj b/backend/tests/Benchmarks/Benchmarks.csproj index 9cdd9e0a..ae028828 100644 --- a/backend/tests/Benchmarks/Benchmarks.csproj +++ b/backend/tests/Benchmarks/Benchmarks.csproj @@ -10,9 +10,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/backend/tests/Notifo.Domain.Tests/Notifo.Domain.Tests.csproj b/backend/tests/Notifo.Domain.Tests/Notifo.Domain.Tests.csproj index 5bd3e7ef..c285af48 100644 --- a/backend/tests/Notifo.Domain.Tests/Notifo.Domain.Tests.csproj +++ b/backend/tests/Notifo.Domain.Tests/Notifo.Domain.Tests.csproj @@ -11,17 +11,17 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/backend/tests/Notifo.Identity.Tests/Notifo.Identity.Tests.csproj b/backend/tests/Notifo.Identity.Tests/Notifo.Identity.Tests.csproj index 75311a7d..bd49d31b 100644 --- a/backend/tests/Notifo.Identity.Tests/Notifo.Identity.Tests.csproj +++ b/backend/tests/Notifo.Identity.Tests/Notifo.Identity.Tests.csproj @@ -10,14 +10,14 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/backend/tests/Notifo.Infrastructure.Tests/Notifo.Infrastructure.Tests.csproj b/backend/tests/Notifo.Infrastructure.Tests/Notifo.Infrastructure.Tests.csproj index b984c572..cfc4698b 100644 --- a/backend/tests/Notifo.Infrastructure.Tests/Notifo.Infrastructure.Tests.csproj +++ b/backend/tests/Notifo.Infrastructure.Tests/Notifo.Infrastructure.Tests.csproj @@ -10,15 +10,15 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/frontend/src/app/service/service.ts b/frontend/src/app/service/service.ts index 2192502a..953a8bca 100644 --- a/frontend/src/app/service/service.ts +++ b/frontend/src/app/service/service.ts @@ -1,6 +1,6 @@ //---------------------- // -// Generated using the NSwag toolchain v13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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) // //---------------------- @@ -15,7 +15,7 @@ export class UserClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -423,7 +423,7 @@ export class UsersClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -1125,7 +1125,7 @@ export class TopicsClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -1317,7 +1317,7 @@ export class TemplatesClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -1500,7 +1500,7 @@ export class SystemUsersClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -1910,7 +1910,7 @@ export class PingClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -2044,7 +2044,7 @@ export class NotificationsClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -2428,7 +2428,7 @@ export class MobilePushClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -2583,7 +2583,7 @@ export class MediaClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -3191,7 +3191,7 @@ export class LogsClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -3277,7 +3277,7 @@ export class EventsClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -3469,7 +3469,7 @@ export class DiagnosticsClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -3572,7 +3572,7 @@ export class ConfigsClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -3669,7 +3669,7 @@ export class EmailTemplatesClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -4347,7 +4347,7 @@ export class MessagingTemplatesClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -4861,7 +4861,7 @@ export class SmsTemplatesClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -5375,7 +5375,7 @@ export class AppsClient { constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { this.http = http ? http : window as any; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://localhost:5002"; + this.baseUrl = baseUrl ?? "https://localhost:5002"; } /** @@ -6284,7 +6284,7 @@ export interface NotificationFormattingDto { /** The optional body with one entry per language. */ body?: LocalizedText | undefined; /** The optional confirm link with one entry per language. */ - confirmlink?: LocalizedText | undefined; + confirmLink?: LocalizedText | undefined; /** The optional confirm text with one entry per language. */ confirmText?: LocalizedText | undefined; /** The optional small image with one entry per language. */ diff --git a/tools/sdk/CodeGenerator/Client.Class.ProcessResponse.liquid b/tools/sdk/CodeGenerator/Client.Class.ProcessResponse.liquid deleted file mode 100644 index 045bb3dc..00000000 --- a/tools/sdk/CodeGenerator/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/tools/sdk/CodeGenerator/Client.Class.liquid b/tools/sdk/CodeGenerator/Client.Class.liquid index 52f56913..89760102 100644 --- a/tools/sdk/CodeGenerator/Client.Class.liquid +++ b/tools/sdk/CodeGenerator/Client.Class.liquid @@ -3,29 +3,71 @@ {{ ClientClassAccessModifier }} partial class {{ Class }} {% if HasBaseType %}: {% endif %}{% if HasBaseClass %}{{ BaseClass }}{% if GenerateClientInterfaces %}, {% endif %}{% endif %}{% if GenerateClientInterfaces %}I{{ Class }}{% endif %} { {% 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 -%} private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; +{% if InjectHttpClient -%} + private {{ HttpClientType }} _httpClient; +{% endif -%} {% 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 }}(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; -{% 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 = {{ JsonSerializerParameterCode }}; {% if UseSystemTextJson == false and SerializeTypeInformation -%} @@ -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,33 +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 %}"); -{% 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_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { {% if UseHttpRequestMessageCreationMethod -%} @@ -152,12 +174,6 @@ using (var request_ = new System.Net.Http.HttpRequestMessage()) {% endif -%} { -{% for parameter in operation.Parameters %} -{% if parameter.VariableName == "app" %} - request_.Headers.TryAddWithoutValidation(SpecialHeaders.AppName, app); -{% endif -%} -{% endfor -%} - {% for parameter in operation.HeaderParameters %} {% if parameter.IsRequired -%} if ({{ parameter.VariableName }} == null) @@ -181,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_; @@ -244,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 -%} @@ -262,6 +278,67 @@ 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 -%} +{% for parameter in operation.PathParameters -%} +{% if parameter.Name == pathParameterParts[0] -%} +{% if parameter.IsOptional -%} +{% assign pathParameterFound = false -%} + 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 -%} @@ -282,7 +359,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) diff --git a/tools/sdk/CodeGenerator/CodeGenerator.csproj b/tools/sdk/CodeGenerator/CodeGenerator.csproj index 78b50b45..515ecedc 100644 --- a/tools/sdk/CodeGenerator/CodeGenerator.csproj +++ b/tools/sdk/CodeGenerator/CodeGenerator.csproj @@ -7,12 +7,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + @@ -25,9 +25,6 @@ Always - - Always - diff --git a/tools/sdk/CodeGenerator/Program.cs b/tools/sdk/CodeGenerator/Program.cs index 60c801ea..f1cb74b5 100644 --- a/tools/sdk/CodeGenerator/Program.cs +++ b/tools/sdk/CodeGenerator/Program.cs @@ -8,6 +8,7 @@ using System; using System.IO; using NJsonSchema; +using NJsonSchema.CodeGeneration; using NJsonSchema.CodeGeneration.CSharp; using NJsonSchema.CodeGeneration.TypeScript; using NSwag; @@ -73,11 +74,13 @@ private static void GenerateTypescript(OpenApiDocument document) File.WriteAllText(@"..\..\..\..\..\..\frontend\src\app\service\service.ts", code); } - public sealed class PropertyNameGenerator : CSharpPropertyNameGenerator + public sealed class PropertyNameGenerator : IPropertyNameGenerator { - public override string Generate(JsonSchemaProperty property) + private readonly CSharpPropertyNameGenerator inner = new CSharpPropertyNameGenerator(); + + public string Generate(JsonSchemaProperty property) { - var result = base.Generate(property); + var result = inner.Generate(property); result = result.Replace("!", string.Empty, StringComparison.Ordinal); diff --git a/tools/sdk/Notifo.SDK.Tests/Notifo.SDK.Tests.csproj b/tools/sdk/Notifo.SDK.Tests/Notifo.SDK.Tests.csproj index 635257d3..84d8d3e7 100644 --- a/tools/sdk/Notifo.SDK.Tests/Notifo.SDK.Tests.csproj +++ b/tools/sdk/Notifo.SDK.Tests/Notifo.SDK.Tests.csproj @@ -10,8 +10,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/tools/sdk/Notifo.SDK/Generated.cs b/tools/sdk/Notifo.SDK/Generated.cs index 0b5016ff..26d36bb5 100644 --- a/tools/sdk/Notifo.SDK/Generated.cs +++ b/tools/sdk/Notifo.SDK/Generated.cs @@ -1,23 +1,26 @@ //---------------------- // -// Generated using the NSwag toolchain v13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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) // //---------------------- #pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." #pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." #pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' +#pragma warning disable 612 // Disable "CS0612 '...' is obsolete" #pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... #pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." #pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" #pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" #pragma warning disable 8603 // Disable "CS8603 Possible null reference return" +#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" +#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type" namespace Notifo.SDK { using System = global::System; - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 IUserClient { @@ -105,19 +108,20 @@ public partial interface IUserClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UserClient : IUserClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public UserClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -126,7 +130,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -140,18 +144,20 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetUserAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me"); - var client_ = _httpClientProvider.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/me" + urlBuilder_.Append("api/me"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -163,7 +169,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) @@ -223,15 +231,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me"); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -239,6 +244,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/me" + urlBuilder_.Append("api/me"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -250,7 +260,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) @@ -316,18 +328,20 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetAdminUserAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/admin"); - var client_ = _httpClientProvider.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/me/admin" + urlBuilder_.Append("api/me/admin"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -339,7 +353,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) @@ -396,23 +412,26 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetTopicsAsync(string language = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/topics?"); - if (language != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("language") + "=").Append(System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _httpClientProvider.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/me/topics" + urlBuilder_.Append("api/me/topics"); + urlBuilder_.Append('?'); + if (language != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("language")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -424,7 +443,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) @@ -484,36 +505,38 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetMySubscriptionsAsync(string topics = null, string query = null, int? take = null, int? skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/subscriptions?"); + var client_ = _httpClientProvider.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/me/subscriptions" + urlBuilder_.Append("api/me/subscriptions"); + urlBuilder_.Append('?'); if (topics != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("Topics") + "=").Append(System.Uri.EscapeDataString(ConvertToString(topics, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("Topics")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(topics, System.Globalization.CultureInfo.InvariantCulture))).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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -525,7 +548,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) @@ -588,21 +613,23 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/subscriptions"); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/me/subscriptions" + urlBuilder_.Append("api/me/subscriptions"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -614,7 +641,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) @@ -682,19 +711,21 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (topic == null) throw new System.ArgumentNullException("topic"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/subscriptions/{topic}"); - urlBuilder_.Replace("{topic}", System.Uri.EscapeDataString(ConvertToString(topic, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/me/subscriptions/{topic}" + urlBuilder_.Append("api/me/subscriptions/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(topic, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -706,7 +737,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) @@ -775,19 +808,21 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (prefix == null) throw new System.ArgumentNullException("prefix"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/subscriptions/{prefix}"); - urlBuilder_.Replace("{prefix}", System.Uri.EscapeDataString(ConvertToString(prefix, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - 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/me/subscriptions/{prefix}" + urlBuilder_.Append("api/me/subscriptions/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(prefix, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -799,7 +834,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) @@ -944,10 +981,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); @@ -955,7 +1001,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 { @@ -1084,19 +1130,20 @@ public partial interface IUsersClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public UsersClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -1105,7 +1152,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -1127,38 +1174,40 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/users?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/users" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/users"); + 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 (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('&'); } 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 (withDetails != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("withDetails") + "=").Append(System.Uri.EscapeDataString(ConvertToString(withDetails, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("withDetails")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(withDetails, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -1170,7 +1219,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) @@ -1240,16 +1291,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/users"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -1257,6 +1304,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/{appId}/users" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/users"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1268,7 +1322,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) @@ -1349,25 +1405,29 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/users/{id}?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - if (withDetails != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("withDetails") + "=").Append(System.Uri.EscapeDataString(ConvertToString(withDetails, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _httpClientProvider.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/{appId}/users/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('?'); + if (withDetails != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("withDetails")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(withDetails, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); + } + urlBuilder_.Length--; + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1379,7 +1439,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) @@ -1449,19 +1511,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/users/{id}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/users/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1473,7 +1538,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) @@ -1551,35 +1618,38 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/users/{id}/subscriptions?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/users/{id}/subscriptions" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/subscriptions"); + 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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -1591,7 +1661,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) @@ -1665,23 +1737,27 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/users/{id}/subscriptions"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{appId}/users/{id}/subscriptions" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/subscriptions"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1693,7 +1769,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) @@ -1772,20 +1850,24 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (prefix == null) throw new System.ArgumentNullException("prefix"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/users/{id}/subscriptions/{prefix}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{prefix}", System.Uri.EscapeDataString(ConvertToString(prefix, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/users/{id}/subscriptions/{prefix}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/subscriptions/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(prefix, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1797,7 +1879,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) @@ -1876,23 +1960,27 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/users/{id}/allowed-topics"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{appId}/users/{id}/allowed-topics" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/allowed-topics"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -1904,7 +1992,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) @@ -1983,20 +2073,24 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (prefix == null) throw new System.ArgumentNullException("prefix"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/users/{id}/allowed-topics/{prefix}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{prefix}", System.Uri.EscapeDataString(ConvertToString(prefix, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/users/{id}/allowed-topics/{prefix}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/allowed-topics/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(prefix, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2008,7 +2102,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) @@ -2087,20 +2183,24 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (token == null) throw new System.ArgumentNullException("token"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/users/{id}/mobilepush/{token}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{token}", System.Uri.EscapeDataString(ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/users/{id}/mobilepush/{token}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/mobilepush/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2112,7 +2212,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) @@ -2191,20 +2293,24 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (endpoint == null) throw new System.ArgumentNullException("endpoint"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/users/{id}/webpush/{endpoint}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{endpoint}", System.Uri.EscapeDataString(ConvertToString(endpoint, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/users/{id}/webpush/{endpoint}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/webpush/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(endpoint, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2216,7 +2322,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) @@ -2367,10 +2475,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); @@ -2378,7 +2495,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ITopicsClient { @@ -2417,19 +2534,20 @@ public partial interface ITopicsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 TopicsClient : ITopicsClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public TopicsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -2438,7 +2556,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -2460,38 +2578,40 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/topics?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/topics" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/topics"); + urlBuilder_.Append('?'); if (scope != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("Scope") + "=").Append(System.Uri.EscapeDataString(ConvertToString(scope, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("Scope")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(scope, System.Globalization.CultureInfo.InvariantCulture))).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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -2503,7 +2623,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) @@ -2573,16 +2695,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/topics"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -2590,6 +2708,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/{appId}/topics" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/topics"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2601,7 +2726,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) @@ -2675,19 +2802,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (path == null) throw new System.ArgumentNullException("path"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/topics/{path}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{path}", System.Uri.EscapeDataString(ConvertToString(path, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/topics/{path}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/topics/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(path, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -2699,7 +2829,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) @@ -2844,10 +2976,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); @@ -2855,7 +2996,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 { @@ -2893,19 +3034,20 @@ public partial interface ITemplatesClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public TemplatesClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -2914,7 +3056,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -2935,33 +3077,36 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/templates?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/templates" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/templates"); + 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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -2973,7 +3118,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) @@ -3037,16 +3184,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/templates"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -3054,6 +3197,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/{appId}/templates" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/templates"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3065,7 +3215,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) @@ -3139,19 +3291,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (code == null) throw new System.ArgumentNullException("code"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/templates/{code}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/templates/{code}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3163,7 +3318,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) @@ -3308,10 +3465,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); @@ -3319,7 +3485,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ISystemUsersClient { @@ -3391,19 +3557,20 @@ public partial interface ISystemUsersClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 SystemUsersClient : ISystemUsersClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public SystemUsersClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -3412,7 +3579,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -3429,31 +3596,34 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetUsersAsync(string query = null, int? take = null, int? skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/system-users?"); + var client_ = _httpClientProvider.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/system-users" + urlBuilder_.Append("api/system-users"); + 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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -3465,7 +3635,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) @@ -3525,15 +3697,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/system-users"); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -3541,6 +3710,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/system-users" + urlBuilder_.Append("api/system-users"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3552,7 +3726,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) @@ -3622,19 +3798,21 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/system-users/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/system-users/{id}" + urlBuilder_.Append("api/system-users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3646,7 +3824,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) @@ -3716,16 +3896,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/system-users/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -3733,6 +3909,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/system-users/{id}" + urlBuilder_.Append("api/system-users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3744,7 +3926,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) @@ -3824,18 +4008,20 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/system-users/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/system-users/{id}" + urlBuilder_.Append("api/system-users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3847,7 +4033,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) @@ -3922,20 +4110,23 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/system-users/{id}/lock"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); 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/system-users/{id}/lock" + urlBuilder_.Append("api/system-users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/lock"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -3947,7 +4138,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) @@ -4027,20 +4220,23 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/system-users/{id}/unlock"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); 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/system-users/{id}/unlock" + urlBuilder_.Append("api/system-users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/unlock"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -4052,7 +4248,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) @@ -4212,10 +4410,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); @@ -4223,7 +4430,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 { @@ -4262,19 +4469,20 @@ public partial interface IPingClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public PingClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -4283,7 +4491,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -4301,17 +4509,19 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() [System.Obsolete] public virtual async System.Threading.Tasks.Task GetOldPingAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("ping"); - var client_ = _httpClientProvider.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: "ping" + urlBuilder_.Append("ping"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -4323,7 +4533,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) @@ -4377,17 +4589,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"); - var client_ = _httpClientProvider.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(); @@ -4399,7 +4613,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) @@ -4452,18 +4668,20 @@ 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"); - var client_ = _httpClientProvider.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/info" + urlBuilder_.Append("api/info"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -4475,7 +4693,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) @@ -4615,10 +4835,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); @@ -4626,7 +4855,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 INotificationsClient { @@ -4707,19 +4936,20 @@ public partial interface INotificationsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 NotificationsClient : INotificationsClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public NotificationsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -4728,7 +4958,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -4752,46 +4982,48 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/notifications?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/notifications" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/notifications"); + urlBuilder_.Append('?'); if (channels != null) { - foreach (var item_ in channels) { urlBuilder_.Append(System.Uri.EscapeDataString("Channels") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } + foreach (var item_ in channels) { urlBuilder_.Append(System.Uri.EscapeDataString("Channels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } } if (channel != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("Channel") + "=").Append(System.Uri.EscapeDataString(ConvertToString(channel, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("Channel")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(channel, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (correlationId != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("CorrelationId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(correlationId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("CorrelationId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(correlationId, System.Globalization.CultureInfo.InvariantCulture))).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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -4803,7 +5035,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) @@ -4879,47 +5113,50 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/users/{id}/notifications?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/users/{id}/notifications" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/users/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/notifications"); + urlBuilder_.Append('?'); if (channels != null) { - foreach (var item_ in channels) { urlBuilder_.Append(System.Uri.EscapeDataString("Channels") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } + foreach (var item_ in channels) { urlBuilder_.Append(System.Uri.EscapeDataString("Channels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } } if (channel != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("Channel") + "=").Append(System.Uri.EscapeDataString(ConvertToString(channel, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("Channel")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(channel, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (correlationId != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("CorrelationId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(correlationId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("CorrelationId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(correlationId, System.Globalization.CultureInfo.InvariantCulture))).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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -4931,7 +5168,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) @@ -4999,44 +5238,46 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetMyNotificationsAsync(System.Collections.Generic.IEnumerable channels = null, string channel = null, string correlationId = null, string query = null, int? take = null, int? skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/notifications?"); + var client_ = _httpClientProvider.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/me/notifications" + urlBuilder_.Append("api/me/notifications"); + urlBuilder_.Append('?'); if (channels != null) { - foreach (var item_ in channels) { urlBuilder_.Append(System.Uri.EscapeDataString("Channels") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } + foreach (var item_ in channels) { urlBuilder_.Append(System.Uri.EscapeDataString("Channels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } } if (channel != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("Channel") + "=").Append(System.Uri.EscapeDataString(ConvertToString(channel, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("Channel")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(channel, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (correlationId != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("CorrelationId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(correlationId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("CorrelationId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(correlationId, System.Globalization.CultureInfo.InvariantCulture))).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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -5048,7 +5289,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) @@ -5105,23 +5348,26 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetMyArchiveAsync(string channel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/notifications/archive?"); - if (channel != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("channel") + "=").Append(System.Uri.EscapeDataString(ConvertToString(channel, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - var client_ = _httpClientProvider.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/me/notifications/archive" + urlBuilder_.Append("api/me/notifications/archive"); + 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(); @@ -5133,7 +5379,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) @@ -5193,36 +5441,38 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetMyDeviceNotificationsAsync(string deviceIdentifier = null, System.DateTimeOffset? after = null, DeviceNotificationsQueryScope? scope = null, int? take = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/notifications/device?"); + var client_ = _httpClientProvider.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/me/notifications/device" + urlBuilder_.Append("api/me/notifications/device"); + urlBuilder_.Append('?'); if (deviceIdentifier != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("DeviceIdentifier") + "=").Append(System.Uri.EscapeDataString(ConvertToString(deviceIdentifier, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("DeviceIdentifier")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(deviceIdentifier, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (after != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("After") + "=").Append(System.Uri.EscapeDataString(after.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("After")).Append('=').Append(System.Uri.EscapeDataString(after.Value.ToString("s", 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_.Append(System.Uri.EscapeDataString("Scope")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(scope, 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_ = _httpClientProvider.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(); @@ -5234,7 +5484,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) @@ -5294,21 +5546,23 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/notifications/handled"); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/me/notifications/handled" + urlBuilder_.Append("api/me/notifications/handled"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5320,7 +5574,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) @@ -5465,10 +5721,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); @@ -5476,7 +5741,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 IMobilePushClient { @@ -5508,19 +5773,20 @@ public partial interface IMobilePushClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 MobilePushClient : IMobilePushClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public MobilePushClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -5529,7 +5795,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -5543,18 +5809,20 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetMyTokenAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/mobilepush"); - var client_ = _httpClientProvider.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/me/mobilepush" + urlBuilder_.Append("api/me/mobilepush"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5566,7 +5834,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) @@ -5626,21 +5896,23 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/mobilepush"); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/me/mobilepush" + urlBuilder_.Append("api/me/mobilepush"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5652,7 +5924,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) @@ -5717,18 +5991,20 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (token == null) throw new System.ArgumentNullException("token"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/mobilepush/{token}"); - urlBuilder_.Replace("{token}", System.Uri.EscapeDataString(ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/me/mobilepush/{token}" + urlBuilder_.Append("api/me/mobilepush/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(token, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -5740,7 +6016,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) @@ -5885,10 +6163,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); @@ -5896,7 +6183,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 IMediaClient { @@ -6020,19 +6307,20 @@ public partial interface IMediaClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 MediaClient : IMediaClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public MediaClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -6041,7 +6329,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -6062,33 +6350,36 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/media?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/media" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/media"); + 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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -6100,7 +6391,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) @@ -6166,16 +6459,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/media"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var boundary_ = System.Guid.NewGuid().ToString(); var content_ = new System.Net.Http.MultipartFormDataContent(boundary_); content_.Headers.Remove("Content-Type"); @@ -6193,6 +6482,13 @@ 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/{appId}/media" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/media"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -6204,7 +6500,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) @@ -6291,73 +6589,73 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (fileName == null) throw new System.ArgumentNullException("fileName"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/media/{fileName}?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{fileName}", System.Uri.EscapeDataString(ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/apps/{appId}/media/{fileName}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/media/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.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 (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 (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 (preset != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("preset") + "=").Append(System.Uri.EscapeDataString(ConvertToString(preset, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("preset")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(preset, 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 (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 (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 (emptyOnFailure != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("emptyOnFailure") + "=").Append(System.Uri.EscapeDataString(ConvertToString(emptyOnFailure, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("emptyOnFailure")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(emptyOnFailure, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -6369,7 +6667,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) @@ -6383,7 +6683,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { 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 + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else @@ -6437,19 +6737,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (fileName == null) throw new System.ArgumentNullException("fileName"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/media/{fileName}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{fileName}", System.Uri.EscapeDataString(ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/media/{fileName}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/media/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -6461,7 +6764,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) @@ -6548,73 +6853,73 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (fileName == null) throw new System.ArgumentNullException("fileName"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/asset/{appId}/{fileName}?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{fileName}", System.Uri.EscapeDataString(ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/asset/{appId}/{fileName}" + urlBuilder_.Append("api/asset/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.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 (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 (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 (preset != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("preset") + "=").Append(System.Uri.EscapeDataString(ConvertToString(preset, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("preset")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(preset, 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 (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 (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 (emptyOnFailure != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("emptyOnFailure") + "=").Append(System.Uri.EscapeDataString(ConvertToString(emptyOnFailure, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("emptyOnFailure")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(emptyOnFailure, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -6626,7 +6931,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) @@ -6640,7 +6947,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { 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 + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else @@ -6706,73 +7013,73 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (fileName == null) throw new System.ArgumentNullException("fileName"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/assets/{appId}/{fileName}?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{fileName}", System.Uri.EscapeDataString(ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/{fileName}" + urlBuilder_.Append("api/assets/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.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 (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 (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 (preset != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("preset") + "=").Append(System.Uri.EscapeDataString(ConvertToString(preset, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("preset")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(preset, 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 (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 (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 (emptyOnFailure != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("emptyOnFailure") + "=").Append(System.Uri.EscapeDataString(ConvertToString(emptyOnFailure, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("emptyOnFailure")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(emptyOnFailure, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -6784,7 +7091,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) @@ -6798,7 +7107,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { 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 + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else @@ -6857,75 +7166,74 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task ProxyImageAsync(string url = null, long? cache = null, int? download = null, string bg = null, int? width = null, int? height = null, int? quality = null, string preset = null, ResizeMode? mode = null, float? focusX = null, float? focusY = null, bool? force = null, bool? emptyOnFailure = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/assets/proxy?"); + var client_ = _httpClientProvider.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/proxy" + urlBuilder_.Append("api/assets/proxy"); + urlBuilder_.Append('?'); if (url != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("url") + "=").Append(System.Uri.EscapeDataString(ConvertToString(url, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("url")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(url, 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 (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 (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 (preset != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("preset") + "=").Append(System.Uri.EscapeDataString(ConvertToString(preset, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("preset")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(preset, 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 (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 (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 (emptyOnFailure != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("emptyOnFailure") + "=").Append(System.Uri.EscapeDataString(ConvertToString(emptyOnFailure, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("emptyOnFailure")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(emptyOnFailure, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -6937,7 +7245,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) @@ -6951,7 +7261,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { 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 + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else @@ -7081,10 +7391,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); @@ -7092,7 +7411,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ILogsClient { @@ -7113,19 +7432,20 @@ public partial interface ILogsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 LogsClient : ILogsClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public LogsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -7134,7 +7454,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -7158,46 +7478,48 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/logs?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/logs" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/logs"); + urlBuilder_.Append('?'); if (systems != null) { - foreach (var item_ in systems) { urlBuilder_.Append(System.Uri.EscapeDataString("Systems") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } + foreach (var item_ in systems) { urlBuilder_.Append(System.Uri.EscapeDataString("Systems")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } } if (userId != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("UserId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("UserId")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(userId, System.Globalization.CultureInfo.InvariantCulture))).Append('&'); } if (eventCode != null) { - urlBuilder_.Append(System.Uri.EscapeDataString("EventCode") + "=").Append(System.Uri.EscapeDataString(ConvertToString(eventCode, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Append(System.Uri.EscapeDataString("EventCode")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(eventCode, System.Globalization.CultureInfo.InvariantCulture))).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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -7209,7 +7531,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) @@ -7355,10 +7679,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); @@ -7366,7 +7699,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 IEventsClient { @@ -7404,19 +7737,20 @@ public partial interface IEventsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 EventsClient : IEventsClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public EventsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -7425,7 +7759,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -7447,38 +7781,40 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/events?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/events" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/events"); + urlBuilder_.Append('?'); if (channels != null) { - foreach (var item_ in channels) { urlBuilder_.Append(System.Uri.EscapeDataString("Channels") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } + foreach (var item_ in channels) { urlBuilder_.Append(System.Uri.EscapeDataString("Channels")).Append('=').Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -7490,7 +7826,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) @@ -7560,22 +7898,25 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/events"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{appId}/events" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/events"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -7587,7 +7928,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) @@ -7658,21 +8001,23 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/me/events"); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("POST"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/me/events" + urlBuilder_.Append("api/me/events"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -7684,7 +8029,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) @@ -7835,10 +8182,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); @@ -7846,7 +8202,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 { @@ -7868,19 +8224,20 @@ public partial interface IDiagnosticsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public DiagnosticsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -7889,7 +8246,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -7903,17 +8260,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"); - var client_ = _httpClientProvider.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(); @@ -7925,7 +8284,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) @@ -7986,17 +8347,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"); - var client_ = _httpClientProvider.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(); @@ -8008,7 +8371,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) @@ -8153,10 +8518,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); @@ -8164,7 +8538,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 IConfigsClient { @@ -8186,19 +8560,20 @@ public partial interface IConfigsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ConfigsClient : IConfigsClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public ConfigsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -8207,7 +8582,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -8221,18 +8596,20 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task> GetTimezonesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/timezones"); - var client_ = _httpClientProvider.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/timezones" + urlBuilder_.Append("api/timezones"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8244,7 +8621,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) @@ -8300,18 +8679,20 @@ 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"); - var client_ = _httpClientProvider.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/languages" + urlBuilder_.Append("api/languages"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8323,7 +8704,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) @@ -8463,10 +8846,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); @@ -8474,7 +8866,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 IEmailTemplatesClient { @@ -8591,19 +8983,20 @@ public partial interface IEmailTemplatesClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 EmailTemplatesClient : IEmailTemplatesClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public EmailTemplatesClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -8612,7 +9005,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -8625,18 +9018,20 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// A server side error occurred. public virtual async System.Threading.Tasks.Task GetSchemaAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/mjml/schema"); - var client_ = _httpClientProvider.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/mjml/schema" + urlBuilder_.Append("api/mjml/schema"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8648,7 +9043,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) @@ -8712,20 +9109,24 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/email-templates/{id}/preview"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/apps/{appId}/email-templates/{id}/preview" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/email-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/preview"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8737,7 +9138,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) @@ -8751,7 +9154,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { 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 + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } else @@ -8805,16 +9208,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/email-templates/render"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -8822,6 +9221,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/{appId}/email-templates/render" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/email-templates/render"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -8833,7 +9239,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) @@ -8912,33 +9320,36 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/email-templates?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/email-templates" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/email-templates"); + 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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -8950,7 +9361,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) @@ -9020,16 +9433,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/email-templates"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -9037,6 +9446,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/{appId}/email-templates" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/email-templates"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9048,7 +9464,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) @@ -9128,20 +9546,23 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/email-templates/{id}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/email-templates/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/email-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9153,7 +9574,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) @@ -9227,17 +9650,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/email-templates/{code}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -9245,6 +9663,14 @@ 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/{appId}/email-templates/{code}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/email-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9256,7 +9682,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) @@ -9339,17 +9767,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/email-templates/{code}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -9357,6 +9780,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/{appId}/email-templates/{code}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/email-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9368,7 +9799,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) @@ -9448,19 +9881,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (code == null) throw new System.ArgumentNullException("code"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/email-templates/{code}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/email-templates/{code}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/email-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9472,7 +9908,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) @@ -9554,19 +9992,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/email-templates/{code}/{language}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{language}", System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -9574,6 +10005,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/{appId}/email-templates/{code}/{language}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/email-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9585,7 +10026,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) @@ -9668,21 +10111,25 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (language == null) throw new System.ArgumentNullException("language"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/email-templates/{code}/{language}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{language}", System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - 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/{appId}/email-templates/{code}/{language}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/email-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -9694,7 +10141,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) @@ -9850,10 +10299,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); @@ -9861,7 +10319,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 IMessagingTemplatesClient { @@ -9951,19 +10409,20 @@ public partial interface IMessagingTemplatesClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 MessagingTemplatesClient : IMessagingTemplatesClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public MessagingTemplatesClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -9972,7 +10431,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -9993,33 +10452,36 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/messaging-templates?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/messaging-templates" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/messaging-templates"); + 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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -10031,7 +10493,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) @@ -10101,16 +10565,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/messaging-templates"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -10118,6 +10578,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/{appId}/messaging-templates" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/messaging-templates"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10129,7 +10596,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) @@ -10209,20 +10678,23 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/messaging-templates/{id}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/messaging-templates/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/messaging-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10234,7 +10706,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) @@ -10308,17 +10782,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/messaging-templates/{code}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -10326,6 +10795,14 @@ 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/{appId}/messaging-templates/{code}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/messaging-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10337,7 +10814,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) @@ -10420,17 +10899,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/messaging-templates/{code}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -10438,6 +10912,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/{appId}/messaging-templates/{code}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/messaging-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10449,7 +10931,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) @@ -10529,19 +11013,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (code == null) throw new System.ArgumentNullException("code"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/messaging-templates/{code}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/messaging-templates/{code}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/messaging-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10553,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) @@ -10635,19 +11124,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/messaging-templates/{code}/{language}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{language}", System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -10655,6 +11137,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/{appId}/messaging-templates/{code}/{language}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/messaging-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10666,7 +11158,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) @@ -10749,21 +11243,25 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (language == null) throw new System.ArgumentNullException("language"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/messaging-templates/{code}/{language}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{language}", System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - 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/{appId}/messaging-templates/{code}/{language}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/messaging-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -10775,7 +11273,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) @@ -10931,10 +11431,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); @@ -10942,7 +11451,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ISmsTemplatesClient { @@ -11032,19 +11541,20 @@ public partial interface ISmsTemplatesClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 SmsTemplatesClient : ISmsTemplatesClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public SmsTemplatesClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -11053,7 +11563,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -11074,33 +11584,36 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/sms-templates?"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + var client_ = _httpClientProvider.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/{appId}/sms-templates" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/sms-templates"); + 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 (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('&'); } 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('&'); } urlBuilder_.Length--; - var client_ = _httpClientProvider.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(); @@ -11112,7 +11625,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) @@ -11182,16 +11697,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/sms-templates"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -11199,6 +11710,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/{appId}/sms-templates" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/sms-templates"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -11210,7 +11728,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) @@ -11290,20 +11810,23 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/sms-templates/{id}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/sms-templates/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/sms-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -11315,7 +11838,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) @@ -11389,17 +11914,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/sms-templates/{code}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -11407,6 +11927,14 @@ 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/{appId}/sms-templates/{code}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/sms-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -11418,7 +11946,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) @@ -11501,17 +12031,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/sms-templates/{code}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -11519,6 +12044,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/{appId}/sms-templates/{code}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/sms-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -11530,7 +12063,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) @@ -11610,19 +12145,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (code == null) throw new System.ArgumentNullException("code"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/sms-templates/{code}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/sms-templates/{code}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/sms-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -11634,7 +12172,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) @@ -11716,19 +12256,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/sms-templates/{code}/{language}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{language}", System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -11736,6 +12269,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/{appId}/sms-templates/{code}/{language}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/sms-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -11747,7 +12290,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) @@ -11830,21 +12375,25 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (language == null) throw new System.ArgumentNullException("language"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/sms-templates/{code}/{language}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{code}", System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{language}", System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - 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/{appId}/sms-templates/{code}/{language}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/sms-templates/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(code, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append('/'); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(language, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -11856,7 +12405,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) @@ -12012,10 +12563,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); @@ -12023,7 +12583,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 { @@ -12125,19 +12685,20 @@ public partial interface IAppsClient } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Lazy _settings; + private System.Net.Http.HttpClient _httpClient; + private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public AppsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _settings = new System.Lazy(CreateSerializerSettings); + _httpClient = httpClient; } - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() + private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() { var settings = new Newtonsoft.Json.JsonSerializerSettings(); UpdateJsonSerializerSettings(settings); @@ -12146,7 +12707,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() 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); @@ -12160,18 +12721,20 @@ 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"); - var client_ = _httpClientProvider.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" + urlBuilder_.Append("api/apps"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12183,7 +12746,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) @@ -12243,15 +12808,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps"); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -12259,6 +12821,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(); @@ -12270,7 +12837,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) @@ -12340,19 +12909,21 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12364,7 +12935,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) @@ -12434,16 +13007,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -12451,6 +13020,12 @@ 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/{appId}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12462,7 +13037,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) @@ -12542,16 +13119,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/contributors"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -12559,6 +13132,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/{appId}/contributors" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/contributors"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12570,7 +13150,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) @@ -12650,21 +13232,24 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (contributorId == null) throw new System.ArgumentNullException("contributorId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/contributors/{contributorId}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{contributorId}", System.Uri.EscapeDataString(ConvertToString(contributorId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); 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/{appId}/contributors/{contributorId}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/contributors/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(contributorId, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12676,7 +13261,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) @@ -12752,19 +13339,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (appId == null) throw new System.ArgumentNullException("appId"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/integrations"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/integrations" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/integrations"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12776,7 +13366,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) @@ -12846,16 +13438,12 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/integration"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); @@ -12863,6 +13451,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/{appId}/integration" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/integration"); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12874,7 +13469,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) @@ -12958,23 +13555,26 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (request == null) throw new System.ArgumentNullException("request"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/integrations/{id}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.Get(); + var disposeClient_ = false; try { using (var request_ = new System.Net.Http.HttpRequestMessage()) { - var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value); var content_ = new System.Net.Http.StringContent(json_); content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); request_.Content = content_; request_.Method = new System.Net.Http.HttpMethod("PUT"); + var urlBuilder_ = new System.Text.StringBuilder(); + + // Operation Path: "api/apps/{appId}/integrations/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/integrations/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -12986,7 +13586,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) @@ -13061,19 +13663,22 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (id == null) throw new System.ArgumentNullException("id"); - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/apps/{appId}/integrations/{id}"); - urlBuilder_.Replace("{appId}", System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - var client_ = _httpClientProvider.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/{appId}/integrations/{id}" + urlBuilder_.Append("api/apps/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(appId, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append("/integrations/"); + urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + PrepareRequest(client_, request_, urlBuilder_); var url_ = urlBuilder_.ToString(); @@ -13085,7 +13690,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) @@ -13236,10 +13843,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); @@ -13247,7 +13863,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu } } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ProfileDto { /// @@ -13312,7 +13928,7 @@ public partial class ProfileDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ChannelSettingDto { /// @@ -13365,7 +13981,7 @@ public partial class ChannelSettingDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ChannelSend { @@ -13383,7 +13999,7 @@ public enum ChannelSend } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ChannelCondition { @@ -13401,7 +14017,7 @@ public enum ChannelCondition } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ChannelRequired { @@ -13416,13 +14032,13 @@ public enum ChannelRequired } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 NotificationProperties : System.Collections.Generic.Dictionary { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 { /// @@ -13463,7 +14079,7 @@ public partial class ErrorDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 AdminProfileDto { /// @@ -13474,7 +14090,7 @@ public partial class AdminProfileDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 { /// @@ -13515,7 +14131,7 @@ public partial class UpdateProfileDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UserTopicDto { /// @@ -13553,7 +14169,7 @@ public partial class UserTopicDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 TopicChannel { @@ -13565,7 +14181,7 @@ public enum TopicChannel } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ListResponseDtoOfSubscriptionDto { /// @@ -13583,7 +14199,7 @@ public partial class ListResponseDtoOfSubscriptionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 SubscriptionDto { /// @@ -13608,7 +14224,7 @@ public partial class SubscriptionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 SchedulingDto { /// @@ -13648,7 +14264,7 @@ public partial class SchedulingDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 SchedulingType { @@ -13665,7 +14281,7 @@ public enum SchedulingType ///
ISO-8601. This corresponds with System.DayOfWeek except for Sunday, which ///
is 7 in the ISO numbering and 0 in System.DayOfWeek. ///
- [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 IsoDayOfWeek { @@ -13695,7 +14311,7 @@ public enum IsoDayOfWeek } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 SubscribeManyDto { /// @@ -13712,7 +14328,7 @@ public partial class SubscribeManyDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 SubscribeDto { /// @@ -13742,7 +14358,7 @@ public partial class SubscribeDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ListResponseDtoOfUserDto { /// @@ -13760,7 +14376,7 @@ public partial class ListResponseDtoOfUserDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 { /// @@ -13881,7 +14497,7 @@ public partial class UserDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 MobilePushTokenDto { /// @@ -13913,7 +14529,7 @@ public partial class MobilePushTokenDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 MobileDeviceType { @@ -13928,7 +14544,7 @@ public enum MobileDeviceType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 WebPushSubscriptionDto { /// @@ -13940,7 +14556,7 @@ public partial class WebPushSubscriptionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UserPropertyDto { /// @@ -13964,7 +14580,7 @@ public partial class UserPropertyDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UpsertUsersDto { /// @@ -13976,7 +14592,7 @@ public partial class UpsertUsersDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UpsertUserDto { /// @@ -14047,7 +14663,7 @@ public partial class UpsertUserDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 AddAllowedTopicDto { /// @@ -14059,7 +14675,7 @@ public partial class AddAllowedTopicDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ListResponseDtoOfTopicDto { /// @@ -14077,7 +14693,7 @@ public partial class ListResponseDtoOfTopicDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 TopicDto { /// @@ -14140,13 +14756,13 @@ public partial class TopicDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 LocalizedText : System.Collections.Generic.Dictionary { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 TopicQueryScope { @@ -14161,7 +14777,7 @@ public enum TopicQueryScope } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UpsertTopicsDto { /// @@ -14173,7 +14789,7 @@ public partial class UpsertTopicsDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UpsertTopicDto { /// @@ -14208,7 +14824,7 @@ public partial class UpsertTopicDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ListResponseDtoOfTemplateDto { /// @@ -14226,7 +14842,7 @@ public partial class ListResponseDtoOfTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 { /// @@ -14266,7 +14882,7 @@ public partial class TemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 NotificationFormattingDto { /// @@ -14285,8 +14901,8 @@ public partial class NotificationFormattingDto /// /// The optional confirm link with one entry per language. /// - [Newtonsoft.Json.JsonProperty("confirmlink", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public LocalizedText Confirmlink { get; set; } + [Newtonsoft.Json.JsonProperty("confirmLink", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LocalizedText ConfirmLink { get; set; } /// /// The optional confirm text with one entry per language. @@ -14327,7 +14943,7 @@ public partial class NotificationFormattingDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ConfirmMode { @@ -14339,7 +14955,7 @@ public enum ConfirmMode } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UpsertTemplatesDto { /// @@ -14351,7 +14967,7 @@ public partial class UpsertTemplatesDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UpsertTemplateDto { /// @@ -14376,7 +14992,7 @@ public partial class UpsertTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ListResponseDtoOfSystemUserDto { /// @@ -14394,7 +15010,7 @@ public partial class ListResponseDtoOfSystemUserDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 SystemUserDto { /// @@ -14432,7 +15048,7 @@ public partial class SystemUserDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 CreateSystemUserDto { /// @@ -14457,7 +15073,7 @@ public partial class CreateSystemUserDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UpdateSystemUserDto { /// @@ -14482,7 +15098,7 @@ public partial class UpdateSystemUserDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 InfoDto { /// @@ -14494,7 +15110,7 @@ public partial class InfoDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ListResponseDtoOfUserNotificationDetailsDto { /// @@ -14512,7 +15128,7 @@ public partial class ListResponseDtoOfUserNotificationDetailsDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UserNotificationDetailsDto : UserNotificationBaseDto { /// @@ -14542,7 +15158,7 @@ public partial class UserNotificationDetailsDto : UserNotificationBaseDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UserNotificationChannelDto { /// @@ -14579,7 +15195,7 @@ public partial class UserNotificationChannelDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ChannelSendInfoDto { /// @@ -14630,7 +15246,7 @@ public partial class ChannelSendInfoDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 DeliveryStatus { @@ -14654,13 +15270,13 @@ public enum DeliveryStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 SendConfiguration : System.Collections.Generic.Dictionary { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 HandledInfoDto { /// @@ -14678,7 +15294,7 @@ public partial class HandledInfoDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UserNotificationBaseDto { /// @@ -14801,7 +15417,7 @@ public abstract partial class UserNotificationBaseDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ListResponseDtoOfUserNotificationDto { /// @@ -14819,7 +15435,7 @@ public partial class ListResponseDtoOfUserNotificationDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UserNotificationDto : UserNotificationBaseDto { /// @@ -14836,7 +15452,7 @@ public partial class UserNotificationDto : UserNotificationBaseDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 DeviceNotificationsQueryScope { @@ -14851,7 +15467,7 @@ public enum DeviceNotificationsQueryScope } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 TrackNotificationDto { /// @@ -14887,7 +15503,7 @@ public partial class TrackNotificationDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ListResponseDtoOfMobilePushTokenDto { /// @@ -14905,7 +15521,7 @@ public partial class ListResponseDtoOfMobilePushTokenDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 MobilePushTokenDto2 { /// @@ -14931,7 +15547,7 @@ public partial class MobilePushTokenDto2 } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 RegisterMobileTokenDto { /// @@ -14955,7 +15571,7 @@ public partial class RegisterMobileTokenDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ListResponseDtoOfMediaDto { /// @@ -14973,7 +15589,7 @@ public partial class ListResponseDtoOfMediaDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 MediaDto { /// @@ -15041,7 +15657,7 @@ public partial class MediaDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 MediaType { @@ -15059,13 +15675,13 @@ public enum MediaType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 MediaMetadata : System.Collections.Generic.Dictionary { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 { @@ -15092,7 +15708,7 @@ public enum ResizeMode } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ListResponseDtoOfLogEntryDto { /// @@ -15110,7 +15726,7 @@ public partial class ListResponseDtoOfLogEntryDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 LogEntryDto { /// @@ -15155,7 +15771,7 @@ public partial class LogEntryDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ListResponseDtoOfEventDto { /// @@ -15173,7 +15789,7 @@ public partial class ListResponseDtoOfEventDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 EventDto { /// @@ -15264,7 +15880,7 @@ public partial class EventDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 PublishManyDto { /// @@ -15276,7 +15892,7 @@ public partial class PublishManyDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 PublishDto { /// @@ -15372,7 +15988,7 @@ public partial class PublishDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 MjmlSchema { [Newtonsoft.Json.JsonProperty("!top", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] @@ -15390,7 +16006,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 EmailPreviewDto { /// @@ -15407,7 +16023,7 @@ public partial class EmailPreviewDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 EmailPreviewErrorDto { /// @@ -15431,7 +16047,7 @@ public partial class EmailPreviewErrorDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 EmailPreviewRequestDto { /// @@ -15450,7 +16066,7 @@ public partial class EmailPreviewRequestDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 EmailPreviewType { @@ -15462,7 +16078,7 @@ public enum EmailPreviewType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ListResponseDtoOfChannelTemplateDto { /// @@ -15480,7 +16096,7 @@ public partial class ListResponseDtoOfChannelTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ChannelTemplateDto { /// @@ -15511,7 +16127,7 @@ public partial class ChannelTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ChannelTemplateDetailsDtoOfEmailTemplateDto { /// @@ -15556,7 +16172,7 @@ public partial class ChannelTemplateDetailsDtoOfEmailTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 EmailTemplateDto { /// @@ -15593,13 +16209,13 @@ public partial class EmailTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 CreateChannelTemplateDto { } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 CreateChannelTemplateLanguageDto { /// @@ -15611,7 +16227,7 @@ public partial class CreateChannelTemplateLanguageDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UpdateChannelTemplateDtoOfEmailTemplateDto { /// @@ -15634,7 +16250,7 @@ public partial class UpdateChannelTemplateDtoOfEmailTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ChannelTemplateDetailsDtoOfMessagingTemplateDto { /// @@ -15679,7 +16295,7 @@ public partial class ChannelTemplateDetailsDtoOfMessagingTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 MessagingTemplateDto { /// @@ -15691,7 +16307,7 @@ public partial class MessagingTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UpdateChannelTemplateDtoOfMessagingTemplateDto { /// @@ -15714,7 +16330,7 @@ public partial class UpdateChannelTemplateDtoOfMessagingTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ChannelTemplateDetailsDtoOfSmsTemplateDto { /// @@ -15759,7 +16375,7 @@ public partial class ChannelTemplateDetailsDtoOfSmsTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 SmsTemplateDto { /// @@ -15771,7 +16387,7 @@ public partial class SmsTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UpdateChannelTemplateDtoOfSmsTemplateDto { /// @@ -15794,7 +16410,7 @@ public partial class UpdateChannelTemplateDtoOfSmsTemplateDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 { /// @@ -15855,7 +16471,7 @@ public partial class AppDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 AppDetailsDto { /// @@ -15929,7 +16545,7 @@ public partial class AppDetailsDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 AppContributorDto { /// @@ -15955,7 +16571,7 @@ public partial class AppContributorDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UpsertAppDto { /// @@ -16020,7 +16636,7 @@ public partial class UpsertAppDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 AddContributorDto { /// @@ -16038,7 +16654,7 @@ public partial class AddContributorDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ConfiguredIntegrationsDto { /// @@ -16057,7 +16673,7 @@ public partial class ConfiguredIntegrationsDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 ConfiguredIntegrationDto { /// @@ -16108,7 +16724,7 @@ public partial class ConfiguredIntegrationDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 IntegrationStatus { @@ -16126,7 +16742,7 @@ public enum IntegrationStatus } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 IntegrationDefinitionDto { /// @@ -16165,7 +16781,7 @@ public partial class IntegrationDefinitionDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 IntegrationPropertyDto { /// @@ -16251,7 +16867,7 @@ public partial class IntegrationPropertyDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 PropertyType { @@ -16272,7 +16888,7 @@ public enum PropertyType } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 IntegrationCreatedDto { /// @@ -16291,7 +16907,7 @@ public partial class IntegrationCreatedDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 CreateIntegrationDto { /// @@ -16328,7 +16944,7 @@ public partial class CreateIntegrationDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 UpdateIntegrationDto { /// @@ -16364,7 +16980,7 @@ public partial class UpdateIntegrationDto } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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() @@ -16373,7 +16989,7 @@ public DateFormatConverter() } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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) @@ -16400,7 +17016,7 @@ public FileParameter(System.IO.Stream data, string fileName, string contentType) public string ContentType { get; private set; } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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; @@ -16437,7 +17053,7 @@ public void Dispose() } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 NotifoException : System.Exception { public int StatusCode { get; private set; } @@ -16460,7 +17076,7 @@ public override string ToString() } } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v9.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 NotifoException : NotifoException { public TResult Result { get; private set; } @@ -16474,10 +17090,14 @@ public NotifoException(string message, int statusCode, string response, System.C } -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 #pragma warning restore 108 +#pragma warning restore 114 +#pragma warning restore 472 +#pragma warning restore 612 +#pragma warning restore 1573 +#pragma warning restore 1591 +#pragma warning restore 8073 #pragma warning restore 3016 -#pragma warning restore 8603 \ No newline at end of file +#pragma warning restore 8603 +#pragma warning restore 8604 +#pragma warning restore 8625 \ No newline at end of file diff --git a/tools/sdk/Notifo.SDK/Notifo.SDK.csproj b/tools/sdk/Notifo.SDK/Notifo.SDK.csproj index 7064fea9..cb5e991a 100644 --- a/tools/sdk/Notifo.SDK/Notifo.SDK.csproj +++ b/tools/sdk/Notifo.SDK/Notifo.SDK.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From fad561f1a9b760f1962227a38c5e4066f20e614d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 12 Jan 2024 18:51:10 +0100 Subject: [PATCH 2/4] Fix mjml net --- .../src/Notifo.Domain/Notifo.Domain.csproj | 2 +- ...s.Should_build_schema_as_json.verified.txt | 824 +++++++++++++++++- .../Channels/Email/MjmlSchemaTests.cs | 7 +- 3 files changed, 829 insertions(+), 4 deletions(-) diff --git a/backend/src/Notifo.Domain/Notifo.Domain.csproj b/backend/src/Notifo.Domain/Notifo.Domain.csproj index 9f40f242..c4ba23e4 100644 --- a/backend/src/Notifo.Domain/Notifo.Domain.csproj +++ b/backend/src/Notifo.Domain/Notifo.Domain.csproj @@ -30,7 +30,7 @@ - + diff --git a/backend/tests/Notifo.Domain.Tests/Channels/Email/MjmlSchemaTests.Should_build_schema_as_json.verified.txt b/backend/tests/Notifo.Domain.Tests/Channels/Email/MjmlSchemaTests.Should_build_schema_as_json.verified.txt index 091e1a91..6fc16234 100644 --- a/backend/tests/Notifo.Domain.Tests/Channels/Email/MjmlSchemaTests.Should_build_schema_as_json.verified.txt +++ b/backend/tests/Notifo.Domain.Tests/Channels/Email/MjmlSchemaTests.Should_build_schema_as_json.verified.txt @@ -1,3 +1,825 @@ { - json: {"!top":["mjml"],"mj-accordion":{"attrs":{"border":null,"container-background-color":null,"font-family":null,"icon-align":["top","middle","bottom"],"icon-height":null,"icon-position":["left","right"],"icon-unwrapped-alt":null,"icon-unwrapped-url":null,"icon-width":null,"icon-wrapped-alt":null,"icon-wrapped-url":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"css-class":null},"children":["mj-accordion-element","mj-raw"]},"mj-accordion-element":{"attrs":{"background-color":null,"border":null,"font-family":null,"icon-align":["top","middle","bottom"],"icon-height":null,"icon-position":["left","right"],"icon-unwrapped-alt":null,"icon-unwrapped-url":null,"icon-width":null,"icon-wrapped-alt":null,"icon-wrapped-url":null,"css-class":null},"children":["mj-accordion-text","mj-accordion-title","mj-raw"]},"mj-accordion-text":{"attrs":{"background-color":null,"border":null,"color":null,"font-family":null,"font-size":null,"font-weight":null,"letter-spacing":null,"line-height":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"css-class":null},"children":null},"mj-accordion-title":{"attrs":{"background-color":null,"border":null,"color":null,"font-family":null,"font-size":null,"icon-align":null,"icon-height":null,"icon-position":null,"icon-unwrapped-alt":null,"icon-unwrapped-url":null,"icon-width":null,"icon-wrapped-url":null,"icon-wrapped-alt":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"css-class":null},"children":null},"mj-attributes":{"attrs":{},"children":null},"mj-body":{"attrs":{"css-class":null,"background-color":null,"width":null},"children":["mj-hero","mj-raw","mj-section","mj-wrapper"]},"mj-breakpoint":{"attrs":{"width":null},"children":null},"mj-button":{"attrs":{"align":null,"background-color":null,"border":null,"border-bottom":null,"border-left":null,"border-radius":null,"border-right":null,"border-top":null,"color":null,"container-background-color":null,"font-family":null,"font-size":null,"font-style":null,"font-weight":null,"height":null,"href":null,"inner-padding":null,"inner-padding-bottom":null,"inner-padding-left":null,"inner-padding-right":null,"inner-padding-top":null,"letter-spacing":null,"line-height":null,"name":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"rel":null,"target":null,"text-align":["left","right","center","justify"],"text-decoration":null,"text-transform":null,"vertical-align":["top","middle","bottom"],"width":null,"css-class":null},"children":null},"mj-carousel":{"attrs":{"align":["left","center","right"],"border-radius":null,"container-background-color":null,"icon-width":null,"left-icon":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"right-icon":null,"tb-border":null,"tb-border-radius":null,"tb-hover-border-color":null,"tb-selected-border-color":null,"tb-width":null,"thumbnails":null,"css-class":null},"children":["mj-carousel-image"]},"mj-carousel-image":{"attrs":{"alt":null,"border-radius":null,"href":null,"rel":null,"src":null,"target":null,"tb-border":null,"tb-border-radius":null,"tb-width":null,"thumbnails-src":null,"title":null,"css-class":null},"children":null},"mj-column":{"attrs":{"background-color":null,"border":null,"border-bottom":null,"border-left":null,"border-radius":null,"border-right":null,"border-top":null,"direction":["ltr","rtl"],"inner-background-color":null,"inner-border":null,"inner-border-bottom":null,"inner-border-left":null,"inner-border-radius":null,"inner-border-right":null,"inner-border-top":null,"mobile-width":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"vertical-align":["top","middle","bottom"],"width":null,"css-class":null},"children":["mj-accordion","mj-button","mj-carousel","mj-divider","mj-image","mj-msobutton","mj-navbar","mj-raw","mj-social","mj-spacer","mj-table","mj-text"]},"mj-divider":{"attrs":{"align":["left","center","right"],"border-color":null,"border-style":null,"border-width":null,"container-background-color":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"width":null,"css-class":null},"children":null},"mj-font":{"attrs":{"name":null,"href":null},"children":null},"mj-group":{"attrs":{"background-color":null,"direction":["ltr","rtl"],"vertical-align":["top","middle","bottom"],"width":null,"css-class":null},"children":["mj-column","mj-raw"]},"mj-head":{"attrs":{},"children":["mj-attributes","mj-breakpoint","mj-font","mj-preview","mj-raw","mj-style","mj-title"]},"mj-hero":{"attrs":{"align":["left","center","right"],"background-color":null,"background-height":null,"background-position":null,"background-url":null,"background-width":null,"border-radius":null,"container-background-color":null,"height":null,"inner-background-color":null,"inner-padding":null,"inner-padding-bottom":null,"inner-padding-left":null,"inner-padding-right":null,"inner-padding-top":null,"mode":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"vertical-align":["top","middle","bottom"],"width":null,"css-class":null},"children":["mj-accordion","mj-button","mj-carousel","mj-divider","mj-image","mj-msobutton","mj-navbar","mj-raw","mj-social","mj-spacer","mj-table","mj-text"]},"mj-image":{"attrs":{"align":["left","center","right"],"alt":null,"border":null,"border-bottom":null,"border-left":null,"border-radius":null,"border-right":null,"border-top":null,"container-background-color":null,"fluid-on-mobile":null,"full-width":["true","false"],"font-size":null,"height":null,"href":null,"max-height":null,"name":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"rel":null,"sizes":null,"src":null,"srcset":null,"target":null,"title":null,"usemap":null,"width":null,"css-class":null},"children":null},"mj-msobutton":{"attrs":{"mso-proof":["true","false"],"mso-height":null,"mso-width":null,"align":null,"background-color":null,"border":null,"border-bottom":null,"border-left":null,"border-radius":null,"border-right":null,"border-top":null,"color":null,"container-background-color":null,"font-family":null,"font-size":null,"font-style":null,"font-weight":null,"height":null,"href":null,"inner-padding":null,"inner-padding-bottom":null,"inner-padding-left":null,"inner-padding-right":null,"inner-padding-top":null,"letter-spacing":null,"line-height":null,"name":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"rel":null,"target":null,"text-align":["left","right","center","justify"],"text-decoration":null,"text-transform":null,"vertical-align":["top","middle","bottom"],"width":null,"css-class":null},"children":null},"mj-navbar":{"attrs":{"align":["left","center","right"],"base-url":null,"hamburger":null,"ico-align":["left","center","right"],"ico-close":null,"ico-color":null,"ico-font-family":null,"ico-font-size":null,"ico-line-height":null,"ico-open":null,"ico-padding":null,"ico-padding-bottom":null,"ico-padding-left":null,"ico-padding-right":null,"ico-padding-top":null,"ico-text-decoration":null,"ico-text-transform":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"css-class":null},"children":["mj-navbar-link","mj-raw"]},"mj-navbar-link":{"attrs":{"color":null,"font-family":null,"font-size":null,"font-style":null,"font-weight":null,"href":null,"letter-spacing":null,"line-height":null,"name":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"rel":null,"target":null,"text-decoration":null,"text-transform":null,"navbar-base-url":null,"css-class":null},"children":null},"mj-preview":{"attrs":{},"children":null},"mj-raw":{"attrs":{"css-class":null},"children":null},"mjml":{"attrs":{},"children":["mj-body","mj-head","mj-raw"]},"mj-section":{"attrs":{"background-color":null,"background-position":null,"background-position-x":null,"background-position-y":null,"background-repeat":null,"background-size":null,"background-url":null,"border":null,"border-bottom":null,"border-left":null,"border-radius":null,"border-right":null,"border-top":null,"direction":null,"full-width":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"text-align":["left","right","center","justify"],"text-padding":null,"css-class":null},"children":["mj-column","mj-group","mj-raw"]},"mj-social":{"attrs":{"align":["left","center","right"],"border-radius":null,"color":null,"container-background-color":null,"font-family":null,"font-size":null,"font-style":null,"font-weight":null,"icon-height":null,"icon-padding":null,"icon-size":null,"inner-padding":null,"line-height":null,"mode":["vertical","horizontal"],"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"table-layout":["auto","fixed"],"text-decoration":null,"text-padding":null,"vertical-align":["top","middle","bottom"],"css-class":null},"children":["mj-raw","mj-social-element"]},"mj-social-element":{"attrs":{"align":["left","center","right"],"alt":null,"background-color":null,"border-radius":null,"color":null,"font-family":null,"font-size":null,"font-style":null,"font-weight":null,"href":null,"icon-height":null,"icon-padding":null,"icon-size":null,"line-height":null,"name":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"rel":null,"sizes":null,"src":null,"srcset":null,"target":null,"text-decoration":null,"text-padding":null,"title":null,"vertical-align":["top","middle","bottom"],"css-class":null},"children":null},"mj-spacer":{"attrs":{"border":null,"border-bottom":null,"border-left":null,"border-right":null,"border-top":null,"container-background-color":null,"height":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"css-class":null},"children":null},"mj-style":{"attrs":{"inline":null},"children":null},"mj-table":{"attrs":{"align":["left","center","right"],"border":null,"cellpadding":null,"cellspacing":null,"color":null,"container-background-color":null,"font-family":null,"font-size":null,"font-weight":null,"line-height":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"role":null,"table-layout":null,"vertical-align":["top","middle","bottom"],"width":null,"css-class":null},"children":null},"mj-text":{"attrs":{"align":["left","center","right","justify"],"color":null,"container-background-color":null,"font-family":null,"font-size":null,"font-style":null,"font-weight":null,"height":null,"letter-spacing":null,"line-height":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"text-decoration":null,"text-transform":null,"vertical-align":["top","middle","bottom"],"css-class":null},"children":null},"mj-title":{"attrs":{},"children":null},"mj-wrapper":{"attrs":{"background-color":null,"background-position":null,"background-position-x":null,"background-position-y":null,"background-repeat":null,"background-size":null,"background-url":null,"border":null,"border-bottom":null,"border-left":null,"border-radius":null,"border-right":null,"border-top":null,"direction":null,"full-width":null,"padding":null,"padding-bottom":null,"padding-left":null,"padding-right":null,"padding-top":null,"text-align":["left","right","center","justify"],"text-padding":null,"css-class":null},"children":["mj-hero","mj-raw","mj-section"]}} + "!top": [ + "mjml" + ], + "mj-accordion": { + "attrs": { + "border": null, + "container-background-color": null, + "font-family": null, + "icon-align": [ + "top", + "middle", + "bottom" + ], + "icon-height": null, + "icon-position": [ + "left", + "right" + ], + "icon-unwrapped-alt": null, + "icon-unwrapped-url": null, + "icon-width": null, + "icon-wrapped-alt": null, + "icon-wrapped-url": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "css-class": null + }, + "children": [ + "mj-accordion-element", + "mj-raw" + ] + }, + "mj-accordion-element": { + "attrs": { + "background-color": null, + "border": null, + "font-family": null, + "icon-align": [ + "top", + "middle", + "bottom" + ], + "icon-height": null, + "icon-position": [ + "left", + "right" + ], + "icon-unwrapped-alt": null, + "icon-unwrapped-url": null, + "icon-width": null, + "icon-wrapped-alt": null, + "icon-wrapped-url": null, + "css-class": null + }, + "children": [ + "mj-accordion-text", + "mj-accordion-title", + "mj-raw" + ] + }, + "mj-accordion-text": { + "attrs": { + "background-color": null, + "border": null, + "color": null, + "font-family": null, + "font-size": null, + "font-weight": null, + "letter-spacing": null, + "line-height": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "css-class": null + }, + "children": null + }, + "mj-accordion-title": { + "attrs": { + "background-color": null, + "border": null, + "color": null, + "font-family": null, + "font-size": null, + "icon-align": null, + "icon-height": null, + "icon-position": null, + "icon-unwrapped-alt": null, + "icon-unwrapped-url": null, + "icon-width": null, + "icon-wrapped-alt": null, + "icon-wrapped-url": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "css-class": null + }, + "children": null + }, + "mj-attributes": { + "attrs": {}, + "children": null + }, + "mj-body": { + "attrs": { + "background-color": null, + "css-class": null, + "width": null + }, + "children": [ + "mj-hero", + "mj-raw", + "mj-section", + "mj-wrapper" + ] + }, + "mj-breakpoint": { + "attrs": { + "width": null + }, + "children": null + }, + "mj-button": { + "attrs": { + "align": null, + "background-color": null, + "border": null, + "border-bottom": null, + "border-left": null, + "border-radius": null, + "border-right": null, + "border-top": null, + "color": null, + "container-background-color": null, + "font-family": null, + "font-size": null, + "font-style": null, + "font-weight": null, + "height": null, + "href": null, + "inner-padding": null, + "inner-padding-bottom": null, + "inner-padding-left": null, + "inner-padding-right": null, + "inner-padding-top": null, + "letter-spacing": null, + "line-height": null, + "name": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "rel": null, + "target": null, + "text-align": [ + "left", + "right", + "center", + "justify" + ], + "text-decoration": null, + "text-transform": null, + "vertical-align": [ + "top", + "middle", + "bottom" + ], + "width": null, + "css-class": null + }, + "children": null + }, + "mj-carousel": { + "attrs": { + "align": [ + "left", + "center", + "right" + ], + "border-radius": null, + "container-background-color": null, + "icon-width": null, + "left-icon": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "right-icon": null, + "tb-border": null, + "tb-border-radius": null, + "tb-hover-border-color": null, + "tb-selected-border-color": null, + "tb-width": null, + "thumbnails": null, + "css-class": null + }, + "children": [ + "mj-carousel-image" + ] + }, + "mj-carousel-image": { + "attrs": { + "alt": null, + "border-radius": null, + "href": null, + "rel": null, + "src": null, + "target": null, + "tb-border": null, + "tb-border-radius": null, + "tb-width": null, + "thumbnails-src": null, + "title": null, + "css-class": null + }, + "children": null + }, + "mj-column": { + "attrs": { + "background-color": null, + "border": null, + "border-bottom": null, + "border-left": null, + "border-radius": null, + "border-right": null, + "border-top": null, + "direction": [ + "ltr", + "rtl" + ], + "inner-background-color": null, + "inner-border": null, + "inner-border-bottom": null, + "inner-border-left": null, + "inner-border-radius": null, + "inner-border-right": null, + "inner-border-top": null, + "mobile-width": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "vertical-align": [ + "top", + "middle", + "bottom" + ], + "width": null, + "css-class": null + }, + "children": [ + "mj-accordion", + "mj-button", + "mj-carousel", + "mj-divider", + "mj-image", + "mj-msobutton", + "mj-navbar", + "mj-raw", + "mj-social", + "mj-spacer", + "mj-table", + "mj-text" + ] + }, + "mj-divider": { + "attrs": { + "align": [ + "left", + "center", + "right" + ], + "border-color": null, + "border-style": null, + "border-width": null, + "container-background-color": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "width": null, + "css-class": null + }, + "children": null + }, + "mj-font": { + "attrs": { + "href": null, + "name": null + }, + "children": null + }, + "mj-group": { + "attrs": { + "background-color": null, + "direction": [ + "ltr", + "rtl" + ], + "vertical-align": [ + "top", + "middle", + "bottom" + ], + "width": null, + "css-class": null + }, + "children": [ + "mj-column", + "mj-raw" + ] + }, + "mj-head": { + "attrs": {}, + "children": [ + "mj-attributes", + "mj-breakpoint", + "mj-font", + "mj-preview", + "mj-raw", + "mj-style", + "mj-title" + ] + }, + "mj-hero": { + "attrs": { + "align": [ + "left", + "center", + "right" + ], + "background-color": null, + "background-height": null, + "background-position": null, + "background-url": null, + "background-width": null, + "border-radius": null, + "container-background-color": null, + "height": null, + "inner-background-color": null, + "inner-padding": null, + "inner-padding-bottom": null, + "inner-padding-left": null, + "inner-padding-right": null, + "inner-padding-top": null, + "mode": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "vertical-align": [ + "top", + "middle", + "bottom" + ], + "width": null, + "css-class": null + }, + "children": [ + "mj-accordion", + "mj-button", + "mj-carousel", + "mj-divider", + "mj-image", + "mj-msobutton", + "mj-navbar", + "mj-raw", + "mj-social", + "mj-spacer", + "mj-table", + "mj-text" + ] + }, + "mj-image": { + "attrs": { + "align": [ + "left", + "center", + "right" + ], + "alt": null, + "border": null, + "border-bottom": null, + "border-left": null, + "border-radius": null, + "border-right": null, + "border-top": null, + "container-background-color": null, + "fluid-on-mobile": null, + "font-size": null, + "full-width": [ + "true", + "false" + ], + "height": null, + "href": null, + "max-height": null, + "name": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "rel": null, + "sizes": null, + "src": null, + "srcset": null, + "target": null, + "title": null, + "usemap": null, + "width": null, + "css-class": null + }, + "children": null + }, + "mj-msobutton": { + "attrs": { + "mso-height": null, + "mso-proof": [ + "true", + "false" + ], + "mso-width": null, + "align": null, + "background-color": null, + "border": null, + "border-bottom": null, + "border-left": null, + "border-radius": null, + "border-right": null, + "border-top": null, + "color": null, + "container-background-color": null, + "font-family": null, + "font-size": null, + "font-style": null, + "font-weight": null, + "height": null, + "href": null, + "inner-padding": null, + "inner-padding-bottom": null, + "inner-padding-left": null, + "inner-padding-right": null, + "inner-padding-top": null, + "letter-spacing": null, + "line-height": null, + "name": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "rel": null, + "target": null, + "text-align": [ + "left", + "right", + "center", + "justify" + ], + "text-decoration": null, + "text-transform": null, + "vertical-align": [ + "top", + "middle", + "bottom" + ], + "width": null, + "css-class": null + }, + "children": null + }, + "mj-navbar": { + "attrs": { + "align": [ + "left", + "center", + "right" + ], + "base-url": null, + "hamburger": null, + "ico-align": [ + "left", + "center", + "right" + ], + "ico-close": null, + "ico-color": null, + "ico-font-family": null, + "ico-font-size": null, + "ico-line-height": null, + "ico-open": null, + "ico-padding": null, + "ico-padding-bottom": null, + "ico-padding-left": null, + "ico-padding-right": null, + "ico-padding-top": null, + "ico-text-decoration": null, + "ico-text-transform": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "css-class": null + }, + "children": [ + "mj-navbar-link", + "mj-raw" + ] + }, + "mj-navbar-link": { + "attrs": { + "color": null, + "font-family": null, + "font-size": null, + "font-style": null, + "font-weight": null, + "href": null, + "letter-spacing": null, + "line-height": null, + "name": null, + "navbar-base-url": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "rel": null, + "target": null, + "text-decoration": null, + "text-transform": null, + "css-class": null + }, + "children": null + }, + "mj-preview": { + "attrs": {}, + "children": null + }, + "mj-raw": { + "attrs": { + "css-class": null + }, + "children": null + }, + "mjml": { + "attrs": {}, + "children": [ + "mj-body", + "mj-head", + "mj-raw" + ] + }, + "mj-section": { + "attrs": { + "background-color": null, + "background-position": null, + "background-position-x": null, + "background-position-y": null, + "background-repeat": null, + "background-size": null, + "background-url": null, + "border": null, + "border-bottom": null, + "border-left": null, + "border-radius": null, + "border-right": null, + "border-top": null, + "direction": null, + "full-width": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "text-align": [ + "left", + "right", + "center", + "justify" + ], + "text-padding": null, + "css-class": null + }, + "children": [ + "mj-column", + "mj-group", + "mj-raw" + ] + }, + "mj-social": { + "attrs": { + "align": [ + "left", + "center", + "right" + ], + "border-radius": null, + "color": null, + "container-background-color": null, + "font-family": null, + "font-size": null, + "font-style": null, + "font-weight": null, + "icon-height": null, + "icon-padding": null, + "icon-size": null, + "inner-padding": null, + "line-height": null, + "mode": [ + "vertical", + "horizontal" + ], + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "table-layout": [ + "auto", + "fixed" + ], + "text-decoration": null, + "text-padding": null, + "vertical-align": [ + "top", + "middle", + "bottom" + ], + "css-class": null + }, + "children": [ + "mj-raw", + "mj-social-element" + ] + }, + "mj-social-element": { + "attrs": { + "align": [ + "left", + "center", + "right" + ], + "alt": null, + "background-color": null, + "border-radius": null, + "color": null, + "font-family": null, + "font-size": null, + "font-style": null, + "font-weight": null, + "href": null, + "icon-height": null, + "icon-padding": null, + "icon-size": null, + "line-height": null, + "name": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "rel": null, + "sizes": null, + "src": null, + "srcset": null, + "target": null, + "text-decoration": null, + "text-padding": null, + "title": null, + "vertical-align": [ + "top", + "middle", + "bottom" + ], + "css-class": null + }, + "children": null + }, + "mj-spacer": { + "attrs": { + "border": null, + "border-bottom": null, + "border-left": null, + "border-right": null, + "border-top": null, + "container-background-color": null, + "height": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "css-class": null + }, + "children": null + }, + "mj-style": { + "attrs": { + "inline": null + }, + "children": null + }, + "mj-table": { + "attrs": { + "align": [ + "left", + "center", + "right" + ], + "border": null, + "cellpadding": null, + "cellspacing": null, + "color": null, + "container-background-color": null, + "font-family": null, + "font-size": null, + "font-weight": null, + "line-height": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "role": null, + "table-layout": null, + "vertical-align": [ + "top", + "middle", + "bottom" + ], + "width": null, + "css-class": null + }, + "children": null + }, + "mj-text": { + "attrs": { + "align": [ + "left", + "center", + "right", + "justify" + ], + "color": null, + "container-background-color": null, + "font-family": null, + "font-size": null, + "font-style": null, + "font-weight": null, + "height": null, + "letter-spacing": null, + "line-height": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "text-decoration": null, + "text-transform": null, + "vertical-align": [ + "top", + "middle", + "bottom" + ], + "css-class": null + }, + "children": null + }, + "mj-title": { + "attrs": {}, + "children": null + }, + "mj-wrapper": { + "attrs": { + "background-color": null, + "background-position": null, + "background-position-x": null, + "background-position-y": null, + "background-repeat": null, + "background-size": null, + "background-url": null, + "border": null, + "border-bottom": null, + "border-left": null, + "border-radius": null, + "border-right": null, + "border-top": null, + "direction": null, + "full-width": null, + "padding": null, + "padding-bottom": null, + "padding-left": null, + "padding-right": null, + "padding-top": null, + "text-align": [ + "left", + "right", + "center", + "justify" + ], + "text-padding": null, + "css-class": null + }, + "children": [ + "mj-hero", + "mj-raw", + "mj-section" + ] + } } \ No newline at end of file diff --git a/backend/tests/Notifo.Domain.Tests/Channels/Email/MjmlSchemaTests.cs b/backend/tests/Notifo.Domain.Tests/Channels/Email/MjmlSchemaTests.cs index 58ee2172..770d8745 100644 --- a/backend/tests/Notifo.Domain.Tests/Channels/Email/MjmlSchemaTests.cs +++ b/backend/tests/Notifo.Domain.Tests/Channels/Email/MjmlSchemaTests.cs @@ -27,8 +27,11 @@ public async Task Should_build_schema() [Fact] public async Task Should_build_schema_as_json() { - var json = JsonSerializer.Serialize(MjmlSchema.Build(mjmlRenderer)); + var json = JsonSerializer.Serialize(MjmlSchema.Build(mjmlRenderer), new JsonSerializerOptions + { + WriteIndented = true + }); - await Verify(new { json }); + await Verify(json); } } From b4824629189e4b634a3bb3e1149bb81dafb6c8ae Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 12 Jan 2024 19:13:40 +0100 Subject: [PATCH 3/4] Fix client. --- tools/sdk/CodeGenerator/Client.Class.liquid | 2 + tools/sdk/CodeGenerator/Program.cs | 1 + tools/sdk/Notifo.SDK/Generated.Custom.cs | 30 +-- tools/sdk/Notifo.SDK/Generated.cs | 236 ++++++++++++++++---- 4 files changed, 215 insertions(+), 54 deletions(-) diff --git a/tools/sdk/CodeGenerator/Client.Class.liquid b/tools/sdk/CodeGenerator/Client.Class.liquid index 89760102..6aabba64 100644 --- a/tools/sdk/CodeGenerator/Client.Class.liquid +++ b/tools/sdk/CodeGenerator/Client.Class.liquid @@ -165,7 +165,9 @@ {% endif -%} var client_ = _httpClientProvider.Get(); +#pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; +#pragma warning restore CS0219 // Variable is assigned but its value is never used try { {% if UseHttpRequestMessageCreationMethod -%} diff --git a/tools/sdk/CodeGenerator/Program.cs b/tools/sdk/CodeGenerator/Program.cs index f1cb74b5..c5680fa7 100644 --- a/tools/sdk/CodeGenerator/Program.cs +++ b/tools/sdk/CodeGenerator/Program.cs @@ -36,6 +36,7 @@ private static void GenerateCSharp(OpenApiDocument document) GenerateOptionalParameters = true, GenerateClientInterfaces = true, GenerateBaseUrlProperty = true, + InjectHttpClient = false, OperationNameGenerator = new TagNameGenerator(), UseBaseUrl = false }; diff --git a/tools/sdk/Notifo.SDK/Generated.Custom.cs b/tools/sdk/Notifo.SDK/Generated.Custom.cs index 1d3cf098..515d334a 100644 --- a/tools/sdk/Notifo.SDK/Generated.Custom.cs +++ b/tools/sdk/Notifo.SDK/Generated.Custom.cs @@ -78,7 +78,7 @@ public override string ToString() public partial class AppsClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -86,7 +86,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class ConfigsClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -94,7 +94,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class EmailTemplatesClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -102,7 +102,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class EventsClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -110,7 +110,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class LogsClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -118,7 +118,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class MobilePushClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -126,7 +126,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class MediaClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -134,7 +134,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class NotificationsClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -142,7 +142,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class PingClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -150,7 +150,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class SmsTemplatesClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -158,7 +158,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class SystemUsersClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -166,7 +166,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class TemplatesClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -174,7 +174,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class TopicsClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -182,7 +182,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class UserClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } @@ -190,7 +190,7 @@ partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) public partial class UsersClient { - partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) + static partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings) { settings.Configure(); } diff --git a/tools/sdk/Notifo.SDK/Generated.cs b/tools/sdk/Notifo.SDK/Generated.cs index 26d36bb5..7a06884e 100644 --- a/tools/sdk/Notifo.SDK/Generated.cs +++ b/tools/sdk/Notifo.SDK/Generated.cs @@ -112,13 +112,11 @@ public partial interface IUserClient public partial class UserClient : IUserClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public UserClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -145,7 +143,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetUserAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -232,7 +232,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -329,7 +331,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetAdminUserAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -413,7 +417,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task> GetTopicsAsync(string language = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -506,7 +512,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetMySubscriptionsAsync(string topics = null, string query = null, int? take = null, int? skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -614,7 +622,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -712,7 +722,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("topic"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -809,7 +821,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("prefix"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1134,13 +1148,11 @@ public partial interface IUsersClient public partial class UsersClient : IUsersClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public UsersClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -1175,7 +1187,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1292,7 +1306,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1406,7 +1422,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1512,7 +1530,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1619,7 +1639,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1738,7 +1760,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1851,7 +1875,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("prefix"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -1961,7 +1987,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2074,7 +2102,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("prefix"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2184,7 +2214,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("token"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2294,7 +2326,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("endpoint"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2538,13 +2572,11 @@ public partial interface ITopicsClient public partial class TopicsClient : ITopicsClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public TopicsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -2579,7 +2611,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2696,7 +2730,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -2803,7 +2839,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("path"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3038,13 +3076,11 @@ public partial interface ITemplatesClient public partial class TemplatesClient : ITemplatesClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public TemplatesClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -3078,7 +3114,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3185,7 +3223,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3292,7 +3332,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("code"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3561,13 +3603,11 @@ public partial interface ISystemUsersClient public partial class SystemUsersClient : ISystemUsersClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public SystemUsersClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -3597,7 +3637,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetUsersAsync(string query = null, int? take = null, int? skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3698,7 +3740,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3799,7 +3843,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -3897,7 +3943,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -4009,7 +4057,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -4111,7 +4161,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -4221,7 +4273,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -4473,13 +4527,11 @@ public partial interface IPingClient public partial class PingClient : IPingClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public PingClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -4510,7 +4562,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetOldPingAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -4590,7 +4644,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetPingAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -4669,7 +4725,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -4940,13 +4998,11 @@ public partial interface INotificationsClient public partial class NotificationsClient : INotificationsClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public NotificationsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -4983,7 +5039,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5114,7 +5172,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5239,7 +5299,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetMyNotificationsAsync(System.Collections.Generic.IEnumerable channels = null, string channel = null, string correlationId = null, string query = null, int? take = null, int? skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5349,7 +5411,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetMyArchiveAsync(string channel = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5442,7 +5506,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetMyDeviceNotificationsAsync(string deviceIdentifier = null, System.DateTimeOffset? after = null, DeviceNotificationsQueryScope? scope = null, int? take = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5547,7 +5613,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5777,13 +5845,11 @@ public partial interface IMobilePushClient public partial class MobilePushClient : IMobilePushClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public MobilePushClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -5810,7 +5876,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetMyTokenAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5897,7 +5965,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -5992,7 +6062,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("token"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6311,13 +6383,11 @@ public partial interface IMediaClient public partial class MediaClient : IMediaClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public MediaClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -6351,7 +6421,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6460,7 +6532,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6590,7 +6664,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("fileName"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6682,7 +6758,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (status_ == 200 || status_ == 201 || 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_); + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } @@ -6738,7 +6814,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("fileName"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6854,7 +6932,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("fileName"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -6946,7 +7026,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (status_ == 200 || status_ == 201 || 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_); + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } @@ -7014,7 +7094,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("fileName"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -7106,7 +7188,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (status_ == 200 || status_ == 201 || 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_); + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } @@ -7167,7 +7249,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task ProxyImageAsync(string url = null, long? cache = null, int? download = null, string bg = null, int? width = null, int? height = null, int? quality = null, string preset = null, ResizeMode? mode = null, float? focusX = null, float? focusY = null, bool? force = null, bool? emptyOnFailure = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -7260,7 +7344,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (status_ == 200 || status_ == 201 || 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_); + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } @@ -7436,13 +7520,11 @@ public partial interface ILogsClient public partial class LogsClient : ILogsClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public LogsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -7479,7 +7561,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -7741,13 +7825,11 @@ public partial interface IEventsClient public partial class EventsClient : IEventsClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public EventsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -7782,7 +7864,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -7899,7 +7983,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -8002,7 +8088,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -8228,13 +8316,11 @@ public partial interface IDiagnosticsClient public partial class DiagnosticsClient : IDiagnosticsClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public DiagnosticsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -8261,7 +8347,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetDumpAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -8348,7 +8436,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetGCDumpAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -8564,13 +8654,11 @@ public partial interface IConfigsClient public partial class ConfigsClient : IConfigsClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public ConfigsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -8597,7 +8685,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task> GetTimezonesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -8680,7 +8770,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task> GetLanguagesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -8987,13 +9079,11 @@ public partial interface IEmailTemplatesClient public partial class EmailTemplatesClient : IEmailTemplatesClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public EmailTemplatesClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -9019,7 +9109,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task GetSchemaAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9110,7 +9202,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9153,7 +9247,7 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() if (status_ == 200 || status_ == 201 || 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_); + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse return fileResponse_; } @@ -9209,7 +9303,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9321,7 +9417,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9434,7 +9532,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9547,7 +9647,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9651,7 +9753,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9768,7 +9872,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9882,7 +9988,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("code"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -9993,7 +10101,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -10112,7 +10222,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("language"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -10413,13 +10525,11 @@ public partial interface IMessagingTemplatesClient public partial class MessagingTemplatesClient : IMessagingTemplatesClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public MessagingTemplatesClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -10453,7 +10563,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -10566,7 +10678,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -10679,7 +10793,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -10783,7 +10899,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -10900,7 +11018,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -11014,7 +11134,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("code"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -11125,7 +11247,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -11244,7 +11368,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("language"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -11545,13 +11671,11 @@ public partial interface ISmsTemplatesClient public partial class SmsTemplatesClient : ISmsTemplatesClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public SmsTemplatesClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -11585,7 +11709,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -11698,7 +11824,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -11811,7 +11939,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -11915,7 +12045,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12032,7 +12164,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12146,7 +12280,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("code"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12257,7 +12393,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12376,7 +12514,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("language"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12689,13 +12829,11 @@ public partial interface IAppsClient public partial class AppsClient : IAppsClient { private Notifo.SDK.Configuration.IHttpClientProvider _httpClientProvider; - private System.Net.Http.HttpClient _httpClient; private static System.Lazy _settings = new System.Lazy(CreateSerializerSettings, true); public AppsClient(Notifo.SDK.Configuration.IHttpClientProvider httpClientProvider) { _httpClientProvider = httpClientProvider; - _httpClient = httpClient; } private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() @@ -12722,7 +12860,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() public virtual async System.Threading.Tasks.Task> GetAppsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12809,7 +12949,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -12910,7 +13052,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13008,7 +13152,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13120,7 +13266,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13233,7 +13381,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("contributorId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13340,7 +13490,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("appId"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13439,7 +13591,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13556,7 +13710,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("request"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) @@ -13664,7 +13820,9 @@ private static Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() throw new System.ArgumentNullException("id"); var client_ = _httpClientProvider.Get(); + #pragma warning disable CS0219 // Variable is assigned but its value is never used var disposeClient_ = false; + #pragma warning restore CS0219 // Variable is assigned but its value is never used try { using (var request_ = new System.Net.Http.HttpRequestMessage()) From 4b613422f717ae86277133634b6a3f0656c247a1 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 12 Jan 2024 20:02:20 +0100 Subject: [PATCH 4/4] Fix ID generation. --- backend/src/Notifo.Identity/Notifo.Identity.csproj | 2 +- backend/src/Notifo/Areas/Account/Pages/_Layout.cshtml | 2 +- backend/src/Notifo/Areas/Account/Pages/_LayoutLogin.cshtml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/Notifo.Identity/Notifo.Identity.csproj b/backend/src/Notifo.Identity/Notifo.Identity.csproj index 4658440e..621760ad 100644 --- a/backend/src/Notifo.Identity/Notifo.Identity.csproj +++ b/backend/src/Notifo.Identity/Notifo.Identity.csproj @@ -17,7 +17,7 @@ - + diff --git a/backend/src/Notifo/Areas/Account/Pages/_Layout.cshtml b/backend/src/Notifo/Areas/Account/Pages/_Layout.cshtml index dc1caa21..5d2d7e1c 100644 --- a/backend/src/Notifo/Areas/Account/Pages/_Layout.cshtml +++ b/backend/src/Notifo/Areas/Account/Pages/_Layout.cshtml @@ -20,7 +20,7 @@ } - + diff --git a/backend/src/Notifo/Areas/Account/Pages/_LayoutLogin.cshtml b/backend/src/Notifo/Areas/Account/Pages/_LayoutLogin.cshtml index ccb4de16..161719d9 100644 --- a/backend/src/Notifo/Areas/Account/Pages/_LayoutLogin.cshtml +++ b/backend/src/Notifo/Areas/Account/Pages/_LayoutLogin.cshtml @@ -27,7 +27,7 @@ var galleryEnabled = false; } - +