diff --git a/fern/pages/changelogs/csharp-sdk/2025-03-31.mdx b/fern/pages/changelogs/csharp-sdk/2025-03-31.mdx new file mode 100644 index 00000000000..89f65b74bc1 --- /dev/null +++ b/fern/pages/changelogs/csharp-sdk/2025-03-31.mdx @@ -0,0 +1,5 @@ +## 1.15.12 +**`(fix):`** Fallback from `init` to `set` on .NET Framework & .NET Standard 2.0 for public and protected properties. +This ensures the properties can be set on older TFMs without compilation errors. + + diff --git a/generators/csharp/base/src/asIs/FileParameter.Template.cs b/generators/csharp/base/src/asIs/FileParameter.Template.cs index 5756f8c2499..dc6eda5d42b 100644 --- a/generators/csharp/base/src/asIs/FileParameter.Template.cs +++ b/generators/csharp/base/src/asIs/FileParameter.Template.cs @@ -14,17 +14,17 @@ public record FileParameter : /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/generators/csharp/base/src/asIs/GrpcRequestOptions.Template.cs b/generators/csharp/base/src/asIs/GrpcRequestOptions.Template.cs index 2055b3aeb35..0103fc997dd 100644 --- a/generators/csharp/base/src/asIs/GrpcRequestOptions.Template.cs +++ b/generators/csharp/base/src/asIs/GrpcRequestOptions.Template.cs @@ -8,25 +8,60 @@ public partial class GrpcRequestOptions /// /// The maximum number of retry attempts. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { + get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { + get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Options for write operations. /// - public WriteOptions? WriteOptions { get; init; } + public WriteOptions? WriteOptions { + get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Client-side call credentials. Provide authorization with per-call granularity. /// - public CallCredentials? CallCredentials { get; init; } + public CallCredentials? CallCredentials { + get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Headers to be sent with this particular request. /// - internal Headers Headers { get; init; } = new(); + internal Headers Headers { + get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new(); } diff --git a/generators/csharp/codegen/src/ast/Field.ts b/generators/csharp/codegen/src/ast/Field.ts index 237721d7fc2..0c370f7dc98 100644 --- a/generators/csharp/codegen/src/ast/Field.ts +++ b/generators/csharp/codegen/src/ast/Field.ts @@ -208,10 +208,27 @@ export class Field extends AstNode { writer.write("get; "); } if (this.init) { - if (!this.hasSameAccess(this.init)) { - writer.write(`${this.init} `); + // if init is accessible to the end user (public, or protected through inheritance), + // we should not expose init to the user on .NET Framework + const needsFallback = + (this.access === Access.Public || this.access === Access.Protected) && + (this.init === true || this.init === Access.Public || this.init === Access.Protected); + if (needsFallback) { + writer.writeLine(); + writer.writeNoIndent("#if NET5_0_OR_GREATER\n"); + if (!this.hasSameAccess(this.init)) { + writer.write(`${this.init} `); + } + writer.writeTextStatement("init"); + writer.writeNoIndent("#else\n"); + writer.writeTextStatement("set"); + writer.writeNoIndent("#endif\n"); + } else { + if (!this.hasSameAccess(this.init)) { + writer.write(`${this.init} `); + } + writer.write("init; "); } - writer.write("init; "); } if (this.set) { if (!this.hasSameAccess(this.set)) { diff --git a/generators/csharp/sdk/src/root-client/RootClientGenerator.ts b/generators/csharp/sdk/src/root-client/RootClientGenerator.ts index cc1a155006e..64ebdf260b4 100644 --- a/generators/csharp/sdk/src/root-client/RootClientGenerator.ts +++ b/generators/csharp/sdk/src/root-client/RootClientGenerator.ts @@ -111,7 +111,6 @@ export class RootClientGenerator extends FileGenerator IR parser. - + the new OpenAPI -> IR parser. + type: fix irVersion: 57 version: 0.57.5 @@ -66,7 +66,7 @@ ``` Each namespace creates a separate package in the generated IR, allowing for clear separation between different versions or components of your API. - + type: feat irVersion: 57 version: 0.57.4 @@ -80,9 +80,9 @@ - changelogEntry: - summary: | - Add support for parsing `type: enum` in OpenAPI schemas. This allows for proper conversion of enum types that use the + Add support for parsing `type: enum` in OpenAPI schemas. This allows for proper conversion of enum types that use the non-standard `type: enum` format instead of the standard `type: string` with `enum` values. - + type: feat irVersion: 57 version: 0.57.2 @@ -97,7 +97,7 @@ You are an AI assistant. Only respond to questions using information from the documents. Include markdown footnotes to the sources of your information. - + type: feat irVersion: 57 version: 0.57.1 @@ -203,8 +203,8 @@ - changelogEntry: - summary: | - The `fern init --openapi` command now references the OpenAPI file in - place using the new `specs` syntax in generators.yml instead of copying the file into the + The `fern init --openapi` command now references the OpenAPI file in + place using the new `specs` syntax in generators.yml instead of copying the file into the Fern directory. This makes it easier to maintain the source OpenAPI file separately from the Fern configuration. type: fix irVersion: 57 @@ -327,8 +327,8 @@ - changelogEntry: - summary: | - Updated the CLI to gracefully handle unsupported security schemes (e.g. cookie-based auth) by skipping them - instead of throwing an error. This allows the CLI to continue processing the rest of the API definition even when + Updated the CLI to gracefully handle unsupported security schemes (e.g. cookie-based auth) by skipping them + instead of throwing an error. This allows the CLI to continue processing the rest of the API definition even when it encounters security schemes it cannot convert. type: fix irVersion: 56 @@ -373,14 +373,14 @@ type: fix irVersion: 56 version: 0.56.0 - + - changelogEntry: - summary: | - Hidden sections are now removed from the docs sitemap. + Hidden sections are now removed from the docs sitemap. type: fix irVersion: 56 version: 0.56.0-rc6 - + - changelogEntry: - summary: | Fixed duplicate validation messages in docs validation by deduplicating violations diff --git a/seed/csharp-model/accept-header/src/SeedAccept/Core/Public/FileParameter.cs b/seed/csharp-model/accept-header/src/SeedAccept/Core/Public/FileParameter.cs index 5af2475c4dd..5615002ed06 100644 --- a/seed/csharp-model/accept-header/src/SeedAccept/Core/Public/FileParameter.cs +++ b/seed/csharp-model/accept-header/src/SeedAccept/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/alias-extends/src/SeedAliasExtends/Core/Public/FileParameter.cs b/seed/csharp-model/alias-extends/src/SeedAliasExtends/Core/Public/FileParameter.cs index 1b9d68d8ba1..d25743e74d4 100644 --- a/seed/csharp-model/alias-extends/src/SeedAliasExtends/Core/Public/FileParameter.cs +++ b/seed/csharp-model/alias-extends/src/SeedAliasExtends/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/alias/src/SeedAlias/Core/Public/FileParameter.cs b/seed/csharp-model/alias/src/SeedAlias/Core/Public/FileParameter.cs index 58078ca8750..f43f769d2ad 100644 --- a/seed/csharp-model/alias/src/SeedAlias/Core/Public/FileParameter.cs +++ b/seed/csharp-model/alias/src/SeedAlias/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/any-auth/src/SeedAnyAuth/Core/Public/FileParameter.cs b/seed/csharp-model/any-auth/src/SeedAnyAuth/Core/Public/FileParameter.cs index bbe5574a4e8..3ec65fe0e70 100644 --- a/seed/csharp-model/any-auth/src/SeedAnyAuth/Core/Public/FileParameter.cs +++ b/seed/csharp-model/any-auth/src/SeedAnyAuth/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/FileParameter.cs b/seed/csharp-model/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/FileParameter.cs index ab236cf8f95..2c6034398e8 100644 --- a/seed/csharp-model/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/FileParameter.cs +++ b/seed/csharp-model/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/audiences/src/SeedAudiences/Core/Public/FileParameter.cs b/seed/csharp-model/audiences/src/SeedAudiences/Core/Public/FileParameter.cs index ac20013e45d..c9b7cd268e5 100644 --- a/seed/csharp-model/audiences/src/SeedAudiences/Core/Public/FileParameter.cs +++ b/seed/csharp-model/audiences/src/SeedAudiences/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/FileParameter.cs b/seed/csharp-model/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/FileParameter.cs index 55824949e95..c17c8ce2a11 100644 --- a/seed/csharp-model/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/FileParameter.cs +++ b/seed/csharp-model/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/FileParameter.cs b/seed/csharp-model/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/FileParameter.cs index 9660209f564..de0606a06a6 100644 --- a/seed/csharp-model/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/FileParameter.cs +++ b/seed/csharp-model/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/basic-auth/src/SeedBasicAuth/Core/Public/FileParameter.cs b/seed/csharp-model/basic-auth/src/SeedBasicAuth/Core/Public/FileParameter.cs index 575394f2b64..a586c7a2d9b 100644 --- a/seed/csharp-model/basic-auth/src/SeedBasicAuth/Core/Public/FileParameter.cs +++ b/seed/csharp-model/basic-auth/src/SeedBasicAuth/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/FileParameter.cs b/seed/csharp-model/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/FileParameter.cs index 44d6f26b118..51c078fc2b1 100644 --- a/seed/csharp-model/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/FileParameter.cs +++ b/seed/csharp-model/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/bytes/src/SeedBytes/Core/Public/FileParameter.cs b/seed/csharp-model/bytes/src/SeedBytes/Core/Public/FileParameter.cs index f8f63e299af..4486f242873 100644 --- a/seed/csharp-model/bytes/src/SeedBytes/Core/Public/FileParameter.cs +++ b/seed/csharp-model/bytes/src/SeedBytes/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/circular-references-advanced/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-model/circular-references-advanced/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-model/circular-references-advanced/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-model/circular-references-advanced/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/circular-references/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-model/circular-references/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-model/circular-references/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-model/circular-references/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/content-type/.editorconfig b/seed/csharp-model/content-type/.editorconfig new file mode 100644 index 00000000000..a450a4ea14b --- /dev/null +++ b/seed/csharp-model/content-type/.editorconfig @@ -0,0 +1,34 @@ +root = true + +[*.cs] +resharper_arrange_object_creation_when_type_evident_highlighting = hint +resharper_auto_property_can_be_made_get_only_global_highlighting = hint +resharper_check_namespace_highlighting = hint +resharper_class_never_instantiated_global_highlighting = hint +resharper_collection_never_updated_global_highlighting = hint +resharper_convert_type_check_pattern_to_null_check_highlighting = hint +resharper_inconsistent_naming_highlighting = hint +resharper_member_can_be_private_global_highlighting = hint +resharper_not_accessed_field_local_highlighting = hint +resharper_partial_type_with_single_part_highlighting = hint +resharper_prefer_concrete_value_over_default_highlighting = none +resharper_private_field_can_be_converted_to_local_variable_highlighting = hint +resharper_property_can_be_made_init_only_global_highlighting = hint +resharper_redundant_name_qualifier_highlighting = none +resharper_redundant_using_directive_highlighting = hint +resharper_replace_slice_with_range_indexer_highlighting = none +resharper_unused_auto_property_accessor_global_highlighting = hint +resharper_unused_auto_property_accessor_local_highlighting = hint +resharper_unused_member_global_highlighting = hint +resharper_unused_type_global_highlighting = hint +resharper_use_string_interpolation_highlighting = hint +resharper_property_can_be_made_init_only_local_highlighting = hint +resharper_member_hides_static_from_outer_class_highlighting = hint +resharper_class_never_instantiated_local_highlighting = hint +dotnet_diagnostic.CS1591.severity = suggestion + +[src/**/Types/*.cs] +resharper_check_namespace_highlighting = none + +[src/**/Core/Public/*.cs] +resharper_check_namespace_highlighting = none \ No newline at end of file diff --git a/seed/csharp-model/content-type/.github/workflows/ci.yml b/seed/csharp-model/content-type/.github/workflows/ci.yml new file mode 100644 index 00000000000..03bb29b44a1 --- /dev/null +++ b/seed/csharp-model/content-type/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: ci + +on: [push] + +jobs: + compile: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - uses: actions/checkout@master + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Install tools + run: | + dotnet tool restore + + - name: Build Release + run: dotnet build src -c Release /p:ContinuousIntegrationBuild=true + + unit-tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - uses: actions/checkout@master + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Install tools + run: | + dotnet tool restore + + - name: Run Tests + run: | + dotnet test src + + + publish: + needs: [compile] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Publish + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_TOKEN }} + run: | + dotnet pack src -c Release + dotnet nuget push src/SeedContentTypes/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source "nuget.org" diff --git a/seed/csharp-model/content-type/.gitignore b/seed/csharp-model/content-type/.gitignore new file mode 100644 index 00000000000..11014f2b33d --- /dev/null +++ b/seed/csharp-model/content-type/.gitignore @@ -0,0 +1,484 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +## This is based on `dotnet new gitignore` and customized by Fern + +# dotenv files +.env + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +# [Rr]elease/ (Ignored by Fern) +# [Rr]eleases/ (Ignored by Fern) +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +# [Ll]og/ (Ignored by Fern) +# [Ll]ogs/ (Ignored by Fern) + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml +.idea + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-model/content-type/.mock/definition/api.yml b/seed/csharp-model/content-type/.mock/definition/api.yml new file mode 100644 index 00000000000..ea70b01ab76 --- /dev/null +++ b/seed/csharp-model/content-type/.mock/definition/api.yml @@ -0,0 +1 @@ +name: content-types \ No newline at end of file diff --git a/seed/csharp-model/content-type/.mock/definition/service.yml b/seed/csharp-model/content-type/.mock/definition/service.yml new file mode 100644 index 00000000000..8f029ae49e0 --- /dev/null +++ b/seed/csharp-model/content-type/.mock/definition/service.yml @@ -0,0 +1,16 @@ +service: + auth: false + base-path: '' + endpoints: + patch: + method: PATCH + path: / + request: + body: + properties: + application: nullable + require_auth: nullable + content-type: application/merge-patch+json + name: PatchProxyRequest + source: + openapi: ../specs/vault/swagger.json diff --git a/seed/csharp-model/content-type/.mock/fern.config.json b/seed/csharp-model/content-type/.mock/fern.config.json new file mode 100644 index 00000000000..4c8e54ac313 --- /dev/null +++ b/seed/csharp-model/content-type/.mock/fern.config.json @@ -0,0 +1 @@ +{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/csharp-model/content-type/.mock/generators.yml b/seed/csharp-model/content-type/.mock/generators.yml new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/seed/csharp-model/content-type/.mock/generators.yml @@ -0,0 +1 @@ +{} diff --git a/seed/csharp-model/content-type/snippet-templates.json b/seed/csharp-model/content-type/snippet-templates.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/csharp-model/content-type/snippet.json b/seed/csharp-model/content-type/snippet.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/DateOnlyJsonTests.cs b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/DateOnlyJsonTests.cs new file mode 100644 index 00000000000..882da6acf4c --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/DateOnlyJsonTests.cs @@ -0,0 +1,76 @@ +using NUnit.Framework; +using SeedContentTypes.Core; + +namespace SeedContentTypes.Test.Core.Json; + +[TestFixture] +public class DateOnlyJsonTests +{ + [Test] + public void SerializeDateOnly_ShouldMatchExpectedFormat() + { + (DateOnly dateOnly, string expected)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (new DateOnly(2023, 1, 1), "\"2023-01-01\""), + (new DateOnly(2023, 12, 31), "\"2023-12-31\""), + (new DateOnly(2023, 6, 15), "\"2023-06-15\""), + (new DateOnly(2023, 3, 10), "\"2023-03-10\""), + ]; + foreach (var (dateOnly, expected) in testCases) + { + var json = JsonUtils.Serialize(dateOnly); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeDateOnly_ShouldMatchExpectedDateOnly() + { + (DateOnly expected, string json)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (new DateOnly(2023, 1, 1), "\"2023-01-01\""), + (new DateOnly(2023, 12, 31), "\"2023-12-31\""), + (new DateOnly(2023, 6, 15), "\"2023-06-15\""), + (new DateOnly(2023, 3, 10), "\"2023-03-10\""), + ]; + + foreach (var (expected, json) in testCases) + { + var dateOnly = JsonUtils.Deserialize(json); + Assert.That(dateOnly, Is.EqualTo(expected)); + } + } + + [Test] + public void SerializeNullableDateOnly_ShouldMatchExpectedFormat() + { + (DateOnly? dateOnly, string expected)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (null, "null"), + ]; + foreach (var (dateOnly, expected) in testCases) + { + var json = JsonUtils.Serialize(dateOnly); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeNullableDateOnly_ShouldMatchExpectedDateOnly() + { + (DateOnly? expected, string json)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateOnly = JsonUtils.Deserialize(json); + Assert.That(dateOnly, Is.EqualTo(expected)); + } + } +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/DateTimeJsonTests.cs b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/DateTimeJsonTests.cs new file mode 100644 index 00000000000..124430db4ef --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/DateTimeJsonTests.cs @@ -0,0 +1,110 @@ +using NUnit.Framework; +using SeedContentTypes.Core; + +namespace SeedContentTypes.Test.Core.Json; + +[TestFixture] +public class DateTimeJsonTests +{ + [Test] + public void SerializeDateTime_ShouldMatchExpectedFormat() + { + (DateTime dateTime, string expected)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), "\"2023-01-01T00:00:00.000Z\""), + ( + new DateTime(2023, 12, 31, 23, 59, 59, DateTimeKind.Utc), + "\"2023-12-31T23:59:59.000Z\"" + ), + (new DateTime(2023, 6, 15, 12, 0, 0, DateTimeKind.Utc), "\"2023-06-15T12:00:00.000Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.000Z\"" + ), + ( + new DateTime(2023, 3, 10, 8, 45, 30, 123, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.123Z\"" + ), + ]; + foreach (var (dateTime, expected) in testCases) + { + var json = JsonUtils.Serialize(dateTime); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeDateTime_ShouldMatchExpectedDateTime() + { + (DateTime expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), "\"2023-01-01T00:00:00.000Z\""), + ( + new DateTime(2023, 12, 31, 23, 59, 59, DateTimeKind.Utc), + "\"2023-12-31T23:59:59.000Z\"" + ), + (new DateTime(2023, 6, 15, 12, 0, 0, DateTimeKind.Utc), "\"2023-06-15T12:00:00.000Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.000Z\"" + ), + (new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), "\"2023-03-10T08:45:30Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, 123, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.123Z\"" + ), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } + + [Test] + public void SerializeNullableDateTime_ShouldMatchExpectedFormat() + { + (DateTime? expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeNullableDateTime_ShouldMatchExpectedDateTime() + { + (DateTime? expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/EnumSerializerTests.cs b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/EnumSerializerTests.cs new file mode 100644 index 00000000000..21950a9b28d --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/EnumSerializerTests.cs @@ -0,0 +1,60 @@ +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using NUnit.Framework; +using SeedContentTypes.Core; + +namespace SeedContentTypes.Test.Core.Json; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class StringEnumSerializerTests +{ + private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true }; + + private const DummyEnum KnownEnumValue2 = DummyEnum.KnownValue2; + private const string KnownEnumValue2String = "known_value2"; + + private const string JsonWithKnownEnum2 = $$""" + { + "enum_property": "{{KnownEnumValue2String}}" + } + """; + + [Test] + public void ShouldParseKnownEnumValue2() + { + var obj = JsonSerializer.Deserialize(JsonWithKnownEnum2, JsonOptions); + Assert.That(obj, Is.Not.Null); + Assert.That(obj.EnumProperty, Is.EqualTo(KnownEnumValue2)); + } + + [Test] + public void ShouldSerializeKnownEnumValue2() + { + var json = JsonSerializer.SerializeToElement( + new DummyObject { EnumProperty = KnownEnumValue2 }, + JsonOptions + ); + TestContext.Out.WriteLine("Serialized JSON: \n" + json); + var enumString = json.GetProperty("enum_property").GetString(); + Assert.That(enumString, Is.Not.Null); + Assert.That(enumString, Is.EqualTo(KnownEnumValue2String)); + } +} + +public class DummyObject +{ + [JsonPropertyName("enum_property")] + public DummyEnum EnumProperty { get; set; } +} + +[JsonConverter(typeof(EnumSerializer))] +public enum DummyEnum +{ + [EnumMember(Value = "known_value1")] + KnownValue1, + + [EnumMember(Value = "known_value2")] + KnownValue2, +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/JsonAccessAttributeTests.cs b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/JsonAccessAttributeTests.cs new file mode 100644 index 00000000000..783763a148b --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/JsonAccessAttributeTests.cs @@ -0,0 +1,46 @@ +using global::System.Text.Json.Serialization; +using NUnit.Framework; +using SeedContentTypes.Core; + +namespace SeedContentTypes.Test.Core.Json; + +[TestFixture] +public class JsonAccessAttributeTests +{ + private class MyClass + { + [JsonPropertyName("read_only_prop")] + [JsonAccess(JsonAccessType.ReadOnly)] + public string? ReadOnlyProp { get; set; } + + [JsonPropertyName("write_only_prop")] + [JsonAccess(JsonAccessType.WriteOnly)] + public string? WriteOnlyProp { get; set; } + + [JsonPropertyName("normal_prop")] + public string? NormalProp { get; set; } + } + + [Test] + public void JsonAccessAttribute_ShouldWorkAsExpected() + { + const string json = + """ { "read_only_prop": "read", "write_only_prop": "write", "normal_prop": "normal_prop" } """; + var obj = JsonUtils.Deserialize(json); + + Assert.Multiple(() => + { + Assert.That(obj.ReadOnlyProp, Is.EqualTo("read")); + Assert.That(obj.WriteOnlyProp, Is.Null); + Assert.That(obj.NormalProp, Is.EqualTo("normal_prop")); + }); + + obj.WriteOnlyProp = "write"; + obj.NormalProp = "new_value"; + + var serializedJson = JsonUtils.Serialize(obj); + const string expectedJson = + "{ \"write_only_prop\": \"write\",\n \"normal_prop\": \"new_value\" }"; + Assert.That(serializedJson, Is.EqualTo(expectedJson).IgnoreWhiteSpace); + } +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/OneOfSerializerTests.cs b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/OneOfSerializerTests.cs new file mode 100644 index 00000000000..d52b073f676 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Core/Json/OneOfSerializerTests.cs @@ -0,0 +1,314 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using NUnit.Framework; +using OneOf; +using SeedContentTypes.Core; + +namespace SeedContentTypes.Test.Core.Json; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class OneOfSerializerTests +{ + private class Foo + { + [JsonPropertyName("string_prop")] + public required string StringProp { get; set; } + } + + private class Bar + { + [JsonPropertyName("int_prop")] + public required int IntProp { get; set; } + } + + private static readonly OneOf OneOf1 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT2(new { }); + private const string OneOf1String = "{}"; + + private static readonly OneOf OneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT0("test"); + private const string OneOf2String = "\"test\""; + + private static readonly OneOf OneOf3 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT1(123); + private const string OneOf3String = "123"; + + private static readonly OneOf OneOf4 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT3(new Foo { StringProp = "test" }); + private const string OneOf4String = "{\"string_prop\": \"test\"}"; + + private static readonly OneOf OneOf5 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string OneOf5String = "{\"int_prop\": 5}"; + + [Test] + public void Serialize_OneOfs_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void OneOfs_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value)).IgnoreWhiteSpace); + } + }); + } + + private static readonly OneOf? NullableOneOf1 = null; + private const string NullableOneOf1String = "null"; + + private static readonly OneOf? NullableOneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string NullableOneOf2String = "{\"int_prop\": 5}"; + + [Test] + public void Serialize_NullableOneOfs_Should_Return_Expected_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void NullableOneOfs_Should_Deserialize_From_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize?>(json); + Assert.That(result?.Index, Is.EqualTo(oneOf?.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result?.Value)).IgnoreWhiteSpace); + } + }); + } + + private static readonly OneOf OneOfWithNullable1 = OneOf< + string, + int, + Foo? + >.FromT2(null); + private const string OneOfWithNullable1String = "null"; + + private static readonly OneOf OneOfWithNullable2 = OneOf< + string, + int, + Foo? + >.FromT2(new Foo { StringProp = "test" }); + private const string OneOfWithNullable2String = "{\"string_prop\": \"test\"}"; + + private static readonly OneOf OneOfWithNullable3 = OneOf< + string, + int, + Foo? + >.FromT0("test"); + private const string OneOfWithNullable3String = "\"test\""; + + [Test] + public void Serialize_OneOfWithNullables_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOfWithNullable1, OneOfWithNullable1String), + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void OneOfWithNullables_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + // (OneOfWithNullable1, OneOfWithNullable1String), // not possible with .NET's JSON serializer + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value)).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void Serialize_OneOfWithObjectLast_Should_Return_Expected_String() + { + var oneOfWithObjectLast = OneOf.FromT4( + new { random = "data" } + ); + const string oneOfWithObjectLastString = "{\"random\": \"data\"}"; + + var result = JsonUtils.Serialize(oneOfWithObjectLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectLastString).IgnoreWhiteSpace); + } + + [Test] + public void OneOfWithObjectLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectLastString = "{\"random\": \"data\"}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(4)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That( + JsonUtils.Serialize(result.Value), + Is.EqualTo(oneOfWithObjectLastString).IgnoreWhiteSpace + ); + }); + } + + [Test] + public void Serialize_OneOfWithObjectNotLast_Should_Return_Expected_String() + { + var oneOfWithObjectNotLast = OneOf.FromT1( + new { random = "data" } + ); + const string oneOfWithObjectNotLastString = "{\"random\": \"data\"}"; + + var result = JsonUtils.Serialize(oneOfWithObjectNotLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectNotLastString).IgnoreWhiteSpace); + } + + [Test] + public void OneOfWithObjectNotLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectNotLastString = "{\"random\": \"data\"}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectNotLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(1)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That( + JsonUtils.Serialize(result.Value), + Is.EqualTo(oneOfWithObjectNotLastString).IgnoreWhiteSpace + ); + }); + } + + [Test] + public void Serialize_OneOfSingleType_Should_Return_Expected_String() + { + var oneOfSingle = OneOf.FromT0("single"); + const string oneOfSingleString = "\"single\""; + + var result = JsonUtils.Serialize(oneOfSingle); + Assert.That(result, Is.EqualTo(oneOfSingleString)); + } + + [Test] + public void OneOfSingleType_Should_Deserialize_From_String() + { + const string oneOfSingleString = "\"single\""; + var result = JsonUtils.Deserialize>(oneOfSingleString); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(0)); + Assert.That(result.Value, Is.EqualTo("single")); + }); + } + + [Test] + public void Deserialize_InvalidData_Should_Throw_Exception() + { + const string invalidJson = "{\"invalid\": \"data\"}"; + + Assert.Throws(() => + { + JsonUtils.Deserialize>(invalidJson); + }); + } +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes.Test/SeedContentTypes.Test.Custom.props b/seed/csharp-model/content-type/src/SeedContentTypes.Test/SeedContentTypes.Test.Custom.props new file mode 100644 index 00000000000..55e683b0772 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes.Test/SeedContentTypes.Test.Custom.props @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/seed/csharp-model/content-type/src/SeedContentTypes.Test/SeedContentTypes.Test.csproj b/seed/csharp-model/content-type/src/SeedContentTypes.Test/SeedContentTypes.Test.csproj new file mode 100644 index 00000000000..72abc7e39f5 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes.Test/SeedContentTypes.Test.csproj @@ -0,0 +1,37 @@ + + + + net8.0 + 12 + enable + enable + false + true + true + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + \ No newline at end of file diff --git a/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs new file mode 100644 index 00000000000..1704c99af44 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs @@ -0,0 +1,236 @@ +using System.Text.Json; +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for EqualConstraint to handle JsonElement objects. +/// +public static class JsonElementComparerExtensions +{ + /// + /// Extension method for comparing JsonElement objects in NUnit tests. + /// Property order doesn't matter, but array order does matter. + /// Includes special handling for DateTime string formats. + /// + /// The Is.EqualTo() constraint instance. + /// A constraint that can compare JsonElements with detailed diffs. + public static EqualConstraint UsingJsonElementComparer(this EqualConstraint constraint) + { + return constraint.Using(new JsonElementComparer()); + } +} + +/// +/// Equality comparer for JsonElement with detailed reporting. +/// Property order doesn't matter, but array order does matter. +/// Now includes special handling for DateTime string formats with improved null handling. +/// +public class JsonElementComparer : IEqualityComparer +{ + private string _failurePath = string.Empty; + + /// + public bool Equals(JsonElement x, JsonElement y) + { + _failurePath = string.Empty; + return CompareJsonElements(x, y, string.Empty); + } + + /// + public int GetHashCode(JsonElement obj) + { + return JsonSerializer.Serialize(obj).GetHashCode(); + } + + private bool CompareJsonElements(JsonElement x, JsonElement y, string path) + { + // If value kinds don't match, they're not equivalent + if (x.ValueKind != y.ValueKind) + { + _failurePath = $"{path}: Expected {x.ValueKind} but got {y.ValueKind}"; + return false; + } + + switch (x.ValueKind) + { + case JsonValueKind.Object: + return CompareJsonObjects(x, y, path); + + case JsonValueKind.Array: + return CompareJsonArraysInOrder(x, y, path); + + case JsonValueKind.String: + string? xStr = x.GetString(); + string? yStr = y.GetString(); + + // Handle null strings + if (xStr is null && yStr is null) + return true; + + if (xStr is null || yStr is null) + { + _failurePath = + $"{path}: Expected {(xStr is null ? "null" : $"\"{xStr}\"")} but got {(yStr is null ? "null" : $"\"{yStr}\"")}"; + return false; + } + + // Check if they are identical strings + if (xStr == yStr) + return true; + + // Try to handle DateTime strings + if (IsLikelyDateTimeString(xStr) && IsLikelyDateTimeString(yStr)) + { + if (AreEquivalentDateTimeStrings(xStr, yStr)) + return true; + } + + _failurePath = $"{path}: Expected \"{xStr}\" but got \"{yStr}\""; + return false; + + case JsonValueKind.Number: + if (x.GetDecimal() != y.GetDecimal()) + { + _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + + return true; + + case JsonValueKind.True: + case JsonValueKind.False: + if (x.GetBoolean() != y.GetBoolean()) + { + _failurePath = $"{path}: Expected {x.GetBoolean()} but got {y.GetBoolean()}"; + return false; + } + + return true; + + case JsonValueKind.Null: + return true; + + default: + _failurePath = $"{path}: Unsupported JsonValueKind {x.ValueKind}"; + return false; + } + } + + private bool IsLikelyDateTimeString(string? str) + { + // Simple heuristic to identify likely ISO date time strings + return str != null + && (str.Contains("T") && (str.EndsWith("Z") || str.Contains("+") || str.Contains("-"))); + } + + private bool AreEquivalentDateTimeStrings(string str1, string str2) + { + // Try to parse both as DateTime + if (DateTime.TryParse(str1, out DateTime dt1) && DateTime.TryParse(str2, out DateTime dt2)) + { + return dt1 == dt2; + } + + return false; + } + + private bool CompareJsonObjects(JsonElement x, JsonElement y, string path) + { + // Create dictionaries for both JSON objects + var xProps = new Dictionary(); + var yProps = new Dictionary(); + + foreach (var prop in x.EnumerateObject()) + xProps[prop.Name] = prop.Value; + + foreach (var prop in y.EnumerateObject()) + yProps[prop.Name] = prop.Value; + + // Check if all properties in x exist in y + foreach (var key in xProps.Keys) + { + if (!yProps.ContainsKey(key)) + { + _failurePath = $"{path}: Missing property '{key}'"; + return false; + } + } + + // Check if y has extra properties + foreach (var key in yProps.Keys) + { + if (!xProps.ContainsKey(key)) + { + _failurePath = $"{path}: Unexpected property '{key}'"; + return false; + } + } + + // Compare each property value + foreach (var key in xProps.Keys) + { + var propPath = string.IsNullOrEmpty(path) ? key : $"{path}.{key}"; + if (!CompareJsonElements(xProps[key], yProps[key], propPath)) + { + return false; + } + } + + return true; + } + + private bool CompareJsonArraysInOrder(JsonElement x, JsonElement y, string path) + { + var xArray = x.EnumerateArray(); + var yArray = y.EnumerateArray(); + + // Count x elements + var xCount = 0; + var xElements = new List(); + foreach (var item in xArray) + { + xElements.Add(item); + xCount++; + } + + // Count y elements + var yCount = 0; + var yElements = new List(); + foreach (var item in yArray) + { + yElements.Add(item); + yCount++; + } + + // Check if counts match + if (xCount != yCount) + { + _failurePath = $"{path}: Expected {xCount} items but found {yCount}"; + return false; + } + + // Compare elements in order + for (var i = 0; i < xCount; i++) + { + var itemPath = $"{path}[{i}]"; + if (!CompareJsonElements(xElements[i], yElements[i], itemPath)) + { + return false; + } + } + + return true; + } + + /// + public override string ToString() + { + if (!string.IsNullOrEmpty(_failurePath)) + { + return $"JSON comparison failed at {_failurePath}"; + } + + return "JsonElementEqualityComparer"; + } +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/NUnitExtensions.cs b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/NUnitExtensions.cs new file mode 100644 index 00000000000..426df124538 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/NUnitExtensions.cs @@ -0,0 +1,28 @@ +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for NUnit constraints. +/// +public static class NUnitExtensions +{ + /// + /// Modifies the EqualConstraint to use our own set of default comparers. + /// + /// + /// + public static EqualConstraint UsingDefaults(this EqualConstraint constraint) => + constraint + .UsingPropertiesComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingOneOfComparer() + .UsingJsonElementComparer(); +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/OneOfComparer.cs b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/OneOfComparer.cs new file mode 100644 index 00000000000..0c975b471ff --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/OneOfComparer.cs @@ -0,0 +1,43 @@ +using NUnit.Framework.Constraints; +using OneOf; + +namespace NUnit.Framework; + +/// +/// Extensions for EqualConstraint to handle OneOf values. +/// +public static class EqualConstraintExtensions +{ + /// + /// Modifies the EqualConstraint to handle OneOf instances by comparing their inner values. + /// This works alongside other comparison modifiers like UsingPropertiesComparer. + /// + /// The EqualConstraint to modify. + /// The same constraint instance for method chaining. + public static EqualConstraint UsingOneOfComparer(this EqualConstraint constraint) + { + // Register a comparer factory for IOneOf types + constraint.Using( + (x, y) => + { + // ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract + if (x.Value is null && y.Value is null) + { + return true; + } + + if (x.Value is null) + { + return false; + } + + var propertiesComparer = new NUnitEqualityComparer(); + var tolerance = Tolerance.Default; + propertiesComparer.CompareProperties = true; + return propertiesComparer.AreEqual(x.Value, y.Value, ref tolerance); + } + ); + + return constraint; + } +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/ReadOnlyMemoryComparer.cs b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/ReadOnlyMemoryComparer.cs new file mode 100644 index 00000000000..fc0b595a5e5 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes.Test/Utils/ReadOnlyMemoryComparer.cs @@ -0,0 +1,87 @@ +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for NUnit constraints. +/// +public static class ReadOnlyMemoryComparerExtensions +{ + /// + /// Extension method for comparing ReadOnlyMemory<T> in NUnit tests. + /// + /// The type of elements in the ReadOnlyMemory. + /// The Is.EqualTo() constraint instance. + /// A constraint that can compare ReadOnlyMemory<T>. + public static EqualConstraint UsingReadOnlyMemoryComparer(this EqualConstraint constraint) + where T : IComparable + { + return constraint.Using(new ReadOnlyMemoryComparer()); + } +} + +/// +/// Comparer for ReadOnlyMemory<T>. Compares sequences by value. +/// +/// +/// The type of elements in the ReadOnlyMemory. +/// +public class ReadOnlyMemoryComparer : IComparer> + where T : IComparable +{ + /// + public int Compare(ReadOnlyMemory x, ReadOnlyMemory y) + { + // Check if sequences are equal + var xSpan = x.Span; + var ySpan = y.Span; + + // Optimized case for IEquatable implementations + if (typeof(IEquatable).IsAssignableFrom(typeof(T))) + { + var areEqual = xSpan.SequenceEqual(ySpan); + if (areEqual) + { + return 0; // Sequences are equal + } + } + else + { + // Manual equality check for non-IEquatable types + if (xSpan.Length == ySpan.Length) + { + var areEqual = true; + for (var i = 0; i < xSpan.Length; i++) + { + if (!EqualityComparer.Default.Equals(xSpan[i], ySpan[i])) + { + areEqual = false; + break; + } + } + + if (areEqual) + { + return 0; // Sequences are equal + } + } + } + + // For non-equal sequences, we need to return a consistent ordering + // First compare lengths + if (x.Length != y.Length) + return x.Length.CompareTo(y.Length); + + // Same length but different content - compare first differing element + for (var i = 0; i < x.Length; i++) + { + if (!EqualityComparer.Default.Equals(xSpan[i], ySpan[i])) + { + return xSpan[i].CompareTo(ySpan[i]); + } + } + + // Should never reach here if not equal + return 0; + } +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes/Core/CollectionItemSerializer.cs b/seed/csharp-model/content-type/src/SeedContentTypes/Core/CollectionItemSerializer.cs new file mode 100644 index 00000000000..ac2ecc55ed9 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes/Core/CollectionItemSerializer.cs @@ -0,0 +1,89 @@ +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedContentTypes.Core; + +/// +/// Json collection converter. +/// +/// Type of item to convert. +/// Converter to use for individual items. +internal class CollectionItemSerializer + : JsonConverter> + where TConverterType : JsonConverter +{ + /// + /// Reads a json string and deserializes it into an object. + /// + /// Json reader. + /// Type to convert. + /// Serializer options. + /// Created object. + public override IEnumerable? Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType == JsonTokenType.Null) + { + return default; + } + + var jsonSerializerOptions = new JsonSerializerOptions(options); + jsonSerializerOptions.Converters.Clear(); + jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); + + var returnValue = new List(); + + while (reader.TokenType != JsonTokenType.EndArray) + { + if (reader.TokenType != JsonTokenType.StartArray) + { + var item = (TDatatype)( + JsonSerializer.Deserialize(ref reader, typeof(TDatatype), jsonSerializerOptions) + ?? throw new Exception( + $"Failed to deserialize collection item of type {typeof(TDatatype)}" + ) + ); + returnValue.Add(item); + } + + reader.Read(); + } + + return returnValue; + } + + /// + /// Writes a json string. + /// + /// Json writer. + /// Value to write. + /// Serializer options. + public override void Write( + Utf8JsonWriter writer, + IEnumerable? value, + JsonSerializerOptions options + ) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + var jsonSerializerOptions = new JsonSerializerOptions(options); + jsonSerializerOptions.Converters.Clear(); + jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); + + writer.WriteStartArray(); + + foreach (var data in value) + { + JsonSerializer.Serialize(writer, data, jsonSerializerOptions); + } + + writer.WriteEndArray(); + } +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes/Core/Constants.cs b/seed/csharp-model/content-type/src/SeedContentTypes/Core/Constants.cs new file mode 100644 index 00000000000..4ff044e137d --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes/Core/Constants.cs @@ -0,0 +1,7 @@ +namespace SeedContentTypes.Core; + +internal static class Constants +{ + public const string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffK"; + public const string DateFormat = "yyyy-MM-dd"; +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes/Core/DateOnlyConverter.cs b/seed/csharp-model/content-type/src/SeedContentTypes/Core/DateOnlyConverter.cs new file mode 100644 index 00000000000..a1a5c8e4aa7 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes/Core/DateOnlyConverter.cs @@ -0,0 +1,748 @@ +// ReSharper disable All +#pragma warning disable + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using global::System.Diagnostics; +using global::System.Diagnostics.CodeAnalysis; +using global::System.Globalization; +using global::System.Runtime.CompilerServices; +using global::System.Runtime.InteropServices; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +// ReSharper disable SuggestVarOrType_SimpleTypes +// ReSharper disable SuggestVarOrType_BuiltInTypes + +namespace SeedContentTypes.Core +{ + /// + /// Custom converter for handling the data type with the System.Text.Json library. + /// + /// + /// This class backported from: + /// + /// System.Text.Json.Serialization.Converters.DateOnlyConverter + /// + public sealed class DateOnlyConverter : JsonConverter + { + private const int FormatLength = 10; // YYYY-MM-DD + + private const int MaxEscapedFormatLength = + FormatLength * JsonConstants.MaxExpansionFactorWhileEscaping; + + /// + public override DateOnly Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType != JsonTokenType.String) + { + ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); + } + + return ReadCore(ref reader); + } + + /// + public override DateOnly ReadAsPropertyName( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); + return ReadCore(ref reader); + } + + private static DateOnly ReadCore(ref Utf8JsonReader reader) + { + if ( + !JsonHelpers.IsInRangeInclusive( + reader.ValueLength(), + FormatLength, + MaxEscapedFormatLength + ) + ) + { + ThrowHelper.ThrowFormatException(DataType.DateOnly); + } + + scoped ReadOnlySpan source; + if (!reader.HasValueSequence && !reader.ValueIsEscaped) + { + source = reader.ValueSpan; + } + else + { + Span stackSpan = stackalloc byte[MaxEscapedFormatLength]; + int bytesWritten = reader.CopyString(stackSpan); + source = stackSpan.Slice(0, bytesWritten); + } + + if (!JsonHelpers.TryParseAsIso(source, out DateOnly value)) + { + ThrowHelper.ThrowFormatException(DataType.DateOnly); + } + + return value; + } + + /// + public override void Write( + Utf8JsonWriter writer, + DateOnly value, + JsonSerializerOptions options + ) + { +#if NET8_0_OR_GREATER + Span buffer = stackalloc byte[FormatLength]; +#else + Span buffer = stackalloc char[FormatLength]; +#endif + // ReSharper disable once RedundantAssignment + bool formattedSuccessfully = value.TryFormat( + buffer, + out int charsWritten, + "O".AsSpan(), + CultureInfo.InvariantCulture + ); + Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); + writer.WriteStringValue(buffer); + } + + /// + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DateOnly value, + JsonSerializerOptions options + ) + { +#if NET8_0_OR_GREATER + Span buffer = stackalloc byte[FormatLength]; +#else + Span buffer = stackalloc char[FormatLength]; +#endif + // ReSharper disable once RedundantAssignment + bool formattedSuccessfully = value.TryFormat( + buffer, + out int charsWritten, + "O".AsSpan(), + CultureInfo.InvariantCulture + ); + Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); + writer.WritePropertyName(buffer); + } + } + + internal static class JsonConstants + { + // The maximum number of fraction digits the Json DateTime parser allows + public const int DateTimeParseNumFractionDigits = 16; + + // In the worst case, an ASCII character represented as a single utf-8 byte could expand 6x when escaped. + public const int MaxExpansionFactorWhileEscaping = 6; + + // The largest fraction expressible by TimeSpan and DateTime formats + public const int MaxDateTimeFraction = 9_999_999; + + // TimeSpan and DateTime formats allow exactly up to many digits for specifying the fraction after the seconds. + public const int DateTimeNumFractionDigits = 7; + + public const byte UtcOffsetToken = (byte)'Z'; + + public const byte TimePrefix = (byte)'T'; + + public const byte Period = (byte)'.'; + + public const byte Hyphen = (byte)'-'; + + public const byte Colon = (byte)':'; + + public const byte Plus = (byte)'+'; + } + + // ReSharper disable SuggestVarOrType_Elsewhere + // ReSharper disable SuggestVarOrType_SimpleTypes + // ReSharper disable SuggestVarOrType_BuiltInTypes + + + internal static class JsonHelpers + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsInRangeInclusive(int value, int lowerBound, int upperBound) => + (uint)(value - lowerBound) <= (uint)(upperBound - lowerBound); + + public static bool IsDigit(byte value) => (uint)(value - '0') <= '9' - '0'; + + [StructLayout(LayoutKind.Auto)] + private struct DateTimeParseData + { + public int Year; + public int Month; + public int Day; + public bool IsCalendarDateOnly; + public int Hour; + public int Minute; + public int Second; + public int Fraction; // This value should never be greater than 9_999_999. + public int OffsetHours; + public int OffsetMinutes; + + // ReSharper disable once NotAccessedField.Local + public byte OffsetToken; + } + + public static bool TryParseAsIso(ReadOnlySpan source, out DateOnly value) + { + if ( + TryParseDateTimeOffset(source, out DateTimeParseData parseData) + && parseData.IsCalendarDateOnly + && TryCreateDateTime(parseData, DateTimeKind.Unspecified, out DateTime dateTime) + ) + { + value = DateOnly.FromDateTime(dateTime); + return true; + } + + value = default; + return false; + } + + /// + /// ISO 8601 date time parser (ISO 8601-1:2019). + /// + /// The date/time to parse in UTF-8 format. + /// The parsed for the given . + /// + /// Supports extended calendar date (5.2.2.1) and complete (5.4.2.1) calendar date/time of day + /// representations with optional specification of seconds and fractional seconds. + /// + /// Times can be explicitly specified as UTC ("Z" - 5.3.3) or offsets from UTC ("+/-hh:mm" 5.3.4.2). + /// If unspecified they are considered to be local per spec. + /// + /// Examples: (TZD is either "Z" or hh:mm offset from UTC) + /// + /// YYYY-MM-DD (e.g. 1997-07-16) + /// YYYY-MM-DDThh:mm (e.g. 1997-07-16T19:20) + /// YYYY-MM-DDThh:mm:ss (e.g. 1997-07-16T19:20:30) + /// YYYY-MM-DDThh:mm:ss.s (e.g. 1997-07-16T19:20:30.45) + /// YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00) + /// YYYY-MM-DDThh:mm:ssTZD (e.g. 1997-07-16T19:20:3001:00) + /// YYYY-MM-DDThh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45Z) + /// + /// Generally speaking we always require the "extended" option when one exists (3.1.3.5). + /// The extended variants have separator characters between components ('-', ':', '.', etc.). + /// Spaces are not permitted. + /// + /// "true" if successfully parsed. + private static bool TryParseDateTimeOffset( + ReadOnlySpan source, + out DateTimeParseData parseData + ) + { + parseData = default; + + // too short datetime + Debug.Assert(source.Length >= 10); + + // Parse the calendar date + // ----------------------- + // ISO 8601-1:2019 5.2.2.1b "Calendar date complete extended format" + // [dateX] = [year]["-"][month]["-"][day] + // [year] = [YYYY] [0000 - 9999] (4.3.2) + // [month] = [MM] [01 - 12] (4.3.3) + // [day] = [DD] [01 - 28, 29, 30, 31] (4.3.4) + // + // Note: 5.2.2.2 "Representations with reduced precision" allows for + // just [year]["-"][month] (a) and just [year] (b), but we currently + // don't permit it. + + { + uint digit1 = source[0] - (uint)'0'; + uint digit2 = source[1] - (uint)'0'; + uint digit3 = source[2] - (uint)'0'; + uint digit4 = source[3] - (uint)'0'; + + if (digit1 > 9 || digit2 > 9 || digit3 > 9 || digit4 > 9) + { + return false; + } + + parseData.Year = (int)(digit1 * 1000 + digit2 * 100 + digit3 * 10 + digit4); + } + + if ( + source[4] != JsonConstants.Hyphen + || !TryGetNextTwoDigits(source.Slice(start: 5, length: 2), ref parseData.Month) + || source[7] != JsonConstants.Hyphen + || !TryGetNextTwoDigits(source.Slice(start: 8, length: 2), ref parseData.Day) + ) + { + return false; + } + + // We now have YYYY-MM-DD [dateX] + // ReSharper disable once ConvertIfStatementToSwitchStatement + if (source.Length == 10) + { + parseData.IsCalendarDateOnly = true; + return true; + } + + // Parse the time of day + // --------------------- + // + // ISO 8601-1:2019 5.3.1.2b "Local time of day complete extended format" + // [timeX] = ["T"][hour][":"][min][":"][sec] + // [hour] = [hh] [00 - 23] (4.3.8a) + // [minute] = [mm] [00 - 59] (4.3.9a) + // [sec] = [ss] [00 - 59, 60 with a leap second] (4.3.10a) + // + // ISO 8601-1:2019 5.3.3 "UTC of day" + // [timeX]["Z"] + // + // ISO 8601-1:2019 5.3.4.2 "Local time of day with the time shift between + // local timescale and UTC" (Extended format) + // + // [shiftX] = ["+"|"-"][hour][":"][min] + // + // Notes: + // + // "T" is optional per spec, but _only_ when times are used alone. In our + // case, we're reading out a complete date & time and as such require "T". + // (5.4.2.1b). + // + // For [timeX] We allow seconds to be omitted per 5.3.1.3a "Representations + // with reduced precision". 5.3.1.3b allows just specifying the hour, but + // we currently don't permit this. + // + // Decimal fractions are allowed for hours, minutes and seconds (5.3.14). + // We only allow fractions for seconds currently. Lower order components + // can't follow, i.e. you can have T23.3, but not T23.3:04. There must be + // one digit, but the max number of digits is implementation defined. We + // currently allow up to 16 digits of fractional seconds only. While we + // support 16 fractional digits we only parse the first seven, anything + // past that is considered a zero. This is to stay compatible with the + // DateTime implementation which is limited to this resolution. + + if (source.Length < 16) + { + // Source does not have enough characters for YYYY-MM-DDThh:mm + return false; + } + + // Parse THH:MM (e.g. "T10:32") + if ( + source[10] != JsonConstants.TimePrefix + || source[13] != JsonConstants.Colon + || !TryGetNextTwoDigits(source.Slice(start: 11, length: 2), ref parseData.Hour) + || !TryGetNextTwoDigits(source.Slice(start: 14, length: 2), ref parseData.Minute) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm + Debug.Assert(source.Length >= 16); + if (source.Length == 16) + { + return true; + } + + byte curByte = source[16]; + int sourceIndex = 17; + + // Either a TZD ['Z'|'+'|'-'] or a seconds separator [':'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + case JsonConstants.Colon: + break; + default: + return false; + } + + // Try reading the seconds + if ( + source.Length < 19 + || !TryGetNextTwoDigits(source.Slice(start: 17, length: 2), ref parseData.Second) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm:ss + Debug.Assert(source.Length >= 19); + if (source.Length == 19) + { + return true; + } + + curByte = source[19]; + sourceIndex = 20; + + // Either a TZD ['Z'|'+'|'-'] or a seconds decimal fraction separator ['.'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + case JsonConstants.Period: + break; + default: + return false; + } + + // Source does not have enough characters for second fractions (i.e. ".s") + // YYYY-MM-DDThh:mm:ss.s + if (source.Length < 21) + { + return false; + } + + // Parse fraction. This value should never be greater than 9_999_999 + int numDigitsRead = 0; + int fractionEnd = Math.Min( + sourceIndex + JsonConstants.DateTimeParseNumFractionDigits, + source.Length + ); + + while (sourceIndex < fractionEnd && IsDigit(curByte = source[sourceIndex])) + { + if (numDigitsRead < JsonConstants.DateTimeNumFractionDigits) + { + parseData.Fraction = parseData.Fraction * 10 + (int)(curByte - (uint)'0'); + numDigitsRead++; + } + + sourceIndex++; + } + + if (parseData.Fraction != 0) + { + while (numDigitsRead < JsonConstants.DateTimeNumFractionDigits) + { + parseData.Fraction *= 10; + numDigitsRead++; + } + } + + // We now have YYYY-MM-DDThh:mm:ss.s + Debug.Assert(sourceIndex <= source.Length); + if (sourceIndex == source.Length) + { + return true; + } + + curByte = source[sourceIndex++]; + + // TZD ['Z'|'+'|'-'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + default: + return false; + } + + static bool ParseOffset(ref DateTimeParseData parseData, ReadOnlySpan offsetData) + { + // Parse the hours for the offset + if ( + offsetData.Length < 2 + || !TryGetNextTwoDigits(offsetData.Slice(0, 2), ref parseData.OffsetHours) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm:ss.s+|-hh + + if (offsetData.Length == 2) + { + // Just hours offset specified + return true; + } + + // Ensure we have enough for ":mm" + return offsetData.Length == 5 + && offsetData[2] == JsonConstants.Colon + && TryGetNextTwoDigits(offsetData.Slice(3), ref parseData.OffsetMinutes); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + // ReSharper disable once RedundantAssignment + private static bool TryGetNextTwoDigits(ReadOnlySpan source, ref int value) + { + Debug.Assert(source.Length == 2); + + uint digit1 = source[0] - (uint)'0'; + uint digit2 = source[1] - (uint)'0'; + + if (digit1 > 9 || digit2 > 9) + { + value = 0; + return false; + } + + value = (int)(digit1 * 10 + digit2); + return true; + } + + // The following methods are borrowed verbatim from src/Common/src/CoreLib/System/Buffers/Text/Utf8Parser/Utf8Parser.Date.Helpers.cs + + /// + /// Overflow-safe DateTime factory. + /// + private static bool TryCreateDateTime( + DateTimeParseData parseData, + DateTimeKind kind, + out DateTime value + ) + { + if (parseData.Year == 0) + { + value = default; + return false; + } + + Debug.Assert(parseData.Year <= 9999); // All of our callers to date parse the year from fixed 4-digit fields so this value is trusted. + + if ((uint)parseData.Month - 1 >= 12) + { + value = default; + return false; + } + + uint dayMinusOne = (uint)parseData.Day - 1; + if ( + dayMinusOne >= 28 + && dayMinusOne >= DateTime.DaysInMonth(parseData.Year, parseData.Month) + ) + { + value = default; + return false; + } + + if ((uint)parseData.Hour > 23) + { + value = default; + return false; + } + + if ((uint)parseData.Minute > 59) + { + value = default; + return false; + } + + // This needs to allow leap seconds when appropriate. + // See https://github.com/dotnet/runtime/issues/30135. + if ((uint)parseData.Second > 59) + { + value = default; + return false; + } + + Debug.Assert(parseData.Fraction is >= 0 and <= JsonConstants.MaxDateTimeFraction); // All of our callers to date parse the fraction from fixed 7-digit fields so this value is trusted. + + ReadOnlySpan days = DateTime.IsLeapYear(parseData.Year) + ? DaysToMonth366 + : DaysToMonth365; + int yearMinusOne = parseData.Year - 1; + int totalDays = + yearMinusOne * 365 + + yearMinusOne / 4 + - yearMinusOne / 100 + + yearMinusOne / 400 + + days[parseData.Month - 1] + + parseData.Day + - 1; + long ticks = totalDays * TimeSpan.TicksPerDay; + int totalSeconds = parseData.Hour * 3600 + parseData.Minute * 60 + parseData.Second; + ticks += totalSeconds * TimeSpan.TicksPerSecond; + ticks += parseData.Fraction; + value = new DateTime(ticks: ticks, kind: kind); + return true; + } + + private static ReadOnlySpan DaysToMonth365 => + [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; + private static ReadOnlySpan DaysToMonth366 => + [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]; + } + + internal static class ThrowHelper + { + private const string ExceptionSourceValueToRethrowAsJsonException = + "System.Text.Json.Rethrowable"; + + [DoesNotReturn] + public static void ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType) + { + throw GetInvalidOperationException("string", tokenType); + } + + public static void ThrowFormatException(DataType dataType) + { + throw new FormatException(SR.Format(SR.UnsupportedFormat, dataType)) + { + Source = ExceptionSourceValueToRethrowAsJsonException, + }; + } + + private static Exception GetInvalidOperationException( + string message, + JsonTokenType tokenType + ) + { + return GetInvalidOperationException(SR.Format(SR.InvalidCast, tokenType, message)); + } + + private static InvalidOperationException GetInvalidOperationException(string message) + { + return new InvalidOperationException(message) + { + Source = ExceptionSourceValueToRethrowAsJsonException, + }; + } + } + + internal static class Utf8JsonReaderExtensions + { + internal static int ValueLength(this Utf8JsonReader reader) => + reader.HasValueSequence + ? checked((int)reader.ValueSequence.Length) + : reader.ValueSpan.Length; + } + + internal enum DataType + { + TimeOnly, + DateOnly, + } + + [SuppressMessage("ReSharper", "InconsistentNaming")] + internal static class SR + { + private static readonly bool s_usingResourceKeys = + AppContext.TryGetSwitch( + "System.Resources.UseSystemResourceKeys", + out bool usingResourceKeys + ) && usingResourceKeys; + + public static string UnsupportedFormat => Strings.UnsupportedFormat; + + public static string InvalidCast => Strings.InvalidCast; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static string Format(string resourceFormat, object? p1) => + s_usingResourceKeys + ? string.Join(", ", resourceFormat, p1) + : string.Format(resourceFormat, p1); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static string Format(string resourceFormat, object? p1, object? p2) => + s_usingResourceKeys + ? string.Join(", ", resourceFormat, p1, p2) + : string.Format(resourceFormat, p1, p2); + } + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute( + "System.Resources.Tools.StronglyTypedResourceBuilder", + "17.0.0.0" + )] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Strings + { + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( + "Microsoft.Performance", + "CA1811:AvoidUncalledPrivateCode" + )] + internal Strings() { } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute( + global::System.ComponentModel.EditorBrowsableState.Advanced + )] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = + new global::System.Resources.ResourceManager( + "System.Text.Json.Resources.Strings", + typeof(Strings).Assembly + ); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute( + global::System.ComponentModel.EditorBrowsableState.Advanced + )] + internal static global::System.Globalization.CultureInfo Culture + { + get { return resourceCulture; } + set { resourceCulture = value; } + } + + /// + /// Looks up a localized string similar to Cannot get the value of a token type '{0}' as a {1}.. + /// + internal static string InvalidCast + { + get { return ResourceManager.GetString("InvalidCast", resourceCulture); } + } + + /// + /// Looks up a localized string similar to The JSON value is not in a supported {0} format.. + /// + internal static string UnsupportedFormat + { + get { return ResourceManager.GetString("UnsupportedFormat", resourceCulture); } + } + } +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes/Core/DateTimeSerializer.cs b/seed/csharp-model/content-type/src/SeedContentTypes/Core/DateTimeSerializer.cs new file mode 100644 index 00000000000..3d56aa93897 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes/Core/DateTimeSerializer.cs @@ -0,0 +1,22 @@ +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedContentTypes.Core; + +internal class DateTimeSerializer : JsonConverter +{ + public override DateTime Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + return DateTime.Parse(reader.GetString()!, null, DateTimeStyles.RoundtripKind); + } + + public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString(Constants.DateTimeFormat)); + } +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes/Core/EnumSerializer.cs b/seed/csharp-model/content-type/src/SeedContentTypes/Core/EnumSerializer.cs new file mode 100644 index 00000000000..01755796d38 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes/Core/EnumSerializer.cs @@ -0,0 +1,53 @@ +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedContentTypes.Core; + +internal class EnumSerializer : JsonConverter + where TEnum : struct, Enum +{ + private readonly Dictionary _enumToString = new(); + private readonly Dictionary _stringToEnum = new(); + + public EnumSerializer() + { + var type = typeof(TEnum); + var values = Enum.GetValues(type); + + foreach (var value in values) + { + var enumValue = (TEnum)value; + var enumMember = type.GetField(enumValue.ToString())!; + var attr = enumMember + .GetCustomAttributes(typeof(EnumMemberAttribute), false) + .Cast() + .FirstOrDefault(); + + var stringValue = + attr?.Value + ?? value.ToString() + ?? throw new Exception("Unexpected null enum toString value"); + + _enumToString.Add(enumValue, stringValue); + _stringToEnum.Add(stringValue, enumValue); + } + } + + public override TEnum Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write(Utf8JsonWriter writer, TEnum value, JsonSerializerOptions options) + { + writer.WriteStringValue(_enumToString[value]); + } +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes/Core/JsonAccessAttribute.cs b/seed/csharp-model/content-type/src/SeedContentTypes/Core/JsonAccessAttribute.cs new file mode 100644 index 00000000000..1edcce487e7 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes/Core/JsonAccessAttribute.cs @@ -0,0 +1,13 @@ +namespace SeedContentTypes.Core; + +[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] +internal class JsonAccessAttribute(JsonAccessType accessType) : Attribute +{ + internal JsonAccessType AccessType { get; init; } = accessType; +} + +internal enum JsonAccessType +{ + ReadOnly, + WriteOnly, +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes/Core/JsonConfiguration.cs b/seed/csharp-model/content-type/src/SeedContentTypes/Core/JsonConfiguration.cs new file mode 100644 index 00000000000..db2755adf20 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes/Core/JsonConfiguration.cs @@ -0,0 +1,156 @@ +using global::System.Text.Json; +using global::System.Text.Json.Nodes; +using global::System.Text.Json.Serialization; +using global::System.Text.Json.Serialization.Metadata; + +namespace SeedContentTypes.Core; + +internal static partial class JsonOptions +{ + internal static readonly JsonSerializerOptions JsonSerializerOptions; + + static JsonOptions() + { + var options = new JsonSerializerOptions + { + Converters = { new DateTimeSerializer(), +#if USE_PORTABLE_DATE_ONLY + new DateOnlyConverter(), +#endif + new OneOfSerializer() }, +#if DEBUG + WriteIndented = true, +#endif + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = new DefaultJsonTypeInfoResolver + { + Modifiers = + { + static typeInfo => + { + if (typeInfo.Kind != JsonTypeInfoKind.Object) + return; + + foreach (var propertyInfo in typeInfo.Properties) + { + var jsonAccessAttribute = propertyInfo + .AttributeProvider?.GetCustomAttributes( + typeof(JsonAccessAttribute), + true + ) + .OfType() + .FirstOrDefault(); + + if (jsonAccessAttribute != null) + { + propertyInfo.IsRequired = false; + switch (jsonAccessAttribute.AccessType) + { + case JsonAccessType.ReadOnly: + propertyInfo.Get = null; + propertyInfo.ShouldSerialize = (_, _) => false; + break; + case JsonAccessType.WriteOnly: + propertyInfo.Set = null; + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + var jsonIgnoreAttribute = propertyInfo + .AttributeProvider?.GetCustomAttributes( + typeof(JsonIgnoreAttribute), + true + ) + .OfType() + .FirstOrDefault(); + + if (jsonIgnoreAttribute is not null) + { + propertyInfo.IsRequired = false; + } + } + }, + }, + }, + }; + ConfigureJsonSerializerOptions(options); + JsonSerializerOptions = options; + } + + static partial void ConfigureJsonSerializerOptions(JsonSerializerOptions defaultOptions); +} + +internal static class JsonUtils +{ + internal static string Serialize(T obj) => + JsonSerializer.Serialize(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonElement SerializeToElement(T obj) => + JsonSerializer.SerializeToElement(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonDocument SerializeToDocument(T obj) => + JsonSerializer.SerializeToDocument(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonNode? SerializeToNode(T obj) => + JsonSerializer.SerializeToNode(obj, JsonOptions.JsonSerializerOptions); + + internal static byte[] SerializeToUtf8Bytes(T obj) => + JsonSerializer.SerializeToUtf8Bytes(obj, JsonOptions.JsonSerializerOptions); + + internal static string SerializeWithAdditionalProperties( + T obj, + object? additionalProperties = null + ) + { + if (additionalProperties == null) + { + return Serialize(obj); + } + var additionalPropertiesJsonNode = SerializeToNode(additionalProperties); + if (additionalPropertiesJsonNode is not JsonObject additionalPropertiesJsonObject) + { + throw new InvalidOperationException( + "The additional properties must serialize to a JSON object." + ); + } + var jsonNode = SerializeToNode(obj); + if (jsonNode is not JsonObject jsonObject) + { + throw new InvalidOperationException( + "The serialized object must be a JSON object to add properties." + ); + } + MergeJsonObjects(jsonObject, additionalPropertiesJsonObject); + return jsonObject.ToJsonString(JsonOptions.JsonSerializerOptions); + } + + private static void MergeJsonObjects(JsonObject baseObject, JsonObject overrideObject) + { + foreach (var property in overrideObject) + { + if (!baseObject.TryGetPropertyValue(property.Key, out JsonNode? existingValue)) + { + baseObject[property.Key] = + property.Value != null ? JsonNode.Parse(property.Value.ToJsonString()) : null; + continue; + } + if ( + existingValue is JsonObject nestedBaseObject + && property.Value is JsonObject nestedOverrideObject + ) + { + // If both values are objects, recursively merge them. + MergeJsonObjects(nestedBaseObject, nestedOverrideObject); + continue; + } + // Otherwise, the overrideObject takes precedence. + baseObject[property.Key] = + property.Value != null ? JsonNode.Parse(property.Value.ToJsonString()) : null; + } + } + + internal static T Deserialize(string json) => + JsonSerializer.Deserialize(json, JsonOptions.JsonSerializerOptions)!; +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes/Core/OneOfSerializer.cs b/seed/csharp-model/content-type/src/SeedContentTypes/Core/OneOfSerializer.cs new file mode 100644 index 00000000000..c6184dfc2fd --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes/Core/OneOfSerializer.cs @@ -0,0 +1,91 @@ +using System.Reflection; +using System.Text.Json; +using System.Text.Json.Serialization; +using OneOf; + +namespace SeedContentTypes.Core; + +internal class OneOfSerializer : JsonConverter +{ + public override IOneOf? Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType is JsonTokenType.Null) + return default; + + foreach (var (type, cast) in GetOneOfTypes(typeToConvert)) + { + try + { + var readerCopy = reader; + var result = JsonSerializer.Deserialize(ref readerCopy, type, options); + reader.Skip(); + return (IOneOf)cast.Invoke(null, [result])!; + } + catch (JsonException) { } + } + + throw new JsonException( + $"Cannot deserialize into one of the supported types for {typeToConvert}" + ); + } + + public override void Write(Utf8JsonWriter writer, IOneOf value, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, value.Value, options); + } + + private static (global::System.Type type, MethodInfo cast)[] GetOneOfTypes( + global::System.Type typeToConvert + ) + { + var type = typeToConvert; + if (Nullable.GetUnderlyingType(type) is { } underlyingType) + { + type = underlyingType; + } + + var casts = type.GetRuntimeMethods() + .Where(m => m.IsSpecialName && m.Name == "op_Implicit") + .ToArray(); + while (type != null) + { + if ( + type.IsGenericType + && (type.Name.StartsWith("OneOf`") || type.Name.StartsWith("OneOfBase`")) + ) + { + var genericArguments = type.GetGenericArguments(); + if (genericArguments.Length == 1) + { + return [(genericArguments[0], casts[0])]; + } + + // if object type is present, make sure it is last + var indexOfObjectType = Array.IndexOf(genericArguments, typeof(object)); + if (indexOfObjectType != -1 && genericArguments.Length - 1 != indexOfObjectType) + { + genericArguments = genericArguments + .OrderBy(t => t == typeof(object) ? 1 : 0) + .ToArray(); + } + + return genericArguments + .Select(t => (t, casts.First(c => c.GetParameters()[0].ParameterType == t))) + .ToArray(); + } + + type = type.BaseType; + } + + throw new InvalidOperationException($"{type} isn't OneOf or OneOfBase"); + } + + public override bool CanConvert(global::System.Type typeToConvert) + { + return typeof(IOneOf).IsAssignableFrom(typeToConvert); + } +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes/Core/Public/FileParameter.cs b/seed/csharp-model/content-type/src/SeedContentTypes/Core/Public/FileParameter.cs new file mode 100644 index 00000000000..620b10faaa5 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes/Core/Public/FileParameter.cs @@ -0,0 +1,63 @@ +namespace SeedContentTypes; + +/// +/// File parameter for uploading files. +/// +public record FileParameter : IDisposable +#if NET6_0_OR_GREATER + , IAsyncDisposable +#endif +{ + private bool _disposed; + + /// + /// The name of the file to be uploaded. + /// + public string? FileName { get; set; } + + /// + /// The content type of the file to be uploaded. + /// + public string? ContentType { get; set; } + + /// + /// The content of the file to be uploaded. + /// + public required Stream Stream { get; set; } + + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + protected virtual void Dispose(bool disposing) + { + if (_disposed) + return; + if (disposing) + { + Stream.Dispose(); + } + + _disposed = true; + } + +#if NET6_0_OR_GREATER + /// + public async ValueTask DisposeAsync() + { + if (!_disposed) + { + await Stream.DisposeAsync().ConfigureAwait(false); + _disposed = true; + } + + GC.SuppressFinalize(this); + } +#endif + + public static implicit operator FileParameter(Stream stream) => new() { Stream = stream }; +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes/Core/Public/Version.cs b/seed/csharp-model/content-type/src/SeedContentTypes/Core/Public/Version.cs new file mode 100644 index 00000000000..725686846ff --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes/Core/Public/Version.cs @@ -0,0 +1,6 @@ +namespace SeedContentTypes; + +internal class Version +{ + public const string Current = "0.0.1"; +} diff --git a/seed/csharp-model/content-type/src/SeedContentTypes/SeedContentTypes.Custom.props b/seed/csharp-model/content-type/src/SeedContentTypes/SeedContentTypes.Custom.props new file mode 100644 index 00000000000..70df2849401 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes/SeedContentTypes.Custom.props @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/seed/csharp-model/content-type/src/SeedContentTypes/SeedContentTypes.csproj b/seed/csharp-model/content-type/src/SeedContentTypes/SeedContentTypes.csproj new file mode 100644 index 00000000000..425f6acdcf2 --- /dev/null +++ b/seed/csharp-model/content-type/src/SeedContentTypes/SeedContentTypes.csproj @@ -0,0 +1,53 @@ + + + + net462;net8.0;net7.0;net6.0;netstandard2.0 + enable + 12 + enable + 0.0.1 + $(Version) + $(Version) + README.md + https://github.com/content-type/fern + true + + + + false + + + $(DefineConstants);USE_PORTABLE_DATE_ONLY + true + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + + + + <_Parameter1>SeedContentTypes.Test + + + + + diff --git a/seed/csharp-model/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/FileParameter.cs b/seed/csharp-model/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/FileParameter.cs index fd3724549d6..e9d49e1df3a 100644 --- a/seed/csharp-model/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/FileParameter.cs +++ b/seed/csharp-model/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/csharp-grpc-proto-exhaustive/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-model/csharp-grpc-proto-exhaustive/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-model/csharp-grpc-proto-exhaustive/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-model/csharp-grpc-proto-exhaustive/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/csharp-grpc-proto/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-model/csharp-grpc-proto/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-model/csharp-grpc-proto/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-model/csharp-grpc-proto/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/FileParameter.cs b/seed/csharp-model/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/FileParameter.cs index 7be49470276..7c0f68a0801 100644 --- a/seed/csharp-model/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/FileParameter.cs +++ b/seed/csharp-model/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/csharp-property-access/src/SeedCsharpAccess/Core/Public/FileParameter.cs b/seed/csharp-model/csharp-property-access/src/SeedCsharpAccess/Core/Public/FileParameter.cs index d39e99370a2..176ba07a17e 100644 --- a/seed/csharp-model/csharp-property-access/src/SeedCsharpAccess/Core/Public/FileParameter.cs +++ b/seed/csharp-model/csharp-property-access/src/SeedCsharpAccess/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/custom-auth/src/SeedCustomAuth/Core/Public/FileParameter.cs b/seed/csharp-model/custom-auth/src/SeedCustomAuth/Core/Public/FileParameter.cs index 8113f86b7cf..a6e263fb210 100644 --- a/seed/csharp-model/custom-auth/src/SeedCustomAuth/Core/Public/FileParameter.cs +++ b/seed/csharp-model/custom-auth/src/SeedCustomAuth/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/enum/forward-compatible-enums/src/SeedEnum/Core/Public/FileParameter.cs b/seed/csharp-model/enum/forward-compatible-enums/src/SeedEnum/Core/Public/FileParameter.cs index 50c7cf006a8..5b60e9a9755 100644 --- a/seed/csharp-model/enum/forward-compatible-enums/src/SeedEnum/Core/Public/FileParameter.cs +++ b/seed/csharp-model/enum/forward-compatible-enums/src/SeedEnum/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/enum/plain-enums/src/SeedEnum/Core/Public/FileParameter.cs b/seed/csharp-model/enum/plain-enums/src/SeedEnum/Core/Public/FileParameter.cs index 50c7cf006a8..5b60e9a9755 100644 --- a/seed/csharp-model/enum/plain-enums/src/SeedEnum/Core/Public/FileParameter.cs +++ b/seed/csharp-model/enum/plain-enums/src/SeedEnum/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/error-property/src/SeedErrorProperty/Core/Public/FileParameter.cs b/seed/csharp-model/error-property/src/SeedErrorProperty/Core/Public/FileParameter.cs index 98ca831515b..9e72372c3f0 100644 --- a/seed/csharp-model/error-property/src/SeedErrorProperty/Core/Public/FileParameter.cs +++ b/seed/csharp-model/error-property/src/SeedErrorProperty/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/examples/src/SeedExamples/Core/Public/FileParameter.cs b/seed/csharp-model/examples/src/SeedExamples/Core/Public/FileParameter.cs index d083e9ac0b6..98f6dc9692d 100644 --- a/seed/csharp-model/examples/src/SeedExamples/Core/Public/FileParameter.cs +++ b/seed/csharp-model/examples/src/SeedExamples/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/exhaustive/src/SeedExhaustive/Core/Public/FileParameter.cs b/seed/csharp-model/exhaustive/src/SeedExhaustive/Core/Public/FileParameter.cs index b14ad88caa1..688152a5957 100644 --- a/seed/csharp-model/exhaustive/src/SeedExhaustive/Core/Public/FileParameter.cs +++ b/seed/csharp-model/exhaustive/src/SeedExhaustive/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/extends/src/SeedExtends/Core/Public/FileParameter.cs b/seed/csharp-model/extends/src/SeedExtends/Core/Public/FileParameter.cs index a39eb8e3a3f..2de81e4633c 100644 --- a/seed/csharp-model/extends/src/SeedExtends/Core/Public/FileParameter.cs +++ b/seed/csharp-model/extends/src/SeedExtends/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/extra-properties/src/SeedExtraProperties/Core/Public/FileParameter.cs b/seed/csharp-model/extra-properties/src/SeedExtraProperties/Core/Public/FileParameter.cs index 7386e64bf7d..f05c0c74d36 100644 --- a/seed/csharp-model/extra-properties/src/SeedExtraProperties/Core/Public/FileParameter.cs +++ b/seed/csharp-model/extra-properties/src/SeedExtraProperties/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/file-download/src/SeedFileDownload/Core/Public/FileParameter.cs b/seed/csharp-model/file-download/src/SeedFileDownload/Core/Public/FileParameter.cs index 88140ff40b8..7f9656bd031 100644 --- a/seed/csharp-model/file-download/src/SeedFileDownload/Core/Public/FileParameter.cs +++ b/seed/csharp-model/file-download/src/SeedFileDownload/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/file-upload/.mock/ir.json b/seed/csharp-model/file-upload/.mock/ir.json new file mode 100644 index 00000000000..c5fb0c5ee73 --- /dev/null +++ b/seed/csharp-model/file-upload/.mock/ir.json @@ -0,0 +1,3924 @@ +{ + "fdrApiDefinitionId": null, + "apiVersion": null, + "apiName": { + "originalName": "file-upload", + "camelCase": { + "unsafeName": "fileUpload", + "safeName": "fileUpload" + }, + "snakeCase": { + "unsafeName": "file_upload", + "safeName": "file_upload" + }, + "screamingSnakeCase": { + "unsafeName": "FILE_UPLOAD", + "safeName": "FILE_UPLOAD" + }, + "pascalCase": { + "unsafeName": "FileUpload", + "safeName": "FileUpload" + } + }, + "apiDisplayName": null, + "apiDocs": null, + "auth": { + "requirement": "ALL", + "schemes": [], + "docs": null + }, + "headers": [], + "idempotencyHeaders": [], + "types": { + "type_service:Id": { + "inline": null, + "name": { + "name": { + "originalName": "Id", + "camelCase": { + "unsafeName": "id", + "safeName": "id" + }, + "snakeCase": { + "unsafeName": "id", + "safeName": "id" + }, + "screamingSnakeCase": { + "unsafeName": "ID", + "safeName": "ID" + }, + "pascalCase": { + "unsafeName": "Id", + "safeName": "Id" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "typeId": "type_service:Id" + }, + "shape": { + "_type": "alias", + "aliasOf": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "resolvedType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + }, + "referencedTypes": [], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "availability": null, + "docs": null + }, + "type_service:MyObject": { + "inline": null, + "name": { + "name": { + "originalName": "MyObject", + "camelCase": { + "unsafeName": "myObject", + "safeName": "myObject" + }, + "snakeCase": { + "unsafeName": "my_object", + "safeName": "my_object" + }, + "screamingSnakeCase": { + "unsafeName": "MY_OBJECT", + "safeName": "MY_OBJECT" + }, + "pascalCase": { + "unsafeName": "MyObject", + "safeName": "MyObject" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "typeId": "type_service:MyObject" + }, + "shape": { + "_type": "object", + "extends": [], + "properties": [ + { + "name": { + "name": { + "originalName": "foo", + "camelCase": { + "unsafeName": "foo", + "safeName": "foo" + }, + "snakeCase": { + "unsafeName": "foo", + "safeName": "foo" + }, + "screamingSnakeCase": { + "unsafeName": "FOO", + "safeName": "FOO" + }, + "pascalCase": { + "unsafeName": "Foo", + "safeName": "Foo" + } + }, + "wireValue": "foo" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "availability": null, + "docs": null + } + ], + "extra-properties": false, + "extendedProperties": [] + }, + "referencedTypes": [], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "availability": null, + "docs": null + }, + "type_service:ObjectType": { + "inline": null, + "name": { + "name": { + "originalName": "ObjectType", + "camelCase": { + "unsafeName": "objectType", + "safeName": "objectType" + }, + "snakeCase": { + "unsafeName": "object_type", + "safeName": "object_type" + }, + "screamingSnakeCase": { + "unsafeName": "OBJECT_TYPE", + "safeName": "OBJECT_TYPE" + }, + "pascalCase": { + "unsafeName": "ObjectType", + "safeName": "ObjectType" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "typeId": "type_service:ObjectType" + }, + "shape": { + "_type": "enum", + "default": null, + "values": [ + { + "name": { + "name": { + "originalName": "FOO", + "camelCase": { + "unsafeName": "foo", + "safeName": "foo" + }, + "snakeCase": { + "unsafeName": "foo", + "safeName": "foo" + }, + "screamingSnakeCase": { + "unsafeName": "FOO", + "safeName": "FOO" + }, + "pascalCase": { + "unsafeName": "Foo", + "safeName": "Foo" + } + }, + "wireValue": "FOO" + }, + "availability": null, + "docs": null + }, + { + "name": { + "name": { + "originalName": "BAR", + "camelCase": { + "unsafeName": "bar", + "safeName": "bar" + }, + "snakeCase": { + "unsafeName": "bar", + "safeName": "bar" + }, + "screamingSnakeCase": { + "unsafeName": "BAR", + "safeName": "BAR" + }, + "pascalCase": { + "unsafeName": "Bar", + "safeName": "Bar" + } + }, + "wireValue": "BAR" + }, + "availability": null, + "docs": null + } + ] + }, + "referencedTypes": [], + "encoding": { + "json": {}, + "proto": null + }, + "source": null, + "userProvidedExamples": [], + "autogeneratedExamples": [], + "availability": null, + "docs": null + } + }, + "errors": {}, + "services": { + "service_service": { + "availability": null, + "name": { + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "displayName": null, + "basePath": { + "head": "/", + "parts": [] + }, + "headers": [], + "pathParameters": [], + "encoding": { + "json": {}, + "proto": null + }, + "transport": { + "type": "http" + }, + "endpoints": [ + { + "id": "endpoint_service.post", + "name": { + "originalName": "post", + "camelCase": { + "unsafeName": "post", + "safeName": "post" + }, + "snakeCase": { + "unsafeName": "post", + "safeName": "post" + }, + "screamingSnakeCase": { + "unsafeName": "POST", + "safeName": "POST" + }, + "pascalCase": { + "unsafeName": "Post", + "safeName": "Post" + } + }, + "displayName": null, + "auth": false, + "idempotent": false, + "baseUrl": null, + "method": "POST", + "basePath": null, + "path": { + "head": "", + "parts": [] + }, + "fullPath": { + "head": "", + "parts": [] + }, + "pathParameters": [], + "allPathParameters": [], + "queryParameters": [], + "headers": [], + "requestBody": { + "type": "fileUpload", + "name": { + "originalName": "MyRequest", + "camelCase": { + "unsafeName": "myRequest", + "safeName": "myRequest" + }, + "snakeCase": { + "unsafeName": "my_request", + "safeName": "my_request" + }, + "screamingSnakeCase": { + "unsafeName": "MY_REQUEST", + "safeName": "MY_REQUEST" + }, + "pascalCase": { + "unsafeName": "MyRequest", + "safeName": "MyRequest" + } + }, + "properties": [ + { + "type": "bodyProperty", + "contentType": null, + "name": { + "name": { + "originalName": "maybe_string", + "camelCase": { + "unsafeName": "maybeString", + "safeName": "maybeString" + }, + "snakeCase": { + "unsafeName": "maybe_string", + "safeName": "maybe_string" + }, + "screamingSnakeCase": { + "unsafeName": "MAYBE_STRING", + "safeName": "MAYBE_STRING" + }, + "pascalCase": { + "unsafeName": "MaybeString", + "safeName": "MaybeString" + } + }, + "wireValue": "maybe_string" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "optional", + "optional": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "availability": null, + "docs": null + }, + { + "type": "bodyProperty", + "contentType": null, + "name": { + "name": { + "originalName": "integer", + "camelCase": { + "unsafeName": "integer", + "safeName": "integer" + }, + "snakeCase": { + "unsafeName": "integer", + "safeName": "integer" + }, + "screamingSnakeCase": { + "unsafeName": "INTEGER", + "safeName": "INTEGER" + }, + "pascalCase": { + "unsafeName": "Integer", + "safeName": "Integer" + } + }, + "wireValue": "integer" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "INTEGER", + "v2": { + "type": "integer", + "default": null, + "validation": null + } + } + }, + "availability": null, + "docs": null + }, + { + "type": "file", + "value": { + "type": "file", + "key": { + "name": { + "originalName": "file", + "camelCase": { + "unsafeName": "file", + "safeName": "file" + }, + "snakeCase": { + "unsafeName": "file", + "safeName": "file" + }, + "screamingSnakeCase": { + "unsafeName": "FILE", + "safeName": "FILE" + }, + "pascalCase": { + "unsafeName": "File", + "safeName": "File" + } + }, + "wireValue": "file" + }, + "isOptional": false, + "contentType": null + } + }, + { + "type": "file", + "value": { + "type": "fileArray", + "key": { + "name": { + "originalName": "file_list", + "camelCase": { + "unsafeName": "fileList", + "safeName": "fileList" + }, + "snakeCase": { + "unsafeName": "file_list", + "safeName": "file_list" + }, + "screamingSnakeCase": { + "unsafeName": "FILE_LIST", + "safeName": "FILE_LIST" + }, + "pascalCase": { + "unsafeName": "FileList", + "safeName": "FileList" + } + }, + "wireValue": "file_list" + }, + "isOptional": false, + "contentType": null + } + }, + { + "type": "file", + "value": { + "type": "file", + "key": { + "name": { + "originalName": "maybe_file", + "camelCase": { + "unsafeName": "maybeFile", + "safeName": "maybeFile" + }, + "snakeCase": { + "unsafeName": "maybe_file", + "safeName": "maybe_file" + }, + "screamingSnakeCase": { + "unsafeName": "MAYBE_FILE", + "safeName": "MAYBE_FILE" + }, + "pascalCase": { + "unsafeName": "MaybeFile", + "safeName": "MaybeFile" + } + }, + "wireValue": "maybe_file" + }, + "isOptional": true, + "contentType": null + } + }, + { + "type": "file", + "value": { + "type": "fileArray", + "key": { + "name": { + "originalName": "maybe_file_list", + "camelCase": { + "unsafeName": "maybeFileList", + "safeName": "maybeFileList" + }, + "snakeCase": { + "unsafeName": "maybe_file_list", + "safeName": "maybe_file_list" + }, + "screamingSnakeCase": { + "unsafeName": "MAYBE_FILE_LIST", + "safeName": "MAYBE_FILE_LIST" + }, + "pascalCase": { + "unsafeName": "MaybeFileList", + "safeName": "MaybeFileList" + } + }, + "wireValue": "maybe_file_list" + }, + "isOptional": true, + "contentType": null + } + }, + { + "type": "bodyProperty", + "contentType": null, + "name": { + "name": { + "originalName": "maybe_integer", + "camelCase": { + "unsafeName": "maybeInteger", + "safeName": "maybeInteger" + }, + "snakeCase": { + "unsafeName": "maybe_integer", + "safeName": "maybe_integer" + }, + "screamingSnakeCase": { + "unsafeName": "MAYBE_INTEGER", + "safeName": "MAYBE_INTEGER" + }, + "pascalCase": { + "unsafeName": "MaybeInteger", + "safeName": "MaybeInteger" + } + }, + "wireValue": "maybe_integer" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "optional", + "optional": { + "_type": "primitive", + "primitive": { + "v1": "INTEGER", + "v2": { + "type": "integer", + "default": null, + "validation": null + } + } + } + } + }, + "availability": null, + "docs": null + }, + { + "type": "bodyProperty", + "contentType": null, + "name": { + "name": { + "originalName": "optional_list_of_strings", + "camelCase": { + "unsafeName": "optionalListOfStrings", + "safeName": "optionalListOfStrings" + }, + "snakeCase": { + "unsafeName": "optional_list_of_strings", + "safeName": "optional_list_of_strings" + }, + "screamingSnakeCase": { + "unsafeName": "OPTIONAL_LIST_OF_STRINGS", + "safeName": "OPTIONAL_LIST_OF_STRINGS" + }, + "pascalCase": { + "unsafeName": "OptionalListOfStrings", + "safeName": "OptionalListOfStrings" + } + }, + "wireValue": "optional_list_of_strings" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "optional", + "optional": { + "_type": "container", + "container": { + "_type": "list", + "list": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + } + } + }, + "availability": null, + "docs": null + }, + { + "type": "bodyProperty", + "contentType": null, + "name": { + "name": { + "originalName": "list_of_objects", + "camelCase": { + "unsafeName": "listOfObjects", + "safeName": "listOfObjects" + }, + "snakeCase": { + "unsafeName": "list_of_objects", + "safeName": "list_of_objects" + }, + "screamingSnakeCase": { + "unsafeName": "LIST_OF_OBJECTS", + "safeName": "LIST_OF_OBJECTS" + }, + "pascalCase": { + "unsafeName": "ListOfObjects", + "safeName": "ListOfObjects" + } + }, + "wireValue": "list_of_objects" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "list", + "list": { + "_type": "named", + "name": { + "originalName": "MyObject", + "camelCase": { + "unsafeName": "myObject", + "safeName": "myObject" + }, + "snakeCase": { + "unsafeName": "my_object", + "safeName": "my_object" + }, + "screamingSnakeCase": { + "unsafeName": "MY_OBJECT", + "safeName": "MY_OBJECT" + }, + "pascalCase": { + "unsafeName": "MyObject", + "safeName": "MyObject" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "typeId": "type_service:MyObject", + "default": null, + "inline": null + } + } + }, + "availability": null, + "docs": null + }, + { + "type": "bodyProperty", + "contentType": null, + "name": { + "name": { + "originalName": "optional_metadata", + "camelCase": { + "unsafeName": "optionalMetadata", + "safeName": "optionalMetadata" + }, + "snakeCase": { + "unsafeName": "optional_metadata", + "safeName": "optional_metadata" + }, + "screamingSnakeCase": { + "unsafeName": "OPTIONAL_METADATA", + "safeName": "OPTIONAL_METADATA" + }, + "pascalCase": { + "unsafeName": "OptionalMetadata", + "safeName": "OptionalMetadata" + } + }, + "wireValue": "optional_metadata" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "optional", + "optional": { + "_type": "unknown" + } + } + }, + "availability": null, + "docs": null + }, + { + "type": "bodyProperty", + "contentType": null, + "name": { + "name": { + "originalName": "optional_object_type", + "camelCase": { + "unsafeName": "optionalObjectType", + "safeName": "optionalObjectType" + }, + "snakeCase": { + "unsafeName": "optional_object_type", + "safeName": "optional_object_type" + }, + "screamingSnakeCase": { + "unsafeName": "OPTIONAL_OBJECT_TYPE", + "safeName": "OPTIONAL_OBJECT_TYPE" + }, + "pascalCase": { + "unsafeName": "OptionalObjectType", + "safeName": "OptionalObjectType" + } + }, + "wireValue": "optional_object_type" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "optional", + "optional": { + "_type": "named", + "name": { + "originalName": "ObjectType", + "camelCase": { + "unsafeName": "objectType", + "safeName": "objectType" + }, + "snakeCase": { + "unsafeName": "object_type", + "safeName": "object_type" + }, + "screamingSnakeCase": { + "unsafeName": "OBJECT_TYPE", + "safeName": "OBJECT_TYPE" + }, + "pascalCase": { + "unsafeName": "ObjectType", + "safeName": "ObjectType" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "typeId": "type_service:ObjectType", + "default": null, + "inline": null + } + } + }, + "availability": null, + "docs": null + }, + { + "type": "bodyProperty", + "contentType": null, + "name": { + "name": { + "originalName": "optional_id", + "camelCase": { + "unsafeName": "optionalId", + "safeName": "optionalId" + }, + "snakeCase": { + "unsafeName": "optional_id", + "safeName": "optional_id" + }, + "screamingSnakeCase": { + "unsafeName": "OPTIONAL_ID", + "safeName": "OPTIONAL_ID" + }, + "pascalCase": { + "unsafeName": "OptionalId", + "safeName": "OptionalId" + } + }, + "wireValue": "optional_id" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "optional", + "optional": { + "_type": "named", + "name": { + "originalName": "Id", + "camelCase": { + "unsafeName": "id", + "safeName": "id" + }, + "snakeCase": { + "unsafeName": "id", + "safeName": "id" + }, + "screamingSnakeCase": { + "unsafeName": "ID", + "safeName": "ID" + }, + "pascalCase": { + "unsafeName": "Id", + "safeName": "Id" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "typeId": "type_service:Id", + "default": null, + "inline": null + } + } + }, + "availability": null, + "docs": null + } + ], + "docs": null + }, + "sdkRequest": { + "shape": { + "type": "wrapper", + "wrapperName": { + "originalName": "MyRequest", + "camelCase": { + "unsafeName": "myRequest", + "safeName": "myRequest" + }, + "snakeCase": { + "unsafeName": "my_request", + "safeName": "my_request" + }, + "screamingSnakeCase": { + "unsafeName": "MY_REQUEST", + "safeName": "MY_REQUEST" + }, + "pascalCase": { + "unsafeName": "MyRequest", + "safeName": "MyRequest" + } + }, + "bodyKey": { + "originalName": "body", + "camelCase": { + "unsafeName": "body", + "safeName": "body" + }, + "snakeCase": { + "unsafeName": "body", + "safeName": "body" + }, + "screamingSnakeCase": { + "unsafeName": "BODY", + "safeName": "BODY" + }, + "pascalCase": { + "unsafeName": "Body", + "safeName": "Body" + } + }, + "includePathParameters": false, + "onlyPathParameters": false + }, + "requestParameterName": { + "originalName": "request", + "camelCase": { + "unsafeName": "request", + "safeName": "request" + }, + "snakeCase": { + "unsafeName": "request", + "safeName": "request" + }, + "screamingSnakeCase": { + "unsafeName": "REQUEST", + "safeName": "REQUEST" + }, + "pascalCase": { + "unsafeName": "Request", + "safeName": "Request" + } + }, + "streamParameter": null + }, + "response": { + "body": null, + "status-code": null + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [], + "pagination": null, + "transport": null, + "availability": null, + "docs": null + }, + { + "id": "endpoint_service.justFile", + "name": { + "originalName": "justFile", + "camelCase": { + "unsafeName": "justFile", + "safeName": "justFile" + }, + "snakeCase": { + "unsafeName": "just_file", + "safeName": "just_file" + }, + "screamingSnakeCase": { + "unsafeName": "JUST_FILE", + "safeName": "JUST_FILE" + }, + "pascalCase": { + "unsafeName": "JustFile", + "safeName": "JustFile" + } + }, + "displayName": null, + "auth": false, + "idempotent": false, + "baseUrl": null, + "method": "POST", + "basePath": null, + "path": { + "head": "/just-file", + "parts": [] + }, + "fullPath": { + "head": "/just-file", + "parts": [] + }, + "pathParameters": [], + "allPathParameters": [], + "queryParameters": [], + "headers": [], + "requestBody": { + "type": "fileUpload", + "name": { + "originalName": "JustFileRequest", + "camelCase": { + "unsafeName": "justFileRequest", + "safeName": "justFileRequest" + }, + "snakeCase": { + "unsafeName": "just_file_request", + "safeName": "just_file_request" + }, + "screamingSnakeCase": { + "unsafeName": "JUST_FILE_REQUEST", + "safeName": "JUST_FILE_REQUEST" + }, + "pascalCase": { + "unsafeName": "JustFileRequest", + "safeName": "JustFileRequest" + } + }, + "properties": [ + { + "type": "file", + "value": { + "type": "file", + "key": { + "name": { + "originalName": "file", + "camelCase": { + "unsafeName": "file", + "safeName": "file" + }, + "snakeCase": { + "unsafeName": "file", + "safeName": "file" + }, + "screamingSnakeCase": { + "unsafeName": "FILE", + "safeName": "FILE" + }, + "pascalCase": { + "unsafeName": "File", + "safeName": "File" + } + }, + "wireValue": "file" + }, + "isOptional": false, + "contentType": null + } + } + ], + "docs": null + }, + "sdkRequest": { + "shape": { + "type": "wrapper", + "wrapperName": { + "originalName": "JustFileRequest", + "camelCase": { + "unsafeName": "justFileRequest", + "safeName": "justFileRequest" + }, + "snakeCase": { + "unsafeName": "just_file_request", + "safeName": "just_file_request" + }, + "screamingSnakeCase": { + "unsafeName": "JUST_FILE_REQUEST", + "safeName": "JUST_FILE_REQUEST" + }, + "pascalCase": { + "unsafeName": "JustFileRequest", + "safeName": "JustFileRequest" + } + }, + "bodyKey": { + "originalName": "body", + "camelCase": { + "unsafeName": "body", + "safeName": "body" + }, + "snakeCase": { + "unsafeName": "body", + "safeName": "body" + }, + "screamingSnakeCase": { + "unsafeName": "BODY", + "safeName": "BODY" + }, + "pascalCase": { + "unsafeName": "Body", + "safeName": "Body" + } + }, + "includePathParameters": false, + "onlyPathParameters": false + }, + "requestParameterName": { + "originalName": "request", + "camelCase": { + "unsafeName": "request", + "safeName": "request" + }, + "snakeCase": { + "unsafeName": "request", + "safeName": "request" + }, + "screamingSnakeCase": { + "unsafeName": "REQUEST", + "safeName": "REQUEST" + }, + "pascalCase": { + "unsafeName": "Request", + "safeName": "Request" + } + }, + "streamParameter": null + }, + "response": { + "body": null, + "status-code": null + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [], + "pagination": null, + "transport": null, + "availability": null, + "docs": null + }, + { + "id": "endpoint_service.justFileWithQueryParams", + "name": { + "originalName": "justFileWithQueryParams", + "camelCase": { + "unsafeName": "justFileWithQueryParams", + "safeName": "justFileWithQueryParams" + }, + "snakeCase": { + "unsafeName": "just_file_with_query_params", + "safeName": "just_file_with_query_params" + }, + "screamingSnakeCase": { + "unsafeName": "JUST_FILE_WITH_QUERY_PARAMS", + "safeName": "JUST_FILE_WITH_QUERY_PARAMS" + }, + "pascalCase": { + "unsafeName": "JustFileWithQueryParams", + "safeName": "JustFileWithQueryParams" + } + }, + "displayName": null, + "auth": false, + "idempotent": false, + "baseUrl": null, + "method": "POST", + "basePath": null, + "path": { + "head": "/just-file-with-query-params", + "parts": [] + }, + "fullPath": { + "head": "/just-file-with-query-params", + "parts": [] + }, + "pathParameters": [], + "allPathParameters": [], + "queryParameters": [ + { + "name": { + "name": { + "originalName": "maybeString", + "camelCase": { + "unsafeName": "maybeString", + "safeName": "maybeString" + }, + "snakeCase": { + "unsafeName": "maybe_string", + "safeName": "maybe_string" + }, + "screamingSnakeCase": { + "unsafeName": "MAYBE_STRING", + "safeName": "MAYBE_STRING" + }, + "pascalCase": { + "unsafeName": "MaybeString", + "safeName": "MaybeString" + } + }, + "wireValue": "maybeString" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "optional", + "optional": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "allowMultiple": false, + "availability": null, + "docs": null + }, + { + "name": { + "name": { + "originalName": "integer", + "camelCase": { + "unsafeName": "integer", + "safeName": "integer" + }, + "snakeCase": { + "unsafeName": "integer", + "safeName": "integer" + }, + "screamingSnakeCase": { + "unsafeName": "INTEGER", + "safeName": "INTEGER" + }, + "pascalCase": { + "unsafeName": "Integer", + "safeName": "Integer" + } + }, + "wireValue": "integer" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "INTEGER", + "v2": { + "type": "integer", + "default": null, + "validation": null + } + } + }, + "allowMultiple": false, + "availability": null, + "docs": null + }, + { + "name": { + "name": { + "originalName": "maybeInteger", + "camelCase": { + "unsafeName": "maybeInteger", + "safeName": "maybeInteger" + }, + "snakeCase": { + "unsafeName": "maybe_integer", + "safeName": "maybe_integer" + }, + "screamingSnakeCase": { + "unsafeName": "MAYBE_INTEGER", + "safeName": "MAYBE_INTEGER" + }, + "pascalCase": { + "unsafeName": "MaybeInteger", + "safeName": "MaybeInteger" + } + }, + "wireValue": "maybeInteger" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "optional", + "optional": { + "_type": "primitive", + "primitive": { + "v1": "INTEGER", + "v2": { + "type": "integer", + "default": null, + "validation": null + } + } + } + } + }, + "allowMultiple": false, + "availability": null, + "docs": null + }, + { + "name": { + "name": { + "originalName": "listOfStrings", + "camelCase": { + "unsafeName": "listOfStrings", + "safeName": "listOfStrings" + }, + "snakeCase": { + "unsafeName": "list_of_strings", + "safeName": "list_of_strings" + }, + "screamingSnakeCase": { + "unsafeName": "LIST_OF_STRINGS", + "safeName": "LIST_OF_STRINGS" + }, + "pascalCase": { + "unsafeName": "ListOfStrings", + "safeName": "ListOfStrings" + } + }, + "wireValue": "listOfStrings" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "allowMultiple": true, + "availability": null, + "docs": null + }, + { + "name": { + "name": { + "originalName": "optionalListOfStrings", + "camelCase": { + "unsafeName": "optionalListOfStrings", + "safeName": "optionalListOfStrings" + }, + "snakeCase": { + "unsafeName": "optional_list_of_strings", + "safeName": "optional_list_of_strings" + }, + "screamingSnakeCase": { + "unsafeName": "OPTIONAL_LIST_OF_STRINGS", + "safeName": "OPTIONAL_LIST_OF_STRINGS" + }, + "pascalCase": { + "unsafeName": "OptionalListOfStrings", + "safeName": "OptionalListOfStrings" + } + }, + "wireValue": "optionalListOfStrings" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "optional", + "optional": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "allowMultiple": true, + "availability": null, + "docs": null + } + ], + "headers": [], + "requestBody": { + "type": "fileUpload", + "name": { + "originalName": "JustFileWithQueryParamsRequest", + "camelCase": { + "unsafeName": "justFileWithQueryParamsRequest", + "safeName": "justFileWithQueryParamsRequest" + }, + "snakeCase": { + "unsafeName": "just_file_with_query_params_request", + "safeName": "just_file_with_query_params_request" + }, + "screamingSnakeCase": { + "unsafeName": "JUST_FILE_WITH_QUERY_PARAMS_REQUEST", + "safeName": "JUST_FILE_WITH_QUERY_PARAMS_REQUEST" + }, + "pascalCase": { + "unsafeName": "JustFileWithQueryParamsRequest", + "safeName": "JustFileWithQueryParamsRequest" + } + }, + "properties": [ + { + "type": "file", + "value": { + "type": "file", + "key": { + "name": { + "originalName": "file", + "camelCase": { + "unsafeName": "file", + "safeName": "file" + }, + "snakeCase": { + "unsafeName": "file", + "safeName": "file" + }, + "screamingSnakeCase": { + "unsafeName": "FILE", + "safeName": "FILE" + }, + "pascalCase": { + "unsafeName": "File", + "safeName": "File" + } + }, + "wireValue": "file" + }, + "isOptional": false, + "contentType": null + } + } + ], + "docs": null + }, + "sdkRequest": { + "shape": { + "type": "wrapper", + "wrapperName": { + "originalName": "JustFileWithQueryParamsRequest", + "camelCase": { + "unsafeName": "justFileWithQueryParamsRequest", + "safeName": "justFileWithQueryParamsRequest" + }, + "snakeCase": { + "unsafeName": "just_file_with_query_params_request", + "safeName": "just_file_with_query_params_request" + }, + "screamingSnakeCase": { + "unsafeName": "JUST_FILE_WITH_QUERY_PARAMS_REQUEST", + "safeName": "JUST_FILE_WITH_QUERY_PARAMS_REQUEST" + }, + "pascalCase": { + "unsafeName": "JustFileWithQueryParamsRequest", + "safeName": "JustFileWithQueryParamsRequest" + } + }, + "bodyKey": { + "originalName": "body", + "camelCase": { + "unsafeName": "body", + "safeName": "body" + }, + "snakeCase": { + "unsafeName": "body", + "safeName": "body" + }, + "screamingSnakeCase": { + "unsafeName": "BODY", + "safeName": "BODY" + }, + "pascalCase": { + "unsafeName": "Body", + "safeName": "Body" + } + }, + "includePathParameters": false, + "onlyPathParameters": false + }, + "requestParameterName": { + "originalName": "request", + "camelCase": { + "unsafeName": "request", + "safeName": "request" + }, + "snakeCase": { + "unsafeName": "request", + "safeName": "request" + }, + "screamingSnakeCase": { + "unsafeName": "REQUEST", + "safeName": "REQUEST" + }, + "pascalCase": { + "unsafeName": "Request", + "safeName": "Request" + } + }, + "streamParameter": null + }, + "response": { + "body": null, + "status-code": null + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [], + "pagination": null, + "transport": null, + "availability": null, + "docs": null + }, + { + "id": "endpoint_service.withContentType", + "name": { + "originalName": "withContentType", + "camelCase": { + "unsafeName": "withContentType", + "safeName": "withContentType" + }, + "snakeCase": { + "unsafeName": "with_content_type", + "safeName": "with_content_type" + }, + "screamingSnakeCase": { + "unsafeName": "WITH_CONTENT_TYPE", + "safeName": "WITH_CONTENT_TYPE" + }, + "pascalCase": { + "unsafeName": "WithContentType", + "safeName": "WithContentType" + } + }, + "displayName": null, + "auth": false, + "idempotent": false, + "baseUrl": null, + "method": "POST", + "basePath": null, + "path": { + "head": "/with-content-type", + "parts": [] + }, + "fullPath": { + "head": "/with-content-type", + "parts": [] + }, + "pathParameters": [], + "allPathParameters": [], + "queryParameters": [], + "headers": [], + "requestBody": { + "type": "fileUpload", + "name": { + "originalName": "WithContentTypeRequest", + "camelCase": { + "unsafeName": "withContentTypeRequest", + "safeName": "withContentTypeRequest" + }, + "snakeCase": { + "unsafeName": "with_content_type_request", + "safeName": "with_content_type_request" + }, + "screamingSnakeCase": { + "unsafeName": "WITH_CONTENT_TYPE_REQUEST", + "safeName": "WITH_CONTENT_TYPE_REQUEST" + }, + "pascalCase": { + "unsafeName": "WithContentTypeRequest", + "safeName": "WithContentTypeRequest" + } + }, + "properties": [ + { + "type": "file", + "value": { + "type": "file", + "key": { + "name": { + "originalName": "file", + "camelCase": { + "unsafeName": "file", + "safeName": "file" + }, + "snakeCase": { + "unsafeName": "file", + "safeName": "file" + }, + "screamingSnakeCase": { + "unsafeName": "FILE", + "safeName": "FILE" + }, + "pascalCase": { + "unsafeName": "File", + "safeName": "File" + } + }, + "wireValue": "file" + }, + "isOptional": false, + "contentType": "application/octet-stream" + } + }, + { + "type": "bodyProperty", + "contentType": null, + "name": { + "name": { + "originalName": "foo", + "camelCase": { + "unsafeName": "foo", + "safeName": "foo" + }, + "snakeCase": { + "unsafeName": "foo", + "safeName": "foo" + }, + "screamingSnakeCase": { + "unsafeName": "FOO", + "safeName": "FOO" + }, + "pascalCase": { + "unsafeName": "Foo", + "safeName": "Foo" + } + }, + "wireValue": "foo" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "availability": null, + "docs": null + }, + { + "type": "bodyProperty", + "contentType": "application/json", + "name": { + "name": { + "originalName": "bar", + "camelCase": { + "unsafeName": "bar", + "safeName": "bar" + }, + "snakeCase": { + "unsafeName": "bar", + "safeName": "bar" + }, + "screamingSnakeCase": { + "unsafeName": "BAR", + "safeName": "BAR" + }, + "pascalCase": { + "unsafeName": "Bar", + "safeName": "Bar" + } + }, + "wireValue": "bar" + }, + "valueType": { + "_type": "named", + "name": { + "originalName": "MyObject", + "camelCase": { + "unsafeName": "myObject", + "safeName": "myObject" + }, + "snakeCase": { + "unsafeName": "my_object", + "safeName": "my_object" + }, + "screamingSnakeCase": { + "unsafeName": "MY_OBJECT", + "safeName": "MY_OBJECT" + }, + "pascalCase": { + "unsafeName": "MyObject", + "safeName": "MyObject" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "typeId": "type_service:MyObject", + "default": null, + "inline": null + }, + "availability": null, + "docs": null + }, + { + "type": "bodyProperty", + "contentType": "application/json", + "name": { + "name": { + "originalName": "foo_bar", + "camelCase": { + "unsafeName": "fooBar", + "safeName": "fooBar" + }, + "snakeCase": { + "unsafeName": "foo_bar", + "safeName": "foo_bar" + }, + "screamingSnakeCase": { + "unsafeName": "FOO_BAR", + "safeName": "FOO_BAR" + }, + "pascalCase": { + "unsafeName": "FooBar", + "safeName": "FooBar" + } + }, + "wireValue": "foo_bar" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "optional", + "optional": { + "_type": "named", + "name": { + "originalName": "MyObject", + "camelCase": { + "unsafeName": "myObject", + "safeName": "myObject" + }, + "snakeCase": { + "unsafeName": "my_object", + "safeName": "my_object" + }, + "screamingSnakeCase": { + "unsafeName": "MY_OBJECT", + "safeName": "MY_OBJECT" + }, + "pascalCase": { + "unsafeName": "MyObject", + "safeName": "MyObject" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "typeId": "type_service:MyObject", + "default": null, + "inline": null + } + } + }, + "availability": null, + "docs": null + } + ], + "docs": null + }, + "sdkRequest": { + "shape": { + "type": "wrapper", + "wrapperName": { + "originalName": "WithContentTypeRequest", + "camelCase": { + "unsafeName": "withContentTypeRequest", + "safeName": "withContentTypeRequest" + }, + "snakeCase": { + "unsafeName": "with_content_type_request", + "safeName": "with_content_type_request" + }, + "screamingSnakeCase": { + "unsafeName": "WITH_CONTENT_TYPE_REQUEST", + "safeName": "WITH_CONTENT_TYPE_REQUEST" + }, + "pascalCase": { + "unsafeName": "WithContentTypeRequest", + "safeName": "WithContentTypeRequest" + } + }, + "bodyKey": { + "originalName": "body", + "camelCase": { + "unsafeName": "body", + "safeName": "body" + }, + "snakeCase": { + "unsafeName": "body", + "safeName": "body" + }, + "screamingSnakeCase": { + "unsafeName": "BODY", + "safeName": "BODY" + }, + "pascalCase": { + "unsafeName": "Body", + "safeName": "Body" + } + }, + "includePathParameters": false, + "onlyPathParameters": false + }, + "requestParameterName": { + "originalName": "request", + "camelCase": { + "unsafeName": "request", + "safeName": "request" + }, + "snakeCase": { + "unsafeName": "request", + "safeName": "request" + }, + "screamingSnakeCase": { + "unsafeName": "REQUEST", + "safeName": "REQUEST" + }, + "pascalCase": { + "unsafeName": "Request", + "safeName": "Request" + } + }, + "streamParameter": null + }, + "response": { + "body": null, + "status-code": null + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [], + "pagination": null, + "transport": null, + "availability": null, + "docs": null + } + ] + } + }, + "constants": { + "errorInstanceIdKey": { + "name": { + "originalName": "errorInstanceId", + "camelCase": { + "unsafeName": "errorInstanceId", + "safeName": "errorInstanceId" + }, + "snakeCase": { + "unsafeName": "error_instance_id", + "safeName": "error_instance_id" + }, + "screamingSnakeCase": { + "unsafeName": "ERROR_INSTANCE_ID", + "safeName": "ERROR_INSTANCE_ID" + }, + "pascalCase": { + "unsafeName": "ErrorInstanceId", + "safeName": "ErrorInstanceId" + } + }, + "wireValue": "errorInstanceId" + } + }, + "environments": null, + "errorDiscriminationStrategy": { + "type": "statusCode" + }, + "basePath": null, + "pathParameters": [], + "variables": [], + "serviceTypeReferenceInfo": { + "typesReferencedOnlyByService": { + "service_service": [ + "type_service:Id", + "type_service:MyObject", + "type_service:ObjectType" + ] + }, + "sharedTypes": [] + }, + "webhookGroups": {}, + "websocketChannels": {}, + "readmeConfig": null, + "sourceConfig": null, + "publishConfig": null, + "dynamic": { + "version": "1.0.0", + "types": { + "type_service:Id": { + "type": "alias", + "declaration": { + "name": { + "originalName": "Id", + "camelCase": { + "unsafeName": "id", + "safeName": "id" + }, + "snakeCase": { + "unsafeName": "id", + "safeName": "id" + }, + "screamingSnakeCase": { + "unsafeName": "ID", + "safeName": "ID" + }, + "pascalCase": { + "unsafeName": "Id", + "safeName": "Id" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + }, + "type_service:MyObject": { + "type": "object", + "declaration": { + "name": { + "originalName": "MyObject", + "camelCase": { + "unsafeName": "myObject", + "safeName": "myObject" + }, + "snakeCase": { + "unsafeName": "my_object", + "safeName": "my_object" + }, + "screamingSnakeCase": { + "unsafeName": "MY_OBJECT", + "safeName": "MY_OBJECT" + }, + "pascalCase": { + "unsafeName": "MyObject", + "safeName": "MyObject" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "foo", + "camelCase": { + "unsafeName": "foo", + "safeName": "foo" + }, + "snakeCase": { + "unsafeName": "foo", + "safeName": "foo" + }, + "screamingSnakeCase": { + "unsafeName": "FOO", + "safeName": "FOO" + }, + "pascalCase": { + "unsafeName": "Foo", + "safeName": "Foo" + } + }, + "wireValue": "foo" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + } + ] + }, + "type_service:ObjectType": { + "type": "enum", + "declaration": { + "name": { + "originalName": "ObjectType", + "camelCase": { + "unsafeName": "objectType", + "safeName": "objectType" + }, + "snakeCase": { + "unsafeName": "object_type", + "safeName": "object_type" + }, + "screamingSnakeCase": { + "unsafeName": "OBJECT_TYPE", + "safeName": "OBJECT_TYPE" + }, + "pascalCase": { + "unsafeName": "ObjectType", + "safeName": "ObjectType" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "values": [ + { + "name": { + "originalName": "FOO", + "camelCase": { + "unsafeName": "foo", + "safeName": "foo" + }, + "snakeCase": { + "unsafeName": "foo", + "safeName": "foo" + }, + "screamingSnakeCase": { + "unsafeName": "FOO", + "safeName": "FOO" + }, + "pascalCase": { + "unsafeName": "Foo", + "safeName": "Foo" + } + }, + "wireValue": "FOO" + }, + { + "name": { + "originalName": "BAR", + "camelCase": { + "unsafeName": "bar", + "safeName": "bar" + }, + "snakeCase": { + "unsafeName": "bar", + "safeName": "bar" + }, + "screamingSnakeCase": { + "unsafeName": "BAR", + "safeName": "BAR" + }, + "pascalCase": { + "unsafeName": "Bar", + "safeName": "Bar" + } + }, + "wireValue": "BAR" + } + ] + } + }, + "headers": [], + "endpoints": { + "endpoint_service.post": { + "auth": null, + "declaration": { + "name": { + "originalName": "post", + "camelCase": { + "unsafeName": "post", + "safeName": "post" + }, + "snakeCase": { + "unsafeName": "post", + "safeName": "post" + }, + "screamingSnakeCase": { + "unsafeName": "POST", + "safeName": "POST" + }, + "pascalCase": { + "unsafeName": "Post", + "safeName": "Post" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "location": { + "method": "POST", + "path": "/" + }, + "request": { + "type": "inlined", + "declaration": { + "name": { + "originalName": "MyRequest", + "camelCase": { + "unsafeName": "myRequest", + "safeName": "myRequest" + }, + "snakeCase": { + "unsafeName": "my_request", + "safeName": "my_request" + }, + "screamingSnakeCase": { + "unsafeName": "MY_REQUEST", + "safeName": "MY_REQUEST" + }, + "pascalCase": { + "unsafeName": "MyRequest", + "safeName": "MyRequest" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "pathParameters": [], + "queryParameters": [], + "headers": [], + "body": { + "type": "fileUpload", + "properties": [ + { + "type": "bodyProperty", + "name": { + "name": { + "originalName": "maybe_string", + "camelCase": { + "unsafeName": "maybeString", + "safeName": "maybeString" + }, + "snakeCase": { + "unsafeName": "maybe_string", + "safeName": "maybe_string" + }, + "screamingSnakeCase": { + "unsafeName": "MAYBE_STRING", + "safeName": "MAYBE_STRING" + }, + "pascalCase": { + "unsafeName": "MaybeString", + "safeName": "MaybeString" + } + }, + "wireValue": "maybe_string" + }, + "typeReference": { + "type": "optional", + "value": { + "type": "primitive", + "value": "STRING" + } + } + }, + { + "type": "bodyProperty", + "name": { + "name": { + "originalName": "integer", + "camelCase": { + "unsafeName": "integer", + "safeName": "integer" + }, + "snakeCase": { + "unsafeName": "integer", + "safeName": "integer" + }, + "screamingSnakeCase": { + "unsafeName": "INTEGER", + "safeName": "INTEGER" + }, + "pascalCase": { + "unsafeName": "Integer", + "safeName": "Integer" + } + }, + "wireValue": "integer" + }, + "typeReference": { + "type": "primitive", + "value": "INTEGER" + } + }, + { + "type": "file", + "name": { + "originalName": "file", + "camelCase": { + "unsafeName": "file", + "safeName": "file" + }, + "snakeCase": { + "unsafeName": "file", + "safeName": "file" + }, + "screamingSnakeCase": { + "unsafeName": "FILE", + "safeName": "FILE" + }, + "pascalCase": { + "unsafeName": "File", + "safeName": "File" + } + }, + "wireValue": "file" + }, + { + "type": "fileArray", + "name": { + "originalName": "file_list", + "camelCase": { + "unsafeName": "fileList", + "safeName": "fileList" + }, + "snakeCase": { + "unsafeName": "file_list", + "safeName": "file_list" + }, + "screamingSnakeCase": { + "unsafeName": "FILE_LIST", + "safeName": "FILE_LIST" + }, + "pascalCase": { + "unsafeName": "FileList", + "safeName": "FileList" + } + }, + "wireValue": "file_list" + }, + { + "type": "file", + "name": { + "originalName": "maybe_file", + "camelCase": { + "unsafeName": "maybeFile", + "safeName": "maybeFile" + }, + "snakeCase": { + "unsafeName": "maybe_file", + "safeName": "maybe_file" + }, + "screamingSnakeCase": { + "unsafeName": "MAYBE_FILE", + "safeName": "MAYBE_FILE" + }, + "pascalCase": { + "unsafeName": "MaybeFile", + "safeName": "MaybeFile" + } + }, + "wireValue": "maybe_file" + }, + { + "type": "fileArray", + "name": { + "originalName": "maybe_file_list", + "camelCase": { + "unsafeName": "maybeFileList", + "safeName": "maybeFileList" + }, + "snakeCase": { + "unsafeName": "maybe_file_list", + "safeName": "maybe_file_list" + }, + "screamingSnakeCase": { + "unsafeName": "MAYBE_FILE_LIST", + "safeName": "MAYBE_FILE_LIST" + }, + "pascalCase": { + "unsafeName": "MaybeFileList", + "safeName": "MaybeFileList" + } + }, + "wireValue": "maybe_file_list" + }, + { + "type": "bodyProperty", + "name": { + "name": { + "originalName": "maybe_integer", + "camelCase": { + "unsafeName": "maybeInteger", + "safeName": "maybeInteger" + }, + "snakeCase": { + "unsafeName": "maybe_integer", + "safeName": "maybe_integer" + }, + "screamingSnakeCase": { + "unsafeName": "MAYBE_INTEGER", + "safeName": "MAYBE_INTEGER" + }, + "pascalCase": { + "unsafeName": "MaybeInteger", + "safeName": "MaybeInteger" + } + }, + "wireValue": "maybe_integer" + }, + "typeReference": { + "type": "optional", + "value": { + "type": "primitive", + "value": "INTEGER" + } + } + }, + { + "type": "bodyProperty", + "name": { + "name": { + "originalName": "optional_list_of_strings", + "camelCase": { + "unsafeName": "optionalListOfStrings", + "safeName": "optionalListOfStrings" + }, + "snakeCase": { + "unsafeName": "optional_list_of_strings", + "safeName": "optional_list_of_strings" + }, + "screamingSnakeCase": { + "unsafeName": "OPTIONAL_LIST_OF_STRINGS", + "safeName": "OPTIONAL_LIST_OF_STRINGS" + }, + "pascalCase": { + "unsafeName": "OptionalListOfStrings", + "safeName": "OptionalListOfStrings" + } + }, + "wireValue": "optional_list_of_strings" + }, + "typeReference": { + "type": "optional", + "value": { + "type": "list", + "value": { + "type": "primitive", + "value": "STRING" + } + } + } + }, + { + "type": "bodyProperty", + "name": { + "name": { + "originalName": "list_of_objects", + "camelCase": { + "unsafeName": "listOfObjects", + "safeName": "listOfObjects" + }, + "snakeCase": { + "unsafeName": "list_of_objects", + "safeName": "list_of_objects" + }, + "screamingSnakeCase": { + "unsafeName": "LIST_OF_OBJECTS", + "safeName": "LIST_OF_OBJECTS" + }, + "pascalCase": { + "unsafeName": "ListOfObjects", + "safeName": "ListOfObjects" + } + }, + "wireValue": "list_of_objects" + }, + "typeReference": { + "type": "list", + "value": { + "type": "named", + "value": "type_service:MyObject" + } + } + }, + { + "type": "bodyProperty", + "name": { + "name": { + "originalName": "optional_metadata", + "camelCase": { + "unsafeName": "optionalMetadata", + "safeName": "optionalMetadata" + }, + "snakeCase": { + "unsafeName": "optional_metadata", + "safeName": "optional_metadata" + }, + "screamingSnakeCase": { + "unsafeName": "OPTIONAL_METADATA", + "safeName": "OPTIONAL_METADATA" + }, + "pascalCase": { + "unsafeName": "OptionalMetadata", + "safeName": "OptionalMetadata" + } + }, + "wireValue": "optional_metadata" + }, + "typeReference": { + "type": "optional", + "value": { + "type": "unknown" + } + } + }, + { + "type": "bodyProperty", + "name": { + "name": { + "originalName": "optional_object_type", + "camelCase": { + "unsafeName": "optionalObjectType", + "safeName": "optionalObjectType" + }, + "snakeCase": { + "unsafeName": "optional_object_type", + "safeName": "optional_object_type" + }, + "screamingSnakeCase": { + "unsafeName": "OPTIONAL_OBJECT_TYPE", + "safeName": "OPTIONAL_OBJECT_TYPE" + }, + "pascalCase": { + "unsafeName": "OptionalObjectType", + "safeName": "OptionalObjectType" + } + }, + "wireValue": "optional_object_type" + }, + "typeReference": { + "type": "optional", + "value": { + "type": "named", + "value": "type_service:ObjectType" + } + } + }, + { + "type": "bodyProperty", + "name": { + "name": { + "originalName": "optional_id", + "camelCase": { + "unsafeName": "optionalId", + "safeName": "optionalId" + }, + "snakeCase": { + "unsafeName": "optional_id", + "safeName": "optional_id" + }, + "screamingSnakeCase": { + "unsafeName": "OPTIONAL_ID", + "safeName": "OPTIONAL_ID" + }, + "pascalCase": { + "unsafeName": "OptionalId", + "safeName": "OptionalId" + } + }, + "wireValue": "optional_id" + }, + "typeReference": { + "type": "optional", + "value": { + "type": "named", + "value": "type_service:Id" + } + } + } + ] + }, + "metadata": { + "includePathParameters": false, + "onlyPathParameters": false + } + }, + "response": { + "type": "json" + } + }, + "endpoint_service.justFile": { + "auth": null, + "declaration": { + "name": { + "originalName": "justFile", + "camelCase": { + "unsafeName": "justFile", + "safeName": "justFile" + }, + "snakeCase": { + "unsafeName": "just_file", + "safeName": "just_file" + }, + "screamingSnakeCase": { + "unsafeName": "JUST_FILE", + "safeName": "JUST_FILE" + }, + "pascalCase": { + "unsafeName": "JustFile", + "safeName": "JustFile" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "location": { + "method": "POST", + "path": "/just-file" + }, + "request": { + "type": "inlined", + "declaration": { + "name": { + "originalName": "JustFileRequest", + "camelCase": { + "unsafeName": "justFileRequest", + "safeName": "justFileRequest" + }, + "snakeCase": { + "unsafeName": "just_file_request", + "safeName": "just_file_request" + }, + "screamingSnakeCase": { + "unsafeName": "JUST_FILE_REQUEST", + "safeName": "JUST_FILE_REQUEST" + }, + "pascalCase": { + "unsafeName": "JustFileRequest", + "safeName": "JustFileRequest" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "pathParameters": [], + "queryParameters": [], + "headers": [], + "body": { + "type": "fileUpload", + "properties": [ + { + "type": "file", + "name": { + "originalName": "file", + "camelCase": { + "unsafeName": "file", + "safeName": "file" + }, + "snakeCase": { + "unsafeName": "file", + "safeName": "file" + }, + "screamingSnakeCase": { + "unsafeName": "FILE", + "safeName": "FILE" + }, + "pascalCase": { + "unsafeName": "File", + "safeName": "File" + } + }, + "wireValue": "file" + } + ] + }, + "metadata": { + "includePathParameters": false, + "onlyPathParameters": false + } + }, + "response": { + "type": "json" + } + }, + "endpoint_service.justFileWithQueryParams": { + "auth": null, + "declaration": { + "name": { + "originalName": "justFileWithQueryParams", + "camelCase": { + "unsafeName": "justFileWithQueryParams", + "safeName": "justFileWithQueryParams" + }, + "snakeCase": { + "unsafeName": "just_file_with_query_params", + "safeName": "just_file_with_query_params" + }, + "screamingSnakeCase": { + "unsafeName": "JUST_FILE_WITH_QUERY_PARAMS", + "safeName": "JUST_FILE_WITH_QUERY_PARAMS" + }, + "pascalCase": { + "unsafeName": "JustFileWithQueryParams", + "safeName": "JustFileWithQueryParams" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "location": { + "method": "POST", + "path": "/just-file-with-query-params" + }, + "request": { + "type": "inlined", + "declaration": { + "name": { + "originalName": "JustFileWithQueryParamsRequest", + "camelCase": { + "unsafeName": "justFileWithQueryParamsRequest", + "safeName": "justFileWithQueryParamsRequest" + }, + "snakeCase": { + "unsafeName": "just_file_with_query_params_request", + "safeName": "just_file_with_query_params_request" + }, + "screamingSnakeCase": { + "unsafeName": "JUST_FILE_WITH_QUERY_PARAMS_REQUEST", + "safeName": "JUST_FILE_WITH_QUERY_PARAMS_REQUEST" + }, + "pascalCase": { + "unsafeName": "JustFileWithQueryParamsRequest", + "safeName": "JustFileWithQueryParamsRequest" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "pathParameters": [], + "queryParameters": [ + { + "name": { + "name": { + "originalName": "maybeString", + "camelCase": { + "unsafeName": "maybeString", + "safeName": "maybeString" + }, + "snakeCase": { + "unsafeName": "maybe_string", + "safeName": "maybe_string" + }, + "screamingSnakeCase": { + "unsafeName": "MAYBE_STRING", + "safeName": "MAYBE_STRING" + }, + "pascalCase": { + "unsafeName": "MaybeString", + "safeName": "MaybeString" + } + }, + "wireValue": "maybeString" + }, + "typeReference": { + "type": "optional", + "value": { + "type": "primitive", + "value": "STRING" + } + } + }, + { + "name": { + "name": { + "originalName": "integer", + "camelCase": { + "unsafeName": "integer", + "safeName": "integer" + }, + "snakeCase": { + "unsafeName": "integer", + "safeName": "integer" + }, + "screamingSnakeCase": { + "unsafeName": "INTEGER", + "safeName": "INTEGER" + }, + "pascalCase": { + "unsafeName": "Integer", + "safeName": "Integer" + } + }, + "wireValue": "integer" + }, + "typeReference": { + "type": "primitive", + "value": "INTEGER" + } + }, + { + "name": { + "name": { + "originalName": "maybeInteger", + "camelCase": { + "unsafeName": "maybeInteger", + "safeName": "maybeInteger" + }, + "snakeCase": { + "unsafeName": "maybe_integer", + "safeName": "maybe_integer" + }, + "screamingSnakeCase": { + "unsafeName": "MAYBE_INTEGER", + "safeName": "MAYBE_INTEGER" + }, + "pascalCase": { + "unsafeName": "MaybeInteger", + "safeName": "MaybeInteger" + } + }, + "wireValue": "maybeInteger" + }, + "typeReference": { + "type": "optional", + "value": { + "type": "primitive", + "value": "INTEGER" + } + } + }, + { + "name": { + "name": { + "originalName": "listOfStrings", + "camelCase": { + "unsafeName": "listOfStrings", + "safeName": "listOfStrings" + }, + "snakeCase": { + "unsafeName": "list_of_strings", + "safeName": "list_of_strings" + }, + "screamingSnakeCase": { + "unsafeName": "LIST_OF_STRINGS", + "safeName": "LIST_OF_STRINGS" + }, + "pascalCase": { + "unsafeName": "ListOfStrings", + "safeName": "ListOfStrings" + } + }, + "wireValue": "listOfStrings" + }, + "typeReference": { + "type": "list", + "value": { + "type": "primitive", + "value": "STRING" + } + } + }, + { + "name": { + "name": { + "originalName": "optionalListOfStrings", + "camelCase": { + "unsafeName": "optionalListOfStrings", + "safeName": "optionalListOfStrings" + }, + "snakeCase": { + "unsafeName": "optional_list_of_strings", + "safeName": "optional_list_of_strings" + }, + "screamingSnakeCase": { + "unsafeName": "OPTIONAL_LIST_OF_STRINGS", + "safeName": "OPTIONAL_LIST_OF_STRINGS" + }, + "pascalCase": { + "unsafeName": "OptionalListOfStrings", + "safeName": "OptionalListOfStrings" + } + }, + "wireValue": "optionalListOfStrings" + }, + "typeReference": { + "type": "list", + "value": { + "type": "optional", + "value": { + "type": "primitive", + "value": "STRING" + } + } + } + } + ], + "headers": [], + "body": { + "type": "fileUpload", + "properties": [ + { + "type": "file", + "name": { + "originalName": "file", + "camelCase": { + "unsafeName": "file", + "safeName": "file" + }, + "snakeCase": { + "unsafeName": "file", + "safeName": "file" + }, + "screamingSnakeCase": { + "unsafeName": "FILE", + "safeName": "FILE" + }, + "pascalCase": { + "unsafeName": "File", + "safeName": "File" + } + }, + "wireValue": "file" + } + ] + }, + "metadata": { + "includePathParameters": false, + "onlyPathParameters": false + } + }, + "response": { + "type": "json" + } + }, + "endpoint_service.withContentType": { + "auth": null, + "declaration": { + "name": { + "originalName": "withContentType", + "camelCase": { + "unsafeName": "withContentType", + "safeName": "withContentType" + }, + "snakeCase": { + "unsafeName": "with_content_type", + "safeName": "with_content_type" + }, + "screamingSnakeCase": { + "unsafeName": "WITH_CONTENT_TYPE", + "safeName": "WITH_CONTENT_TYPE" + }, + "pascalCase": { + "unsafeName": "WithContentType", + "safeName": "WithContentType" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "location": { + "method": "POST", + "path": "/with-content-type" + }, + "request": { + "type": "inlined", + "declaration": { + "name": { + "originalName": "WithContentTypeRequest", + "camelCase": { + "unsafeName": "withContentTypeRequest", + "safeName": "withContentTypeRequest" + }, + "snakeCase": { + "unsafeName": "with_content_type_request", + "safeName": "with_content_type_request" + }, + "screamingSnakeCase": { + "unsafeName": "WITH_CONTENT_TYPE_REQUEST", + "safeName": "WITH_CONTENT_TYPE_REQUEST" + }, + "pascalCase": { + "unsafeName": "WithContentTypeRequest", + "safeName": "WithContentTypeRequest" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + } + }, + "pathParameters": [], + "queryParameters": [], + "headers": [], + "body": { + "type": "fileUpload", + "properties": [ + { + "type": "file", + "name": { + "originalName": "file", + "camelCase": { + "unsafeName": "file", + "safeName": "file" + }, + "snakeCase": { + "unsafeName": "file", + "safeName": "file" + }, + "screamingSnakeCase": { + "unsafeName": "FILE", + "safeName": "FILE" + }, + "pascalCase": { + "unsafeName": "File", + "safeName": "File" + } + }, + "wireValue": "file" + }, + { + "type": "bodyProperty", + "name": { + "name": { + "originalName": "foo", + "camelCase": { + "unsafeName": "foo", + "safeName": "foo" + }, + "snakeCase": { + "unsafeName": "foo", + "safeName": "foo" + }, + "screamingSnakeCase": { + "unsafeName": "FOO", + "safeName": "FOO" + }, + "pascalCase": { + "unsafeName": "Foo", + "safeName": "Foo" + } + }, + "wireValue": "foo" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + }, + { + "type": "bodyProperty", + "name": { + "name": { + "originalName": "bar", + "camelCase": { + "unsafeName": "bar", + "safeName": "bar" + }, + "snakeCase": { + "unsafeName": "bar", + "safeName": "bar" + }, + "screamingSnakeCase": { + "unsafeName": "BAR", + "safeName": "BAR" + }, + "pascalCase": { + "unsafeName": "Bar", + "safeName": "Bar" + } + }, + "wireValue": "bar" + }, + "typeReference": { + "type": "named", + "value": "type_service:MyObject" + } + }, + { + "type": "bodyProperty", + "name": { + "name": { + "originalName": "foo_bar", + "camelCase": { + "unsafeName": "fooBar", + "safeName": "fooBar" + }, + "snakeCase": { + "unsafeName": "foo_bar", + "safeName": "foo_bar" + }, + "screamingSnakeCase": { + "unsafeName": "FOO_BAR", + "safeName": "FOO_BAR" + }, + "pascalCase": { + "unsafeName": "FooBar", + "safeName": "FooBar" + } + }, + "wireValue": "foo_bar" + }, + "typeReference": { + "type": "optional", + "value": { + "type": "named", + "value": "type_service:MyObject" + } + } + } + ] + }, + "metadata": { + "includePathParameters": false, + "onlyPathParameters": false + } + }, + "response": { + "type": "json" + } + } + } + }, + "subpackages": { + "subpackage_service": { + "name": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + ], + "packagePath": [], + "file": { + "originalName": "service", + "camelCase": { + "unsafeName": "service", + "safeName": "service" + }, + "snakeCase": { + "unsafeName": "service", + "safeName": "service" + }, + "screamingSnakeCase": { + "unsafeName": "SERVICE", + "safeName": "SERVICE" + }, + "pascalCase": { + "unsafeName": "Service", + "safeName": "Service" + } + } + }, + "service": "service_service", + "types": [ + "type_service:Id", + "type_service:MyObject", + "type_service:ObjectType" + ], + "errors": [], + "subpackages": [], + "navigationConfig": null, + "webhooks": null, + "websocket": null, + "hasEndpointsInTree": true, + "docs": null + } + }, + "rootPackage": { + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "websocket": null, + "service": null, + "types": [], + "errors": [], + "subpackages": [ + "subpackage_service" + ], + "webhooks": null, + "navigationConfig": null, + "hasEndpointsInTree": true, + "docs": null + }, + "sdkConfig": { + "isAuthMandatory": false, + "hasStreamingEndpoints": false, + "hasPaginatedEndpoints": false, + "hasFileDownloadEndpoints": false, + "platformHeaders": { + "language": "X-Fern-Language", + "sdkName": "X-Fern-SDK-Name", + "sdkVersion": "X-Fern-SDK-Version", + "userAgent": null + } + } +} \ No newline at end of file diff --git a/seed/csharp-model/file-upload/src/SeedFileUpload/Core/Public/FileParameter.cs b/seed/csharp-model/file-upload/src/SeedFileUpload/Core/Public/FileParameter.cs index 860937485a7..1c748f89ca8 100644 --- a/seed/csharp-model/file-upload/src/SeedFileUpload/Core/Public/FileParameter.cs +++ b/seed/csharp-model/file-upload/src/SeedFileUpload/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/folders/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-model/folders/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-model/folders/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-model/folders/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/FileParameter.cs b/seed/csharp-model/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/FileParameter.cs index 8e2b0db70a6..bfa78de5c25 100644 --- a/seed/csharp-model/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/FileParameter.cs +++ b/seed/csharp-model/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/imdb/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-model/imdb/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-model/imdb/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-model/imdb/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/license/src/SeedLicense/Core/Public/FileParameter.cs b/seed/csharp-model/license/src/SeedLicense/Core/Public/FileParameter.cs index cd02ece26b0..19c61220c60 100644 --- a/seed/csharp-model/license/src/SeedLicense/Core/Public/FileParameter.cs +++ b/seed/csharp-model/license/src/SeedLicense/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/literal/src/SeedLiteral/Core/Public/FileParameter.cs b/seed/csharp-model/literal/src/SeedLiteral/Core/Public/FileParameter.cs index c5d0ff64cae..90d73ec170d 100644 --- a/seed/csharp-model/literal/src/SeedLiteral/Core/Public/FileParameter.cs +++ b/seed/csharp-model/literal/src/SeedLiteral/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/mixed-case/src/SeedMixedCase/Core/Public/FileParameter.cs b/seed/csharp-model/mixed-case/src/SeedMixedCase/Core/Public/FileParameter.cs index 06ec8e183df..53551a60141 100644 --- a/seed/csharp-model/mixed-case/src/SeedMixedCase/Core/Public/FileParameter.cs +++ b/seed/csharp-model/mixed-case/src/SeedMixedCase/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/FileParameter.cs b/seed/csharp-model/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/FileParameter.cs index 1e4b519e349..c7b7e2bcb1b 100644 --- a/seed/csharp-model/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/FileParameter.cs +++ b/seed/csharp-model/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/multi-line-docs/src/SeedMultiLineDocs/Core/Public/FileParameter.cs b/seed/csharp-model/multi-line-docs/src/SeedMultiLineDocs/Core/Public/FileParameter.cs index 8a083e72130..3fde937cd4d 100644 --- a/seed/csharp-model/multi-line-docs/src/SeedMultiLineDocs/Core/Public/FileParameter.cs +++ b/seed/csharp-model/multi-line-docs/src/SeedMultiLineDocs/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/FileParameter.cs b/seed/csharp-model/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/FileParameter.cs index 264c18f0f2f..37a82d4397e 100644 --- a/seed/csharp-model/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/FileParameter.cs +++ b/seed/csharp-model/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/multi-url-environment/src/SeedMultiUrlEnvironment/Core/Public/FileParameter.cs b/seed/csharp-model/multi-url-environment/src/SeedMultiUrlEnvironment/Core/Public/FileParameter.cs index a94f5cf9a6b..413ab264256 100644 --- a/seed/csharp-model/multi-url-environment/src/SeedMultiUrlEnvironment/Core/Public/FileParameter.cs +++ b/seed/csharp-model/multi-url-environment/src/SeedMultiUrlEnvironment/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/no-environment/src/SeedNoEnvironment/Core/Public/FileParameter.cs b/seed/csharp-model/no-environment/src/SeedNoEnvironment/Core/Public/FileParameter.cs index 1e15762ac28..c0ea41021e7 100644 --- a/seed/csharp-model/no-environment/src/SeedNoEnvironment/Core/Public/FileParameter.cs +++ b/seed/csharp-model/no-environment/src/SeedNoEnvironment/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/nullable/src/SeedNullable/Core/Public/FileParameter.cs b/seed/csharp-model/nullable/src/SeedNullable/Core/Public/FileParameter.cs index c13e5cf06f6..aca9ac913cf 100644 --- a/seed/csharp-model/nullable/src/SeedNullable/Core/Public/FileParameter.cs +++ b/seed/csharp-model/nullable/src/SeedNullable/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs b/seed/csharp-model/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs index 42e5f448791..659899a7c75 100644 --- a/seed/csharp-model/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs +++ b/seed/csharp-model/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/FileParameter.cs b/seed/csharp-model/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/FileParameter.cs index 6bc23e084d4..f9016ab8a33 100644 --- a/seed/csharp-model/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/FileParameter.cs +++ b/seed/csharp-model/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/FileParameter.cs b/seed/csharp-model/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/FileParameter.cs index 74724396f1d..ab070887e53 100644 --- a/seed/csharp-model/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/FileParameter.cs +++ b/seed/csharp-model/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs b/seed/csharp-model/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs index 42e5f448791..659899a7c75 100644 --- a/seed/csharp-model/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs +++ b/seed/csharp-model/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/oauth-client-credentials/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs b/seed/csharp-model/oauth-client-credentials/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs index 42e5f448791..659899a7c75 100644 --- a/seed/csharp-model/oauth-client-credentials/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs +++ b/seed/csharp-model/oauth-client-credentials/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/object/src/SeedObject/Core/Public/FileParameter.cs b/seed/csharp-model/object/src/SeedObject/Core/Public/FileParameter.cs index 4191220dd93..59054bda81c 100644 --- a/seed/csharp-model/object/src/SeedObject/Core/Public/FileParameter.cs +++ b/seed/csharp-model/object/src/SeedObject/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/objects-with-imports/src/SeedObjectsWithImports/Core/Public/FileParameter.cs b/seed/csharp-model/objects-with-imports/src/SeedObjectsWithImports/Core/Public/FileParameter.cs index 44e541f68bf..ef8fe4b0f33 100644 --- a/seed/csharp-model/objects-with-imports/src/SeedObjectsWithImports/Core/Public/FileParameter.cs +++ b/seed/csharp-model/objects-with-imports/src/SeedObjectsWithImports/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/optional/src/SeedObjectsWithImports/Core/Public/FileParameter.cs b/seed/csharp-model/optional/src/SeedObjectsWithImports/Core/Public/FileParameter.cs index 44e541f68bf..ef8fe4b0f33 100644 --- a/seed/csharp-model/optional/src/SeedObjectsWithImports/Core/Public/FileParameter.cs +++ b/seed/csharp-model/optional/src/SeedObjectsWithImports/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/package-yml/src/SeedPackageYml/Core/Public/FileParameter.cs b/seed/csharp-model/package-yml/src/SeedPackageYml/Core/Public/FileParameter.cs index 3fc9e6cb3dc..c3d49bff127 100644 --- a/seed/csharp-model/package-yml/src/SeedPackageYml/Core/Public/FileParameter.cs +++ b/seed/csharp-model/package-yml/src/SeedPackageYml/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/pagination/src/SeedPagination/Core/Public/FileParameter.cs b/seed/csharp-model/pagination/src/SeedPagination/Core/Public/FileParameter.cs index 4b64635606c..e9ee63627aa 100644 --- a/seed/csharp-model/pagination/src/SeedPagination/Core/Public/FileParameter.cs +++ b/seed/csharp-model/pagination/src/SeedPagination/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/path-parameters/src/SeedPathParameters/Core/Public/FileParameter.cs b/seed/csharp-model/path-parameters/src/SeedPathParameters/Core/Public/FileParameter.cs index 2c7eb860438..292a313d282 100644 --- a/seed/csharp-model/path-parameters/src/SeedPathParameters/Core/Public/FileParameter.cs +++ b/seed/csharp-model/path-parameters/src/SeedPathParameters/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/plain-text/src/SeedPlainText/Core/Public/FileParameter.cs b/seed/csharp-model/plain-text/src/SeedPlainText/Core/Public/FileParameter.cs index 79882ca04e4..da0be3a9909 100644 --- a/seed/csharp-model/plain-text/src/SeedPlainText/Core/Public/FileParameter.cs +++ b/seed/csharp-model/plain-text/src/SeedPlainText/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/public-object/.editorconfig b/seed/csharp-model/public-object/.editorconfig new file mode 100644 index 00000000000..a450a4ea14b --- /dev/null +++ b/seed/csharp-model/public-object/.editorconfig @@ -0,0 +1,34 @@ +root = true + +[*.cs] +resharper_arrange_object_creation_when_type_evident_highlighting = hint +resharper_auto_property_can_be_made_get_only_global_highlighting = hint +resharper_check_namespace_highlighting = hint +resharper_class_never_instantiated_global_highlighting = hint +resharper_collection_never_updated_global_highlighting = hint +resharper_convert_type_check_pattern_to_null_check_highlighting = hint +resharper_inconsistent_naming_highlighting = hint +resharper_member_can_be_private_global_highlighting = hint +resharper_not_accessed_field_local_highlighting = hint +resharper_partial_type_with_single_part_highlighting = hint +resharper_prefer_concrete_value_over_default_highlighting = none +resharper_private_field_can_be_converted_to_local_variable_highlighting = hint +resharper_property_can_be_made_init_only_global_highlighting = hint +resharper_redundant_name_qualifier_highlighting = none +resharper_redundant_using_directive_highlighting = hint +resharper_replace_slice_with_range_indexer_highlighting = none +resharper_unused_auto_property_accessor_global_highlighting = hint +resharper_unused_auto_property_accessor_local_highlighting = hint +resharper_unused_member_global_highlighting = hint +resharper_unused_type_global_highlighting = hint +resharper_use_string_interpolation_highlighting = hint +resharper_property_can_be_made_init_only_local_highlighting = hint +resharper_member_hides_static_from_outer_class_highlighting = hint +resharper_class_never_instantiated_local_highlighting = hint +dotnet_diagnostic.CS1591.severity = suggestion + +[src/**/Types/*.cs] +resharper_check_namespace_highlighting = none + +[src/**/Core/Public/*.cs] +resharper_check_namespace_highlighting = none \ No newline at end of file diff --git a/seed/csharp-model/public-object/.github/workflows/ci.yml b/seed/csharp-model/public-object/.github/workflows/ci.yml new file mode 100644 index 00000000000..b898349fd20 --- /dev/null +++ b/seed/csharp-model/public-object/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: ci + +on: [push] + +jobs: + compile: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - uses: actions/checkout@master + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Install tools + run: | + dotnet tool restore + + - name: Build Release + run: dotnet build src -c Release /p:ContinuousIntegrationBuild=true + + unit-tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - uses: actions/checkout@master + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Install tools + run: | + dotnet tool restore + + - name: Run Tests + run: | + dotnet test src + + + publish: + needs: [compile] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Publish + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_TOKEN }} + run: | + dotnet pack src -c Release + dotnet nuget push src/SeedPublicObject/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source "nuget.org" diff --git a/seed/csharp-model/public-object/.gitignore b/seed/csharp-model/public-object/.gitignore new file mode 100644 index 00000000000..11014f2b33d --- /dev/null +++ b/seed/csharp-model/public-object/.gitignore @@ -0,0 +1,484 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +## This is based on `dotnet new gitignore` and customized by Fern + +# dotenv files +.env + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +# [Rr]elease/ (Ignored by Fern) +# [Rr]eleases/ (Ignored by Fern) +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +# [Ll]og/ (Ignored by Fern) +# [Ll]ogs/ (Ignored by Fern) + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml +.idea + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-model/public-object/.mock/definition/api.yml b/seed/csharp-model/public-object/.mock/definition/api.yml new file mode 100644 index 00000000000..80a86663e3b --- /dev/null +++ b/seed/csharp-model/public-object/.mock/definition/api.yml @@ -0,0 +1 @@ +name: public-object diff --git a/seed/csharp-model/public-object/.mock/definition/service.yml b/seed/csharp-model/public-object/.mock/definition/service.yml new file mode 100644 index 00000000000..af9c663168f --- /dev/null +++ b/seed/csharp-model/public-object/.mock/definition/service.yml @@ -0,0 +1,8 @@ +service: + auth: false + base-path: / + endpoints: + get: + path: /helloworld.txt + method: GET + response: file diff --git a/seed/csharp-model/public-object/.mock/fern.config.json b/seed/csharp-model/public-object/.mock/fern.config.json new file mode 100644 index 00000000000..4c8e54ac313 --- /dev/null +++ b/seed/csharp-model/public-object/.mock/fern.config.json @@ -0,0 +1 @@ +{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/csharp-model/public-object/.mock/generators.yml b/seed/csharp-model/public-object/.mock/generators.yml new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/seed/csharp-model/public-object/.mock/generators.yml @@ -0,0 +1 @@ +{} diff --git a/seed/csharp-model/public-object/snippet-templates.json b/seed/csharp-model/public-object/snippet-templates.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/csharp-model/public-object/snippet.json b/seed/csharp-model/public-object/snippet.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/DateOnlyJsonTests.cs b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/DateOnlyJsonTests.cs new file mode 100644 index 00000000000..a5dea8a0ac7 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/DateOnlyJsonTests.cs @@ -0,0 +1,76 @@ +using NUnit.Framework; +using SeedPublicObject.Core; + +namespace SeedPublicObject.Test.Core.Json; + +[TestFixture] +public class DateOnlyJsonTests +{ + [Test] + public void SerializeDateOnly_ShouldMatchExpectedFormat() + { + (DateOnly dateOnly, string expected)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (new DateOnly(2023, 1, 1), "\"2023-01-01\""), + (new DateOnly(2023, 12, 31), "\"2023-12-31\""), + (new DateOnly(2023, 6, 15), "\"2023-06-15\""), + (new DateOnly(2023, 3, 10), "\"2023-03-10\""), + ]; + foreach (var (dateOnly, expected) in testCases) + { + var json = JsonUtils.Serialize(dateOnly); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeDateOnly_ShouldMatchExpectedDateOnly() + { + (DateOnly expected, string json)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (new DateOnly(2023, 1, 1), "\"2023-01-01\""), + (new DateOnly(2023, 12, 31), "\"2023-12-31\""), + (new DateOnly(2023, 6, 15), "\"2023-06-15\""), + (new DateOnly(2023, 3, 10), "\"2023-03-10\""), + ]; + + foreach (var (expected, json) in testCases) + { + var dateOnly = JsonUtils.Deserialize(json); + Assert.That(dateOnly, Is.EqualTo(expected)); + } + } + + [Test] + public void SerializeNullableDateOnly_ShouldMatchExpectedFormat() + { + (DateOnly? dateOnly, string expected)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (null, "null"), + ]; + foreach (var (dateOnly, expected) in testCases) + { + var json = JsonUtils.Serialize(dateOnly); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeNullableDateOnly_ShouldMatchExpectedDateOnly() + { + (DateOnly? expected, string json)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateOnly = JsonUtils.Deserialize(json); + Assert.That(dateOnly, Is.EqualTo(expected)); + } + } +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/DateTimeJsonTests.cs b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/DateTimeJsonTests.cs new file mode 100644 index 00000000000..3cbcdc19730 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/DateTimeJsonTests.cs @@ -0,0 +1,110 @@ +using NUnit.Framework; +using SeedPublicObject.Core; + +namespace SeedPublicObject.Test.Core.Json; + +[TestFixture] +public class DateTimeJsonTests +{ + [Test] + public void SerializeDateTime_ShouldMatchExpectedFormat() + { + (DateTime dateTime, string expected)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), "\"2023-01-01T00:00:00.000Z\""), + ( + new DateTime(2023, 12, 31, 23, 59, 59, DateTimeKind.Utc), + "\"2023-12-31T23:59:59.000Z\"" + ), + (new DateTime(2023, 6, 15, 12, 0, 0, DateTimeKind.Utc), "\"2023-06-15T12:00:00.000Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.000Z\"" + ), + ( + new DateTime(2023, 3, 10, 8, 45, 30, 123, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.123Z\"" + ), + ]; + foreach (var (dateTime, expected) in testCases) + { + var json = JsonUtils.Serialize(dateTime); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeDateTime_ShouldMatchExpectedDateTime() + { + (DateTime expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), "\"2023-01-01T00:00:00.000Z\""), + ( + new DateTime(2023, 12, 31, 23, 59, 59, DateTimeKind.Utc), + "\"2023-12-31T23:59:59.000Z\"" + ), + (new DateTime(2023, 6, 15, 12, 0, 0, DateTimeKind.Utc), "\"2023-06-15T12:00:00.000Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.000Z\"" + ), + (new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), "\"2023-03-10T08:45:30Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, 123, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.123Z\"" + ), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } + + [Test] + public void SerializeNullableDateTime_ShouldMatchExpectedFormat() + { + (DateTime? expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeNullableDateTime_ShouldMatchExpectedDateTime() + { + (DateTime? expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/EnumSerializerTests.cs b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/EnumSerializerTests.cs new file mode 100644 index 00000000000..b3e24a0f2e0 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/EnumSerializerTests.cs @@ -0,0 +1,60 @@ +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using NUnit.Framework; +using SeedPublicObject.Core; + +namespace SeedPublicObject.Test.Core.Json; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class StringEnumSerializerTests +{ + private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true }; + + private const DummyEnum KnownEnumValue2 = DummyEnum.KnownValue2; + private const string KnownEnumValue2String = "known_value2"; + + private const string JsonWithKnownEnum2 = $$""" + { + "enum_property": "{{KnownEnumValue2String}}" + } + """; + + [Test] + public void ShouldParseKnownEnumValue2() + { + var obj = JsonSerializer.Deserialize(JsonWithKnownEnum2, JsonOptions); + Assert.That(obj, Is.Not.Null); + Assert.That(obj.EnumProperty, Is.EqualTo(KnownEnumValue2)); + } + + [Test] + public void ShouldSerializeKnownEnumValue2() + { + var json = JsonSerializer.SerializeToElement( + new DummyObject { EnumProperty = KnownEnumValue2 }, + JsonOptions + ); + TestContext.Out.WriteLine("Serialized JSON: \n" + json); + var enumString = json.GetProperty("enum_property").GetString(); + Assert.That(enumString, Is.Not.Null); + Assert.That(enumString, Is.EqualTo(KnownEnumValue2String)); + } +} + +public class DummyObject +{ + [JsonPropertyName("enum_property")] + public DummyEnum EnumProperty { get; set; } +} + +[JsonConverter(typeof(EnumSerializer))] +public enum DummyEnum +{ + [EnumMember(Value = "known_value1")] + KnownValue1, + + [EnumMember(Value = "known_value2")] + KnownValue2, +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/JsonAccessAttributeTests.cs b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/JsonAccessAttributeTests.cs new file mode 100644 index 00000000000..e35ee172d32 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/JsonAccessAttributeTests.cs @@ -0,0 +1,46 @@ +using global::System.Text.Json.Serialization; +using NUnit.Framework; +using SeedPublicObject.Core; + +namespace SeedPublicObject.Test.Core.Json; + +[TestFixture] +public class JsonAccessAttributeTests +{ + private class MyClass + { + [JsonPropertyName("read_only_prop")] + [JsonAccess(JsonAccessType.ReadOnly)] + public string? ReadOnlyProp { get; set; } + + [JsonPropertyName("write_only_prop")] + [JsonAccess(JsonAccessType.WriteOnly)] + public string? WriteOnlyProp { get; set; } + + [JsonPropertyName("normal_prop")] + public string? NormalProp { get; set; } + } + + [Test] + public void JsonAccessAttribute_ShouldWorkAsExpected() + { + const string json = + """ { "read_only_prop": "read", "write_only_prop": "write", "normal_prop": "normal_prop" } """; + var obj = JsonUtils.Deserialize(json); + + Assert.Multiple(() => + { + Assert.That(obj.ReadOnlyProp, Is.EqualTo("read")); + Assert.That(obj.WriteOnlyProp, Is.Null); + Assert.That(obj.NormalProp, Is.EqualTo("normal_prop")); + }); + + obj.WriteOnlyProp = "write"; + obj.NormalProp = "new_value"; + + var serializedJson = JsonUtils.Serialize(obj); + const string expectedJson = + "{ \"write_only_prop\": \"write\",\n \"normal_prop\": \"new_value\" }"; + Assert.That(serializedJson, Is.EqualTo(expectedJson).IgnoreWhiteSpace); + } +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/OneOfSerializerTests.cs b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/OneOfSerializerTests.cs new file mode 100644 index 00000000000..06bebece75e --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Core/Json/OneOfSerializerTests.cs @@ -0,0 +1,314 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using NUnit.Framework; +using OneOf; +using SeedPublicObject.Core; + +namespace SeedPublicObject.Test.Core.Json; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class OneOfSerializerTests +{ + private class Foo + { + [JsonPropertyName("string_prop")] + public required string StringProp { get; set; } + } + + private class Bar + { + [JsonPropertyName("int_prop")] + public required int IntProp { get; set; } + } + + private static readonly OneOf OneOf1 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT2(new { }); + private const string OneOf1String = "{}"; + + private static readonly OneOf OneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT0("test"); + private const string OneOf2String = "\"test\""; + + private static readonly OneOf OneOf3 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT1(123); + private const string OneOf3String = "123"; + + private static readonly OneOf OneOf4 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT3(new Foo { StringProp = "test" }); + private const string OneOf4String = "{\"string_prop\": \"test\"}"; + + private static readonly OneOf OneOf5 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string OneOf5String = "{\"int_prop\": 5}"; + + [Test] + public void Serialize_OneOfs_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void OneOfs_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value)).IgnoreWhiteSpace); + } + }); + } + + private static readonly OneOf? NullableOneOf1 = null; + private const string NullableOneOf1String = "null"; + + private static readonly OneOf? NullableOneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string NullableOneOf2String = "{\"int_prop\": 5}"; + + [Test] + public void Serialize_NullableOneOfs_Should_Return_Expected_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void NullableOneOfs_Should_Deserialize_From_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize?>(json); + Assert.That(result?.Index, Is.EqualTo(oneOf?.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result?.Value)).IgnoreWhiteSpace); + } + }); + } + + private static readonly OneOf OneOfWithNullable1 = OneOf< + string, + int, + Foo? + >.FromT2(null); + private const string OneOfWithNullable1String = "null"; + + private static readonly OneOf OneOfWithNullable2 = OneOf< + string, + int, + Foo? + >.FromT2(new Foo { StringProp = "test" }); + private const string OneOfWithNullable2String = "{\"string_prop\": \"test\"}"; + + private static readonly OneOf OneOfWithNullable3 = OneOf< + string, + int, + Foo? + >.FromT0("test"); + private const string OneOfWithNullable3String = "\"test\""; + + [Test] + public void Serialize_OneOfWithNullables_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOfWithNullable1, OneOfWithNullable1String), + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void OneOfWithNullables_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + // (OneOfWithNullable1, OneOfWithNullable1String), // not possible with .NET's JSON serializer + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value)).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void Serialize_OneOfWithObjectLast_Should_Return_Expected_String() + { + var oneOfWithObjectLast = OneOf.FromT4( + new { random = "data" } + ); + const string oneOfWithObjectLastString = "{\"random\": \"data\"}"; + + var result = JsonUtils.Serialize(oneOfWithObjectLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectLastString).IgnoreWhiteSpace); + } + + [Test] + public void OneOfWithObjectLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectLastString = "{\"random\": \"data\"}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(4)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That( + JsonUtils.Serialize(result.Value), + Is.EqualTo(oneOfWithObjectLastString).IgnoreWhiteSpace + ); + }); + } + + [Test] + public void Serialize_OneOfWithObjectNotLast_Should_Return_Expected_String() + { + var oneOfWithObjectNotLast = OneOf.FromT1( + new { random = "data" } + ); + const string oneOfWithObjectNotLastString = "{\"random\": \"data\"}"; + + var result = JsonUtils.Serialize(oneOfWithObjectNotLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectNotLastString).IgnoreWhiteSpace); + } + + [Test] + public void OneOfWithObjectNotLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectNotLastString = "{\"random\": \"data\"}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectNotLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(1)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That( + JsonUtils.Serialize(result.Value), + Is.EqualTo(oneOfWithObjectNotLastString).IgnoreWhiteSpace + ); + }); + } + + [Test] + public void Serialize_OneOfSingleType_Should_Return_Expected_String() + { + var oneOfSingle = OneOf.FromT0("single"); + const string oneOfSingleString = "\"single\""; + + var result = JsonUtils.Serialize(oneOfSingle); + Assert.That(result, Is.EqualTo(oneOfSingleString)); + } + + [Test] + public void OneOfSingleType_Should_Deserialize_From_String() + { + const string oneOfSingleString = "\"single\""; + var result = JsonUtils.Deserialize>(oneOfSingleString); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(0)); + Assert.That(result.Value, Is.EqualTo("single")); + }); + } + + [Test] + public void Deserialize_InvalidData_Should_Throw_Exception() + { + const string invalidJson = "{\"invalid\": \"data\"}"; + + Assert.Throws(() => + { + JsonUtils.Deserialize>(invalidJson); + }); + } +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject.Test/SeedPublicObject.Test.Custom.props b/seed/csharp-model/public-object/src/SeedPublicObject.Test/SeedPublicObject.Test.Custom.props new file mode 100644 index 00000000000..55e683b0772 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject.Test/SeedPublicObject.Test.Custom.props @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/seed/csharp-model/public-object/src/SeedPublicObject.Test/SeedPublicObject.Test.csproj b/seed/csharp-model/public-object/src/SeedPublicObject.Test/SeedPublicObject.Test.csproj new file mode 100644 index 00000000000..6e52893b477 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject.Test/SeedPublicObject.Test.csproj @@ -0,0 +1,37 @@ + + + + net8.0 + 12 + enable + enable + false + true + true + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + \ No newline at end of file diff --git a/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs new file mode 100644 index 00000000000..1704c99af44 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs @@ -0,0 +1,236 @@ +using System.Text.Json; +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for EqualConstraint to handle JsonElement objects. +/// +public static class JsonElementComparerExtensions +{ + /// + /// Extension method for comparing JsonElement objects in NUnit tests. + /// Property order doesn't matter, but array order does matter. + /// Includes special handling for DateTime string formats. + /// + /// The Is.EqualTo() constraint instance. + /// A constraint that can compare JsonElements with detailed diffs. + public static EqualConstraint UsingJsonElementComparer(this EqualConstraint constraint) + { + return constraint.Using(new JsonElementComparer()); + } +} + +/// +/// Equality comparer for JsonElement with detailed reporting. +/// Property order doesn't matter, but array order does matter. +/// Now includes special handling for DateTime string formats with improved null handling. +/// +public class JsonElementComparer : IEqualityComparer +{ + private string _failurePath = string.Empty; + + /// + public bool Equals(JsonElement x, JsonElement y) + { + _failurePath = string.Empty; + return CompareJsonElements(x, y, string.Empty); + } + + /// + public int GetHashCode(JsonElement obj) + { + return JsonSerializer.Serialize(obj).GetHashCode(); + } + + private bool CompareJsonElements(JsonElement x, JsonElement y, string path) + { + // If value kinds don't match, they're not equivalent + if (x.ValueKind != y.ValueKind) + { + _failurePath = $"{path}: Expected {x.ValueKind} but got {y.ValueKind}"; + return false; + } + + switch (x.ValueKind) + { + case JsonValueKind.Object: + return CompareJsonObjects(x, y, path); + + case JsonValueKind.Array: + return CompareJsonArraysInOrder(x, y, path); + + case JsonValueKind.String: + string? xStr = x.GetString(); + string? yStr = y.GetString(); + + // Handle null strings + if (xStr is null && yStr is null) + return true; + + if (xStr is null || yStr is null) + { + _failurePath = + $"{path}: Expected {(xStr is null ? "null" : $"\"{xStr}\"")} but got {(yStr is null ? "null" : $"\"{yStr}\"")}"; + return false; + } + + // Check if they are identical strings + if (xStr == yStr) + return true; + + // Try to handle DateTime strings + if (IsLikelyDateTimeString(xStr) && IsLikelyDateTimeString(yStr)) + { + if (AreEquivalentDateTimeStrings(xStr, yStr)) + return true; + } + + _failurePath = $"{path}: Expected \"{xStr}\" but got \"{yStr}\""; + return false; + + case JsonValueKind.Number: + if (x.GetDecimal() != y.GetDecimal()) + { + _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + + return true; + + case JsonValueKind.True: + case JsonValueKind.False: + if (x.GetBoolean() != y.GetBoolean()) + { + _failurePath = $"{path}: Expected {x.GetBoolean()} but got {y.GetBoolean()}"; + return false; + } + + return true; + + case JsonValueKind.Null: + return true; + + default: + _failurePath = $"{path}: Unsupported JsonValueKind {x.ValueKind}"; + return false; + } + } + + private bool IsLikelyDateTimeString(string? str) + { + // Simple heuristic to identify likely ISO date time strings + return str != null + && (str.Contains("T") && (str.EndsWith("Z") || str.Contains("+") || str.Contains("-"))); + } + + private bool AreEquivalentDateTimeStrings(string str1, string str2) + { + // Try to parse both as DateTime + if (DateTime.TryParse(str1, out DateTime dt1) && DateTime.TryParse(str2, out DateTime dt2)) + { + return dt1 == dt2; + } + + return false; + } + + private bool CompareJsonObjects(JsonElement x, JsonElement y, string path) + { + // Create dictionaries for both JSON objects + var xProps = new Dictionary(); + var yProps = new Dictionary(); + + foreach (var prop in x.EnumerateObject()) + xProps[prop.Name] = prop.Value; + + foreach (var prop in y.EnumerateObject()) + yProps[prop.Name] = prop.Value; + + // Check if all properties in x exist in y + foreach (var key in xProps.Keys) + { + if (!yProps.ContainsKey(key)) + { + _failurePath = $"{path}: Missing property '{key}'"; + return false; + } + } + + // Check if y has extra properties + foreach (var key in yProps.Keys) + { + if (!xProps.ContainsKey(key)) + { + _failurePath = $"{path}: Unexpected property '{key}'"; + return false; + } + } + + // Compare each property value + foreach (var key in xProps.Keys) + { + var propPath = string.IsNullOrEmpty(path) ? key : $"{path}.{key}"; + if (!CompareJsonElements(xProps[key], yProps[key], propPath)) + { + return false; + } + } + + return true; + } + + private bool CompareJsonArraysInOrder(JsonElement x, JsonElement y, string path) + { + var xArray = x.EnumerateArray(); + var yArray = y.EnumerateArray(); + + // Count x elements + var xCount = 0; + var xElements = new List(); + foreach (var item in xArray) + { + xElements.Add(item); + xCount++; + } + + // Count y elements + var yCount = 0; + var yElements = new List(); + foreach (var item in yArray) + { + yElements.Add(item); + yCount++; + } + + // Check if counts match + if (xCount != yCount) + { + _failurePath = $"{path}: Expected {xCount} items but found {yCount}"; + return false; + } + + // Compare elements in order + for (var i = 0; i < xCount; i++) + { + var itemPath = $"{path}[{i}]"; + if (!CompareJsonElements(xElements[i], yElements[i], itemPath)) + { + return false; + } + } + + return true; + } + + /// + public override string ToString() + { + if (!string.IsNullOrEmpty(_failurePath)) + { + return $"JSON comparison failed at {_failurePath}"; + } + + return "JsonElementEqualityComparer"; + } +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/NUnitExtensions.cs b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/NUnitExtensions.cs new file mode 100644 index 00000000000..426df124538 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/NUnitExtensions.cs @@ -0,0 +1,28 @@ +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for NUnit constraints. +/// +public static class NUnitExtensions +{ + /// + /// Modifies the EqualConstraint to use our own set of default comparers. + /// + /// + /// + public static EqualConstraint UsingDefaults(this EqualConstraint constraint) => + constraint + .UsingPropertiesComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingOneOfComparer() + .UsingJsonElementComparer(); +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/OneOfComparer.cs b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/OneOfComparer.cs new file mode 100644 index 00000000000..0c975b471ff --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/OneOfComparer.cs @@ -0,0 +1,43 @@ +using NUnit.Framework.Constraints; +using OneOf; + +namespace NUnit.Framework; + +/// +/// Extensions for EqualConstraint to handle OneOf values. +/// +public static class EqualConstraintExtensions +{ + /// + /// Modifies the EqualConstraint to handle OneOf instances by comparing their inner values. + /// This works alongside other comparison modifiers like UsingPropertiesComparer. + /// + /// The EqualConstraint to modify. + /// The same constraint instance for method chaining. + public static EqualConstraint UsingOneOfComparer(this EqualConstraint constraint) + { + // Register a comparer factory for IOneOf types + constraint.Using( + (x, y) => + { + // ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract + if (x.Value is null && y.Value is null) + { + return true; + } + + if (x.Value is null) + { + return false; + } + + var propertiesComparer = new NUnitEqualityComparer(); + var tolerance = Tolerance.Default; + propertiesComparer.CompareProperties = true; + return propertiesComparer.AreEqual(x.Value, y.Value, ref tolerance); + } + ); + + return constraint; + } +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/ReadOnlyMemoryComparer.cs b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/ReadOnlyMemoryComparer.cs new file mode 100644 index 00000000000..fc0b595a5e5 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject.Test/Utils/ReadOnlyMemoryComparer.cs @@ -0,0 +1,87 @@ +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for NUnit constraints. +/// +public static class ReadOnlyMemoryComparerExtensions +{ + /// + /// Extension method for comparing ReadOnlyMemory<T> in NUnit tests. + /// + /// The type of elements in the ReadOnlyMemory. + /// The Is.EqualTo() constraint instance. + /// A constraint that can compare ReadOnlyMemory<T>. + public static EqualConstraint UsingReadOnlyMemoryComparer(this EqualConstraint constraint) + where T : IComparable + { + return constraint.Using(new ReadOnlyMemoryComparer()); + } +} + +/// +/// Comparer for ReadOnlyMemory<T>. Compares sequences by value. +/// +/// +/// The type of elements in the ReadOnlyMemory. +/// +public class ReadOnlyMemoryComparer : IComparer> + where T : IComparable +{ + /// + public int Compare(ReadOnlyMemory x, ReadOnlyMemory y) + { + // Check if sequences are equal + var xSpan = x.Span; + var ySpan = y.Span; + + // Optimized case for IEquatable implementations + if (typeof(IEquatable).IsAssignableFrom(typeof(T))) + { + var areEqual = xSpan.SequenceEqual(ySpan); + if (areEqual) + { + return 0; // Sequences are equal + } + } + else + { + // Manual equality check for non-IEquatable types + if (xSpan.Length == ySpan.Length) + { + var areEqual = true; + for (var i = 0; i < xSpan.Length; i++) + { + if (!EqualityComparer.Default.Equals(xSpan[i], ySpan[i])) + { + areEqual = false; + break; + } + } + + if (areEqual) + { + return 0; // Sequences are equal + } + } + } + + // For non-equal sequences, we need to return a consistent ordering + // First compare lengths + if (x.Length != y.Length) + return x.Length.CompareTo(y.Length); + + // Same length but different content - compare first differing element + for (var i = 0; i < x.Length; i++) + { + if (!EqualityComparer.Default.Equals(xSpan[i], ySpan[i])) + { + return xSpan[i].CompareTo(ySpan[i]); + } + } + + // Should never reach here if not equal + return 0; + } +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject/Core/CollectionItemSerializer.cs b/seed/csharp-model/public-object/src/SeedPublicObject/Core/CollectionItemSerializer.cs new file mode 100644 index 00000000000..25a8268f28e --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject/Core/CollectionItemSerializer.cs @@ -0,0 +1,89 @@ +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedPublicObject.Core; + +/// +/// Json collection converter. +/// +/// Type of item to convert. +/// Converter to use for individual items. +internal class CollectionItemSerializer + : JsonConverter> + where TConverterType : JsonConverter +{ + /// + /// Reads a json string and deserializes it into an object. + /// + /// Json reader. + /// Type to convert. + /// Serializer options. + /// Created object. + public override IEnumerable? Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType == JsonTokenType.Null) + { + return default; + } + + var jsonSerializerOptions = new JsonSerializerOptions(options); + jsonSerializerOptions.Converters.Clear(); + jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); + + var returnValue = new List(); + + while (reader.TokenType != JsonTokenType.EndArray) + { + if (reader.TokenType != JsonTokenType.StartArray) + { + var item = (TDatatype)( + JsonSerializer.Deserialize(ref reader, typeof(TDatatype), jsonSerializerOptions) + ?? throw new Exception( + $"Failed to deserialize collection item of type {typeof(TDatatype)}" + ) + ); + returnValue.Add(item); + } + + reader.Read(); + } + + return returnValue; + } + + /// + /// Writes a json string. + /// + /// Json writer. + /// Value to write. + /// Serializer options. + public override void Write( + Utf8JsonWriter writer, + IEnumerable? value, + JsonSerializerOptions options + ) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + var jsonSerializerOptions = new JsonSerializerOptions(options); + jsonSerializerOptions.Converters.Clear(); + jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); + + writer.WriteStartArray(); + + foreach (var data in value) + { + JsonSerializer.Serialize(writer, data, jsonSerializerOptions); + } + + writer.WriteEndArray(); + } +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject/Core/Constants.cs b/seed/csharp-model/public-object/src/SeedPublicObject/Core/Constants.cs new file mode 100644 index 00000000000..33f91506846 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject/Core/Constants.cs @@ -0,0 +1,7 @@ +namespace SeedPublicObject.Core; + +internal static class Constants +{ + public const string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffK"; + public const string DateFormat = "yyyy-MM-dd"; +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject/Core/DateOnlyConverter.cs b/seed/csharp-model/public-object/src/SeedPublicObject/Core/DateOnlyConverter.cs new file mode 100644 index 00000000000..4359bbec949 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject/Core/DateOnlyConverter.cs @@ -0,0 +1,748 @@ +// ReSharper disable All +#pragma warning disable + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using global::System.Diagnostics; +using global::System.Diagnostics.CodeAnalysis; +using global::System.Globalization; +using global::System.Runtime.CompilerServices; +using global::System.Runtime.InteropServices; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +// ReSharper disable SuggestVarOrType_SimpleTypes +// ReSharper disable SuggestVarOrType_BuiltInTypes + +namespace SeedPublicObject.Core +{ + /// + /// Custom converter for handling the data type with the System.Text.Json library. + /// + /// + /// This class backported from: + /// + /// System.Text.Json.Serialization.Converters.DateOnlyConverter + /// + public sealed class DateOnlyConverter : JsonConverter + { + private const int FormatLength = 10; // YYYY-MM-DD + + private const int MaxEscapedFormatLength = + FormatLength * JsonConstants.MaxExpansionFactorWhileEscaping; + + /// + public override DateOnly Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType != JsonTokenType.String) + { + ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); + } + + return ReadCore(ref reader); + } + + /// + public override DateOnly ReadAsPropertyName( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); + return ReadCore(ref reader); + } + + private static DateOnly ReadCore(ref Utf8JsonReader reader) + { + if ( + !JsonHelpers.IsInRangeInclusive( + reader.ValueLength(), + FormatLength, + MaxEscapedFormatLength + ) + ) + { + ThrowHelper.ThrowFormatException(DataType.DateOnly); + } + + scoped ReadOnlySpan source; + if (!reader.HasValueSequence && !reader.ValueIsEscaped) + { + source = reader.ValueSpan; + } + else + { + Span stackSpan = stackalloc byte[MaxEscapedFormatLength]; + int bytesWritten = reader.CopyString(stackSpan); + source = stackSpan.Slice(0, bytesWritten); + } + + if (!JsonHelpers.TryParseAsIso(source, out DateOnly value)) + { + ThrowHelper.ThrowFormatException(DataType.DateOnly); + } + + return value; + } + + /// + public override void Write( + Utf8JsonWriter writer, + DateOnly value, + JsonSerializerOptions options + ) + { +#if NET8_0_OR_GREATER + Span buffer = stackalloc byte[FormatLength]; +#else + Span buffer = stackalloc char[FormatLength]; +#endif + // ReSharper disable once RedundantAssignment + bool formattedSuccessfully = value.TryFormat( + buffer, + out int charsWritten, + "O".AsSpan(), + CultureInfo.InvariantCulture + ); + Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); + writer.WriteStringValue(buffer); + } + + /// + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DateOnly value, + JsonSerializerOptions options + ) + { +#if NET8_0_OR_GREATER + Span buffer = stackalloc byte[FormatLength]; +#else + Span buffer = stackalloc char[FormatLength]; +#endif + // ReSharper disable once RedundantAssignment + bool formattedSuccessfully = value.TryFormat( + buffer, + out int charsWritten, + "O".AsSpan(), + CultureInfo.InvariantCulture + ); + Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); + writer.WritePropertyName(buffer); + } + } + + internal static class JsonConstants + { + // The maximum number of fraction digits the Json DateTime parser allows + public const int DateTimeParseNumFractionDigits = 16; + + // In the worst case, an ASCII character represented as a single utf-8 byte could expand 6x when escaped. + public const int MaxExpansionFactorWhileEscaping = 6; + + // The largest fraction expressible by TimeSpan and DateTime formats + public const int MaxDateTimeFraction = 9_999_999; + + // TimeSpan and DateTime formats allow exactly up to many digits for specifying the fraction after the seconds. + public const int DateTimeNumFractionDigits = 7; + + public const byte UtcOffsetToken = (byte)'Z'; + + public const byte TimePrefix = (byte)'T'; + + public const byte Period = (byte)'.'; + + public const byte Hyphen = (byte)'-'; + + public const byte Colon = (byte)':'; + + public const byte Plus = (byte)'+'; + } + + // ReSharper disable SuggestVarOrType_Elsewhere + // ReSharper disable SuggestVarOrType_SimpleTypes + // ReSharper disable SuggestVarOrType_BuiltInTypes + + + internal static class JsonHelpers + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsInRangeInclusive(int value, int lowerBound, int upperBound) => + (uint)(value - lowerBound) <= (uint)(upperBound - lowerBound); + + public static bool IsDigit(byte value) => (uint)(value - '0') <= '9' - '0'; + + [StructLayout(LayoutKind.Auto)] + private struct DateTimeParseData + { + public int Year; + public int Month; + public int Day; + public bool IsCalendarDateOnly; + public int Hour; + public int Minute; + public int Second; + public int Fraction; // This value should never be greater than 9_999_999. + public int OffsetHours; + public int OffsetMinutes; + + // ReSharper disable once NotAccessedField.Local + public byte OffsetToken; + } + + public static bool TryParseAsIso(ReadOnlySpan source, out DateOnly value) + { + if ( + TryParseDateTimeOffset(source, out DateTimeParseData parseData) + && parseData.IsCalendarDateOnly + && TryCreateDateTime(parseData, DateTimeKind.Unspecified, out DateTime dateTime) + ) + { + value = DateOnly.FromDateTime(dateTime); + return true; + } + + value = default; + return false; + } + + /// + /// ISO 8601 date time parser (ISO 8601-1:2019). + /// + /// The date/time to parse in UTF-8 format. + /// The parsed for the given . + /// + /// Supports extended calendar date (5.2.2.1) and complete (5.4.2.1) calendar date/time of day + /// representations with optional specification of seconds and fractional seconds. + /// + /// Times can be explicitly specified as UTC ("Z" - 5.3.3) or offsets from UTC ("+/-hh:mm" 5.3.4.2). + /// If unspecified they are considered to be local per spec. + /// + /// Examples: (TZD is either "Z" or hh:mm offset from UTC) + /// + /// YYYY-MM-DD (e.g. 1997-07-16) + /// YYYY-MM-DDThh:mm (e.g. 1997-07-16T19:20) + /// YYYY-MM-DDThh:mm:ss (e.g. 1997-07-16T19:20:30) + /// YYYY-MM-DDThh:mm:ss.s (e.g. 1997-07-16T19:20:30.45) + /// YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00) + /// YYYY-MM-DDThh:mm:ssTZD (e.g. 1997-07-16T19:20:3001:00) + /// YYYY-MM-DDThh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45Z) + /// + /// Generally speaking we always require the "extended" option when one exists (3.1.3.5). + /// The extended variants have separator characters between components ('-', ':', '.', etc.). + /// Spaces are not permitted. + /// + /// "true" if successfully parsed. + private static bool TryParseDateTimeOffset( + ReadOnlySpan source, + out DateTimeParseData parseData + ) + { + parseData = default; + + // too short datetime + Debug.Assert(source.Length >= 10); + + // Parse the calendar date + // ----------------------- + // ISO 8601-1:2019 5.2.2.1b "Calendar date complete extended format" + // [dateX] = [year]["-"][month]["-"][day] + // [year] = [YYYY] [0000 - 9999] (4.3.2) + // [month] = [MM] [01 - 12] (4.3.3) + // [day] = [DD] [01 - 28, 29, 30, 31] (4.3.4) + // + // Note: 5.2.2.2 "Representations with reduced precision" allows for + // just [year]["-"][month] (a) and just [year] (b), but we currently + // don't permit it. + + { + uint digit1 = source[0] - (uint)'0'; + uint digit2 = source[1] - (uint)'0'; + uint digit3 = source[2] - (uint)'0'; + uint digit4 = source[3] - (uint)'0'; + + if (digit1 > 9 || digit2 > 9 || digit3 > 9 || digit4 > 9) + { + return false; + } + + parseData.Year = (int)(digit1 * 1000 + digit2 * 100 + digit3 * 10 + digit4); + } + + if ( + source[4] != JsonConstants.Hyphen + || !TryGetNextTwoDigits(source.Slice(start: 5, length: 2), ref parseData.Month) + || source[7] != JsonConstants.Hyphen + || !TryGetNextTwoDigits(source.Slice(start: 8, length: 2), ref parseData.Day) + ) + { + return false; + } + + // We now have YYYY-MM-DD [dateX] + // ReSharper disable once ConvertIfStatementToSwitchStatement + if (source.Length == 10) + { + parseData.IsCalendarDateOnly = true; + return true; + } + + // Parse the time of day + // --------------------- + // + // ISO 8601-1:2019 5.3.1.2b "Local time of day complete extended format" + // [timeX] = ["T"][hour][":"][min][":"][sec] + // [hour] = [hh] [00 - 23] (4.3.8a) + // [minute] = [mm] [00 - 59] (4.3.9a) + // [sec] = [ss] [00 - 59, 60 with a leap second] (4.3.10a) + // + // ISO 8601-1:2019 5.3.3 "UTC of day" + // [timeX]["Z"] + // + // ISO 8601-1:2019 5.3.4.2 "Local time of day with the time shift between + // local timescale and UTC" (Extended format) + // + // [shiftX] = ["+"|"-"][hour][":"][min] + // + // Notes: + // + // "T" is optional per spec, but _only_ when times are used alone. In our + // case, we're reading out a complete date & time and as such require "T". + // (5.4.2.1b). + // + // For [timeX] We allow seconds to be omitted per 5.3.1.3a "Representations + // with reduced precision". 5.3.1.3b allows just specifying the hour, but + // we currently don't permit this. + // + // Decimal fractions are allowed for hours, minutes and seconds (5.3.14). + // We only allow fractions for seconds currently. Lower order components + // can't follow, i.e. you can have T23.3, but not T23.3:04. There must be + // one digit, but the max number of digits is implementation defined. We + // currently allow up to 16 digits of fractional seconds only. While we + // support 16 fractional digits we only parse the first seven, anything + // past that is considered a zero. This is to stay compatible with the + // DateTime implementation which is limited to this resolution. + + if (source.Length < 16) + { + // Source does not have enough characters for YYYY-MM-DDThh:mm + return false; + } + + // Parse THH:MM (e.g. "T10:32") + if ( + source[10] != JsonConstants.TimePrefix + || source[13] != JsonConstants.Colon + || !TryGetNextTwoDigits(source.Slice(start: 11, length: 2), ref parseData.Hour) + || !TryGetNextTwoDigits(source.Slice(start: 14, length: 2), ref parseData.Minute) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm + Debug.Assert(source.Length >= 16); + if (source.Length == 16) + { + return true; + } + + byte curByte = source[16]; + int sourceIndex = 17; + + // Either a TZD ['Z'|'+'|'-'] or a seconds separator [':'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + case JsonConstants.Colon: + break; + default: + return false; + } + + // Try reading the seconds + if ( + source.Length < 19 + || !TryGetNextTwoDigits(source.Slice(start: 17, length: 2), ref parseData.Second) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm:ss + Debug.Assert(source.Length >= 19); + if (source.Length == 19) + { + return true; + } + + curByte = source[19]; + sourceIndex = 20; + + // Either a TZD ['Z'|'+'|'-'] or a seconds decimal fraction separator ['.'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + case JsonConstants.Period: + break; + default: + return false; + } + + // Source does not have enough characters for second fractions (i.e. ".s") + // YYYY-MM-DDThh:mm:ss.s + if (source.Length < 21) + { + return false; + } + + // Parse fraction. This value should never be greater than 9_999_999 + int numDigitsRead = 0; + int fractionEnd = Math.Min( + sourceIndex + JsonConstants.DateTimeParseNumFractionDigits, + source.Length + ); + + while (sourceIndex < fractionEnd && IsDigit(curByte = source[sourceIndex])) + { + if (numDigitsRead < JsonConstants.DateTimeNumFractionDigits) + { + parseData.Fraction = parseData.Fraction * 10 + (int)(curByte - (uint)'0'); + numDigitsRead++; + } + + sourceIndex++; + } + + if (parseData.Fraction != 0) + { + while (numDigitsRead < JsonConstants.DateTimeNumFractionDigits) + { + parseData.Fraction *= 10; + numDigitsRead++; + } + } + + // We now have YYYY-MM-DDThh:mm:ss.s + Debug.Assert(sourceIndex <= source.Length); + if (sourceIndex == source.Length) + { + return true; + } + + curByte = source[sourceIndex++]; + + // TZD ['Z'|'+'|'-'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + default: + return false; + } + + static bool ParseOffset(ref DateTimeParseData parseData, ReadOnlySpan offsetData) + { + // Parse the hours for the offset + if ( + offsetData.Length < 2 + || !TryGetNextTwoDigits(offsetData.Slice(0, 2), ref parseData.OffsetHours) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm:ss.s+|-hh + + if (offsetData.Length == 2) + { + // Just hours offset specified + return true; + } + + // Ensure we have enough for ":mm" + return offsetData.Length == 5 + && offsetData[2] == JsonConstants.Colon + && TryGetNextTwoDigits(offsetData.Slice(3), ref parseData.OffsetMinutes); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + // ReSharper disable once RedundantAssignment + private static bool TryGetNextTwoDigits(ReadOnlySpan source, ref int value) + { + Debug.Assert(source.Length == 2); + + uint digit1 = source[0] - (uint)'0'; + uint digit2 = source[1] - (uint)'0'; + + if (digit1 > 9 || digit2 > 9) + { + value = 0; + return false; + } + + value = (int)(digit1 * 10 + digit2); + return true; + } + + // The following methods are borrowed verbatim from src/Common/src/CoreLib/System/Buffers/Text/Utf8Parser/Utf8Parser.Date.Helpers.cs + + /// + /// Overflow-safe DateTime factory. + /// + private static bool TryCreateDateTime( + DateTimeParseData parseData, + DateTimeKind kind, + out DateTime value + ) + { + if (parseData.Year == 0) + { + value = default; + return false; + } + + Debug.Assert(parseData.Year <= 9999); // All of our callers to date parse the year from fixed 4-digit fields so this value is trusted. + + if ((uint)parseData.Month - 1 >= 12) + { + value = default; + return false; + } + + uint dayMinusOne = (uint)parseData.Day - 1; + if ( + dayMinusOne >= 28 + && dayMinusOne >= DateTime.DaysInMonth(parseData.Year, parseData.Month) + ) + { + value = default; + return false; + } + + if ((uint)parseData.Hour > 23) + { + value = default; + return false; + } + + if ((uint)parseData.Minute > 59) + { + value = default; + return false; + } + + // This needs to allow leap seconds when appropriate. + // See https://github.com/dotnet/runtime/issues/30135. + if ((uint)parseData.Second > 59) + { + value = default; + return false; + } + + Debug.Assert(parseData.Fraction is >= 0 and <= JsonConstants.MaxDateTimeFraction); // All of our callers to date parse the fraction from fixed 7-digit fields so this value is trusted. + + ReadOnlySpan days = DateTime.IsLeapYear(parseData.Year) + ? DaysToMonth366 + : DaysToMonth365; + int yearMinusOne = parseData.Year - 1; + int totalDays = + yearMinusOne * 365 + + yearMinusOne / 4 + - yearMinusOne / 100 + + yearMinusOne / 400 + + days[parseData.Month - 1] + + parseData.Day + - 1; + long ticks = totalDays * TimeSpan.TicksPerDay; + int totalSeconds = parseData.Hour * 3600 + parseData.Minute * 60 + parseData.Second; + ticks += totalSeconds * TimeSpan.TicksPerSecond; + ticks += parseData.Fraction; + value = new DateTime(ticks: ticks, kind: kind); + return true; + } + + private static ReadOnlySpan DaysToMonth365 => + [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; + private static ReadOnlySpan DaysToMonth366 => + [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]; + } + + internal static class ThrowHelper + { + private const string ExceptionSourceValueToRethrowAsJsonException = + "System.Text.Json.Rethrowable"; + + [DoesNotReturn] + public static void ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType) + { + throw GetInvalidOperationException("string", tokenType); + } + + public static void ThrowFormatException(DataType dataType) + { + throw new FormatException(SR.Format(SR.UnsupportedFormat, dataType)) + { + Source = ExceptionSourceValueToRethrowAsJsonException, + }; + } + + private static Exception GetInvalidOperationException( + string message, + JsonTokenType tokenType + ) + { + return GetInvalidOperationException(SR.Format(SR.InvalidCast, tokenType, message)); + } + + private static InvalidOperationException GetInvalidOperationException(string message) + { + return new InvalidOperationException(message) + { + Source = ExceptionSourceValueToRethrowAsJsonException, + }; + } + } + + internal static class Utf8JsonReaderExtensions + { + internal static int ValueLength(this Utf8JsonReader reader) => + reader.HasValueSequence + ? checked((int)reader.ValueSequence.Length) + : reader.ValueSpan.Length; + } + + internal enum DataType + { + TimeOnly, + DateOnly, + } + + [SuppressMessage("ReSharper", "InconsistentNaming")] + internal static class SR + { + private static readonly bool s_usingResourceKeys = + AppContext.TryGetSwitch( + "System.Resources.UseSystemResourceKeys", + out bool usingResourceKeys + ) && usingResourceKeys; + + public static string UnsupportedFormat => Strings.UnsupportedFormat; + + public static string InvalidCast => Strings.InvalidCast; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static string Format(string resourceFormat, object? p1) => + s_usingResourceKeys + ? string.Join(", ", resourceFormat, p1) + : string.Format(resourceFormat, p1); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static string Format(string resourceFormat, object? p1, object? p2) => + s_usingResourceKeys + ? string.Join(", ", resourceFormat, p1, p2) + : string.Format(resourceFormat, p1, p2); + } + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute( + "System.Resources.Tools.StronglyTypedResourceBuilder", + "17.0.0.0" + )] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Strings + { + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( + "Microsoft.Performance", + "CA1811:AvoidUncalledPrivateCode" + )] + internal Strings() { } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute( + global::System.ComponentModel.EditorBrowsableState.Advanced + )] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = + new global::System.Resources.ResourceManager( + "System.Text.Json.Resources.Strings", + typeof(Strings).Assembly + ); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute( + global::System.ComponentModel.EditorBrowsableState.Advanced + )] + internal static global::System.Globalization.CultureInfo Culture + { + get { return resourceCulture; } + set { resourceCulture = value; } + } + + /// + /// Looks up a localized string similar to Cannot get the value of a token type '{0}' as a {1}.. + /// + internal static string InvalidCast + { + get { return ResourceManager.GetString("InvalidCast", resourceCulture); } + } + + /// + /// Looks up a localized string similar to The JSON value is not in a supported {0} format.. + /// + internal static string UnsupportedFormat + { + get { return ResourceManager.GetString("UnsupportedFormat", resourceCulture); } + } + } +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject/Core/DateTimeSerializer.cs b/seed/csharp-model/public-object/src/SeedPublicObject/Core/DateTimeSerializer.cs new file mode 100644 index 00000000000..4c5e36b8517 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject/Core/DateTimeSerializer.cs @@ -0,0 +1,22 @@ +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedPublicObject.Core; + +internal class DateTimeSerializer : JsonConverter +{ + public override DateTime Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + return DateTime.Parse(reader.GetString()!, null, DateTimeStyles.RoundtripKind); + } + + public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString(Constants.DateTimeFormat)); + } +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject/Core/EnumSerializer.cs b/seed/csharp-model/public-object/src/SeedPublicObject/Core/EnumSerializer.cs new file mode 100644 index 00000000000..3059129be3a --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject/Core/EnumSerializer.cs @@ -0,0 +1,53 @@ +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedPublicObject.Core; + +internal class EnumSerializer : JsonConverter + where TEnum : struct, Enum +{ + private readonly Dictionary _enumToString = new(); + private readonly Dictionary _stringToEnum = new(); + + public EnumSerializer() + { + var type = typeof(TEnum); + var values = Enum.GetValues(type); + + foreach (var value in values) + { + var enumValue = (TEnum)value; + var enumMember = type.GetField(enumValue.ToString())!; + var attr = enumMember + .GetCustomAttributes(typeof(EnumMemberAttribute), false) + .Cast() + .FirstOrDefault(); + + var stringValue = + attr?.Value + ?? value.ToString() + ?? throw new Exception("Unexpected null enum toString value"); + + _enumToString.Add(enumValue, stringValue); + _stringToEnum.Add(stringValue, enumValue); + } + } + + public override TEnum Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write(Utf8JsonWriter writer, TEnum value, JsonSerializerOptions options) + { + writer.WriteStringValue(_enumToString[value]); + } +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject/Core/JsonAccessAttribute.cs b/seed/csharp-model/public-object/src/SeedPublicObject/Core/JsonAccessAttribute.cs new file mode 100644 index 00000000000..cc7f7c22e2e --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject/Core/JsonAccessAttribute.cs @@ -0,0 +1,13 @@ +namespace SeedPublicObject.Core; + +[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] +internal class JsonAccessAttribute(JsonAccessType accessType) : Attribute +{ + internal JsonAccessType AccessType { get; init; } = accessType; +} + +internal enum JsonAccessType +{ + ReadOnly, + WriteOnly, +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject/Core/JsonConfiguration.cs b/seed/csharp-model/public-object/src/SeedPublicObject/Core/JsonConfiguration.cs new file mode 100644 index 00000000000..350939cbd76 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject/Core/JsonConfiguration.cs @@ -0,0 +1,156 @@ +using global::System.Text.Json; +using global::System.Text.Json.Nodes; +using global::System.Text.Json.Serialization; +using global::System.Text.Json.Serialization.Metadata; + +namespace SeedPublicObject.Core; + +internal static partial class JsonOptions +{ + internal static readonly JsonSerializerOptions JsonSerializerOptions; + + static JsonOptions() + { + var options = new JsonSerializerOptions + { + Converters = { new DateTimeSerializer(), +#if USE_PORTABLE_DATE_ONLY + new DateOnlyConverter(), +#endif + new OneOfSerializer() }, +#if DEBUG + WriteIndented = true, +#endif + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = new DefaultJsonTypeInfoResolver + { + Modifiers = + { + static typeInfo => + { + if (typeInfo.Kind != JsonTypeInfoKind.Object) + return; + + foreach (var propertyInfo in typeInfo.Properties) + { + var jsonAccessAttribute = propertyInfo + .AttributeProvider?.GetCustomAttributes( + typeof(JsonAccessAttribute), + true + ) + .OfType() + .FirstOrDefault(); + + if (jsonAccessAttribute != null) + { + propertyInfo.IsRequired = false; + switch (jsonAccessAttribute.AccessType) + { + case JsonAccessType.ReadOnly: + propertyInfo.Get = null; + propertyInfo.ShouldSerialize = (_, _) => false; + break; + case JsonAccessType.WriteOnly: + propertyInfo.Set = null; + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + var jsonIgnoreAttribute = propertyInfo + .AttributeProvider?.GetCustomAttributes( + typeof(JsonIgnoreAttribute), + true + ) + .OfType() + .FirstOrDefault(); + + if (jsonIgnoreAttribute is not null) + { + propertyInfo.IsRequired = false; + } + } + }, + }, + }, + }; + ConfigureJsonSerializerOptions(options); + JsonSerializerOptions = options; + } + + static partial void ConfigureJsonSerializerOptions(JsonSerializerOptions defaultOptions); +} + +internal static class JsonUtils +{ + internal static string Serialize(T obj) => + JsonSerializer.Serialize(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonElement SerializeToElement(T obj) => + JsonSerializer.SerializeToElement(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonDocument SerializeToDocument(T obj) => + JsonSerializer.SerializeToDocument(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonNode? SerializeToNode(T obj) => + JsonSerializer.SerializeToNode(obj, JsonOptions.JsonSerializerOptions); + + internal static byte[] SerializeToUtf8Bytes(T obj) => + JsonSerializer.SerializeToUtf8Bytes(obj, JsonOptions.JsonSerializerOptions); + + internal static string SerializeWithAdditionalProperties( + T obj, + object? additionalProperties = null + ) + { + if (additionalProperties == null) + { + return Serialize(obj); + } + var additionalPropertiesJsonNode = SerializeToNode(additionalProperties); + if (additionalPropertiesJsonNode is not JsonObject additionalPropertiesJsonObject) + { + throw new InvalidOperationException( + "The additional properties must serialize to a JSON object." + ); + } + var jsonNode = SerializeToNode(obj); + if (jsonNode is not JsonObject jsonObject) + { + throw new InvalidOperationException( + "The serialized object must be a JSON object to add properties." + ); + } + MergeJsonObjects(jsonObject, additionalPropertiesJsonObject); + return jsonObject.ToJsonString(JsonOptions.JsonSerializerOptions); + } + + private static void MergeJsonObjects(JsonObject baseObject, JsonObject overrideObject) + { + foreach (var property in overrideObject) + { + if (!baseObject.TryGetPropertyValue(property.Key, out JsonNode? existingValue)) + { + baseObject[property.Key] = + property.Value != null ? JsonNode.Parse(property.Value.ToJsonString()) : null; + continue; + } + if ( + existingValue is JsonObject nestedBaseObject + && property.Value is JsonObject nestedOverrideObject + ) + { + // If both values are objects, recursively merge them. + MergeJsonObjects(nestedBaseObject, nestedOverrideObject); + continue; + } + // Otherwise, the overrideObject takes precedence. + baseObject[property.Key] = + property.Value != null ? JsonNode.Parse(property.Value.ToJsonString()) : null; + } + } + + internal static T Deserialize(string json) => + JsonSerializer.Deserialize(json, JsonOptions.JsonSerializerOptions)!; +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject/Core/OneOfSerializer.cs b/seed/csharp-model/public-object/src/SeedPublicObject/Core/OneOfSerializer.cs new file mode 100644 index 00000000000..777826354b6 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject/Core/OneOfSerializer.cs @@ -0,0 +1,91 @@ +using System.Reflection; +using System.Text.Json; +using System.Text.Json.Serialization; +using OneOf; + +namespace SeedPublicObject.Core; + +internal class OneOfSerializer : JsonConverter +{ + public override IOneOf? Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType is JsonTokenType.Null) + return default; + + foreach (var (type, cast) in GetOneOfTypes(typeToConvert)) + { + try + { + var readerCopy = reader; + var result = JsonSerializer.Deserialize(ref readerCopy, type, options); + reader.Skip(); + return (IOneOf)cast.Invoke(null, [result])!; + } + catch (JsonException) { } + } + + throw new JsonException( + $"Cannot deserialize into one of the supported types for {typeToConvert}" + ); + } + + public override void Write(Utf8JsonWriter writer, IOneOf value, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, value.Value, options); + } + + private static (global::System.Type type, MethodInfo cast)[] GetOneOfTypes( + global::System.Type typeToConvert + ) + { + var type = typeToConvert; + if (Nullable.GetUnderlyingType(type) is { } underlyingType) + { + type = underlyingType; + } + + var casts = type.GetRuntimeMethods() + .Where(m => m.IsSpecialName && m.Name == "op_Implicit") + .ToArray(); + while (type != null) + { + if ( + type.IsGenericType + && (type.Name.StartsWith("OneOf`") || type.Name.StartsWith("OneOfBase`")) + ) + { + var genericArguments = type.GetGenericArguments(); + if (genericArguments.Length == 1) + { + return [(genericArguments[0], casts[0])]; + } + + // if object type is present, make sure it is last + var indexOfObjectType = Array.IndexOf(genericArguments, typeof(object)); + if (indexOfObjectType != -1 && genericArguments.Length - 1 != indexOfObjectType) + { + genericArguments = genericArguments + .OrderBy(t => t == typeof(object) ? 1 : 0) + .ToArray(); + } + + return genericArguments + .Select(t => (t, casts.First(c => c.GetParameters()[0].ParameterType == t))) + .ToArray(); + } + + type = type.BaseType; + } + + throw new InvalidOperationException($"{type} isn't OneOf or OneOfBase"); + } + + public override bool CanConvert(global::System.Type typeToConvert) + { + return typeof(IOneOf).IsAssignableFrom(typeToConvert); + } +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject/Core/Public/FileParameter.cs b/seed/csharp-model/public-object/src/SeedPublicObject/Core/Public/FileParameter.cs new file mode 100644 index 00000000000..082a2849101 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject/Core/Public/FileParameter.cs @@ -0,0 +1,63 @@ +namespace SeedPublicObject; + +/// +/// File parameter for uploading files. +/// +public record FileParameter : IDisposable +#if NET6_0_OR_GREATER + , IAsyncDisposable +#endif +{ + private bool _disposed; + + /// + /// The name of the file to be uploaded. + /// + public string? FileName { get; set; } + + /// + /// The content type of the file to be uploaded. + /// + public string? ContentType { get; set; } + + /// + /// The content of the file to be uploaded. + /// + public required Stream Stream { get; set; } + + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + protected virtual void Dispose(bool disposing) + { + if (_disposed) + return; + if (disposing) + { + Stream.Dispose(); + } + + _disposed = true; + } + +#if NET6_0_OR_GREATER + /// + public async ValueTask DisposeAsync() + { + if (!_disposed) + { + await Stream.DisposeAsync().ConfigureAwait(false); + _disposed = true; + } + + GC.SuppressFinalize(this); + } +#endif + + public static implicit operator FileParameter(Stream stream) => new() { Stream = stream }; +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject/Core/Public/Version.cs b/seed/csharp-model/public-object/src/SeedPublicObject/Core/Public/Version.cs new file mode 100644 index 00000000000..abdcbb0e811 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject/Core/Public/Version.cs @@ -0,0 +1,6 @@ +namespace SeedPublicObject; + +internal class Version +{ + public const string Current = "0.0.1"; +} diff --git a/seed/csharp-model/public-object/src/SeedPublicObject/SeedPublicObject.Custom.props b/seed/csharp-model/public-object/src/SeedPublicObject/SeedPublicObject.Custom.props new file mode 100644 index 00000000000..70df2849401 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject/SeedPublicObject.Custom.props @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/seed/csharp-model/public-object/src/SeedPublicObject/SeedPublicObject.csproj b/seed/csharp-model/public-object/src/SeedPublicObject/SeedPublicObject.csproj new file mode 100644 index 00000000000..8fd4b115e19 --- /dev/null +++ b/seed/csharp-model/public-object/src/SeedPublicObject/SeedPublicObject.csproj @@ -0,0 +1,53 @@ + + + + net462;net8.0;net7.0;net6.0;netstandard2.0 + enable + 12 + enable + 0.0.1 + $(Version) + $(Version) + README.md + https://github.com/public-object/fern + true + + + + false + + + $(DefineConstants);USE_PORTABLE_DATE_ONLY + true + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + + + + <_Parameter1>SeedPublicObject.Test + + + + + diff --git a/seed/csharp-model/query-parameters/src/SeedQueryParameters/Core/Public/FileParameter.cs b/seed/csharp-model/query-parameters/src/SeedQueryParameters/Core/Public/FileParameter.cs index 9bb9723aaea..109389b082e 100644 --- a/seed/csharp-model/query-parameters/src/SeedQueryParameters/Core/Public/FileParameter.cs +++ b/seed/csharp-model/query-parameters/src/SeedQueryParameters/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/reserved-keywords/src/SeedNurseryApi/Core/Public/FileParameter.cs b/seed/csharp-model/reserved-keywords/src/SeedNurseryApi/Core/Public/FileParameter.cs index 562d0a282f9..accc7487f9d 100644 --- a/seed/csharp-model/reserved-keywords/src/SeedNurseryApi/Core/Public/FileParameter.cs +++ b/seed/csharp-model/reserved-keywords/src/SeedNurseryApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/response-property/src/SeedResponseProperty/Core/Public/FileParameter.cs b/seed/csharp-model/response-property/src/SeedResponseProperty/Core/Public/FileParameter.cs index 229713c03c9..b1e9b19a792 100644 --- a/seed/csharp-model/response-property/src/SeedResponseProperty/Core/Public/FileParameter.cs +++ b/seed/csharp-model/response-property/src/SeedResponseProperty/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/FileParameter.cs b/seed/csharp-model/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/FileParameter.cs index 4177a7d4af2..654512fbc37 100644 --- a/seed/csharp-model/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/FileParameter.cs +++ b/seed/csharp-model/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/server-sent-events/src/SeedServerSentEvents/Core/Public/FileParameter.cs b/seed/csharp-model/server-sent-events/src/SeedServerSentEvents/Core/Public/FileParameter.cs index 4177a7d4af2..654512fbc37 100644 --- a/seed/csharp-model/server-sent-events/src/SeedServerSentEvents/Core/Public/FileParameter.cs +++ b/seed/csharp-model/server-sent-events/src/SeedServerSentEvents/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/simple-fhir/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-model/simple-fhir/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-model/simple-fhir/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-model/simple-fhir/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/FileParameter.cs b/seed/csharp-model/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/FileParameter.cs index 034b2390f26..5b30c308735 100644 --- a/seed/csharp-model/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/FileParameter.cs +++ b/seed/csharp-model/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/FileParameter.cs b/seed/csharp-model/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/FileParameter.cs index e3d23ca026b..07f686d53a4 100644 --- a/seed/csharp-model/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/FileParameter.cs +++ b/seed/csharp-model/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/streaming-parameter/src/SeedStreaming/Core/Public/FileParameter.cs b/seed/csharp-model/streaming-parameter/src/SeedStreaming/Core/Public/FileParameter.cs index 74138df79bb..49bf6113e62 100644 --- a/seed/csharp-model/streaming-parameter/src/SeedStreaming/Core/Public/FileParameter.cs +++ b/seed/csharp-model/streaming-parameter/src/SeedStreaming/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/streaming/src/SeedStreaming/Core/Public/FileParameter.cs b/seed/csharp-model/streaming/src/SeedStreaming/Core/Public/FileParameter.cs index 74138df79bb..49bf6113e62 100644 --- a/seed/csharp-model/streaming/src/SeedStreaming/Core/Public/FileParameter.cs +++ b/seed/csharp-model/streaming/src/SeedStreaming/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/trace/src/SeedTrace/Core/Public/FileParameter.cs b/seed/csharp-model/trace/src/SeedTrace/Core/Public/FileParameter.cs index 5adc1a40721..ec7bef1d2ff 100644 --- a/seed/csharp-model/trace/src/SeedTrace/Core/Public/FileParameter.cs +++ b/seed/csharp-model/trace/src/SeedTrace/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/FileParameter.cs b/seed/csharp-model/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/FileParameter.cs index 84b272e7327..d0b0ee987f9 100644 --- a/seed/csharp-model/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/FileParameter.cs +++ b/seed/csharp-model/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/unions/.mock/ir.json b/seed/csharp-model/unions/.mock/ir.json new file mode 100644 index 00000000000..6625b00b3f7 --- /dev/null +++ b/seed/csharp-model/unions/.mock/ir.json @@ -0,0 +1 @@ +{"fdrApiDefinitionId":null,"apiVersion":null,"apiName":{"originalName":"unions","camelCase":{"unsafeName":"unions","safeName":"unions"},"snakeCase":{"unsafeName":"unions","safeName":"unions"},"screamingSnakeCase":{"unsafeName":"UNIONS","safeName":"UNIONS"},"pascalCase":{"unsafeName":"Unions","safeName":"Unions"}},"apiDisplayName":null,"apiDocs":null,"auth":{"requirement":"ALL","schemes":[],"docs":null},"headers":[],"idempotencyHeaders":[],"types":{"type_bigunion:BigUnion":{"inline":null,"name":{"name":{"originalName":"BigUnion","camelCase":{"unsafeName":"bigUnion","safeName":"bigUnion"},"snakeCase":{"unsafeName":"big_union","safeName":"big_union"},"screamingSnakeCase":{"unsafeName":"BIG_UNION","safeName":"BIG_UNION"},"pascalCase":{"unsafeName":"BigUnion","safeName":"BigUnion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:BigUnion"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"valueType":{"_type":"primitive","primitive":{"v1":"DATE_TIME","v2":null}},"availability":null,"docs":null},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"valueType":{"_type":"container","container":{"_type":"optional","optional":{"_type":"primitive","primitive":{"v1":"DATE_TIME","v2":null}}}},"availability":null,"docs":null}],"types":[{"discriminantValue":{"name":{"originalName":"normalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"wireValue":"normalSweet"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"NormalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:NormalSweet"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"thankfulFactor","camelCase":{"unsafeName":"thankfulFactor","safeName":"thankfulFactor"},"snakeCase":{"unsafeName":"thankful_factor","safeName":"thankful_factor"},"screamingSnakeCase":{"unsafeName":"THANKFUL_FACTOR","safeName":"THANKFUL_FACTOR"},"pascalCase":{"unsafeName":"ThankfulFactor","safeName":"ThankfulFactor"}},"wireValue":"thankfulFactor"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"ThankfulFactor","camelCase":{"unsafeName":"thankfulFactor","safeName":"thankfulFactor"},"snakeCase":{"unsafeName":"thankful_factor","safeName":"thankful_factor"},"screamingSnakeCase":{"unsafeName":"THANKFUL_FACTOR","safeName":"THANKFUL_FACTOR"},"pascalCase":{"unsafeName":"ThankfulFactor","safeName":"ThankfulFactor"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:ThankfulFactor"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"jumboEnd","camelCase":{"unsafeName":"jumboEnd","safeName":"jumboEnd"},"snakeCase":{"unsafeName":"jumbo_end","safeName":"jumbo_end"},"screamingSnakeCase":{"unsafeName":"JUMBO_END","safeName":"JUMBO_END"},"pascalCase":{"unsafeName":"JumboEnd","safeName":"JumboEnd"}},"wireValue":"jumboEnd"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"JumboEnd","camelCase":{"unsafeName":"jumboEnd","safeName":"jumboEnd"},"snakeCase":{"unsafeName":"jumbo_end","safeName":"jumbo_end"},"screamingSnakeCase":{"unsafeName":"JUMBO_END","safeName":"JUMBO_END"},"pascalCase":{"unsafeName":"JumboEnd","safeName":"JumboEnd"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:JumboEnd"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"hastyPain","camelCase":{"unsafeName":"hastyPain","safeName":"hastyPain"},"snakeCase":{"unsafeName":"hasty_pain","safeName":"hasty_pain"},"screamingSnakeCase":{"unsafeName":"HASTY_PAIN","safeName":"HASTY_PAIN"},"pascalCase":{"unsafeName":"HastyPain","safeName":"HastyPain"}},"wireValue":"hastyPain"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"HastyPain","camelCase":{"unsafeName":"hastyPain","safeName":"hastyPain"},"snakeCase":{"unsafeName":"hasty_pain","safeName":"hasty_pain"},"screamingSnakeCase":{"unsafeName":"HASTY_PAIN","safeName":"HASTY_PAIN"},"pascalCase":{"unsafeName":"HastyPain","safeName":"HastyPain"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:HastyPain"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"mistySnow","camelCase":{"unsafeName":"mistySnow","safeName":"mistySnow"},"snakeCase":{"unsafeName":"misty_snow","safeName":"misty_snow"},"screamingSnakeCase":{"unsafeName":"MISTY_SNOW","safeName":"MISTY_SNOW"},"pascalCase":{"unsafeName":"MistySnow","safeName":"MistySnow"}},"wireValue":"mistySnow"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"MistySnow","camelCase":{"unsafeName":"mistySnow","safeName":"mistySnow"},"snakeCase":{"unsafeName":"misty_snow","safeName":"misty_snow"},"screamingSnakeCase":{"unsafeName":"MISTY_SNOW","safeName":"MISTY_SNOW"},"pascalCase":{"unsafeName":"MistySnow","safeName":"MistySnow"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:MistySnow"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"distinctFailure","camelCase":{"unsafeName":"distinctFailure","safeName":"distinctFailure"},"snakeCase":{"unsafeName":"distinct_failure","safeName":"distinct_failure"},"screamingSnakeCase":{"unsafeName":"DISTINCT_FAILURE","safeName":"DISTINCT_FAILURE"},"pascalCase":{"unsafeName":"DistinctFailure","safeName":"DistinctFailure"}},"wireValue":"distinctFailure"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"DistinctFailure","camelCase":{"unsafeName":"distinctFailure","safeName":"distinctFailure"},"snakeCase":{"unsafeName":"distinct_failure","safeName":"distinct_failure"},"screamingSnakeCase":{"unsafeName":"DISTINCT_FAILURE","safeName":"DISTINCT_FAILURE"},"pascalCase":{"unsafeName":"DistinctFailure","safeName":"DistinctFailure"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:DistinctFailure"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"practicalPrinciple","camelCase":{"unsafeName":"practicalPrinciple","safeName":"practicalPrinciple"},"snakeCase":{"unsafeName":"practical_principle","safeName":"practical_principle"},"screamingSnakeCase":{"unsafeName":"PRACTICAL_PRINCIPLE","safeName":"PRACTICAL_PRINCIPLE"},"pascalCase":{"unsafeName":"PracticalPrinciple","safeName":"PracticalPrinciple"}},"wireValue":"practicalPrinciple"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"PracticalPrinciple","camelCase":{"unsafeName":"practicalPrinciple","safeName":"practicalPrinciple"},"snakeCase":{"unsafeName":"practical_principle","safeName":"practical_principle"},"screamingSnakeCase":{"unsafeName":"PRACTICAL_PRINCIPLE","safeName":"PRACTICAL_PRINCIPLE"},"pascalCase":{"unsafeName":"PracticalPrinciple","safeName":"PracticalPrinciple"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:PracticalPrinciple"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"limpingStep","camelCase":{"unsafeName":"limpingStep","safeName":"limpingStep"},"snakeCase":{"unsafeName":"limping_step","safeName":"limping_step"},"screamingSnakeCase":{"unsafeName":"LIMPING_STEP","safeName":"LIMPING_STEP"},"pascalCase":{"unsafeName":"LimpingStep","safeName":"LimpingStep"}},"wireValue":"limpingStep"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"LimpingStep","camelCase":{"unsafeName":"limpingStep","safeName":"limpingStep"},"snakeCase":{"unsafeName":"limping_step","safeName":"limping_step"},"screamingSnakeCase":{"unsafeName":"LIMPING_STEP","safeName":"LIMPING_STEP"},"pascalCase":{"unsafeName":"LimpingStep","safeName":"LimpingStep"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:LimpingStep"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"vibrantExcitement","camelCase":{"unsafeName":"vibrantExcitement","safeName":"vibrantExcitement"},"snakeCase":{"unsafeName":"vibrant_excitement","safeName":"vibrant_excitement"},"screamingSnakeCase":{"unsafeName":"VIBRANT_EXCITEMENT","safeName":"VIBRANT_EXCITEMENT"},"pascalCase":{"unsafeName":"VibrantExcitement","safeName":"VibrantExcitement"}},"wireValue":"vibrantExcitement"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"VibrantExcitement","camelCase":{"unsafeName":"vibrantExcitement","safeName":"vibrantExcitement"},"snakeCase":{"unsafeName":"vibrant_excitement","safeName":"vibrant_excitement"},"screamingSnakeCase":{"unsafeName":"VIBRANT_EXCITEMENT","safeName":"VIBRANT_EXCITEMENT"},"pascalCase":{"unsafeName":"VibrantExcitement","safeName":"VibrantExcitement"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:VibrantExcitement"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"activeDiamond","camelCase":{"unsafeName":"activeDiamond","safeName":"activeDiamond"},"snakeCase":{"unsafeName":"active_diamond","safeName":"active_diamond"},"screamingSnakeCase":{"unsafeName":"ACTIVE_DIAMOND","safeName":"ACTIVE_DIAMOND"},"pascalCase":{"unsafeName":"ActiveDiamond","safeName":"ActiveDiamond"}},"wireValue":"activeDiamond"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"ActiveDiamond","camelCase":{"unsafeName":"activeDiamond","safeName":"activeDiamond"},"snakeCase":{"unsafeName":"active_diamond","safeName":"active_diamond"},"screamingSnakeCase":{"unsafeName":"ACTIVE_DIAMOND","safeName":"ACTIVE_DIAMOND"},"pascalCase":{"unsafeName":"ActiveDiamond","safeName":"ActiveDiamond"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:ActiveDiamond"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"popularLimit","camelCase":{"unsafeName":"popularLimit","safeName":"popularLimit"},"snakeCase":{"unsafeName":"popular_limit","safeName":"popular_limit"},"screamingSnakeCase":{"unsafeName":"POPULAR_LIMIT","safeName":"POPULAR_LIMIT"},"pascalCase":{"unsafeName":"PopularLimit","safeName":"PopularLimit"}},"wireValue":"popularLimit"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"PopularLimit","camelCase":{"unsafeName":"popularLimit","safeName":"popularLimit"},"snakeCase":{"unsafeName":"popular_limit","safeName":"popular_limit"},"screamingSnakeCase":{"unsafeName":"POPULAR_LIMIT","safeName":"POPULAR_LIMIT"},"pascalCase":{"unsafeName":"PopularLimit","safeName":"PopularLimit"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:PopularLimit"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"falseMirror","camelCase":{"unsafeName":"falseMirror","safeName":"falseMirror"},"snakeCase":{"unsafeName":"false_mirror","safeName":"false_mirror"},"screamingSnakeCase":{"unsafeName":"FALSE_MIRROR","safeName":"FALSE_MIRROR"},"pascalCase":{"unsafeName":"FalseMirror","safeName":"FalseMirror"}},"wireValue":"falseMirror"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"FalseMirror","camelCase":{"unsafeName":"falseMirror","safeName":"falseMirror"},"snakeCase":{"unsafeName":"false_mirror","safeName":"false_mirror"},"screamingSnakeCase":{"unsafeName":"FALSE_MIRROR","safeName":"FALSE_MIRROR"},"pascalCase":{"unsafeName":"FalseMirror","safeName":"FalseMirror"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:FalseMirror"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"primaryBlock","camelCase":{"unsafeName":"primaryBlock","safeName":"primaryBlock"},"snakeCase":{"unsafeName":"primary_block","safeName":"primary_block"},"screamingSnakeCase":{"unsafeName":"PRIMARY_BLOCK","safeName":"PRIMARY_BLOCK"},"pascalCase":{"unsafeName":"PrimaryBlock","safeName":"PrimaryBlock"}},"wireValue":"primaryBlock"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"PrimaryBlock","camelCase":{"unsafeName":"primaryBlock","safeName":"primaryBlock"},"snakeCase":{"unsafeName":"primary_block","safeName":"primary_block"},"screamingSnakeCase":{"unsafeName":"PRIMARY_BLOCK","safeName":"PRIMARY_BLOCK"},"pascalCase":{"unsafeName":"PrimaryBlock","safeName":"PrimaryBlock"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:PrimaryBlock"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"rotatingRatio","camelCase":{"unsafeName":"rotatingRatio","safeName":"rotatingRatio"},"snakeCase":{"unsafeName":"rotating_ratio","safeName":"rotating_ratio"},"screamingSnakeCase":{"unsafeName":"ROTATING_RATIO","safeName":"ROTATING_RATIO"},"pascalCase":{"unsafeName":"RotatingRatio","safeName":"RotatingRatio"}},"wireValue":"rotatingRatio"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"RotatingRatio","camelCase":{"unsafeName":"rotatingRatio","safeName":"rotatingRatio"},"snakeCase":{"unsafeName":"rotating_ratio","safeName":"rotating_ratio"},"screamingSnakeCase":{"unsafeName":"ROTATING_RATIO","safeName":"ROTATING_RATIO"},"pascalCase":{"unsafeName":"RotatingRatio","safeName":"RotatingRatio"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:RotatingRatio"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"colorfulCover","camelCase":{"unsafeName":"colorfulCover","safeName":"colorfulCover"},"snakeCase":{"unsafeName":"colorful_cover","safeName":"colorful_cover"},"screamingSnakeCase":{"unsafeName":"COLORFUL_COVER","safeName":"COLORFUL_COVER"},"pascalCase":{"unsafeName":"ColorfulCover","safeName":"ColorfulCover"}},"wireValue":"colorfulCover"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"ColorfulCover","camelCase":{"unsafeName":"colorfulCover","safeName":"colorfulCover"},"snakeCase":{"unsafeName":"colorful_cover","safeName":"colorful_cover"},"screamingSnakeCase":{"unsafeName":"COLORFUL_COVER","safeName":"COLORFUL_COVER"},"pascalCase":{"unsafeName":"ColorfulCover","safeName":"ColorfulCover"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:ColorfulCover"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"disloyalValue","camelCase":{"unsafeName":"disloyalValue","safeName":"disloyalValue"},"snakeCase":{"unsafeName":"disloyal_value","safeName":"disloyal_value"},"screamingSnakeCase":{"unsafeName":"DISLOYAL_VALUE","safeName":"DISLOYAL_VALUE"},"pascalCase":{"unsafeName":"DisloyalValue","safeName":"DisloyalValue"}},"wireValue":"disloyalValue"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"DisloyalValue","camelCase":{"unsafeName":"disloyalValue","safeName":"disloyalValue"},"snakeCase":{"unsafeName":"disloyal_value","safeName":"disloyal_value"},"screamingSnakeCase":{"unsafeName":"DISLOYAL_VALUE","safeName":"DISLOYAL_VALUE"},"pascalCase":{"unsafeName":"DisloyalValue","safeName":"DisloyalValue"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:DisloyalValue"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"gruesomeCoach","camelCase":{"unsafeName":"gruesomeCoach","safeName":"gruesomeCoach"},"snakeCase":{"unsafeName":"gruesome_coach","safeName":"gruesome_coach"},"screamingSnakeCase":{"unsafeName":"GRUESOME_COACH","safeName":"GRUESOME_COACH"},"pascalCase":{"unsafeName":"GruesomeCoach","safeName":"GruesomeCoach"}},"wireValue":"gruesomeCoach"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"GruesomeCoach","camelCase":{"unsafeName":"gruesomeCoach","safeName":"gruesomeCoach"},"snakeCase":{"unsafeName":"gruesome_coach","safeName":"gruesome_coach"},"screamingSnakeCase":{"unsafeName":"GRUESOME_COACH","safeName":"GRUESOME_COACH"},"pascalCase":{"unsafeName":"GruesomeCoach","safeName":"GruesomeCoach"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:GruesomeCoach"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"totalWork","camelCase":{"unsafeName":"totalWork","safeName":"totalWork"},"snakeCase":{"unsafeName":"total_work","safeName":"total_work"},"screamingSnakeCase":{"unsafeName":"TOTAL_WORK","safeName":"TOTAL_WORK"},"pascalCase":{"unsafeName":"TotalWork","safeName":"TotalWork"}},"wireValue":"totalWork"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"TotalWork","camelCase":{"unsafeName":"totalWork","safeName":"totalWork"},"snakeCase":{"unsafeName":"total_work","safeName":"total_work"},"screamingSnakeCase":{"unsafeName":"TOTAL_WORK","safeName":"TOTAL_WORK"},"pascalCase":{"unsafeName":"TotalWork","safeName":"TotalWork"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:TotalWork"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"harmoniousPlay","camelCase":{"unsafeName":"harmoniousPlay","safeName":"harmoniousPlay"},"snakeCase":{"unsafeName":"harmonious_play","safeName":"harmonious_play"},"screamingSnakeCase":{"unsafeName":"HARMONIOUS_PLAY","safeName":"HARMONIOUS_PLAY"},"pascalCase":{"unsafeName":"HarmoniousPlay","safeName":"HarmoniousPlay"}},"wireValue":"harmoniousPlay"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"HarmoniousPlay","camelCase":{"unsafeName":"harmoniousPlay","safeName":"harmoniousPlay"},"snakeCase":{"unsafeName":"harmonious_play","safeName":"harmonious_play"},"screamingSnakeCase":{"unsafeName":"HARMONIOUS_PLAY","safeName":"HARMONIOUS_PLAY"},"pascalCase":{"unsafeName":"HarmoniousPlay","safeName":"HarmoniousPlay"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:HarmoniousPlay"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"uniqueStress","camelCase":{"unsafeName":"uniqueStress","safeName":"uniqueStress"},"snakeCase":{"unsafeName":"unique_stress","safeName":"unique_stress"},"screamingSnakeCase":{"unsafeName":"UNIQUE_STRESS","safeName":"UNIQUE_STRESS"},"pascalCase":{"unsafeName":"UniqueStress","safeName":"UniqueStress"}},"wireValue":"uniqueStress"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"UniqueStress","camelCase":{"unsafeName":"uniqueStress","safeName":"uniqueStress"},"snakeCase":{"unsafeName":"unique_stress","safeName":"unique_stress"},"screamingSnakeCase":{"unsafeName":"UNIQUE_STRESS","safeName":"UNIQUE_STRESS"},"pascalCase":{"unsafeName":"UniqueStress","safeName":"UniqueStress"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:UniqueStress"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"unwillingSmoke","camelCase":{"unsafeName":"unwillingSmoke","safeName":"unwillingSmoke"},"snakeCase":{"unsafeName":"unwilling_smoke","safeName":"unwilling_smoke"},"screamingSnakeCase":{"unsafeName":"UNWILLING_SMOKE","safeName":"UNWILLING_SMOKE"},"pascalCase":{"unsafeName":"UnwillingSmoke","safeName":"UnwillingSmoke"}},"wireValue":"unwillingSmoke"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"UnwillingSmoke","camelCase":{"unsafeName":"unwillingSmoke","safeName":"unwillingSmoke"},"snakeCase":{"unsafeName":"unwilling_smoke","safeName":"unwilling_smoke"},"screamingSnakeCase":{"unsafeName":"UNWILLING_SMOKE","safeName":"UNWILLING_SMOKE"},"pascalCase":{"unsafeName":"UnwillingSmoke","safeName":"UnwillingSmoke"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:UnwillingSmoke"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"frozenSleep","camelCase":{"unsafeName":"frozenSleep","safeName":"frozenSleep"},"snakeCase":{"unsafeName":"frozen_sleep","safeName":"frozen_sleep"},"screamingSnakeCase":{"unsafeName":"FROZEN_SLEEP","safeName":"FROZEN_SLEEP"},"pascalCase":{"unsafeName":"FrozenSleep","safeName":"FrozenSleep"}},"wireValue":"frozenSleep"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"FrozenSleep","camelCase":{"unsafeName":"frozenSleep","safeName":"frozenSleep"},"snakeCase":{"unsafeName":"frozen_sleep","safeName":"frozen_sleep"},"screamingSnakeCase":{"unsafeName":"FROZEN_SLEEP","safeName":"FROZEN_SLEEP"},"pascalCase":{"unsafeName":"FrozenSleep","safeName":"FrozenSleep"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:FrozenSleep"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"diligentDeal","camelCase":{"unsafeName":"diligentDeal","safeName":"diligentDeal"},"snakeCase":{"unsafeName":"diligent_deal","safeName":"diligent_deal"},"screamingSnakeCase":{"unsafeName":"DILIGENT_DEAL","safeName":"DILIGENT_DEAL"},"pascalCase":{"unsafeName":"DiligentDeal","safeName":"DiligentDeal"}},"wireValue":"diligentDeal"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"DiligentDeal","camelCase":{"unsafeName":"diligentDeal","safeName":"diligentDeal"},"snakeCase":{"unsafeName":"diligent_deal","safeName":"diligent_deal"},"screamingSnakeCase":{"unsafeName":"DILIGENT_DEAL","safeName":"DILIGENT_DEAL"},"pascalCase":{"unsafeName":"DiligentDeal","safeName":"DiligentDeal"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:DiligentDeal"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"attractiveScript","camelCase":{"unsafeName":"attractiveScript","safeName":"attractiveScript"},"snakeCase":{"unsafeName":"attractive_script","safeName":"attractive_script"},"screamingSnakeCase":{"unsafeName":"ATTRACTIVE_SCRIPT","safeName":"ATTRACTIVE_SCRIPT"},"pascalCase":{"unsafeName":"AttractiveScript","safeName":"AttractiveScript"}},"wireValue":"attractiveScript"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"AttractiveScript","camelCase":{"unsafeName":"attractiveScript","safeName":"attractiveScript"},"snakeCase":{"unsafeName":"attractive_script","safeName":"attractive_script"},"screamingSnakeCase":{"unsafeName":"ATTRACTIVE_SCRIPT","safeName":"ATTRACTIVE_SCRIPT"},"pascalCase":{"unsafeName":"AttractiveScript","safeName":"AttractiveScript"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:AttractiveScript"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"hoarseMouse","camelCase":{"unsafeName":"hoarseMouse","safeName":"hoarseMouse"},"snakeCase":{"unsafeName":"hoarse_mouse","safeName":"hoarse_mouse"},"screamingSnakeCase":{"unsafeName":"HOARSE_MOUSE","safeName":"HOARSE_MOUSE"},"pascalCase":{"unsafeName":"HoarseMouse","safeName":"HoarseMouse"}},"wireValue":"hoarseMouse"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"HoarseMouse","camelCase":{"unsafeName":"hoarseMouse","safeName":"hoarseMouse"},"snakeCase":{"unsafeName":"hoarse_mouse","safeName":"hoarse_mouse"},"screamingSnakeCase":{"unsafeName":"HOARSE_MOUSE","safeName":"HOARSE_MOUSE"},"pascalCase":{"unsafeName":"HoarseMouse","safeName":"HoarseMouse"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:HoarseMouse"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"circularCard","camelCase":{"unsafeName":"circularCard","safeName":"circularCard"},"snakeCase":{"unsafeName":"circular_card","safeName":"circular_card"},"screamingSnakeCase":{"unsafeName":"CIRCULAR_CARD","safeName":"CIRCULAR_CARD"},"pascalCase":{"unsafeName":"CircularCard","safeName":"CircularCard"}},"wireValue":"circularCard"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"CircularCard","camelCase":{"unsafeName":"circularCard","safeName":"circularCard"},"snakeCase":{"unsafeName":"circular_card","safeName":"circular_card"},"screamingSnakeCase":{"unsafeName":"CIRCULAR_CARD","safeName":"CIRCULAR_CARD"},"pascalCase":{"unsafeName":"CircularCard","safeName":"CircularCard"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:CircularCard"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"potableBad","camelCase":{"unsafeName":"potableBad","safeName":"potableBad"},"snakeCase":{"unsafeName":"potable_bad","safeName":"potable_bad"},"screamingSnakeCase":{"unsafeName":"POTABLE_BAD","safeName":"POTABLE_BAD"},"pascalCase":{"unsafeName":"PotableBad","safeName":"PotableBad"}},"wireValue":"potableBad"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"PotableBad","camelCase":{"unsafeName":"potableBad","safeName":"potableBad"},"snakeCase":{"unsafeName":"potable_bad","safeName":"potable_bad"},"screamingSnakeCase":{"unsafeName":"POTABLE_BAD","safeName":"POTABLE_BAD"},"pascalCase":{"unsafeName":"PotableBad","safeName":"PotableBad"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:PotableBad"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"triangularRepair","camelCase":{"unsafeName":"triangularRepair","safeName":"triangularRepair"},"snakeCase":{"unsafeName":"triangular_repair","safeName":"triangular_repair"},"screamingSnakeCase":{"unsafeName":"TRIANGULAR_REPAIR","safeName":"TRIANGULAR_REPAIR"},"pascalCase":{"unsafeName":"TriangularRepair","safeName":"TriangularRepair"}},"wireValue":"triangularRepair"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"TriangularRepair","camelCase":{"unsafeName":"triangularRepair","safeName":"triangularRepair"},"snakeCase":{"unsafeName":"triangular_repair","safeName":"triangular_repair"},"screamingSnakeCase":{"unsafeName":"TRIANGULAR_REPAIR","safeName":"TRIANGULAR_REPAIR"},"pascalCase":{"unsafeName":"TriangularRepair","safeName":"TriangularRepair"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:TriangularRepair"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"gaseousRoad","camelCase":{"unsafeName":"gaseousRoad","safeName":"gaseousRoad"},"snakeCase":{"unsafeName":"gaseous_road","safeName":"gaseous_road"},"screamingSnakeCase":{"unsafeName":"GASEOUS_ROAD","safeName":"GASEOUS_ROAD"},"pascalCase":{"unsafeName":"GaseousRoad","safeName":"GaseousRoad"}},"wireValue":"gaseousRoad"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"GaseousRoad","camelCase":{"unsafeName":"gaseousRoad","safeName":"gaseousRoad"},"snakeCase":{"unsafeName":"gaseous_road","safeName":"gaseous_road"},"screamingSnakeCase":{"unsafeName":"GASEOUS_ROAD","safeName":"GASEOUS_ROAD"},"pascalCase":{"unsafeName":"GaseousRoad","safeName":"GaseousRoad"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:GaseousRoad"},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":["type_bigunion:NormalSweet","type_bigunion:ThankfulFactor","type_bigunion:JumboEnd","type_bigunion:HastyPain","type_bigunion:MistySnow","type_bigunion:DistinctFailure","type_bigunion:PracticalPrinciple","type_bigunion:LimpingStep","type_bigunion:VibrantExcitement","type_bigunion:ActiveDiamond","type_bigunion:PopularLimit","type_bigunion:FalseMirror","type_bigunion:PrimaryBlock","type_bigunion:RotatingRatio","type_bigunion:ColorfulCover","type_bigunion:DisloyalValue","type_bigunion:GruesomeCoach","type_bigunion:TotalWork","type_bigunion:HarmoniousPlay","type_bigunion:UniqueStress","type_bigunion:UnwillingSmoke","type_bigunion:FrozenSleep","type_bigunion:DiligentDeal","type_bigunion:AttractiveScript","type_bigunion:HoarseMouse","type_bigunion:CircularCard","type_bigunion:PotableBad","type_bigunion:TriangularRepair","type_bigunion:GaseousRoad"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:NormalSweet":{"inline":null,"name":{"name":{"originalName":"NormalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:NormalSweet"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"One","camelCase":{"unsafeName":"one","safeName":"one"},"snakeCase":{"unsafeName":"one","safeName":"one"},"screamingSnakeCase":{"unsafeName":"ONE","safeName":"ONE"},"pascalCase":{"unsafeName":"One","safeName":"One"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example1"}}},"jsonExample":"example1"},"originalTypeDeclaration":{"name":{"originalName":"NormalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:NormalSweet"}}]},"jsonExample":{"value":"example1"},"docs":null},{"name":{"originalName":"Two","camelCase":{"unsafeName":"two","safeName":"two"},"snakeCase":{"unsafeName":"two","safeName":"two"},"screamingSnakeCase":{"unsafeName":"TWO","safeName":"TWO"},"pascalCase":{"unsafeName":"Two","safeName":"Two"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example2"}}},"jsonExample":"example2"},"originalTypeDeclaration":{"name":{"originalName":"NormalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:NormalSweet"}}]},"jsonExample":{"value":"example2"},"docs":null},{"name":{"originalName":"Three","camelCase":{"unsafeName":"three","safeName":"three"},"snakeCase":{"unsafeName":"three","safeName":"three"},"screamingSnakeCase":{"unsafeName":"THREE","safeName":"THREE"},"pascalCase":{"unsafeName":"Three","safeName":"Three"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example3"}}},"jsonExample":"example3"},"originalTypeDeclaration":{"name":{"originalName":"NormalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:NormalSweet"}}]},"jsonExample":{"value":"example3"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:ThankfulFactor":{"inline":null,"name":{"name":{"originalName":"ThankfulFactor","camelCase":{"unsafeName":"thankfulFactor","safeName":"thankfulFactor"},"snakeCase":{"unsafeName":"thankful_factor","safeName":"thankful_factor"},"screamingSnakeCase":{"unsafeName":"THANKFUL_FACTOR","safeName":"THANKFUL_FACTOR"},"pascalCase":{"unsafeName":"ThankfulFactor","safeName":"ThankfulFactor"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:ThankfulFactor"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"One","camelCase":{"unsafeName":"one","safeName":"one"},"snakeCase":{"unsafeName":"one","safeName":"one"},"screamingSnakeCase":{"unsafeName":"ONE","safeName":"ONE"},"pascalCase":{"unsafeName":"One","safeName":"One"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example1"}}},"jsonExample":"example1"},"originalTypeDeclaration":{"name":{"originalName":"ThankfulFactor","camelCase":{"unsafeName":"thankfulFactor","safeName":"thankfulFactor"},"snakeCase":{"unsafeName":"thankful_factor","safeName":"thankful_factor"},"screamingSnakeCase":{"unsafeName":"THANKFUL_FACTOR","safeName":"THANKFUL_FACTOR"},"pascalCase":{"unsafeName":"ThankfulFactor","safeName":"ThankfulFactor"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:ThankfulFactor"}}]},"jsonExample":{"value":"example1"},"docs":null},{"name":{"originalName":"Two","camelCase":{"unsafeName":"two","safeName":"two"},"snakeCase":{"unsafeName":"two","safeName":"two"},"screamingSnakeCase":{"unsafeName":"TWO","safeName":"TWO"},"pascalCase":{"unsafeName":"Two","safeName":"Two"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example2"}}},"jsonExample":"example2"},"originalTypeDeclaration":{"name":{"originalName":"ThankfulFactor","camelCase":{"unsafeName":"thankfulFactor","safeName":"thankfulFactor"},"snakeCase":{"unsafeName":"thankful_factor","safeName":"thankful_factor"},"screamingSnakeCase":{"unsafeName":"THANKFUL_FACTOR","safeName":"THANKFUL_FACTOR"},"pascalCase":{"unsafeName":"ThankfulFactor","safeName":"ThankfulFactor"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:ThankfulFactor"}}]},"jsonExample":{"value":"example2"},"docs":null},{"name":{"originalName":"Three","camelCase":{"unsafeName":"three","safeName":"three"},"snakeCase":{"unsafeName":"three","safeName":"three"},"screamingSnakeCase":{"unsafeName":"THREE","safeName":"THREE"},"pascalCase":{"unsafeName":"Three","safeName":"Three"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example3"}}},"jsonExample":"example3"},"originalTypeDeclaration":{"name":{"originalName":"ThankfulFactor","camelCase":{"unsafeName":"thankfulFactor","safeName":"thankfulFactor"},"snakeCase":{"unsafeName":"thankful_factor","safeName":"thankful_factor"},"screamingSnakeCase":{"unsafeName":"THANKFUL_FACTOR","safeName":"THANKFUL_FACTOR"},"pascalCase":{"unsafeName":"ThankfulFactor","safeName":"ThankfulFactor"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:ThankfulFactor"}}]},"jsonExample":{"value":"example3"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:JumboEnd":{"inline":null,"name":{"name":{"originalName":"JumboEnd","camelCase":{"unsafeName":"jumboEnd","safeName":"jumboEnd"},"snakeCase":{"unsafeName":"jumbo_end","safeName":"jumbo_end"},"screamingSnakeCase":{"unsafeName":"JUMBO_END","safeName":"JUMBO_END"},"pascalCase":{"unsafeName":"JumboEnd","safeName":"JumboEnd"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:JumboEnd"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:HastyPain":{"inline":null,"name":{"name":{"originalName":"HastyPain","camelCase":{"unsafeName":"hastyPain","safeName":"hastyPain"},"snakeCase":{"unsafeName":"hasty_pain","safeName":"hasty_pain"},"screamingSnakeCase":{"unsafeName":"HASTY_PAIN","safeName":"HASTY_PAIN"},"pascalCase":{"unsafeName":"HastyPain","safeName":"HastyPain"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:HastyPain"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:MistySnow":{"inline":null,"name":{"name":{"originalName":"MistySnow","camelCase":{"unsafeName":"mistySnow","safeName":"mistySnow"},"snakeCase":{"unsafeName":"misty_snow","safeName":"misty_snow"},"screamingSnakeCase":{"unsafeName":"MISTY_SNOW","safeName":"MISTY_SNOW"},"pascalCase":{"unsafeName":"MistySnow","safeName":"MistySnow"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:MistySnow"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:DistinctFailure":{"inline":null,"name":{"name":{"originalName":"DistinctFailure","camelCase":{"unsafeName":"distinctFailure","safeName":"distinctFailure"},"snakeCase":{"unsafeName":"distinct_failure","safeName":"distinct_failure"},"screamingSnakeCase":{"unsafeName":"DISTINCT_FAILURE","safeName":"DISTINCT_FAILURE"},"pascalCase":{"unsafeName":"DistinctFailure","safeName":"DistinctFailure"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:DistinctFailure"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:PracticalPrinciple":{"inline":null,"name":{"name":{"originalName":"PracticalPrinciple","camelCase":{"unsafeName":"practicalPrinciple","safeName":"practicalPrinciple"},"snakeCase":{"unsafeName":"practical_principle","safeName":"practical_principle"},"screamingSnakeCase":{"unsafeName":"PRACTICAL_PRINCIPLE","safeName":"PRACTICAL_PRINCIPLE"},"pascalCase":{"unsafeName":"PracticalPrinciple","safeName":"PracticalPrinciple"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:PracticalPrinciple"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:LimpingStep":{"inline":null,"name":{"name":{"originalName":"LimpingStep","camelCase":{"unsafeName":"limpingStep","safeName":"limpingStep"},"snakeCase":{"unsafeName":"limping_step","safeName":"limping_step"},"screamingSnakeCase":{"unsafeName":"LIMPING_STEP","safeName":"LIMPING_STEP"},"pascalCase":{"unsafeName":"LimpingStep","safeName":"LimpingStep"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:LimpingStep"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:VibrantExcitement":{"inline":null,"name":{"name":{"originalName":"VibrantExcitement","camelCase":{"unsafeName":"vibrantExcitement","safeName":"vibrantExcitement"},"snakeCase":{"unsafeName":"vibrant_excitement","safeName":"vibrant_excitement"},"screamingSnakeCase":{"unsafeName":"VIBRANT_EXCITEMENT","safeName":"VIBRANT_EXCITEMENT"},"pascalCase":{"unsafeName":"VibrantExcitement","safeName":"VibrantExcitement"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:VibrantExcitement"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:ActiveDiamond":{"inline":null,"name":{"name":{"originalName":"ActiveDiamond","camelCase":{"unsafeName":"activeDiamond","safeName":"activeDiamond"},"snakeCase":{"unsafeName":"active_diamond","safeName":"active_diamond"},"screamingSnakeCase":{"unsafeName":"ACTIVE_DIAMOND","safeName":"ACTIVE_DIAMOND"},"pascalCase":{"unsafeName":"ActiveDiamond","safeName":"ActiveDiamond"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:ActiveDiamond"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:PopularLimit":{"inline":null,"name":{"name":{"originalName":"PopularLimit","camelCase":{"unsafeName":"popularLimit","safeName":"popularLimit"},"snakeCase":{"unsafeName":"popular_limit","safeName":"popular_limit"},"screamingSnakeCase":{"unsafeName":"POPULAR_LIMIT","safeName":"POPULAR_LIMIT"},"pascalCase":{"unsafeName":"PopularLimit","safeName":"PopularLimit"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:PopularLimit"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:FalseMirror":{"inline":null,"name":{"name":{"originalName":"FalseMirror","camelCase":{"unsafeName":"falseMirror","safeName":"falseMirror"},"snakeCase":{"unsafeName":"false_mirror","safeName":"false_mirror"},"screamingSnakeCase":{"unsafeName":"FALSE_MIRROR","safeName":"FALSE_MIRROR"},"pascalCase":{"unsafeName":"FalseMirror","safeName":"FalseMirror"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:FalseMirror"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:PrimaryBlock":{"inline":null,"name":{"name":{"originalName":"PrimaryBlock","camelCase":{"unsafeName":"primaryBlock","safeName":"primaryBlock"},"snakeCase":{"unsafeName":"primary_block","safeName":"primary_block"},"screamingSnakeCase":{"unsafeName":"PRIMARY_BLOCK","safeName":"PRIMARY_BLOCK"},"pascalCase":{"unsafeName":"PrimaryBlock","safeName":"PrimaryBlock"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:PrimaryBlock"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:RotatingRatio":{"inline":null,"name":{"name":{"originalName":"RotatingRatio","camelCase":{"unsafeName":"rotatingRatio","safeName":"rotatingRatio"},"snakeCase":{"unsafeName":"rotating_ratio","safeName":"rotating_ratio"},"screamingSnakeCase":{"unsafeName":"ROTATING_RATIO","safeName":"ROTATING_RATIO"},"pascalCase":{"unsafeName":"RotatingRatio","safeName":"RotatingRatio"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:RotatingRatio"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:ColorfulCover":{"inline":null,"name":{"name":{"originalName":"ColorfulCover","camelCase":{"unsafeName":"colorfulCover","safeName":"colorfulCover"},"snakeCase":{"unsafeName":"colorful_cover","safeName":"colorful_cover"},"screamingSnakeCase":{"unsafeName":"COLORFUL_COVER","safeName":"COLORFUL_COVER"},"pascalCase":{"unsafeName":"ColorfulCover","safeName":"ColorfulCover"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:ColorfulCover"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:DisloyalValue":{"inline":null,"name":{"name":{"originalName":"DisloyalValue","camelCase":{"unsafeName":"disloyalValue","safeName":"disloyalValue"},"snakeCase":{"unsafeName":"disloyal_value","safeName":"disloyal_value"},"screamingSnakeCase":{"unsafeName":"DISLOYAL_VALUE","safeName":"DISLOYAL_VALUE"},"pascalCase":{"unsafeName":"DisloyalValue","safeName":"DisloyalValue"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:DisloyalValue"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:GruesomeCoach":{"inline":null,"name":{"name":{"originalName":"GruesomeCoach","camelCase":{"unsafeName":"gruesomeCoach","safeName":"gruesomeCoach"},"snakeCase":{"unsafeName":"gruesome_coach","safeName":"gruesome_coach"},"screamingSnakeCase":{"unsafeName":"GRUESOME_COACH","safeName":"GRUESOME_COACH"},"pascalCase":{"unsafeName":"GruesomeCoach","safeName":"GruesomeCoach"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:GruesomeCoach"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:TotalWork":{"inline":null,"name":{"name":{"originalName":"TotalWork","camelCase":{"unsafeName":"totalWork","safeName":"totalWork"},"snakeCase":{"unsafeName":"total_work","safeName":"total_work"},"screamingSnakeCase":{"unsafeName":"TOTAL_WORK","safeName":"TOTAL_WORK"},"pascalCase":{"unsafeName":"TotalWork","safeName":"TotalWork"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:TotalWork"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:HarmoniousPlay":{"inline":null,"name":{"name":{"originalName":"HarmoniousPlay","camelCase":{"unsafeName":"harmoniousPlay","safeName":"harmoniousPlay"},"snakeCase":{"unsafeName":"harmonious_play","safeName":"harmonious_play"},"screamingSnakeCase":{"unsafeName":"HARMONIOUS_PLAY","safeName":"HARMONIOUS_PLAY"},"pascalCase":{"unsafeName":"HarmoniousPlay","safeName":"HarmoniousPlay"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:HarmoniousPlay"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:UniqueStress":{"inline":null,"name":{"name":{"originalName":"UniqueStress","camelCase":{"unsafeName":"uniqueStress","safeName":"uniqueStress"},"snakeCase":{"unsafeName":"unique_stress","safeName":"unique_stress"},"screamingSnakeCase":{"unsafeName":"UNIQUE_STRESS","safeName":"UNIQUE_STRESS"},"pascalCase":{"unsafeName":"UniqueStress","safeName":"UniqueStress"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:UniqueStress"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:UnwillingSmoke":{"inline":null,"name":{"name":{"originalName":"UnwillingSmoke","camelCase":{"unsafeName":"unwillingSmoke","safeName":"unwillingSmoke"},"snakeCase":{"unsafeName":"unwilling_smoke","safeName":"unwilling_smoke"},"screamingSnakeCase":{"unsafeName":"UNWILLING_SMOKE","safeName":"UNWILLING_SMOKE"},"pascalCase":{"unsafeName":"UnwillingSmoke","safeName":"UnwillingSmoke"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:UnwillingSmoke"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:FrozenSleep":{"inline":null,"name":{"name":{"originalName":"FrozenSleep","camelCase":{"unsafeName":"frozenSleep","safeName":"frozenSleep"},"snakeCase":{"unsafeName":"frozen_sleep","safeName":"frozen_sleep"},"screamingSnakeCase":{"unsafeName":"FROZEN_SLEEP","safeName":"FROZEN_SLEEP"},"pascalCase":{"unsafeName":"FrozenSleep","safeName":"FrozenSleep"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:FrozenSleep"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:DiligentDeal":{"inline":null,"name":{"name":{"originalName":"DiligentDeal","camelCase":{"unsafeName":"diligentDeal","safeName":"diligentDeal"},"snakeCase":{"unsafeName":"diligent_deal","safeName":"diligent_deal"},"screamingSnakeCase":{"unsafeName":"DILIGENT_DEAL","safeName":"DILIGENT_DEAL"},"pascalCase":{"unsafeName":"DiligentDeal","safeName":"DiligentDeal"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:DiligentDeal"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:AttractiveScript":{"inline":null,"name":{"name":{"originalName":"AttractiveScript","camelCase":{"unsafeName":"attractiveScript","safeName":"attractiveScript"},"snakeCase":{"unsafeName":"attractive_script","safeName":"attractive_script"},"screamingSnakeCase":{"unsafeName":"ATTRACTIVE_SCRIPT","safeName":"ATTRACTIVE_SCRIPT"},"pascalCase":{"unsafeName":"AttractiveScript","safeName":"AttractiveScript"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:AttractiveScript"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:HoarseMouse":{"inline":null,"name":{"name":{"originalName":"HoarseMouse","camelCase":{"unsafeName":"hoarseMouse","safeName":"hoarseMouse"},"snakeCase":{"unsafeName":"hoarse_mouse","safeName":"hoarse_mouse"},"screamingSnakeCase":{"unsafeName":"HOARSE_MOUSE","safeName":"HOARSE_MOUSE"},"pascalCase":{"unsafeName":"HoarseMouse","safeName":"HoarseMouse"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:HoarseMouse"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:CircularCard":{"inline":null,"name":{"name":{"originalName":"CircularCard","camelCase":{"unsafeName":"circularCard","safeName":"circularCard"},"snakeCase":{"unsafeName":"circular_card","safeName":"circular_card"},"screamingSnakeCase":{"unsafeName":"CIRCULAR_CARD","safeName":"CIRCULAR_CARD"},"pascalCase":{"unsafeName":"CircularCard","safeName":"CircularCard"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:CircularCard"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:PotableBad":{"inline":null,"name":{"name":{"originalName":"PotableBad","camelCase":{"unsafeName":"potableBad","safeName":"potableBad"},"snakeCase":{"unsafeName":"potable_bad","safeName":"potable_bad"},"screamingSnakeCase":{"unsafeName":"POTABLE_BAD","safeName":"POTABLE_BAD"},"pascalCase":{"unsafeName":"PotableBad","safeName":"PotableBad"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:PotableBad"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:TriangularRepair":{"inline":null,"name":{"name":{"originalName":"TriangularRepair","camelCase":{"unsafeName":"triangularRepair","safeName":"triangularRepair"},"snakeCase":{"unsafeName":"triangular_repair","safeName":"triangular_repair"},"screamingSnakeCase":{"unsafeName":"TRIANGULAR_REPAIR","safeName":"TRIANGULAR_REPAIR"},"pascalCase":{"unsafeName":"TriangularRepair","safeName":"TriangularRepair"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:TriangularRepair"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_bigunion:GaseousRoad":{"inline":null,"name":{"name":{"originalName":"GaseousRoad","camelCase":{"unsafeName":"gaseousRoad","safeName":"gaseousRoad"},"snakeCase":{"unsafeName":"gaseous_road","safeName":"gaseous_road"},"screamingSnakeCase":{"unsafeName":"GASEOUS_ROAD","safeName":"GASEOUS_ROAD"},"pascalCase":{"unsafeName":"GaseousRoad","safeName":"GaseousRoad"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:GaseousRoad"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:Union":{"inline":null,"name":{"name":{"originalName":"Union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Union"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[],"types":[{"discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"type":{"_type":"named","name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo","default":null,"inline":null}},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"type":{"_type":"named","name":{"originalName":"Bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Bar","default":null,"inline":null}},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":["type_types:Foo","type_types:Bar"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":"This is a simple union."},"type_types:UnionWithDiscriminant":{"inline":null,"name":{"name":{"originalName":"UnionWithDiscriminant","camelCase":{"unsafeName":"unionWithDiscriminant","safeName":"unionWithDiscriminant"},"snakeCase":{"unsafeName":"union_with_discriminant","safeName":"union_with_discriminant"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_DISCRIMINANT","safeName":"UNION_WITH_DISCRIMINANT"},"pascalCase":{"unsafeName":"UnionWithDiscriminant","safeName":"UnionWithDiscriminant"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithDiscriminant"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"_type"},"extends":[],"baseProperties":[],"types":[{"discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"type":{"_type":"named","name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo","default":null,"inline":null}},"displayName":null,"availability":null,"docs":"This is a Foo field."},{"discriminantValue":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"type":{"_type":"named","name":{"originalName":"Bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Bar","default":null,"inline":null}},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":["type_types:Foo","type_types:Bar"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:UnionWithPrimitive":{"inline":null,"name":{"name":{"originalName":"UnionWithPrimitive","camelCase":{"unsafeName":"unionWithPrimitive","safeName":"unionWithPrimitive"},"snakeCase":{"unsafeName":"union_with_primitive","safeName":"union_with_primitive"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_PRIMITIVE","safeName":"UNION_WITH_PRIMITIVE"},"pascalCase":{"unsafeName":"UnionWithPrimitive","safeName":"UnionWithPrimitive"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithPrimitive"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[],"types":[{"discriminantValue":{"name":{"originalName":"integer","camelCase":{"unsafeName":"integer","safeName":"integer"},"snakeCase":{"unsafeName":"integer","safeName":"integer"},"screamingSnakeCase":{"unsafeName":"INTEGER","safeName":"INTEGER"},"pascalCase":{"unsafeName":"Integer","safeName":"Integer"}},"wireValue":"integer"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"primitive","primitive":{"v1":"INTEGER","v2":{"type":"integer","default":null,"validation":null}}}},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"string","camelCase":{"unsafeName":"string","safeName":"string"},"snakeCase":{"unsafeName":"string","safeName":"string"},"screamingSnakeCase":{"unsafeName":"STRING","safeName":"STRING"},"pascalCase":{"unsafeName":"String","safeName":"String"}},"wireValue":"string"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}}},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"integer","camelCase":{"unsafeName":"integer","safeName":"integer"},"snakeCase":{"unsafeName":"integer","safeName":"integer"},"screamingSnakeCase":{"unsafeName":"INTEGER","safeName":"INTEGER"},"pascalCase":{"unsafeName":"Integer","safeName":"Integer"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"integer","camelCase":{"unsafeName":"integer","safeName":"integer"},"snakeCase":{"unsafeName":"integer","safeName":"integer"},"screamingSnakeCase":{"unsafeName":"INTEGER","safeName":"INTEGER"},"pascalCase":{"unsafeName":"Integer","safeName":"Integer"}},"wireValue":"integer"},"shape":{"type":"singleProperty","shape":{"type":"primitive","primitive":{"type":"integer","integer":9}},"jsonExample":9}}},"jsonExample":{"type":"integer","value":9},"docs":null},{"name":{"originalName":"string","camelCase":{"unsafeName":"string","safeName":"string"},"snakeCase":{"unsafeName":"string","safeName":"string"},"screamingSnakeCase":{"unsafeName":"STRING","safeName":"STRING"},"pascalCase":{"unsafeName":"String","safeName":"String"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"string","camelCase":{"unsafeName":"string","safeName":"string"},"snakeCase":{"unsafeName":"string","safeName":"string"},"screamingSnakeCase":{"unsafeName":"STRING","safeName":"STRING"},"pascalCase":{"unsafeName":"String","safeName":"String"}},"wireValue":"string"},"shape":{"type":"singleProperty","shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"bar"}}},"jsonExample":"bar"}}},"jsonExample":{"type":"string","value":"bar"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:UnionWithDuplicatePrimitive":{"inline":null,"name":{"name":{"originalName":"UnionWithDuplicatePrimitive","camelCase":{"unsafeName":"unionWithDuplicatePrimitive","safeName":"unionWithDuplicatePrimitive"},"snakeCase":{"unsafeName":"union_with_duplicate_primitive","safeName":"union_with_duplicate_primitive"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_DUPLICATE_PRIMITIVE","safeName":"UNION_WITH_DUPLICATE_PRIMITIVE"},"pascalCase":{"unsafeName":"UnionWithDuplicatePrimitive","safeName":"UnionWithDuplicatePrimitive"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithDuplicatePrimitive"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[],"types":[{"discriminantValue":{"name":{"originalName":"integer1","camelCase":{"unsafeName":"integer1","safeName":"integer1"},"snakeCase":{"unsafeName":"integer_1","safeName":"integer_1"},"screamingSnakeCase":{"unsafeName":"INTEGER_1","safeName":"INTEGER_1"},"pascalCase":{"unsafeName":"Integer1","safeName":"Integer1"}},"wireValue":"integer1"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"primitive","primitive":{"v1":"INTEGER","v2":{"type":"integer","default":null,"validation":null}}}},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"integer2","camelCase":{"unsafeName":"integer2","safeName":"integer2"},"snakeCase":{"unsafeName":"integer_2","safeName":"integer_2"},"screamingSnakeCase":{"unsafeName":"INTEGER_2","safeName":"INTEGER_2"},"pascalCase":{"unsafeName":"Integer2","safeName":"Integer2"}},"wireValue":"integer2"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"primitive","primitive":{"v1":"INTEGER","v2":{"type":"integer","default":null,"validation":null}}}},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"string1","camelCase":{"unsafeName":"string1","safeName":"string1"},"snakeCase":{"unsafeName":"string_1","safeName":"string_1"},"screamingSnakeCase":{"unsafeName":"STRING_1","safeName":"STRING_1"},"pascalCase":{"unsafeName":"String1","safeName":"String1"}},"wireValue":"string1"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}}},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"string2","camelCase":{"unsafeName":"string2","safeName":"string2"},"snakeCase":{"unsafeName":"string_2","safeName":"string_2"},"screamingSnakeCase":{"unsafeName":"STRING_2","safeName":"STRING_2"},"pascalCase":{"unsafeName":"String2","safeName":"String2"}},"wireValue":"string2"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}}},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"integer1","camelCase":{"unsafeName":"integer1","safeName":"integer1"},"snakeCase":{"unsafeName":"integer_1","safeName":"integer_1"},"screamingSnakeCase":{"unsafeName":"INTEGER_1","safeName":"INTEGER_1"},"pascalCase":{"unsafeName":"Integer1","safeName":"Integer1"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"integer1","camelCase":{"unsafeName":"integer1","safeName":"integer1"},"snakeCase":{"unsafeName":"integer_1","safeName":"integer_1"},"screamingSnakeCase":{"unsafeName":"INTEGER_1","safeName":"INTEGER_1"},"pascalCase":{"unsafeName":"Integer1","safeName":"Integer1"}},"wireValue":"integer1"},"shape":{"type":"singleProperty","shape":{"type":"primitive","primitive":{"type":"integer","integer":9}},"jsonExample":9}}},"jsonExample":{"type":"integer1","value":9},"docs":null},{"name":{"originalName":"integer2","camelCase":{"unsafeName":"integer2","safeName":"integer2"},"snakeCase":{"unsafeName":"integer_2","safeName":"integer_2"},"screamingSnakeCase":{"unsafeName":"INTEGER_2","safeName":"INTEGER_2"},"pascalCase":{"unsafeName":"Integer2","safeName":"Integer2"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"integer2","camelCase":{"unsafeName":"integer2","safeName":"integer2"},"snakeCase":{"unsafeName":"integer_2","safeName":"integer_2"},"screamingSnakeCase":{"unsafeName":"INTEGER_2","safeName":"INTEGER_2"},"pascalCase":{"unsafeName":"Integer2","safeName":"Integer2"}},"wireValue":"integer2"},"shape":{"type":"singleProperty","shape":{"type":"primitive","primitive":{"type":"integer","integer":5}},"jsonExample":5}}},"jsonExample":{"type":"integer2","value":5},"docs":null},{"name":{"originalName":"string1","camelCase":{"unsafeName":"string1","safeName":"string1"},"snakeCase":{"unsafeName":"string_1","safeName":"string_1"},"screamingSnakeCase":{"unsafeName":"STRING_1","safeName":"STRING_1"},"pascalCase":{"unsafeName":"String1","safeName":"String1"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"string1","camelCase":{"unsafeName":"string1","safeName":"string1"},"snakeCase":{"unsafeName":"string_1","safeName":"string_1"},"screamingSnakeCase":{"unsafeName":"STRING_1","safeName":"STRING_1"},"pascalCase":{"unsafeName":"String1","safeName":"String1"}},"wireValue":"string1"},"shape":{"type":"singleProperty","shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"bar1"}}},"jsonExample":"bar1"}}},"jsonExample":{"type":"string1","value":"bar1"},"docs":null},{"name":{"originalName":"string2","camelCase":{"unsafeName":"string2","safeName":"string2"},"snakeCase":{"unsafeName":"string_2","safeName":"string_2"},"screamingSnakeCase":{"unsafeName":"STRING_2","safeName":"STRING_2"},"pascalCase":{"unsafeName":"String2","safeName":"String2"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"string1","camelCase":{"unsafeName":"string1","safeName":"string1"},"snakeCase":{"unsafeName":"string_1","safeName":"string_1"},"screamingSnakeCase":{"unsafeName":"STRING_1","safeName":"STRING_1"},"pascalCase":{"unsafeName":"String1","safeName":"String1"}},"wireValue":"string1"},"shape":{"type":"singleProperty","shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"bar2"}}},"jsonExample":"bar2"}}},"jsonExample":{"type":"string1","value":"bar2"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:UnionWithoutKey":{"inline":null,"name":{"name":{"originalName":"UnionWithoutKey","camelCase":{"unsafeName":"unionWithoutKey","safeName":"unionWithoutKey"},"snakeCase":{"unsafeName":"union_without_key","safeName":"union_without_key"},"screamingSnakeCase":{"unsafeName":"UNION_WITHOUT_KEY","safeName":"UNION_WITHOUT_KEY"},"pascalCase":{"unsafeName":"UnionWithoutKey","safeName":"UnionWithoutKey"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithoutKey"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[],"types":[{"discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"Bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Bar"},"displayName":null,"availability":null,"docs":"This is a bar field."}]},"referencedTypes":["type_types:Foo","type_types:Bar"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","object":{"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example1"}}},"jsonExample":"example1"},"originalTypeDeclaration":{"typeId":"type_types:Foo","fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}}}}]}}}},"jsonExample":{"type":"foo","name":"example1"},"docs":null},{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"shape":{"type":"samePropertiesAsObject","typeId":"type_types:Bar","object":{"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example1"}}},"jsonExample":"example1"},"originalTypeDeclaration":{"typeId":"type_types:Bar","fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"name":{"originalName":"Bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}}}}]}}}},"jsonExample":{"type":"bar","name":"example1"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:UnionWithNoProperties":{"inline":null,"name":{"name":{"originalName":"UnionWithNoProperties","camelCase":{"unsafeName":"unionWithNoProperties","safeName":"unionWithNoProperties"},"snakeCase":{"unsafeName":"union_with_no_properties","safeName":"union_with_no_properties"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_NO_PROPERTIES","safeName":"UNION_WITH_NO_PROPERTIES"},"pascalCase":{"unsafeName":"UnionWithNoProperties","safeName":"UnionWithNoProperties"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithNoProperties"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[],"types":[{"discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"empty","camelCase":{"unsafeName":"empty","safeName":"empty"},"snakeCase":{"unsafeName":"empty","safeName":"empty"},"screamingSnakeCase":{"unsafeName":"EMPTY","safeName":"EMPTY"},"pascalCase":{"unsafeName":"Empty","safeName":"Empty"}},"wireValue":"empty"},"shape":{"_type":"noProperties"},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":["type_types:Foo"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","object":{"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example"}}},"jsonExample":"example"},"originalTypeDeclaration":{"typeId":"type_types:Foo","fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}}}}]}}}},"jsonExample":{"type":"foo","name":"example"},"docs":null},{"name":{"originalName":"empty","camelCase":{"unsafeName":"empty","safeName":"empty"},"snakeCase":{"unsafeName":"empty","safeName":"empty"},"screamingSnakeCase":{"unsafeName":"EMPTY","safeName":"EMPTY"},"pascalCase":{"unsafeName":"Empty","safeName":"Empty"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"empty","camelCase":{"unsafeName":"empty","safeName":"empty"},"snakeCase":{"unsafeName":"empty","safeName":"empty"},"screamingSnakeCase":{"unsafeName":"EMPTY","safeName":"EMPTY"},"pascalCase":{"unsafeName":"Empty","safeName":"Empty"}},"wireValue":"empty"},"shape":{"type":"noProperties"}}},"jsonExample":{"type":"empty"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:UnionWithMultipleNoProperties":{"inline":null,"name":{"name":{"originalName":"UnionWithMultipleNoProperties","camelCase":{"unsafeName":"unionWithMultipleNoProperties","safeName":"unionWithMultipleNoProperties"},"snakeCase":{"unsafeName":"union_with_multiple_no_properties","safeName":"union_with_multiple_no_properties"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_MULTIPLE_NO_PROPERTIES","safeName":"UNION_WITH_MULTIPLE_NO_PROPERTIES"},"pascalCase":{"unsafeName":"UnionWithMultipleNoProperties","safeName":"UnionWithMultipleNoProperties"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithMultipleNoProperties"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[],"types":[{"discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"empty1","camelCase":{"unsafeName":"empty1","safeName":"empty1"},"snakeCase":{"unsafeName":"empty_1","safeName":"empty_1"},"screamingSnakeCase":{"unsafeName":"EMPTY_1","safeName":"EMPTY_1"},"pascalCase":{"unsafeName":"Empty1","safeName":"Empty1"}},"wireValue":"empty1"},"shape":{"_type":"noProperties"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"empty2","camelCase":{"unsafeName":"empty2","safeName":"empty2"},"snakeCase":{"unsafeName":"empty_2","safeName":"empty_2"},"screamingSnakeCase":{"unsafeName":"EMPTY_2","safeName":"EMPTY_2"},"pascalCase":{"unsafeName":"Empty2","safeName":"Empty2"}},"wireValue":"empty2"},"shape":{"_type":"noProperties"},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":["type_types:Foo"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","object":{"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example"}}},"jsonExample":"example"},"originalTypeDeclaration":{"typeId":"type_types:Foo","fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}}}}]}}}},"jsonExample":{"type":"foo","name":"example"},"docs":null},{"name":{"originalName":"empty1","camelCase":{"unsafeName":"empty1","safeName":"empty1"},"snakeCase":{"unsafeName":"empty_1","safeName":"empty_1"},"screamingSnakeCase":{"unsafeName":"EMPTY_1","safeName":"EMPTY_1"},"pascalCase":{"unsafeName":"Empty1","safeName":"Empty1"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"empty1","camelCase":{"unsafeName":"empty1","safeName":"empty1"},"snakeCase":{"unsafeName":"empty_1","safeName":"empty_1"},"screamingSnakeCase":{"unsafeName":"EMPTY_1","safeName":"EMPTY_1"},"pascalCase":{"unsafeName":"Empty1","safeName":"Empty1"}},"wireValue":"empty1"},"shape":{"type":"noProperties"}}},"jsonExample":{"type":"empty1"},"docs":null},{"name":{"originalName":"empty2","camelCase":{"unsafeName":"empty2","safeName":"empty2"},"snakeCase":{"unsafeName":"empty_2","safeName":"empty_2"},"screamingSnakeCase":{"unsafeName":"EMPTY_2","safeName":"EMPTY_2"},"pascalCase":{"unsafeName":"Empty2","safeName":"Empty2"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"empty2","camelCase":{"unsafeName":"empty2","safeName":"empty2"},"snakeCase":{"unsafeName":"empty_2","safeName":"empty_2"},"screamingSnakeCase":{"unsafeName":"EMPTY_2","safeName":"EMPTY_2"},"pascalCase":{"unsafeName":"Empty2","safeName":"Empty2"}},"wireValue":"empty2"},"shape":{"type":"noProperties"}}},"jsonExample":{"type":"empty2"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:UnionWithLiteral":{"inline":null,"name":{"name":{"originalName":"UnionWithLiteral","camelCase":{"unsafeName":"unionWithLiteral","safeName":"unionWithLiteral"},"snakeCase":{"unsafeName":"union_with_literal","safeName":"union_with_literal"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_LITERAL","safeName":"UNION_WITH_LITERAL"},"pascalCase":{"unsafeName":"UnionWithLiteral","safeName":"UnionWithLiteral"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithLiteral"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[{"name":{"name":{"originalName":"base","camelCase":{"unsafeName":"base","safeName":"base"},"snakeCase":{"unsafeName":"base","safeName":"base"},"screamingSnakeCase":{"unsafeName":"BASE","safeName":"BASE"},"pascalCase":{"unsafeName":"Base","safeName":"Base"}},"wireValue":"base"},"valueType":{"_type":"container","container":{"_type":"literal","literal":{"type":"string","string":"base"}}},"availability":null,"docs":null}],"types":[{"discriminantValue":{"name":{"originalName":"fern","camelCase":{"unsafeName":"fern","safeName":"fern"},"snakeCase":{"unsafeName":"fern","safeName":"fern"},"screamingSnakeCase":{"unsafeName":"FERN","safeName":"FERN"},"pascalCase":{"unsafeName":"Fern","safeName":"Fern"}},"wireValue":"fern"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"container","container":{"_type":"literal","literal":{"type":"string","string":"fern"}}}},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"fern","camelCase":{"unsafeName":"fern","safeName":"fern"},"snakeCase":{"unsafeName":"fern","safeName":"fern"},"screamingSnakeCase":{"unsafeName":"FERN","safeName":"FERN"},"pascalCase":{"unsafeName":"Fern","safeName":"Fern"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"fern","camelCase":{"unsafeName":"fern","safeName":"fern"},"snakeCase":{"unsafeName":"fern","safeName":"fern"},"screamingSnakeCase":{"unsafeName":"FERN","safeName":"FERN"},"pascalCase":{"unsafeName":"Fern","safeName":"Fern"}},"wireValue":"fern"},"shape":{"type":"singleProperty","shape":{"type":"container","container":{"type":"literal","literal":{"type":"string","string":{"original":"fern"}}}}}}},"jsonExample":{"base":"base","type":"fern","fern":"fern"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:UnionWithBaseProperties":{"inline":null,"name":{"name":{"originalName":"UnionWithBaseProperties","camelCase":{"unsafeName":"unionWithBaseProperties","safeName":"unionWithBaseProperties"},"snakeCase":{"unsafeName":"union_with_base_properties","safeName":"union_with_base_properties"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_BASE_PROPERTIES","safeName":"UNION_WITH_BASE_PROPERTIES"},"pascalCase":{"unsafeName":"UnionWithBaseProperties","safeName":"UnionWithBaseProperties"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithBaseProperties"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"types":[{"discriminantValue":{"name":{"originalName":"integer","camelCase":{"unsafeName":"integer","safeName":"integer"},"snakeCase":{"unsafeName":"integer","safeName":"integer"},"screamingSnakeCase":{"unsafeName":"INTEGER","safeName":"INTEGER"},"pascalCase":{"unsafeName":"Integer","safeName":"Integer"}},"wireValue":"integer"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"primitive","primitive":{"v1":"INTEGER","v2":{"type":"integer","default":null,"validation":null}}}},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"string","camelCase":{"unsafeName":"string","safeName":"string"},"snakeCase":{"unsafeName":"string","safeName":"string"},"screamingSnakeCase":{"unsafeName":"STRING","safeName":"STRING"},"pascalCase":{"unsafeName":"String","safeName":"String"}},"wireValue":"string"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}}},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":["type_types:Foo"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"integer","camelCase":{"unsafeName":"integer","safeName":"integer"},"snakeCase":{"unsafeName":"integer","safeName":"integer"},"screamingSnakeCase":{"unsafeName":"INTEGER","safeName":"INTEGER"},"pascalCase":{"unsafeName":"Integer","safeName":"Integer"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"integer","camelCase":{"unsafeName":"integer","safeName":"integer"},"snakeCase":{"unsafeName":"integer","safeName":"integer"},"screamingSnakeCase":{"unsafeName":"INTEGER","safeName":"INTEGER"},"pascalCase":{"unsafeName":"Integer","safeName":"Integer"}},"wireValue":"integer"},"shape":{"type":"singleProperty","shape":{"type":"primitive","primitive":{"type":"integer","integer":5}},"jsonExample":5}}},"jsonExample":{"type":"integer","id":"id","value":5},"docs":null},{"name":{"originalName":"string","camelCase":{"unsafeName":"string","safeName":"string"},"snakeCase":{"unsafeName":"string","safeName":"string"},"screamingSnakeCase":{"unsafeName":"STRING","safeName":"STRING"},"pascalCase":{"unsafeName":"String","safeName":"String"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"string","camelCase":{"unsafeName":"string","safeName":"string"},"snakeCase":{"unsafeName":"string","safeName":"string"},"screamingSnakeCase":{"unsafeName":"STRING","safeName":"STRING"},"pascalCase":{"unsafeName":"String","safeName":"String"}},"wireValue":"string"},"shape":{"type":"singleProperty","shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"string"}}},"jsonExample":"string"}}},"jsonExample":{"type":"string","id":"id","value":"string"},"docs":null},{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","object":{"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"name"}}},"jsonExample":"name"},"originalTypeDeclaration":{"typeId":"type_types:Foo","fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}}}}]}}}},"jsonExample":{"type":"foo","id":"id","name":"name"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:UnionWithTime":{"inline":null,"name":{"name":{"originalName":"UnionWithTime","camelCase":{"unsafeName":"unionWithTime","safeName":"unionWithTime"},"snakeCase":{"unsafeName":"union_with_time","safeName":"union_with_time"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_TIME","safeName":"UNION_WITH_TIME"},"pascalCase":{"unsafeName":"UnionWithTime","safeName":"UnionWithTime"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithTime"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[],"types":[{"discriminantValue":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"primitive","primitive":{"v1":"INTEGER","v2":{"type":"integer","default":null,"validation":null}}}},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"date","camelCase":{"unsafeName":"date","safeName":"date"},"snakeCase":{"unsafeName":"date","safeName":"date"},"screamingSnakeCase":{"unsafeName":"DATE","safeName":"DATE"},"pascalCase":{"unsafeName":"Date","safeName":"Date"}},"wireValue":"date"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"primitive","primitive":{"v1":"DATE","v2":null}}},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"datetime","camelCase":{"unsafeName":"datetime","safeName":"datetime"},"snakeCase":{"unsafeName":"datetime","safeName":"datetime"},"screamingSnakeCase":{"unsafeName":"DATETIME","safeName":"DATETIME"},"pascalCase":{"unsafeName":"Datetime","safeName":"Datetime"}},"wireValue":"datetime"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"primitive","primitive":{"v1":"DATE_TIME","v2":null}}},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"shape":{"type":"singleProperty","shape":{"type":"primitive","primitive":{"type":"integer","integer":5}},"jsonExample":5}}},"jsonExample":{"type":"value","value":5},"docs":null},{"name":{"originalName":"date","camelCase":{"unsafeName":"date","safeName":"date"},"snakeCase":{"unsafeName":"date","safeName":"date"},"screamingSnakeCase":{"unsafeName":"DATE","safeName":"DATE"},"pascalCase":{"unsafeName":"Date","safeName":"Date"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"date","camelCase":{"unsafeName":"date","safeName":"date"},"snakeCase":{"unsafeName":"date","safeName":"date"},"screamingSnakeCase":{"unsafeName":"DATE","safeName":"DATE"},"pascalCase":{"unsafeName":"Date","safeName":"Date"}},"wireValue":"date"},"shape":{"type":"singleProperty","shape":{"type":"primitive","primitive":{"type":"date","date":"1994-01-01"}},"jsonExample":"1994-01-01"}}},"jsonExample":{"type":"date","value":"1994-01-01"},"docs":null},{"name":{"originalName":"datetime","camelCase":{"unsafeName":"datetime","safeName":"datetime"},"snakeCase":{"unsafeName":"datetime","safeName":"datetime"},"screamingSnakeCase":{"unsafeName":"DATETIME","safeName":"DATETIME"},"pascalCase":{"unsafeName":"Datetime","safeName":"Datetime"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"datetime","camelCase":{"unsafeName":"datetime","safeName":"datetime"},"snakeCase":{"unsafeName":"datetime","safeName":"datetime"},"screamingSnakeCase":{"unsafeName":"DATETIME","safeName":"DATETIME"},"pascalCase":{"unsafeName":"Datetime","safeName":"Datetime"}},"wireValue":"datetime"},"shape":{"type":"singleProperty","shape":{"type":"primitive","primitive":{"type":"datetime","datetime":"1994-01-01T01:01:01.000Z","raw":"1994-01-01T01:01:01Z"}},"jsonExample":"1994-01-01T01:01:01Z"}}},"jsonExample":{"type":"datetime","value":"1994-01-01T01:01:01Z"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:UnionWithOptionalTime":{"inline":null,"name":{"name":{"originalName":"UnionWithOptionalTime","camelCase":{"unsafeName":"unionWithOptionalTime","safeName":"unionWithOptionalTime"},"snakeCase":{"unsafeName":"union_with_optional_time","safeName":"union_with_optional_time"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_OPTIONAL_TIME","safeName":"UNION_WITH_OPTIONAL_TIME"},"pascalCase":{"unsafeName":"UnionWithOptionalTime","safeName":"UnionWithOptionalTime"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithOptionalTime"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[],"types":[{"discriminantValue":{"name":{"originalName":"date","camelCase":{"unsafeName":"date","safeName":"date"},"snakeCase":{"unsafeName":"date","safeName":"date"},"screamingSnakeCase":{"unsafeName":"DATE","safeName":"DATE"},"pascalCase":{"unsafeName":"Date","safeName":"Date"}},"wireValue":"date"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"container","container":{"_type":"optional","optional":{"_type":"primitive","primitive":{"v1":"DATE","v2":null}}}}},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"datetime","camelCase":{"unsafeName":"datetime","safeName":"datetime"},"snakeCase":{"unsafeName":"datetime","safeName":"datetime"},"screamingSnakeCase":{"unsafeName":"DATETIME","safeName":"DATETIME"},"pascalCase":{"unsafeName":"Datetime","safeName":"Datetime"}},"wireValue":"datetime"},"shape":{"_type":"singleProperty","name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"type":{"_type":"container","container":{"_type":"optional","optional":{"_type":"primitive","primitive":{"v1":"DATE_TIME","v2":null}}}}},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"date","camelCase":{"unsafeName":"date","safeName":"date"},"snakeCase":{"unsafeName":"date","safeName":"date"},"screamingSnakeCase":{"unsafeName":"DATE","safeName":"DATE"},"pascalCase":{"unsafeName":"Date","safeName":"Date"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"date","camelCase":{"unsafeName":"date","safeName":"date"},"snakeCase":{"unsafeName":"date","safeName":"date"},"screamingSnakeCase":{"unsafeName":"DATE","safeName":"DATE"},"pascalCase":{"unsafeName":"Date","safeName":"Date"}},"wireValue":"date"},"shape":{"type":"singleProperty","shape":{"type":"container","container":{"type":"optional","optional":{"shape":{"type":"primitive","primitive":{"type":"date","date":"1994-01-01"}},"jsonExample":"1994-01-01"},"valueType":{"_type":"primitive","primitive":{"v1":"DATE","v2":null}}}},"jsonExample":"1994-01-01"}}},"jsonExample":{"type":"date","value":"1994-01-01"},"docs":null},{"name":{"originalName":"datetime","camelCase":{"unsafeName":"datetime","safeName":"datetime"},"snakeCase":{"unsafeName":"datetime","safeName":"datetime"},"screamingSnakeCase":{"unsafeName":"DATETIME","safeName":"DATETIME"},"pascalCase":{"unsafeName":"Datetime","safeName":"Datetime"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"datetime","camelCase":{"unsafeName":"datetime","safeName":"datetime"},"snakeCase":{"unsafeName":"datetime","safeName":"datetime"},"screamingSnakeCase":{"unsafeName":"DATETIME","safeName":"DATETIME"},"pascalCase":{"unsafeName":"Datetime","safeName":"Datetime"}},"wireValue":"datetime"},"shape":{"type":"singleProperty","shape":{"type":"container","container":{"type":"optional","optional":{"shape":{"type":"primitive","primitive":{"type":"datetime","datetime":"1994-01-01T01:01:01.000Z","raw":"1994-01-01T01:01:01Z"}},"jsonExample":"1994-01-01T01:01:01Z"},"valueType":{"_type":"primitive","primitive":{"v1":"DATE_TIME","v2":null}}}},"jsonExample":"1994-01-01T01:01:01Z"}}},"jsonExample":{"type":"datetime","value":"1994-01-01T01:01:01Z"},"docs":null},{"name":{"originalName":"empty-date","camelCase":{"unsafeName":"emptyDate","safeName":"emptyDate"},"snakeCase":{"unsafeName":"empty_date","safeName":"empty_date"},"screamingSnakeCase":{"unsafeName":"EMPTY_DATE","safeName":"EMPTY_DATE"},"pascalCase":{"unsafeName":"EmptyDate","safeName":"EmptyDate"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"date","camelCase":{"unsafeName":"date","safeName":"date"},"snakeCase":{"unsafeName":"date","safeName":"date"},"screamingSnakeCase":{"unsafeName":"DATE","safeName":"DATE"},"pascalCase":{"unsafeName":"Date","safeName":"Date"}},"wireValue":"date"},"shape":{"type":"singleProperty","shape":{"type":"container","container":{"type":"optional","optional":null,"valueType":{"_type":"primitive","primitive":{"v1":"DATE","v2":null}}}},"jsonExample":null}}},"jsonExample":{"type":"date","value":null},"docs":null},{"name":{"originalName":"empty-datetime","camelCase":{"unsafeName":"emptyDatetime","safeName":"emptyDatetime"},"snakeCase":{"unsafeName":"empty_datetime","safeName":"empty_datetime"},"screamingSnakeCase":{"unsafeName":"EMPTY_DATETIME","safeName":"EMPTY_DATETIME"},"pascalCase":{"unsafeName":"EmptyDatetime","safeName":"EmptyDatetime"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"datetime","camelCase":{"unsafeName":"datetime","safeName":"datetime"},"snakeCase":{"unsafeName":"datetime","safeName":"datetime"},"screamingSnakeCase":{"unsafeName":"DATETIME","safeName":"DATETIME"},"pascalCase":{"unsafeName":"Datetime","safeName":"Datetime"}},"wireValue":"datetime"},"shape":{"type":"singleProperty","shape":{"type":"container","container":{"type":"optional","optional":null,"valueType":{"_type":"primitive","primitive":{"v1":"DATE_TIME","v2":null}}}},"jsonExample":null}}},"jsonExample":{"type":"datetime","value":null},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:UnionWithSingleElement":{"inline":null,"name":{"name":{"originalName":"UnionWithSingleElement","camelCase":{"unsafeName":"unionWithSingleElement","safeName":"unionWithSingleElement"},"snakeCase":{"unsafeName":"union_with_single_element","safeName":"union_with_single_element"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_SINGLE_ELEMENT","safeName":"UNION_WITH_SINGLE_ELEMENT"},"pascalCase":{"unsafeName":"UnionWithSingleElement","safeName":"UnionWithSingleElement"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithSingleElement"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[],"types":[{"discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":["type_types:Foo"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","object":{"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example1"}}},"jsonExample":"example1"},"originalTypeDeclaration":{"typeId":"type_types:Foo","fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}}}}]}}}},"jsonExample":{"type":"foo","name":"example1"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:UnionWithDuplicateTypes":{"inline":null,"name":{"name":{"originalName":"UnionWithDuplicateTypes","camelCase":{"unsafeName":"unionWithDuplicateTypes","safeName":"unionWithDuplicateTypes"},"snakeCase":{"unsafeName":"union_with_duplicate_types","safeName":"union_with_duplicate_types"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_DUPLICATE_TYPES","safeName":"UNION_WITH_DUPLICATE_TYPES"},"pascalCase":{"unsafeName":"UnionWithDuplicateTypes","safeName":"UnionWithDuplicateTypes"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithDuplicateTypes"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[],"types":[{"discriminantValue":{"name":{"originalName":"foo1","camelCase":{"unsafeName":"foo1","safeName":"foo1"},"snakeCase":{"unsafeName":"foo_1","safeName":"foo_1"},"screamingSnakeCase":{"unsafeName":"FOO_1","safeName":"FOO_1"},"pascalCase":{"unsafeName":"Foo1","safeName":"Foo1"}},"wireValue":"foo1"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"foo2","camelCase":{"unsafeName":"foo2","safeName":"foo2"},"snakeCase":{"unsafeName":"foo_2","safeName":"foo_2"},"screamingSnakeCase":{"unsafeName":"FOO_2","safeName":"FOO_2"},"pascalCase":{"unsafeName":"Foo2","safeName":"Foo2"}},"wireValue":"foo2"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":["type_types:Foo"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"foo1","camelCase":{"unsafeName":"foo1","safeName":"foo1"},"snakeCase":{"unsafeName":"foo_1","safeName":"foo_1"},"screamingSnakeCase":{"unsafeName":"FOO_1","safeName":"FOO_1"},"pascalCase":{"unsafeName":"Foo1","safeName":"Foo1"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"foo1","camelCase":{"unsafeName":"foo1","safeName":"foo1"},"snakeCase":{"unsafeName":"foo_1","safeName":"foo_1"},"screamingSnakeCase":{"unsafeName":"FOO_1","safeName":"FOO_1"},"pascalCase":{"unsafeName":"Foo1","safeName":"Foo1"}},"wireValue":"foo1"},"shape":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","object":{"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example1"}}},"jsonExample":"example1"},"originalTypeDeclaration":{"typeId":"type_types:Foo","fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}}}}]}}}},"jsonExample":{"type":"foo1","name":"example1"},"docs":null},{"name":{"originalName":"foo2","camelCase":{"unsafeName":"foo2","safeName":"foo2"},"snakeCase":{"unsafeName":"foo_2","safeName":"foo_2"},"screamingSnakeCase":{"unsafeName":"FOO_2","safeName":"FOO_2"},"pascalCase":{"unsafeName":"Foo2","safeName":"Foo2"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"foo2","camelCase":{"unsafeName":"foo2","safeName":"foo2"},"snakeCase":{"unsafeName":"foo_2","safeName":"foo_2"},"screamingSnakeCase":{"unsafeName":"FOO_2","safeName":"FOO_2"},"pascalCase":{"unsafeName":"Foo2","safeName":"Foo2"}},"wireValue":"foo2"},"shape":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","object":{"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example2"}}},"jsonExample":"example2"},"originalTypeDeclaration":{"typeId":"type_types:Foo","fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}}}}]}}}},"jsonExample":{"type":"foo2","name":"example2"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:UnionWithSubTypes":{"inline":null,"name":{"name":{"originalName":"UnionWithSubTypes","camelCase":{"unsafeName":"unionWithSubTypes","safeName":"unionWithSubTypes"},"snakeCase":{"unsafeName":"union_with_sub_types","safeName":"union_with_sub_types"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_SUB_TYPES","safeName":"UNION_WITH_SUB_TYPES"},"pascalCase":{"unsafeName":"UnionWithSubTypes","safeName":"UnionWithSubTypes"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:UnionWithSubTypes"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[],"types":[{"discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"fooExtended","camelCase":{"unsafeName":"fooExtended","safeName":"fooExtended"},"snakeCase":{"unsafeName":"foo_extended","safeName":"foo_extended"},"screamingSnakeCase":{"unsafeName":"FOO_EXTENDED","safeName":"FOO_EXTENDED"},"pascalCase":{"unsafeName":"FooExtended","safeName":"FooExtended"}},"wireValue":"fooExtended"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"FooExtended","camelCase":{"unsafeName":"fooExtended","safeName":"fooExtended"},"snakeCase":{"unsafeName":"foo_extended","safeName":"foo_extended"},"screamingSnakeCase":{"unsafeName":"FOO_EXTENDED","safeName":"FOO_EXTENDED"},"pascalCase":{"unsafeName":"FooExtended","safeName":"FooExtended"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:FooExtended"},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":["type_types:Foo","type_types:FooExtended"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"shape":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","object":{"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example1"}}},"jsonExample":"example1"},"originalTypeDeclaration":{"typeId":"type_types:Foo","fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}}}}]}}}},"jsonExample":{"type":"foo","name":"example1"},"docs":null},{"name":{"originalName":"fooExtended","camelCase":{"unsafeName":"fooExtended","safeName":"fooExtended"},"snakeCase":{"unsafeName":"foo_extended","safeName":"foo_extended"},"screamingSnakeCase":{"unsafeName":"FOO_EXTENDED","safeName":"FOO_EXTENDED"},"pascalCase":{"unsafeName":"FooExtended","safeName":"FooExtended"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"fooExtended","camelCase":{"unsafeName":"fooExtended","safeName":"fooExtended"},"snakeCase":{"unsafeName":"foo_extended","safeName":"foo_extended"},"screamingSnakeCase":{"unsafeName":"FOO_EXTENDED","safeName":"FOO_EXTENDED"},"pascalCase":{"unsafeName":"FooExtended","safeName":"FooExtended"}},"wireValue":"fooExtended"},"shape":{"type":"samePropertiesAsObject","typeId":"type_types:FooExtended","object":{"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example2"}}},"jsonExample":"example2"},"originalTypeDeclaration":{"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"}},{"name":{"name":{"originalName":"age","camelCase":{"unsafeName":"age","safeName":"age"},"snakeCase":{"unsafeName":"age","safeName":"age"},"screamingSnakeCase":{"unsafeName":"AGE","safeName":"AGE"},"pascalCase":{"unsafeName":"Age","safeName":"Age"}},"wireValue":"age"},"value":{"shape":{"type":"primitive","primitive":{"type":"integer","integer":5}},"jsonExample":5},"originalTypeDeclaration":{"typeId":"type_types:FooExtended","fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"name":{"originalName":"FooExtended","camelCase":{"unsafeName":"fooExtended","safeName":"fooExtended"},"snakeCase":{"unsafeName":"foo_extended","safeName":"foo_extended"},"screamingSnakeCase":{"unsafeName":"FOO_EXTENDED","safeName":"FOO_EXTENDED"},"pascalCase":{"unsafeName":"FooExtended","safeName":"FooExtended"}}}}]}}}},"jsonExample":{"type":"fooExtended","name":"example2","age":5},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:Foo":{"inline":null,"name":{"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"One","camelCase":{"unsafeName":"one","safeName":"one"},"snakeCase":{"unsafeName":"one","safeName":"one"},"screamingSnakeCase":{"unsafeName":"ONE","safeName":"ONE"},"pascalCase":{"unsafeName":"One","safeName":"One"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example1"}}},"jsonExample":"example1"},"originalTypeDeclaration":{"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"}}]},"jsonExample":{"name":"example1"},"docs":null},{"name":{"originalName":"Two","camelCase":{"unsafeName":"two","safeName":"two"},"snakeCase":{"unsafeName":"two","safeName":"two"},"screamingSnakeCase":{"unsafeName":"TWO","safeName":"TWO"},"pascalCase":{"unsafeName":"Two","safeName":"Two"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example2"}}},"jsonExample":"example2"},"originalTypeDeclaration":{"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"}}]},"jsonExample":{"name":"example2"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:FooExtended":{"inline":null,"name":{"name":{"originalName":"FooExtended","camelCase":{"unsafeName":"fooExtended","safeName":"fooExtended"},"snakeCase":{"unsafeName":"foo_extended","safeName":"foo_extended"},"screamingSnakeCase":{"unsafeName":"FOO_EXTENDED","safeName":"FOO_EXTENDED"},"pascalCase":{"unsafeName":"FooExtended","safeName":"FooExtended"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:FooExtended"},"shape":{"_type":"object","extends":[{"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"}],"properties":[{"name":{"name":{"originalName":"age","camelCase":{"unsafeName":"age","safeName":"age"},"snakeCase":{"unsafeName":"age","safeName":"age"},"screamingSnakeCase":{"unsafeName":"AGE","safeName":"AGE"},"pascalCase":{"unsafeName":"Age","safeName":"Age"}},"wireValue":"age"},"valueType":{"_type":"primitive","primitive":{"v1":"INTEGER","v2":{"type":"integer","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}]},"referencedTypes":["type_types:Foo"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"One","camelCase":{"unsafeName":"one","safeName":"one"},"snakeCase":{"unsafeName":"one","safeName":"one"},"screamingSnakeCase":{"unsafeName":"ONE","safeName":"ONE"},"pascalCase":{"unsafeName":"One","safeName":"One"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example1"}}},"jsonExample":"example1"},"originalTypeDeclaration":{"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"}},{"name":{"name":{"originalName":"age","camelCase":{"unsafeName":"age","safeName":"age"},"snakeCase":{"unsafeName":"age","safeName":"age"},"screamingSnakeCase":{"unsafeName":"AGE","safeName":"AGE"},"pascalCase":{"unsafeName":"Age","safeName":"Age"}},"wireValue":"age"},"value":{"shape":{"type":"primitive","primitive":{"type":"integer","integer":5}},"jsonExample":5},"originalTypeDeclaration":{"name":{"originalName":"FooExtended","camelCase":{"unsafeName":"fooExtended","safeName":"fooExtended"},"snakeCase":{"unsafeName":"foo_extended","safeName":"foo_extended"},"screamingSnakeCase":{"unsafeName":"FOO_EXTENDED","safeName":"FOO_EXTENDED"},"pascalCase":{"unsafeName":"FooExtended","safeName":"FooExtended"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:FooExtended"}}]},"jsonExample":{"name":"example1","age":5},"docs":null},{"name":{"originalName":"Two","camelCase":{"unsafeName":"two","safeName":"two"},"snakeCase":{"unsafeName":"two","safeName":"two"},"screamingSnakeCase":{"unsafeName":"TWO","safeName":"TWO"},"pascalCase":{"unsafeName":"Two","safeName":"Two"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example2"}}},"jsonExample":"example2"},"originalTypeDeclaration":{"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Foo"}},{"name":{"name":{"originalName":"age","camelCase":{"unsafeName":"age","safeName":"age"},"snakeCase":{"unsafeName":"age","safeName":"age"},"screamingSnakeCase":{"unsafeName":"AGE","safeName":"AGE"},"pascalCase":{"unsafeName":"Age","safeName":"Age"}},"wireValue":"age"},"value":{"shape":{"type":"primitive","primitive":{"type":"integer","integer":10}},"jsonExample":10},"originalTypeDeclaration":{"name":{"originalName":"FooExtended","camelCase":{"unsafeName":"fooExtended","safeName":"fooExtended"},"snakeCase":{"unsafeName":"foo_extended","safeName":"foo_extended"},"screamingSnakeCase":{"unsafeName":"FOO_EXTENDED","safeName":"FOO_EXTENDED"},"pascalCase":{"unsafeName":"FooExtended","safeName":"FooExtended"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:FooExtended"}}]},"jsonExample":{"name":"example2","age":10},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_types:Bar":{"inline":null,"name":{"name":{"originalName":"Bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Bar"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"One","camelCase":{"unsafeName":"one","safeName":"one"},"snakeCase":{"unsafeName":"one","safeName":"one"},"screamingSnakeCase":{"unsafeName":"ONE","safeName":"ONE"},"pascalCase":{"unsafeName":"One","safeName":"One"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example1"}}},"jsonExample":"example1"},"originalTypeDeclaration":{"name":{"originalName":"Bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Bar"}}]},"jsonExample":{"name":"example1"},"docs":null},{"name":{"originalName":"Two","camelCase":{"unsafeName":"two","safeName":"two"},"snakeCase":{"unsafeName":"two","safeName":"two"},"screamingSnakeCase":{"unsafeName":"TWO","safeName":"TWO"},"pascalCase":{"unsafeName":"Two","safeName":"Two"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example2"}}},"jsonExample":"example2"},"originalTypeDeclaration":{"name":{"originalName":"Bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"typeId":"type_types:Bar"}}]},"jsonExample":{"name":"example2"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_union:GetShapeRequest":{"inline":null,"name":{"name":{"originalName":"GetShapeRequest","camelCase":{"unsafeName":"getShapeRequest","safeName":"getShapeRequest"},"snakeCase":{"unsafeName":"get_shape_request","safeName":"get_shape_request"},"screamingSnakeCase":{"unsafeName":"GET_SHAPE_REQUEST","safeName":"GET_SHAPE_REQUEST"},"pascalCase":{"unsafeName":"GetShapeRequest","safeName":"GetShapeRequest"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:GetShapeRequest"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"example","camelCase":{"unsafeName":"example","safeName":"example"},"snakeCase":{"unsafeName":"example","safeName":"example"},"screamingSnakeCase":{"unsafeName":"EXAMPLE","safeName":"EXAMPLE"},"pascalCase":{"unsafeName":"Example","safeName":"Example"}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"example"}}},"jsonExample":"example"},"originalTypeDeclaration":{"name":{"originalName":"GetShapeRequest","camelCase":{"unsafeName":"getShapeRequest","safeName":"getShapeRequest"},"snakeCase":{"unsafeName":"get_shape_request","safeName":"get_shape_request"},"screamingSnakeCase":{"unsafeName":"GET_SHAPE_REQUEST","safeName":"GET_SHAPE_REQUEST"},"pascalCase":{"unsafeName":"GetShapeRequest","safeName":"GetShapeRequest"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:GetShapeRequest"}}]},"jsonExample":{"id":"example"},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_union:Shape":{"inline":null,"name":{"name":{"originalName":"Shape","camelCase":{"unsafeName":"shape","safeName":"shape"},"snakeCase":{"unsafeName":"shape","safeName":"shape"},"screamingSnakeCase":{"unsafeName":"SHAPE","safeName":"SHAPE"},"pascalCase":{"unsafeName":"Shape","safeName":"Shape"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:Shape"},"shape":{"_type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"extends":[],"baseProperties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"availability":null,"docs":null}],"types":[{"discriminantValue":{"name":{"originalName":"circle","camelCase":{"unsafeName":"circle","safeName":"circle"},"snakeCase":{"unsafeName":"circle","safeName":"circle"},"screamingSnakeCase":{"unsafeName":"CIRCLE","safeName":"CIRCLE"},"pascalCase":{"unsafeName":"Circle","safeName":"Circle"}},"wireValue":"circle"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"Circle","camelCase":{"unsafeName":"circle","safeName":"circle"},"snakeCase":{"unsafeName":"circle","safeName":"circle"},"screamingSnakeCase":{"unsafeName":"CIRCLE","safeName":"CIRCLE"},"pascalCase":{"unsafeName":"Circle","safeName":"Circle"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:Circle"},"displayName":null,"availability":null,"docs":null},{"discriminantValue":{"name":{"originalName":"square","camelCase":{"unsafeName":"square","safeName":"square"},"snakeCase":{"unsafeName":"square","safeName":"square"},"screamingSnakeCase":{"unsafeName":"SQUARE","safeName":"SQUARE"},"pascalCase":{"unsafeName":"Square","safeName":"Square"}},"wireValue":"square"},"shape":{"_type":"samePropertiesAsObject","name":{"originalName":"Square","camelCase":{"unsafeName":"square","safeName":"square"},"snakeCase":{"unsafeName":"square","safeName":"square"},"screamingSnakeCase":{"unsafeName":"SQUARE","safeName":"SQUARE"},"pascalCase":{"unsafeName":"Square","safeName":"Square"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:Square"},"displayName":null,"availability":null,"docs":null}]},"referencedTypes":["type_union:Circle","type_union:Square"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"circle","camelCase":{"unsafeName":"circle","safeName":"circle"},"snakeCase":{"unsafeName":"circle","safeName":"circle"},"screamingSnakeCase":{"unsafeName":"CIRCLE","safeName":"CIRCLE"},"pascalCase":{"unsafeName":"Circle","safeName":"Circle"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"circle","camelCase":{"unsafeName":"circle","safeName":"circle"},"snakeCase":{"unsafeName":"circle","safeName":"circle"},"screamingSnakeCase":{"unsafeName":"CIRCLE","safeName":"CIRCLE"},"pascalCase":{"unsafeName":"Circle","safeName":"Circle"}},"wireValue":"circle"},"shape":{"type":"samePropertiesAsObject","typeId":"type_union:Circle","object":{"properties":[{"name":{"name":{"originalName":"radius","camelCase":{"unsafeName":"radius","safeName":"radius"},"snakeCase":{"unsafeName":"radius","safeName":"radius"},"screamingSnakeCase":{"unsafeName":"RADIUS","safeName":"RADIUS"},"pascalCase":{"unsafeName":"Radius","safeName":"Radius"}},"wireValue":"radius"},"value":{"shape":{"type":"primitive","primitive":{"type":"double","double":5}},"jsonExample":5},"originalTypeDeclaration":{"typeId":"type_union:Circle","fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"name":{"originalName":"Circle","camelCase":{"unsafeName":"circle","safeName":"circle"},"snakeCase":{"unsafeName":"circle","safeName":"circle"},"screamingSnakeCase":{"unsafeName":"CIRCLE","safeName":"CIRCLE"},"pascalCase":{"unsafeName":"Circle","safeName":"Circle"}}}}]}}}},"jsonExample":{"type":"circle","id":"example","radius":5},"docs":null},{"name":{"originalName":"square","camelCase":{"unsafeName":"square","safeName":"square"},"snakeCase":{"unsafeName":"square","safeName":"square"},"screamingSnakeCase":{"unsafeName":"SQUARE","safeName":"SQUARE"},"pascalCase":{"unsafeName":"Square","safeName":"Square"}},"shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"square","camelCase":{"unsafeName":"square","safeName":"square"},"snakeCase":{"unsafeName":"square","safeName":"square"},"screamingSnakeCase":{"unsafeName":"SQUARE","safeName":"SQUARE"},"pascalCase":{"unsafeName":"Square","safeName":"Square"}},"wireValue":"square"},"shape":{"type":"samePropertiesAsObject","typeId":"type_union:Square","object":{"properties":[{"name":{"name":{"originalName":"length","camelCase":{"unsafeName":"length","safeName":"length"},"snakeCase":{"unsafeName":"length","safeName":"length"},"screamingSnakeCase":{"unsafeName":"LENGTH","safeName":"LENGTH"},"pascalCase":{"unsafeName":"Length","safeName":"Length"}},"wireValue":"length"},"value":{"shape":{"type":"primitive","primitive":{"type":"double","double":5}},"jsonExample":5},"originalTypeDeclaration":{"typeId":"type_union:Square","fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"name":{"originalName":"Square","camelCase":{"unsafeName":"square","safeName":"square"},"snakeCase":{"unsafeName":"square","safeName":"square"},"screamingSnakeCase":{"unsafeName":"SQUARE","safeName":"SQUARE"},"pascalCase":{"unsafeName":"Square","safeName":"Square"}}}}]}}}},"jsonExample":{"type":"square","id":"example","length":5},"docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null},"type_union:Circle":{"inline":null,"name":{"name":{"originalName":"Circle","camelCase":{"unsafeName":"circle","safeName":"circle"},"snakeCase":{"unsafeName":"circle","safeName":"circle"},"screamingSnakeCase":{"unsafeName":"CIRCLE","safeName":"CIRCLE"},"pascalCase":{"unsafeName":"Circle","safeName":"Circle"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:Circle"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"radius","camelCase":{"unsafeName":"radius","safeName":"radius"},"snakeCase":{"unsafeName":"radius","safeName":"radius"},"screamingSnakeCase":{"unsafeName":"RADIUS","safeName":"RADIUS"},"pascalCase":{"unsafeName":"Radius","safeName":"Radius"}},"wireValue":"radius"},"valueType":{"_type":"primitive","primitive":{"v1":"DOUBLE","v2":{"type":"double","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_union:Square":{"inline":null,"name":{"name":{"originalName":"Square","camelCase":{"unsafeName":"square","safeName":"square"},"snakeCase":{"unsafeName":"square","safeName":"square"},"screamingSnakeCase":{"unsafeName":"SQUARE","safeName":"SQUARE"},"pascalCase":{"unsafeName":"Square","safeName":"Square"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:Square"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"length","camelCase":{"unsafeName":"length","safeName":"length"},"snakeCase":{"unsafeName":"length","safeName":"length"},"screamingSnakeCase":{"unsafeName":"LENGTH","safeName":"LENGTH"},"pascalCase":{"unsafeName":"Length","safeName":"Length"}},"wireValue":"length"},"valueType":{"_type":"primitive","primitive":{"v1":"DOUBLE","v2":{"type":"double","default":null,"validation":null}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null}},"errors":{},"services":{"service_bigunion":{"availability":null,"name":{"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"displayName":null,"basePath":{"head":"/","parts":[]},"headers":[],"pathParameters":[],"encoding":{"json":{},"proto":null},"transport":{"type":"http"},"endpoints":[{"id":"endpoint_bigunion.get","name":{"originalName":"get","camelCase":{"unsafeName":"get","safeName":"get"},"snakeCase":{"unsafeName":"get","safeName":"get"},"screamingSnakeCase":{"unsafeName":"GET","safeName":"GET"},"pascalCase":{"unsafeName":"Get","safeName":"Get"}},"displayName":null,"auth":false,"idempotent":false,"baseUrl":null,"method":"GET","basePath":null,"path":{"head":"/","parts":[{"pathParameter":"id","tail":""}]},"fullPath":{"head":"/","parts":[{"pathParameter":"id","tail":""}]},"pathParameters":[{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"location":"ENDPOINT","variable":null,"docs":null}],"allPathParameters":[{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"location":"ENDPOINT","variable":null,"docs":null}],"queryParameters":[],"headers":[],"requestBody":null,"sdkRequest":null,"response":{"body":{"type":"json","value":{"type":"response","responseBodyType":{"_type":"named","name":{"originalName":"BigUnion","camelCase":{"unsafeName":"bigUnion","safeName":"bigUnion"},"snakeCase":{"unsafeName":"big_union","safeName":"big_union"},"screamingSnakeCase":{"unsafeName":"BIG_UNION","safeName":"BIG_UNION"},"pascalCase":{"unsafeName":"BigUnion","safeName":"BigUnion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:BigUnion","default":null,"inline":null},"docs":null}},"status-code":null},"errors":[],"userSpecifiedExamples":[],"autogeneratedExamples":[{"example":{"id":"c1bf0a1c","url":"/id","name":null,"endpointHeaders":[],"endpointPathParameters":[{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"id"}}},"jsonExample":"id"}}],"queryParameters":[],"servicePathParameters":[],"serviceHeaders":[],"rootPathParameters":[],"request":null,"response":{"type":"ok","value":{"type":"body","value":{"shape":{"type":"named","shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"normalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"wireValue":"normalSweet"},"shape":{"type":"samePropertiesAsObject","typeId":"type_bigunion:NormalSweet","object":{"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"originalTypeDeclaration":{"name":{"originalName":"NormalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:NormalSweet"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"value"}}},"jsonExample":"value"}}]}}}},"typeName":{"name":{"originalName":"BigUnion","camelCase":{"unsafeName":"bigUnion","safeName":"bigUnion"},"snakeCase":{"unsafeName":"big_union","safeName":"big_union"},"screamingSnakeCase":{"unsafeName":"BIG_UNION","safeName":"BIG_UNION"},"pascalCase":{"unsafeName":"BigUnion","safeName":"BigUnion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:BigUnion"}},"jsonExample":{"type":"normalSweet","value":"value"}}}},"docs":null}}],"pagination":null,"transport":null,"availability":null,"docs":null},{"id":"endpoint_bigunion.update","name":{"originalName":"update","camelCase":{"unsafeName":"update","safeName":"update"},"snakeCase":{"unsafeName":"update","safeName":"update"},"screamingSnakeCase":{"unsafeName":"UPDATE","safeName":"UPDATE"},"pascalCase":{"unsafeName":"Update","safeName":"Update"}},"displayName":null,"auth":false,"idempotent":false,"baseUrl":null,"method":"PATCH","basePath":null,"path":{"head":"","parts":[]},"fullPath":{"head":"","parts":[]},"pathParameters":[],"allPathParameters":[],"queryParameters":[],"headers":[],"requestBody":{"type":"reference","requestBodyType":{"_type":"named","name":{"originalName":"BigUnion","camelCase":{"unsafeName":"bigUnion","safeName":"bigUnion"},"snakeCase":{"unsafeName":"big_union","safeName":"big_union"},"screamingSnakeCase":{"unsafeName":"BIG_UNION","safeName":"BIG_UNION"},"pascalCase":{"unsafeName":"BigUnion","safeName":"BigUnion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:BigUnion","default":null,"inline":null},"contentType":null,"docs":null},"sdkRequest":{"shape":{"type":"justRequestBody","value":{"type":"typeReference","requestBodyType":{"_type":"named","name":{"originalName":"BigUnion","camelCase":{"unsafeName":"bigUnion","safeName":"bigUnion"},"snakeCase":{"unsafeName":"big_union","safeName":"big_union"},"screamingSnakeCase":{"unsafeName":"BIG_UNION","safeName":"BIG_UNION"},"pascalCase":{"unsafeName":"BigUnion","safeName":"BigUnion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:BigUnion","default":null,"inline":null},"contentType":null,"docs":null}},"requestParameterName":{"originalName":"request","camelCase":{"unsafeName":"request","safeName":"request"},"snakeCase":{"unsafeName":"request","safeName":"request"},"screamingSnakeCase":{"unsafeName":"REQUEST","safeName":"REQUEST"},"pascalCase":{"unsafeName":"Request","safeName":"Request"}},"streamParameter":null},"response":{"body":{"type":"json","value":{"type":"response","responseBodyType":{"_type":"primitive","primitive":{"v1":"BOOLEAN","v2":{"type":"boolean","default":null}}},"docs":null}},"status-code":null},"errors":[],"userSpecifiedExamples":[],"autogeneratedExamples":[{"example":{"id":"ba487f4a","url":"","name":null,"endpointHeaders":[],"endpointPathParameters":[],"queryParameters":[],"servicePathParameters":[],"serviceHeaders":[],"rootPathParameters":[],"request":{"type":"reference","shape":{"type":"named","shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"normalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"wireValue":"normalSweet"},"shape":{"type":"samePropertiesAsObject","typeId":"type_bigunion:NormalSweet","object":{"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"originalTypeDeclaration":{"name":{"originalName":"NormalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:NormalSweet"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"value"}}},"jsonExample":"value"}}]}}}},"typeName":{"name":{"originalName":"BigUnion","camelCase":{"unsafeName":"bigUnion","safeName":"bigUnion"},"snakeCase":{"unsafeName":"big_union","safeName":"big_union"},"screamingSnakeCase":{"unsafeName":"BIG_UNION","safeName":"BIG_UNION"},"pascalCase":{"unsafeName":"BigUnion","safeName":"BigUnion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:BigUnion"}},"jsonExample":{"type":"normalSweet","value":"value"}},"response":{"type":"ok","value":{"type":"body","value":{"shape":{"type":"primitive","primitive":{"type":"boolean","boolean":true}},"jsonExample":true}}},"docs":null}}],"pagination":null,"transport":null,"availability":null,"docs":null},{"id":"endpoint_bigunion.update-many","name":{"originalName":"update-many","camelCase":{"unsafeName":"updateMany","safeName":"updateMany"},"snakeCase":{"unsafeName":"update_many","safeName":"update_many"},"screamingSnakeCase":{"unsafeName":"UPDATE_MANY","safeName":"UPDATE_MANY"},"pascalCase":{"unsafeName":"UpdateMany","safeName":"UpdateMany"}},"displayName":null,"auth":false,"idempotent":false,"baseUrl":null,"method":"PATCH","basePath":null,"path":{"head":"/many","parts":[]},"fullPath":{"head":"/many","parts":[]},"pathParameters":[],"allPathParameters":[],"queryParameters":[],"headers":[],"requestBody":{"type":"reference","requestBodyType":{"_type":"container","container":{"_type":"list","list":{"_type":"named","name":{"originalName":"BigUnion","camelCase":{"unsafeName":"bigUnion","safeName":"bigUnion"},"snakeCase":{"unsafeName":"big_union","safeName":"big_union"},"screamingSnakeCase":{"unsafeName":"BIG_UNION","safeName":"BIG_UNION"},"pascalCase":{"unsafeName":"BigUnion","safeName":"BigUnion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:BigUnion","default":null,"inline":null}}},"contentType":null,"docs":null},"sdkRequest":{"shape":{"type":"justRequestBody","value":{"type":"typeReference","requestBodyType":{"_type":"container","container":{"_type":"list","list":{"_type":"named","name":{"originalName":"BigUnion","camelCase":{"unsafeName":"bigUnion","safeName":"bigUnion"},"snakeCase":{"unsafeName":"big_union","safeName":"big_union"},"screamingSnakeCase":{"unsafeName":"BIG_UNION","safeName":"BIG_UNION"},"pascalCase":{"unsafeName":"BigUnion","safeName":"BigUnion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:BigUnion","default":null,"inline":null}}},"contentType":null,"docs":null}},"requestParameterName":{"originalName":"request","camelCase":{"unsafeName":"request","safeName":"request"},"snakeCase":{"unsafeName":"request","safeName":"request"},"screamingSnakeCase":{"unsafeName":"REQUEST","safeName":"REQUEST"},"pascalCase":{"unsafeName":"Request","safeName":"Request"}},"streamParameter":null},"response":{"body":{"type":"json","value":{"type":"response","responseBodyType":{"_type":"container","container":{"_type":"map","keyType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"valueType":{"_type":"primitive","primitive":{"v1":"BOOLEAN","v2":{"type":"boolean","default":null}}}}},"docs":null}},"status-code":null},"errors":[],"userSpecifiedExamples":[],"autogeneratedExamples":[{"example":{"id":"d4016f5a","url":"/many","name":null,"endpointHeaders":[],"endpointPathParameters":[],"queryParameters":[],"servicePathParameters":[],"serviceHeaders":[],"rootPathParameters":[],"request":{"type":"reference","shape":{"type":"container","container":{"type":"list","list":[{"shape":{"type":"named","shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"normalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"wireValue":"normalSweet"},"shape":{"type":"samePropertiesAsObject","typeId":"type_bigunion:NormalSweet","object":{"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"originalTypeDeclaration":{"name":{"originalName":"NormalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:NormalSweet"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"value"}}},"jsonExample":"value"}}]}}}},"typeName":{"name":{"originalName":"BigUnion","camelCase":{"unsafeName":"bigUnion","safeName":"bigUnion"},"snakeCase":{"unsafeName":"big_union","safeName":"big_union"},"screamingSnakeCase":{"unsafeName":"BIG_UNION","safeName":"BIG_UNION"},"pascalCase":{"unsafeName":"BigUnion","safeName":"BigUnion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:BigUnion"}},"jsonExample":{"type":"normalSweet","value":"value"}},{"shape":{"type":"named","shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"normalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"wireValue":"normalSweet"},"shape":{"type":"samePropertiesAsObject","typeId":"type_bigunion:NormalSweet","object":{"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"originalTypeDeclaration":{"name":{"originalName":"NormalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:NormalSweet"},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"value"}}},"jsonExample":"value"}}]}}}},"typeName":{"name":{"originalName":"BigUnion","camelCase":{"unsafeName":"bigUnion","safeName":"bigUnion"},"snakeCase":{"unsafeName":"big_union","safeName":"big_union"},"screamingSnakeCase":{"unsafeName":"BIG_UNION","safeName":"BIG_UNION"},"pascalCase":{"unsafeName":"BigUnion","safeName":"BigUnion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:BigUnion"}},"jsonExample":{"type":"normalSweet","value":"value"}}],"itemType":{"_type":"named","name":{"originalName":"BigUnion","camelCase":{"unsafeName":"bigUnion","safeName":"bigUnion"},"snakeCase":{"unsafeName":"big_union","safeName":"big_union"},"screamingSnakeCase":{"unsafeName":"BIG_UNION","safeName":"BIG_UNION"},"pascalCase":{"unsafeName":"BigUnion","safeName":"BigUnion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"typeId":"type_bigunion:BigUnion","default":null,"inline":null}}},"jsonExample":[{"type":"normalSweet","value":"value"},{"type":"normalSweet","value":"value"}]},"response":{"type":"ok","value":{"type":"body","value":{"shape":{"type":"container","container":{"type":"map","map":[{"key":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"string"}}},"jsonExample":"string"},"value":{"shape":{"type":"primitive","primitive":{"type":"boolean","boolean":true}},"jsonExample":true}}],"keyType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"valueType":{"_type":"primitive","primitive":{"v1":"BOOLEAN","v2":{"type":"boolean","default":null}}}}},"jsonExample":{"string":true}}}},"docs":null}}],"pagination":null,"transport":null,"availability":null,"docs":null}]},"service_union":{"availability":null,"name":{"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}}},"displayName":null,"basePath":{"head":"/","parts":[]},"headers":[],"pathParameters":[],"encoding":{"json":{},"proto":null},"transport":{"type":"http"},"endpoints":[{"id":"endpoint_union.get","name":{"originalName":"get","camelCase":{"unsafeName":"get","safeName":"get"},"snakeCase":{"unsafeName":"get","safeName":"get"},"screamingSnakeCase":{"unsafeName":"GET","safeName":"GET"},"pascalCase":{"unsafeName":"Get","safeName":"Get"}},"displayName":null,"auth":false,"idempotent":false,"baseUrl":null,"method":"GET","basePath":null,"path":{"head":"/","parts":[{"pathParameter":"id","tail":""}]},"fullPath":{"head":"/","parts":[{"pathParameter":"id","tail":""}]},"pathParameters":[{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"location":"ENDPOINT","variable":null,"docs":null}],"allPathParameters":[{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"valueType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"location":"ENDPOINT","variable":null,"docs":null}],"queryParameters":[],"headers":[],"requestBody":null,"sdkRequest":null,"response":{"body":{"type":"json","value":{"type":"response","responseBodyType":{"_type":"named","name":{"originalName":"Shape","camelCase":{"unsafeName":"shape","safeName":"shape"},"snakeCase":{"unsafeName":"shape","safeName":"shape"},"screamingSnakeCase":{"unsafeName":"SHAPE","safeName":"SHAPE"},"pascalCase":{"unsafeName":"Shape","safeName":"Shape"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:Shape","default":null,"inline":null},"docs":null}},"status-code":null},"errors":[],"userSpecifiedExamples":[],"autogeneratedExamples":[{"example":{"id":"1d4c2a5b","url":"/id","name":null,"endpointHeaders":[],"endpointPathParameters":[{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"id"}}},"jsonExample":"id"}}],"queryParameters":[],"servicePathParameters":[],"serviceHeaders":[],"rootPathParameters":[],"request":null,"response":{"type":"ok","value":{"type":"body","value":{"shape":{"type":"named","shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"circle","camelCase":{"unsafeName":"circle","safeName":"circle"},"snakeCase":{"unsafeName":"circle","safeName":"circle"},"screamingSnakeCase":{"unsafeName":"CIRCLE","safeName":"CIRCLE"},"pascalCase":{"unsafeName":"Circle","safeName":"Circle"}},"wireValue":"circle"},"shape":{"type":"samePropertiesAsObject","typeId":"type_union:Circle","object":{"properties":[{"name":{"name":{"originalName":"radius","camelCase":{"unsafeName":"radius","safeName":"radius"},"snakeCase":{"unsafeName":"radius","safeName":"radius"},"screamingSnakeCase":{"unsafeName":"RADIUS","safeName":"RADIUS"},"pascalCase":{"unsafeName":"Radius","safeName":"Radius"}},"wireValue":"radius"},"originalTypeDeclaration":{"name":{"originalName":"Circle","camelCase":{"unsafeName":"circle","safeName":"circle"},"snakeCase":{"unsafeName":"circle","safeName":"circle"},"screamingSnakeCase":{"unsafeName":"CIRCLE","safeName":"CIRCLE"},"pascalCase":{"unsafeName":"Circle","safeName":"Circle"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:Circle"},"value":{"shape":{"type":"primitive","primitive":{"type":"double","double":1.1}},"jsonExample":1.1}}]}}}},"typeName":{"name":{"originalName":"Shape","camelCase":{"unsafeName":"shape","safeName":"shape"},"snakeCase":{"unsafeName":"shape","safeName":"shape"},"screamingSnakeCase":{"unsafeName":"SHAPE","safeName":"SHAPE"},"pascalCase":{"unsafeName":"Shape","safeName":"Shape"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:Shape"}},"jsonExample":{"type":"circle","radius":1.1}}}},"docs":null}}],"pagination":null,"transport":null,"availability":null,"docs":null},{"id":"endpoint_union.update","name":{"originalName":"update","camelCase":{"unsafeName":"update","safeName":"update"},"snakeCase":{"unsafeName":"update","safeName":"update"},"screamingSnakeCase":{"unsafeName":"UPDATE","safeName":"UPDATE"},"pascalCase":{"unsafeName":"Update","safeName":"Update"}},"displayName":null,"auth":false,"idempotent":false,"baseUrl":null,"method":"PATCH","basePath":null,"path":{"head":"","parts":[]},"fullPath":{"head":"","parts":[]},"pathParameters":[],"allPathParameters":[],"queryParameters":[],"headers":[],"requestBody":{"type":"reference","requestBodyType":{"_type":"named","name":{"originalName":"Shape","camelCase":{"unsafeName":"shape","safeName":"shape"},"snakeCase":{"unsafeName":"shape","safeName":"shape"},"screamingSnakeCase":{"unsafeName":"SHAPE","safeName":"SHAPE"},"pascalCase":{"unsafeName":"Shape","safeName":"Shape"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:Shape","default":null,"inline":null},"contentType":null,"docs":null},"sdkRequest":{"shape":{"type":"justRequestBody","value":{"type":"typeReference","requestBodyType":{"_type":"named","name":{"originalName":"Shape","camelCase":{"unsafeName":"shape","safeName":"shape"},"snakeCase":{"unsafeName":"shape","safeName":"shape"},"screamingSnakeCase":{"unsafeName":"SHAPE","safeName":"SHAPE"},"pascalCase":{"unsafeName":"Shape","safeName":"Shape"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:Shape","default":null,"inline":null},"contentType":null,"docs":null}},"requestParameterName":{"originalName":"request","camelCase":{"unsafeName":"request","safeName":"request"},"snakeCase":{"unsafeName":"request","safeName":"request"},"screamingSnakeCase":{"unsafeName":"REQUEST","safeName":"REQUEST"},"pascalCase":{"unsafeName":"Request","safeName":"Request"}},"streamParameter":null},"response":{"body":{"type":"json","value":{"type":"response","responseBodyType":{"_type":"primitive","primitive":{"v1":"BOOLEAN","v2":{"type":"boolean","default":null}}},"docs":null}},"status-code":null},"errors":[],"userSpecifiedExamples":[],"autogeneratedExamples":[{"example":{"id":"16f7cc99","url":"","name":null,"endpointHeaders":[],"endpointPathParameters":[],"queryParameters":[],"servicePathParameters":[],"serviceHeaders":[],"rootPathParameters":[],"request":{"type":"reference","shape":{"type":"named","shape":{"type":"union","discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"singleUnionType":{"wireDiscriminantValue":{"name":{"originalName":"circle","camelCase":{"unsafeName":"circle","safeName":"circle"},"snakeCase":{"unsafeName":"circle","safeName":"circle"},"screamingSnakeCase":{"unsafeName":"CIRCLE","safeName":"CIRCLE"},"pascalCase":{"unsafeName":"Circle","safeName":"Circle"}},"wireValue":"circle"},"shape":{"type":"samePropertiesAsObject","typeId":"type_union:Circle","object":{"properties":[{"name":{"name":{"originalName":"radius","camelCase":{"unsafeName":"radius","safeName":"radius"},"snakeCase":{"unsafeName":"radius","safeName":"radius"},"screamingSnakeCase":{"unsafeName":"RADIUS","safeName":"RADIUS"},"pascalCase":{"unsafeName":"Radius","safeName":"Radius"}},"wireValue":"radius"},"originalTypeDeclaration":{"name":{"originalName":"Circle","camelCase":{"unsafeName":"circle","safeName":"circle"},"snakeCase":{"unsafeName":"circle","safeName":"circle"},"screamingSnakeCase":{"unsafeName":"CIRCLE","safeName":"CIRCLE"},"pascalCase":{"unsafeName":"Circle","safeName":"Circle"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:Circle"},"value":{"shape":{"type":"primitive","primitive":{"type":"double","double":1.1}},"jsonExample":1.1}}]}}}},"typeName":{"name":{"originalName":"Shape","camelCase":{"unsafeName":"shape","safeName":"shape"},"snakeCase":{"unsafeName":"shape","safeName":"shape"},"screamingSnakeCase":{"unsafeName":"SHAPE","safeName":"SHAPE"},"pascalCase":{"unsafeName":"Shape","safeName":"Shape"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"typeId":"type_union:Shape"}},"jsonExample":{"type":"circle","radius":1.1}},"response":{"type":"ok","value":{"type":"body","value":{"shape":{"type":"primitive","primitive":{"type":"boolean","boolean":true}},"jsonExample":true}}},"docs":null}}],"pagination":null,"transport":null,"availability":null,"docs":null}]}},"constants":{"errorInstanceIdKey":{"name":{"originalName":"errorInstanceId","camelCase":{"unsafeName":"errorInstanceId","safeName":"errorInstanceId"},"snakeCase":{"unsafeName":"error_instance_id","safeName":"error_instance_id"},"screamingSnakeCase":{"unsafeName":"ERROR_INSTANCE_ID","safeName":"ERROR_INSTANCE_ID"},"pascalCase":{"unsafeName":"ErrorInstanceId","safeName":"ErrorInstanceId"}},"wireValue":"errorInstanceId"}},"environments":null,"errorDiscriminationStrategy":{"type":"statusCode"},"basePath":null,"pathParameters":[],"variables":[],"serviceTypeReferenceInfo":{"typesReferencedOnlyByService":{"service_bigunion":["type_bigunion:BigUnion","type_bigunion:NormalSweet","type_bigunion:ThankfulFactor","type_bigunion:JumboEnd","type_bigunion:HastyPain","type_bigunion:MistySnow","type_bigunion:DistinctFailure","type_bigunion:PracticalPrinciple","type_bigunion:LimpingStep","type_bigunion:VibrantExcitement","type_bigunion:ActiveDiamond","type_bigunion:PopularLimit","type_bigunion:FalseMirror","type_bigunion:PrimaryBlock","type_bigunion:RotatingRatio","type_bigunion:ColorfulCover","type_bigunion:DisloyalValue","type_bigunion:GruesomeCoach","type_bigunion:TotalWork","type_bigunion:HarmoniousPlay","type_bigunion:UniqueStress","type_bigunion:UnwillingSmoke","type_bigunion:FrozenSleep","type_bigunion:DiligentDeal","type_bigunion:AttractiveScript","type_bigunion:HoarseMouse","type_bigunion:CircularCard","type_bigunion:PotableBad","type_bigunion:TriangularRepair","type_bigunion:GaseousRoad"],"service_union":["type_union:Shape","type_union:Circle","type_union:Square"]},"sharedTypes":["type_types:Union","type_types:UnionWithDiscriminant","type_types:UnionWithPrimitive","type_types:UnionWithDuplicatePrimitive","type_types:UnionWithoutKey","type_types:UnionWithNoProperties","type_types:UnionWithMultipleNoProperties","type_types:UnionWithLiteral","type_types:UnionWithBaseProperties","type_types:UnionWithTime","type_types:UnionWithOptionalTime","type_types:UnionWithSingleElement","type_types:UnionWithDuplicateTypes","type_types:UnionWithSubTypes","type_types:Foo","type_types:FooExtended","type_types:Bar","type_union:GetShapeRequest"]},"webhookGroups":{},"websocketChannels":{},"readmeConfig":null,"sourceConfig":null,"publishConfig":null,"dynamic":{"version":"1.0.0","types":{"type_bigunion:BigUnion":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"BigUnion","camelCase":{"unsafeName":"bigUnion","safeName":"bigUnion"},"snakeCase":{"unsafeName":"big_union","safeName":"big_union"},"screamingSnakeCase":{"unsafeName":"BIG_UNION","safeName":"BIG_UNION"},"pascalCase":{"unsafeName":"BigUnion","safeName":"BigUnion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"normalSweet":{"type":"samePropertiesAsObject","typeId":"type_bigunion:NormalSweet","discriminantValue":{"name":{"originalName":"normalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"wireValue":"normalSweet"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"thankfulFactor":{"type":"samePropertiesAsObject","typeId":"type_bigunion:ThankfulFactor","discriminantValue":{"name":{"originalName":"thankfulFactor","camelCase":{"unsafeName":"thankfulFactor","safeName":"thankfulFactor"},"snakeCase":{"unsafeName":"thankful_factor","safeName":"thankful_factor"},"screamingSnakeCase":{"unsafeName":"THANKFUL_FACTOR","safeName":"THANKFUL_FACTOR"},"pascalCase":{"unsafeName":"ThankfulFactor","safeName":"ThankfulFactor"}},"wireValue":"thankfulFactor"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"jumboEnd":{"type":"samePropertiesAsObject","typeId":"type_bigunion:JumboEnd","discriminantValue":{"name":{"originalName":"jumboEnd","camelCase":{"unsafeName":"jumboEnd","safeName":"jumboEnd"},"snakeCase":{"unsafeName":"jumbo_end","safeName":"jumbo_end"},"screamingSnakeCase":{"unsafeName":"JUMBO_END","safeName":"JUMBO_END"},"pascalCase":{"unsafeName":"JumboEnd","safeName":"JumboEnd"}},"wireValue":"jumboEnd"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"hastyPain":{"type":"samePropertiesAsObject","typeId":"type_bigunion:HastyPain","discriminantValue":{"name":{"originalName":"hastyPain","camelCase":{"unsafeName":"hastyPain","safeName":"hastyPain"},"snakeCase":{"unsafeName":"hasty_pain","safeName":"hasty_pain"},"screamingSnakeCase":{"unsafeName":"HASTY_PAIN","safeName":"HASTY_PAIN"},"pascalCase":{"unsafeName":"HastyPain","safeName":"HastyPain"}},"wireValue":"hastyPain"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"mistySnow":{"type":"samePropertiesAsObject","typeId":"type_bigunion:MistySnow","discriminantValue":{"name":{"originalName":"mistySnow","camelCase":{"unsafeName":"mistySnow","safeName":"mistySnow"},"snakeCase":{"unsafeName":"misty_snow","safeName":"misty_snow"},"screamingSnakeCase":{"unsafeName":"MISTY_SNOW","safeName":"MISTY_SNOW"},"pascalCase":{"unsafeName":"MistySnow","safeName":"MistySnow"}},"wireValue":"mistySnow"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"distinctFailure":{"type":"samePropertiesAsObject","typeId":"type_bigunion:DistinctFailure","discriminantValue":{"name":{"originalName":"distinctFailure","camelCase":{"unsafeName":"distinctFailure","safeName":"distinctFailure"},"snakeCase":{"unsafeName":"distinct_failure","safeName":"distinct_failure"},"screamingSnakeCase":{"unsafeName":"DISTINCT_FAILURE","safeName":"DISTINCT_FAILURE"},"pascalCase":{"unsafeName":"DistinctFailure","safeName":"DistinctFailure"}},"wireValue":"distinctFailure"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"practicalPrinciple":{"type":"samePropertiesAsObject","typeId":"type_bigunion:PracticalPrinciple","discriminantValue":{"name":{"originalName":"practicalPrinciple","camelCase":{"unsafeName":"practicalPrinciple","safeName":"practicalPrinciple"},"snakeCase":{"unsafeName":"practical_principle","safeName":"practical_principle"},"screamingSnakeCase":{"unsafeName":"PRACTICAL_PRINCIPLE","safeName":"PRACTICAL_PRINCIPLE"},"pascalCase":{"unsafeName":"PracticalPrinciple","safeName":"PracticalPrinciple"}},"wireValue":"practicalPrinciple"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"limpingStep":{"type":"samePropertiesAsObject","typeId":"type_bigunion:LimpingStep","discriminantValue":{"name":{"originalName":"limpingStep","camelCase":{"unsafeName":"limpingStep","safeName":"limpingStep"},"snakeCase":{"unsafeName":"limping_step","safeName":"limping_step"},"screamingSnakeCase":{"unsafeName":"LIMPING_STEP","safeName":"LIMPING_STEP"},"pascalCase":{"unsafeName":"LimpingStep","safeName":"LimpingStep"}},"wireValue":"limpingStep"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"vibrantExcitement":{"type":"samePropertiesAsObject","typeId":"type_bigunion:VibrantExcitement","discriminantValue":{"name":{"originalName":"vibrantExcitement","camelCase":{"unsafeName":"vibrantExcitement","safeName":"vibrantExcitement"},"snakeCase":{"unsafeName":"vibrant_excitement","safeName":"vibrant_excitement"},"screamingSnakeCase":{"unsafeName":"VIBRANT_EXCITEMENT","safeName":"VIBRANT_EXCITEMENT"},"pascalCase":{"unsafeName":"VibrantExcitement","safeName":"VibrantExcitement"}},"wireValue":"vibrantExcitement"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"activeDiamond":{"type":"samePropertiesAsObject","typeId":"type_bigunion:ActiveDiamond","discriminantValue":{"name":{"originalName":"activeDiamond","camelCase":{"unsafeName":"activeDiamond","safeName":"activeDiamond"},"snakeCase":{"unsafeName":"active_diamond","safeName":"active_diamond"},"screamingSnakeCase":{"unsafeName":"ACTIVE_DIAMOND","safeName":"ACTIVE_DIAMOND"},"pascalCase":{"unsafeName":"ActiveDiamond","safeName":"ActiveDiamond"}},"wireValue":"activeDiamond"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"popularLimit":{"type":"samePropertiesAsObject","typeId":"type_bigunion:PopularLimit","discriminantValue":{"name":{"originalName":"popularLimit","camelCase":{"unsafeName":"popularLimit","safeName":"popularLimit"},"snakeCase":{"unsafeName":"popular_limit","safeName":"popular_limit"},"screamingSnakeCase":{"unsafeName":"POPULAR_LIMIT","safeName":"POPULAR_LIMIT"},"pascalCase":{"unsafeName":"PopularLimit","safeName":"PopularLimit"}},"wireValue":"popularLimit"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"falseMirror":{"type":"samePropertiesAsObject","typeId":"type_bigunion:FalseMirror","discriminantValue":{"name":{"originalName":"falseMirror","camelCase":{"unsafeName":"falseMirror","safeName":"falseMirror"},"snakeCase":{"unsafeName":"false_mirror","safeName":"false_mirror"},"screamingSnakeCase":{"unsafeName":"FALSE_MIRROR","safeName":"FALSE_MIRROR"},"pascalCase":{"unsafeName":"FalseMirror","safeName":"FalseMirror"}},"wireValue":"falseMirror"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"primaryBlock":{"type":"samePropertiesAsObject","typeId":"type_bigunion:PrimaryBlock","discriminantValue":{"name":{"originalName":"primaryBlock","camelCase":{"unsafeName":"primaryBlock","safeName":"primaryBlock"},"snakeCase":{"unsafeName":"primary_block","safeName":"primary_block"},"screamingSnakeCase":{"unsafeName":"PRIMARY_BLOCK","safeName":"PRIMARY_BLOCK"},"pascalCase":{"unsafeName":"PrimaryBlock","safeName":"PrimaryBlock"}},"wireValue":"primaryBlock"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"rotatingRatio":{"type":"samePropertiesAsObject","typeId":"type_bigunion:RotatingRatio","discriminantValue":{"name":{"originalName":"rotatingRatio","camelCase":{"unsafeName":"rotatingRatio","safeName":"rotatingRatio"},"snakeCase":{"unsafeName":"rotating_ratio","safeName":"rotating_ratio"},"screamingSnakeCase":{"unsafeName":"ROTATING_RATIO","safeName":"ROTATING_RATIO"},"pascalCase":{"unsafeName":"RotatingRatio","safeName":"RotatingRatio"}},"wireValue":"rotatingRatio"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"colorfulCover":{"type":"samePropertiesAsObject","typeId":"type_bigunion:ColorfulCover","discriminantValue":{"name":{"originalName":"colorfulCover","camelCase":{"unsafeName":"colorfulCover","safeName":"colorfulCover"},"snakeCase":{"unsafeName":"colorful_cover","safeName":"colorful_cover"},"screamingSnakeCase":{"unsafeName":"COLORFUL_COVER","safeName":"COLORFUL_COVER"},"pascalCase":{"unsafeName":"ColorfulCover","safeName":"ColorfulCover"}},"wireValue":"colorfulCover"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"disloyalValue":{"type":"samePropertiesAsObject","typeId":"type_bigunion:DisloyalValue","discriminantValue":{"name":{"originalName":"disloyalValue","camelCase":{"unsafeName":"disloyalValue","safeName":"disloyalValue"},"snakeCase":{"unsafeName":"disloyal_value","safeName":"disloyal_value"},"screamingSnakeCase":{"unsafeName":"DISLOYAL_VALUE","safeName":"DISLOYAL_VALUE"},"pascalCase":{"unsafeName":"DisloyalValue","safeName":"DisloyalValue"}},"wireValue":"disloyalValue"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"gruesomeCoach":{"type":"samePropertiesAsObject","typeId":"type_bigunion:GruesomeCoach","discriminantValue":{"name":{"originalName":"gruesomeCoach","camelCase":{"unsafeName":"gruesomeCoach","safeName":"gruesomeCoach"},"snakeCase":{"unsafeName":"gruesome_coach","safeName":"gruesome_coach"},"screamingSnakeCase":{"unsafeName":"GRUESOME_COACH","safeName":"GRUESOME_COACH"},"pascalCase":{"unsafeName":"GruesomeCoach","safeName":"GruesomeCoach"}},"wireValue":"gruesomeCoach"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"totalWork":{"type":"samePropertiesAsObject","typeId":"type_bigunion:TotalWork","discriminantValue":{"name":{"originalName":"totalWork","camelCase":{"unsafeName":"totalWork","safeName":"totalWork"},"snakeCase":{"unsafeName":"total_work","safeName":"total_work"},"screamingSnakeCase":{"unsafeName":"TOTAL_WORK","safeName":"TOTAL_WORK"},"pascalCase":{"unsafeName":"TotalWork","safeName":"TotalWork"}},"wireValue":"totalWork"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"harmoniousPlay":{"type":"samePropertiesAsObject","typeId":"type_bigunion:HarmoniousPlay","discriminantValue":{"name":{"originalName":"harmoniousPlay","camelCase":{"unsafeName":"harmoniousPlay","safeName":"harmoniousPlay"},"snakeCase":{"unsafeName":"harmonious_play","safeName":"harmonious_play"},"screamingSnakeCase":{"unsafeName":"HARMONIOUS_PLAY","safeName":"HARMONIOUS_PLAY"},"pascalCase":{"unsafeName":"HarmoniousPlay","safeName":"HarmoniousPlay"}},"wireValue":"harmoniousPlay"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"uniqueStress":{"type":"samePropertiesAsObject","typeId":"type_bigunion:UniqueStress","discriminantValue":{"name":{"originalName":"uniqueStress","camelCase":{"unsafeName":"uniqueStress","safeName":"uniqueStress"},"snakeCase":{"unsafeName":"unique_stress","safeName":"unique_stress"},"screamingSnakeCase":{"unsafeName":"UNIQUE_STRESS","safeName":"UNIQUE_STRESS"},"pascalCase":{"unsafeName":"UniqueStress","safeName":"UniqueStress"}},"wireValue":"uniqueStress"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"unwillingSmoke":{"type":"samePropertiesAsObject","typeId":"type_bigunion:UnwillingSmoke","discriminantValue":{"name":{"originalName":"unwillingSmoke","camelCase":{"unsafeName":"unwillingSmoke","safeName":"unwillingSmoke"},"snakeCase":{"unsafeName":"unwilling_smoke","safeName":"unwilling_smoke"},"screamingSnakeCase":{"unsafeName":"UNWILLING_SMOKE","safeName":"UNWILLING_SMOKE"},"pascalCase":{"unsafeName":"UnwillingSmoke","safeName":"UnwillingSmoke"}},"wireValue":"unwillingSmoke"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"frozenSleep":{"type":"samePropertiesAsObject","typeId":"type_bigunion:FrozenSleep","discriminantValue":{"name":{"originalName":"frozenSleep","camelCase":{"unsafeName":"frozenSleep","safeName":"frozenSleep"},"snakeCase":{"unsafeName":"frozen_sleep","safeName":"frozen_sleep"},"screamingSnakeCase":{"unsafeName":"FROZEN_SLEEP","safeName":"FROZEN_SLEEP"},"pascalCase":{"unsafeName":"FrozenSleep","safeName":"FrozenSleep"}},"wireValue":"frozenSleep"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"diligentDeal":{"type":"samePropertiesAsObject","typeId":"type_bigunion:DiligentDeal","discriminantValue":{"name":{"originalName":"diligentDeal","camelCase":{"unsafeName":"diligentDeal","safeName":"diligentDeal"},"snakeCase":{"unsafeName":"diligent_deal","safeName":"diligent_deal"},"screamingSnakeCase":{"unsafeName":"DILIGENT_DEAL","safeName":"DILIGENT_DEAL"},"pascalCase":{"unsafeName":"DiligentDeal","safeName":"DiligentDeal"}},"wireValue":"diligentDeal"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"attractiveScript":{"type":"samePropertiesAsObject","typeId":"type_bigunion:AttractiveScript","discriminantValue":{"name":{"originalName":"attractiveScript","camelCase":{"unsafeName":"attractiveScript","safeName":"attractiveScript"},"snakeCase":{"unsafeName":"attractive_script","safeName":"attractive_script"},"screamingSnakeCase":{"unsafeName":"ATTRACTIVE_SCRIPT","safeName":"ATTRACTIVE_SCRIPT"},"pascalCase":{"unsafeName":"AttractiveScript","safeName":"AttractiveScript"}},"wireValue":"attractiveScript"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"hoarseMouse":{"type":"samePropertiesAsObject","typeId":"type_bigunion:HoarseMouse","discriminantValue":{"name":{"originalName":"hoarseMouse","camelCase":{"unsafeName":"hoarseMouse","safeName":"hoarseMouse"},"snakeCase":{"unsafeName":"hoarse_mouse","safeName":"hoarse_mouse"},"screamingSnakeCase":{"unsafeName":"HOARSE_MOUSE","safeName":"HOARSE_MOUSE"},"pascalCase":{"unsafeName":"HoarseMouse","safeName":"HoarseMouse"}},"wireValue":"hoarseMouse"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"circularCard":{"type":"samePropertiesAsObject","typeId":"type_bigunion:CircularCard","discriminantValue":{"name":{"originalName":"circularCard","camelCase":{"unsafeName":"circularCard","safeName":"circularCard"},"snakeCase":{"unsafeName":"circular_card","safeName":"circular_card"},"screamingSnakeCase":{"unsafeName":"CIRCULAR_CARD","safeName":"CIRCULAR_CARD"},"pascalCase":{"unsafeName":"CircularCard","safeName":"CircularCard"}},"wireValue":"circularCard"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"potableBad":{"type":"samePropertiesAsObject","typeId":"type_bigunion:PotableBad","discriminantValue":{"name":{"originalName":"potableBad","camelCase":{"unsafeName":"potableBad","safeName":"potableBad"},"snakeCase":{"unsafeName":"potable_bad","safeName":"potable_bad"},"screamingSnakeCase":{"unsafeName":"POTABLE_BAD","safeName":"POTABLE_BAD"},"pascalCase":{"unsafeName":"PotableBad","safeName":"PotableBad"}},"wireValue":"potableBad"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"triangularRepair":{"type":"samePropertiesAsObject","typeId":"type_bigunion:TriangularRepair","discriminantValue":{"name":{"originalName":"triangularRepair","camelCase":{"unsafeName":"triangularRepair","safeName":"triangularRepair"},"snakeCase":{"unsafeName":"triangular_repair","safeName":"triangular_repair"},"screamingSnakeCase":{"unsafeName":"TRIANGULAR_REPAIR","safeName":"TRIANGULAR_REPAIR"},"pascalCase":{"unsafeName":"TriangularRepair","safeName":"TriangularRepair"}},"wireValue":"triangularRepair"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]},"gaseousRoad":{"type":"samePropertiesAsObject","typeId":"type_bigunion:GaseousRoad","discriminantValue":{"name":{"originalName":"gaseousRoad","camelCase":{"unsafeName":"gaseousRoad","safeName":"gaseousRoad"},"snakeCase":{"unsafeName":"gaseous_road","safeName":"gaseous_road"},"screamingSnakeCase":{"unsafeName":"GASEOUS_ROAD","safeName":"GASEOUS_ROAD"},"pascalCase":{"unsafeName":"GaseousRoad","safeName":"GaseousRoad"}},"wireValue":"gaseousRoad"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"created-at","camelCase":{"unsafeName":"createdAt","safeName":"createdAt"},"snakeCase":{"unsafeName":"created_at","safeName":"created_at"},"screamingSnakeCase":{"unsafeName":"CREATED_AT","safeName":"CREATED_AT"},"pascalCase":{"unsafeName":"CreatedAt","safeName":"CreatedAt"}},"wireValue":"created-at"},"typeReference":{"type":"primitive","value":"DATE_TIME"}},{"name":{"name":{"originalName":"archived-at","camelCase":{"unsafeName":"archivedAt","safeName":"archivedAt"},"snakeCase":{"unsafeName":"archived_at","safeName":"archived_at"},"screamingSnakeCase":{"unsafeName":"ARCHIVED_AT","safeName":"ARCHIVED_AT"},"pascalCase":{"unsafeName":"ArchivedAt","safeName":"ArchivedAt"}},"wireValue":"archived-at"},"typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}}}]}}},"type_bigunion:NormalSweet":{"type":"object","declaration":{"name":{"originalName":"NormalSweet","camelCase":{"unsafeName":"normalSweet","safeName":"normalSweet"},"snakeCase":{"unsafeName":"normal_sweet","safeName":"normal_sweet"},"screamingSnakeCase":{"unsafeName":"NORMAL_SWEET","safeName":"NORMAL_SWEET"},"pascalCase":{"unsafeName":"NormalSweet","safeName":"NormalSweet"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:ThankfulFactor":{"type":"object","declaration":{"name":{"originalName":"ThankfulFactor","camelCase":{"unsafeName":"thankfulFactor","safeName":"thankfulFactor"},"snakeCase":{"unsafeName":"thankful_factor","safeName":"thankful_factor"},"screamingSnakeCase":{"unsafeName":"THANKFUL_FACTOR","safeName":"THANKFUL_FACTOR"},"pascalCase":{"unsafeName":"ThankfulFactor","safeName":"ThankfulFactor"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:JumboEnd":{"type":"object","declaration":{"name":{"originalName":"JumboEnd","camelCase":{"unsafeName":"jumboEnd","safeName":"jumboEnd"},"snakeCase":{"unsafeName":"jumbo_end","safeName":"jumbo_end"},"screamingSnakeCase":{"unsafeName":"JUMBO_END","safeName":"JUMBO_END"},"pascalCase":{"unsafeName":"JumboEnd","safeName":"JumboEnd"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:HastyPain":{"type":"object","declaration":{"name":{"originalName":"HastyPain","camelCase":{"unsafeName":"hastyPain","safeName":"hastyPain"},"snakeCase":{"unsafeName":"hasty_pain","safeName":"hasty_pain"},"screamingSnakeCase":{"unsafeName":"HASTY_PAIN","safeName":"HASTY_PAIN"},"pascalCase":{"unsafeName":"HastyPain","safeName":"HastyPain"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:MistySnow":{"type":"object","declaration":{"name":{"originalName":"MistySnow","camelCase":{"unsafeName":"mistySnow","safeName":"mistySnow"},"snakeCase":{"unsafeName":"misty_snow","safeName":"misty_snow"},"screamingSnakeCase":{"unsafeName":"MISTY_SNOW","safeName":"MISTY_SNOW"},"pascalCase":{"unsafeName":"MistySnow","safeName":"MistySnow"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:DistinctFailure":{"type":"object","declaration":{"name":{"originalName":"DistinctFailure","camelCase":{"unsafeName":"distinctFailure","safeName":"distinctFailure"},"snakeCase":{"unsafeName":"distinct_failure","safeName":"distinct_failure"},"screamingSnakeCase":{"unsafeName":"DISTINCT_FAILURE","safeName":"DISTINCT_FAILURE"},"pascalCase":{"unsafeName":"DistinctFailure","safeName":"DistinctFailure"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:PracticalPrinciple":{"type":"object","declaration":{"name":{"originalName":"PracticalPrinciple","camelCase":{"unsafeName":"practicalPrinciple","safeName":"practicalPrinciple"},"snakeCase":{"unsafeName":"practical_principle","safeName":"practical_principle"},"screamingSnakeCase":{"unsafeName":"PRACTICAL_PRINCIPLE","safeName":"PRACTICAL_PRINCIPLE"},"pascalCase":{"unsafeName":"PracticalPrinciple","safeName":"PracticalPrinciple"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:LimpingStep":{"type":"object","declaration":{"name":{"originalName":"LimpingStep","camelCase":{"unsafeName":"limpingStep","safeName":"limpingStep"},"snakeCase":{"unsafeName":"limping_step","safeName":"limping_step"},"screamingSnakeCase":{"unsafeName":"LIMPING_STEP","safeName":"LIMPING_STEP"},"pascalCase":{"unsafeName":"LimpingStep","safeName":"LimpingStep"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:VibrantExcitement":{"type":"object","declaration":{"name":{"originalName":"VibrantExcitement","camelCase":{"unsafeName":"vibrantExcitement","safeName":"vibrantExcitement"},"snakeCase":{"unsafeName":"vibrant_excitement","safeName":"vibrant_excitement"},"screamingSnakeCase":{"unsafeName":"VIBRANT_EXCITEMENT","safeName":"VIBRANT_EXCITEMENT"},"pascalCase":{"unsafeName":"VibrantExcitement","safeName":"VibrantExcitement"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:ActiveDiamond":{"type":"object","declaration":{"name":{"originalName":"ActiveDiamond","camelCase":{"unsafeName":"activeDiamond","safeName":"activeDiamond"},"snakeCase":{"unsafeName":"active_diamond","safeName":"active_diamond"},"screamingSnakeCase":{"unsafeName":"ACTIVE_DIAMOND","safeName":"ACTIVE_DIAMOND"},"pascalCase":{"unsafeName":"ActiveDiamond","safeName":"ActiveDiamond"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:PopularLimit":{"type":"object","declaration":{"name":{"originalName":"PopularLimit","camelCase":{"unsafeName":"popularLimit","safeName":"popularLimit"},"snakeCase":{"unsafeName":"popular_limit","safeName":"popular_limit"},"screamingSnakeCase":{"unsafeName":"POPULAR_LIMIT","safeName":"POPULAR_LIMIT"},"pascalCase":{"unsafeName":"PopularLimit","safeName":"PopularLimit"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:FalseMirror":{"type":"object","declaration":{"name":{"originalName":"FalseMirror","camelCase":{"unsafeName":"falseMirror","safeName":"falseMirror"},"snakeCase":{"unsafeName":"false_mirror","safeName":"false_mirror"},"screamingSnakeCase":{"unsafeName":"FALSE_MIRROR","safeName":"FALSE_MIRROR"},"pascalCase":{"unsafeName":"FalseMirror","safeName":"FalseMirror"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:PrimaryBlock":{"type":"object","declaration":{"name":{"originalName":"PrimaryBlock","camelCase":{"unsafeName":"primaryBlock","safeName":"primaryBlock"},"snakeCase":{"unsafeName":"primary_block","safeName":"primary_block"},"screamingSnakeCase":{"unsafeName":"PRIMARY_BLOCK","safeName":"PRIMARY_BLOCK"},"pascalCase":{"unsafeName":"PrimaryBlock","safeName":"PrimaryBlock"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:RotatingRatio":{"type":"object","declaration":{"name":{"originalName":"RotatingRatio","camelCase":{"unsafeName":"rotatingRatio","safeName":"rotatingRatio"},"snakeCase":{"unsafeName":"rotating_ratio","safeName":"rotating_ratio"},"screamingSnakeCase":{"unsafeName":"ROTATING_RATIO","safeName":"ROTATING_RATIO"},"pascalCase":{"unsafeName":"RotatingRatio","safeName":"RotatingRatio"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:ColorfulCover":{"type":"object","declaration":{"name":{"originalName":"ColorfulCover","camelCase":{"unsafeName":"colorfulCover","safeName":"colorfulCover"},"snakeCase":{"unsafeName":"colorful_cover","safeName":"colorful_cover"},"screamingSnakeCase":{"unsafeName":"COLORFUL_COVER","safeName":"COLORFUL_COVER"},"pascalCase":{"unsafeName":"ColorfulCover","safeName":"ColorfulCover"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:DisloyalValue":{"type":"object","declaration":{"name":{"originalName":"DisloyalValue","camelCase":{"unsafeName":"disloyalValue","safeName":"disloyalValue"},"snakeCase":{"unsafeName":"disloyal_value","safeName":"disloyal_value"},"screamingSnakeCase":{"unsafeName":"DISLOYAL_VALUE","safeName":"DISLOYAL_VALUE"},"pascalCase":{"unsafeName":"DisloyalValue","safeName":"DisloyalValue"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:GruesomeCoach":{"type":"object","declaration":{"name":{"originalName":"GruesomeCoach","camelCase":{"unsafeName":"gruesomeCoach","safeName":"gruesomeCoach"},"snakeCase":{"unsafeName":"gruesome_coach","safeName":"gruesome_coach"},"screamingSnakeCase":{"unsafeName":"GRUESOME_COACH","safeName":"GRUESOME_COACH"},"pascalCase":{"unsafeName":"GruesomeCoach","safeName":"GruesomeCoach"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:TotalWork":{"type":"object","declaration":{"name":{"originalName":"TotalWork","camelCase":{"unsafeName":"totalWork","safeName":"totalWork"},"snakeCase":{"unsafeName":"total_work","safeName":"total_work"},"screamingSnakeCase":{"unsafeName":"TOTAL_WORK","safeName":"TOTAL_WORK"},"pascalCase":{"unsafeName":"TotalWork","safeName":"TotalWork"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:HarmoniousPlay":{"type":"object","declaration":{"name":{"originalName":"HarmoniousPlay","camelCase":{"unsafeName":"harmoniousPlay","safeName":"harmoniousPlay"},"snakeCase":{"unsafeName":"harmonious_play","safeName":"harmonious_play"},"screamingSnakeCase":{"unsafeName":"HARMONIOUS_PLAY","safeName":"HARMONIOUS_PLAY"},"pascalCase":{"unsafeName":"HarmoniousPlay","safeName":"HarmoniousPlay"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:UniqueStress":{"type":"object","declaration":{"name":{"originalName":"UniqueStress","camelCase":{"unsafeName":"uniqueStress","safeName":"uniqueStress"},"snakeCase":{"unsafeName":"unique_stress","safeName":"unique_stress"},"screamingSnakeCase":{"unsafeName":"UNIQUE_STRESS","safeName":"UNIQUE_STRESS"},"pascalCase":{"unsafeName":"UniqueStress","safeName":"UniqueStress"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:UnwillingSmoke":{"type":"object","declaration":{"name":{"originalName":"UnwillingSmoke","camelCase":{"unsafeName":"unwillingSmoke","safeName":"unwillingSmoke"},"snakeCase":{"unsafeName":"unwilling_smoke","safeName":"unwilling_smoke"},"screamingSnakeCase":{"unsafeName":"UNWILLING_SMOKE","safeName":"UNWILLING_SMOKE"},"pascalCase":{"unsafeName":"UnwillingSmoke","safeName":"UnwillingSmoke"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:FrozenSleep":{"type":"object","declaration":{"name":{"originalName":"FrozenSleep","camelCase":{"unsafeName":"frozenSleep","safeName":"frozenSleep"},"snakeCase":{"unsafeName":"frozen_sleep","safeName":"frozen_sleep"},"screamingSnakeCase":{"unsafeName":"FROZEN_SLEEP","safeName":"FROZEN_SLEEP"},"pascalCase":{"unsafeName":"FrozenSleep","safeName":"FrozenSleep"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:DiligentDeal":{"type":"object","declaration":{"name":{"originalName":"DiligentDeal","camelCase":{"unsafeName":"diligentDeal","safeName":"diligentDeal"},"snakeCase":{"unsafeName":"diligent_deal","safeName":"diligent_deal"},"screamingSnakeCase":{"unsafeName":"DILIGENT_DEAL","safeName":"DILIGENT_DEAL"},"pascalCase":{"unsafeName":"DiligentDeal","safeName":"DiligentDeal"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:AttractiveScript":{"type":"object","declaration":{"name":{"originalName":"AttractiveScript","camelCase":{"unsafeName":"attractiveScript","safeName":"attractiveScript"},"snakeCase":{"unsafeName":"attractive_script","safeName":"attractive_script"},"screamingSnakeCase":{"unsafeName":"ATTRACTIVE_SCRIPT","safeName":"ATTRACTIVE_SCRIPT"},"pascalCase":{"unsafeName":"AttractiveScript","safeName":"AttractiveScript"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:HoarseMouse":{"type":"object","declaration":{"name":{"originalName":"HoarseMouse","camelCase":{"unsafeName":"hoarseMouse","safeName":"hoarseMouse"},"snakeCase":{"unsafeName":"hoarse_mouse","safeName":"hoarse_mouse"},"screamingSnakeCase":{"unsafeName":"HOARSE_MOUSE","safeName":"HOARSE_MOUSE"},"pascalCase":{"unsafeName":"HoarseMouse","safeName":"HoarseMouse"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:CircularCard":{"type":"object","declaration":{"name":{"originalName":"CircularCard","camelCase":{"unsafeName":"circularCard","safeName":"circularCard"},"snakeCase":{"unsafeName":"circular_card","safeName":"circular_card"},"screamingSnakeCase":{"unsafeName":"CIRCULAR_CARD","safeName":"CIRCULAR_CARD"},"pascalCase":{"unsafeName":"CircularCard","safeName":"CircularCard"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:PotableBad":{"type":"object","declaration":{"name":{"originalName":"PotableBad","camelCase":{"unsafeName":"potableBad","safeName":"potableBad"},"snakeCase":{"unsafeName":"potable_bad","safeName":"potable_bad"},"screamingSnakeCase":{"unsafeName":"POTABLE_BAD","safeName":"POTABLE_BAD"},"pascalCase":{"unsafeName":"PotableBad","safeName":"PotableBad"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:TriangularRepair":{"type":"object","declaration":{"name":{"originalName":"TriangularRepair","camelCase":{"unsafeName":"triangularRepair","safeName":"triangularRepair"},"snakeCase":{"unsafeName":"triangular_repair","safeName":"triangular_repair"},"screamingSnakeCase":{"unsafeName":"TRIANGULAR_REPAIR","safeName":"TRIANGULAR_REPAIR"},"pascalCase":{"unsafeName":"TriangularRepair","safeName":"TriangularRepair"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_bigunion:GaseousRoad":{"type":"object","declaration":{"name":{"originalName":"GaseousRoad","camelCase":{"unsafeName":"gaseousRoad","safeName":"gaseousRoad"},"snakeCase":{"unsafeName":"gaseous_road","safeName":"gaseous_road"},"screamingSnakeCase":{"unsafeName":"GASEOUS_ROAD","safeName":"GASEOUS_ROAD"},"pascalCase":{"unsafeName":"GaseousRoad","safeName":"GaseousRoad"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"properties":[{"name":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_types:Union":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"Union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"foo":{"type":"singleProperty","typeReference":{"type":"named","value":"type_types:Foo"},"discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"properties":null},"bar":{"type":"singleProperty","typeReference":{"type":"named","value":"type_types:Bar"},"discriminantValue":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"properties":null}}},"type_types:UnionWithDiscriminant":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithDiscriminant","camelCase":{"unsafeName":"unionWithDiscriminant","safeName":"unionWithDiscriminant"},"snakeCase":{"unsafeName":"union_with_discriminant","safeName":"union_with_discriminant"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_DISCRIMINANT","safeName":"UNION_WITH_DISCRIMINANT"},"pascalCase":{"unsafeName":"UnionWithDiscriminant","safeName":"UnionWithDiscriminant"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"_type"},"types":{"foo":{"type":"singleProperty","typeReference":{"type":"named","value":"type_types:Foo"},"discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"properties":null},"bar":{"type":"singleProperty","typeReference":{"type":"named","value":"type_types:Bar"},"discriminantValue":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"properties":null}}},"type_types:UnionWithPrimitive":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithPrimitive","camelCase":{"unsafeName":"unionWithPrimitive","safeName":"unionWithPrimitive"},"snakeCase":{"unsafeName":"union_with_primitive","safeName":"union_with_primitive"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_PRIMITIVE","safeName":"UNION_WITH_PRIMITIVE"},"pascalCase":{"unsafeName":"UnionWithPrimitive","safeName":"UnionWithPrimitive"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"integer":{"type":"singleProperty","typeReference":{"type":"primitive","value":"INTEGER"},"discriminantValue":{"name":{"originalName":"integer","camelCase":{"unsafeName":"integer","safeName":"integer"},"snakeCase":{"unsafeName":"integer","safeName":"integer"},"screamingSnakeCase":{"unsafeName":"INTEGER","safeName":"INTEGER"},"pascalCase":{"unsafeName":"Integer","safeName":"Integer"}},"wireValue":"integer"},"properties":null},"string":{"type":"singleProperty","typeReference":{"type":"primitive","value":"STRING"},"discriminantValue":{"name":{"originalName":"string","camelCase":{"unsafeName":"string","safeName":"string"},"snakeCase":{"unsafeName":"string","safeName":"string"},"screamingSnakeCase":{"unsafeName":"STRING","safeName":"STRING"},"pascalCase":{"unsafeName":"String","safeName":"String"}},"wireValue":"string"},"properties":null}}},"type_types:UnionWithDuplicatePrimitive":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithDuplicatePrimitive","camelCase":{"unsafeName":"unionWithDuplicatePrimitive","safeName":"unionWithDuplicatePrimitive"},"snakeCase":{"unsafeName":"union_with_duplicate_primitive","safeName":"union_with_duplicate_primitive"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_DUPLICATE_PRIMITIVE","safeName":"UNION_WITH_DUPLICATE_PRIMITIVE"},"pascalCase":{"unsafeName":"UnionWithDuplicatePrimitive","safeName":"UnionWithDuplicatePrimitive"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"integer1":{"type":"singleProperty","typeReference":{"type":"primitive","value":"INTEGER"},"discriminantValue":{"name":{"originalName":"integer1","camelCase":{"unsafeName":"integer1","safeName":"integer1"},"snakeCase":{"unsafeName":"integer_1","safeName":"integer_1"},"screamingSnakeCase":{"unsafeName":"INTEGER_1","safeName":"INTEGER_1"},"pascalCase":{"unsafeName":"Integer1","safeName":"Integer1"}},"wireValue":"integer1"},"properties":null},"integer2":{"type":"singleProperty","typeReference":{"type":"primitive","value":"INTEGER"},"discriminantValue":{"name":{"originalName":"integer2","camelCase":{"unsafeName":"integer2","safeName":"integer2"},"snakeCase":{"unsafeName":"integer_2","safeName":"integer_2"},"screamingSnakeCase":{"unsafeName":"INTEGER_2","safeName":"INTEGER_2"},"pascalCase":{"unsafeName":"Integer2","safeName":"Integer2"}},"wireValue":"integer2"},"properties":null},"string1":{"type":"singleProperty","typeReference":{"type":"primitive","value":"STRING"},"discriminantValue":{"name":{"originalName":"string1","camelCase":{"unsafeName":"string1","safeName":"string1"},"snakeCase":{"unsafeName":"string_1","safeName":"string_1"},"screamingSnakeCase":{"unsafeName":"STRING_1","safeName":"STRING_1"},"pascalCase":{"unsafeName":"String1","safeName":"String1"}},"wireValue":"string1"},"properties":null},"string2":{"type":"singleProperty","typeReference":{"type":"primitive","value":"STRING"},"discriminantValue":{"name":{"originalName":"string2","camelCase":{"unsafeName":"string2","safeName":"string2"},"snakeCase":{"unsafeName":"string_2","safeName":"string_2"},"screamingSnakeCase":{"unsafeName":"STRING_2","safeName":"STRING_2"},"pascalCase":{"unsafeName":"String2","safeName":"String2"}},"wireValue":"string2"},"properties":null}}},"type_types:UnionWithoutKey":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithoutKey","camelCase":{"unsafeName":"unionWithoutKey","safeName":"unionWithoutKey"},"snakeCase":{"unsafeName":"union_without_key","safeName":"union_without_key"},"screamingSnakeCase":{"unsafeName":"UNION_WITHOUT_KEY","safeName":"UNION_WITHOUT_KEY"},"pascalCase":{"unsafeName":"UnionWithoutKey","safeName":"UnionWithoutKey"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"foo":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"properties":[]},"bar":{"type":"samePropertiesAsObject","typeId":"type_types:Bar","discriminantValue":{"name":{"originalName":"bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"wireValue":"bar"},"properties":[]}}},"type_types:UnionWithNoProperties":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithNoProperties","camelCase":{"unsafeName":"unionWithNoProperties","safeName":"unionWithNoProperties"},"snakeCase":{"unsafeName":"union_with_no_properties","safeName":"union_with_no_properties"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_NO_PROPERTIES","safeName":"UNION_WITH_NO_PROPERTIES"},"pascalCase":{"unsafeName":"UnionWithNoProperties","safeName":"UnionWithNoProperties"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"foo":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"properties":[]},"empty":{"type":"noProperties","discriminantValue":{"name":{"originalName":"empty","camelCase":{"unsafeName":"empty","safeName":"empty"},"snakeCase":{"unsafeName":"empty","safeName":"empty"},"screamingSnakeCase":{"unsafeName":"EMPTY","safeName":"EMPTY"},"pascalCase":{"unsafeName":"Empty","safeName":"Empty"}},"wireValue":"empty"},"properties":null}}},"type_types:UnionWithMultipleNoProperties":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithMultipleNoProperties","camelCase":{"unsafeName":"unionWithMultipleNoProperties","safeName":"unionWithMultipleNoProperties"},"snakeCase":{"unsafeName":"union_with_multiple_no_properties","safeName":"union_with_multiple_no_properties"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_MULTIPLE_NO_PROPERTIES","safeName":"UNION_WITH_MULTIPLE_NO_PROPERTIES"},"pascalCase":{"unsafeName":"UnionWithMultipleNoProperties","safeName":"UnionWithMultipleNoProperties"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"foo":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"properties":[]},"empty1":{"type":"noProperties","discriminantValue":{"name":{"originalName":"empty1","camelCase":{"unsafeName":"empty1","safeName":"empty1"},"snakeCase":{"unsafeName":"empty_1","safeName":"empty_1"},"screamingSnakeCase":{"unsafeName":"EMPTY_1","safeName":"EMPTY_1"},"pascalCase":{"unsafeName":"Empty1","safeName":"Empty1"}},"wireValue":"empty1"},"properties":null},"empty2":{"type":"noProperties","discriminantValue":{"name":{"originalName":"empty2","camelCase":{"unsafeName":"empty2","safeName":"empty2"},"snakeCase":{"unsafeName":"empty_2","safeName":"empty_2"},"screamingSnakeCase":{"unsafeName":"EMPTY_2","safeName":"EMPTY_2"},"pascalCase":{"unsafeName":"Empty2","safeName":"Empty2"}},"wireValue":"empty2"},"properties":null}}},"type_types:UnionWithLiteral":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithLiteral","camelCase":{"unsafeName":"unionWithLiteral","safeName":"unionWithLiteral"},"snakeCase":{"unsafeName":"union_with_literal","safeName":"union_with_literal"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_LITERAL","safeName":"UNION_WITH_LITERAL"},"pascalCase":{"unsafeName":"UnionWithLiteral","safeName":"UnionWithLiteral"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"fern":{"type":"singleProperty","typeReference":{"type":"literal","value":{"type":"string","value":"fern"}},"discriminantValue":{"name":{"originalName":"fern","camelCase":{"unsafeName":"fern","safeName":"fern"},"snakeCase":{"unsafeName":"fern","safeName":"fern"},"screamingSnakeCase":{"unsafeName":"FERN","safeName":"FERN"},"pascalCase":{"unsafeName":"Fern","safeName":"Fern"}},"wireValue":"fern"},"properties":[{"name":{"name":{"originalName":"base","camelCase":{"unsafeName":"base","safeName":"base"},"snakeCase":{"unsafeName":"base","safeName":"base"},"screamingSnakeCase":{"unsafeName":"BASE","safeName":"BASE"},"pascalCase":{"unsafeName":"Base","safeName":"Base"}},"wireValue":"base"},"typeReference":{"type":"literal","value":{"type":"string","value":"base"}}}]}}},"type_types:UnionWithBaseProperties":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithBaseProperties","camelCase":{"unsafeName":"unionWithBaseProperties","safeName":"unionWithBaseProperties"},"snakeCase":{"unsafeName":"union_with_base_properties","safeName":"union_with_base_properties"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_BASE_PROPERTIES","safeName":"UNION_WITH_BASE_PROPERTIES"},"pascalCase":{"unsafeName":"UnionWithBaseProperties","safeName":"UnionWithBaseProperties"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"integer":{"type":"singleProperty","typeReference":{"type":"primitive","value":"INTEGER"},"discriminantValue":{"name":{"originalName":"integer","camelCase":{"unsafeName":"integer","safeName":"integer"},"snakeCase":{"unsafeName":"integer","safeName":"integer"},"screamingSnakeCase":{"unsafeName":"INTEGER","safeName":"INTEGER"},"pascalCase":{"unsafeName":"Integer","safeName":"Integer"}},"wireValue":"integer"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}}]},"string":{"type":"singleProperty","typeReference":{"type":"primitive","value":"STRING"},"discriminantValue":{"name":{"originalName":"string","camelCase":{"unsafeName":"string","safeName":"string"},"snakeCase":{"unsafeName":"string","safeName":"string"},"screamingSnakeCase":{"unsafeName":"STRING","safeName":"STRING"},"pascalCase":{"unsafeName":"String","safeName":"String"}},"wireValue":"string"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}}]},"foo":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}}]}}},"type_types:UnionWithTime":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithTime","camelCase":{"unsafeName":"unionWithTime","safeName":"unionWithTime"},"snakeCase":{"unsafeName":"union_with_time","safeName":"union_with_time"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_TIME","safeName":"UNION_WITH_TIME"},"pascalCase":{"unsafeName":"UnionWithTime","safeName":"UnionWithTime"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"value":{"type":"singleProperty","typeReference":{"type":"primitive","value":"INTEGER"},"discriminantValue":{"name":{"originalName":"value","camelCase":{"unsafeName":"value","safeName":"value"},"snakeCase":{"unsafeName":"value","safeName":"value"},"screamingSnakeCase":{"unsafeName":"VALUE","safeName":"VALUE"},"pascalCase":{"unsafeName":"Value","safeName":"Value"}},"wireValue":"value"},"properties":null},"date":{"type":"singleProperty","typeReference":{"type":"primitive","value":"DATE"},"discriminantValue":{"name":{"originalName":"date","camelCase":{"unsafeName":"date","safeName":"date"},"snakeCase":{"unsafeName":"date","safeName":"date"},"screamingSnakeCase":{"unsafeName":"DATE","safeName":"DATE"},"pascalCase":{"unsafeName":"Date","safeName":"Date"}},"wireValue":"date"},"properties":null},"datetime":{"type":"singleProperty","typeReference":{"type":"primitive","value":"DATE_TIME"},"discriminantValue":{"name":{"originalName":"datetime","camelCase":{"unsafeName":"datetime","safeName":"datetime"},"snakeCase":{"unsafeName":"datetime","safeName":"datetime"},"screamingSnakeCase":{"unsafeName":"DATETIME","safeName":"DATETIME"},"pascalCase":{"unsafeName":"Datetime","safeName":"Datetime"}},"wireValue":"datetime"},"properties":null}}},"type_types:UnionWithOptionalTime":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithOptionalTime","camelCase":{"unsafeName":"unionWithOptionalTime","safeName":"unionWithOptionalTime"},"snakeCase":{"unsafeName":"union_with_optional_time","safeName":"union_with_optional_time"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_OPTIONAL_TIME","safeName":"UNION_WITH_OPTIONAL_TIME"},"pascalCase":{"unsafeName":"UnionWithOptionalTime","safeName":"UnionWithOptionalTime"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"date":{"type":"singleProperty","typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE"}},"discriminantValue":{"name":{"originalName":"date","camelCase":{"unsafeName":"date","safeName":"date"},"snakeCase":{"unsafeName":"date","safeName":"date"},"screamingSnakeCase":{"unsafeName":"DATE","safeName":"DATE"},"pascalCase":{"unsafeName":"Date","safeName":"Date"}},"wireValue":"date"},"properties":null},"datetime":{"type":"singleProperty","typeReference":{"type":"optional","value":{"type":"primitive","value":"DATE_TIME"}},"discriminantValue":{"name":{"originalName":"datetime","camelCase":{"unsafeName":"datetime","safeName":"datetime"},"snakeCase":{"unsafeName":"datetime","safeName":"datetime"},"screamingSnakeCase":{"unsafeName":"DATETIME","safeName":"DATETIME"},"pascalCase":{"unsafeName":"Datetime","safeName":"Datetime"}},"wireValue":"datetime"},"properties":null}}},"type_types:UnionWithSingleElement":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithSingleElement","camelCase":{"unsafeName":"unionWithSingleElement","safeName":"unionWithSingleElement"},"snakeCase":{"unsafeName":"union_with_single_element","safeName":"union_with_single_element"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_SINGLE_ELEMENT","safeName":"UNION_WITH_SINGLE_ELEMENT"},"pascalCase":{"unsafeName":"UnionWithSingleElement","safeName":"UnionWithSingleElement"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"foo":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"properties":[]}}},"type_types:UnionWithDuplicateTypes":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithDuplicateTypes","camelCase":{"unsafeName":"unionWithDuplicateTypes","safeName":"unionWithDuplicateTypes"},"snakeCase":{"unsafeName":"union_with_duplicate_types","safeName":"union_with_duplicate_types"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_DUPLICATE_TYPES","safeName":"UNION_WITH_DUPLICATE_TYPES"},"pascalCase":{"unsafeName":"UnionWithDuplicateTypes","safeName":"UnionWithDuplicateTypes"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"foo1":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","discriminantValue":{"name":{"originalName":"foo1","camelCase":{"unsafeName":"foo1","safeName":"foo1"},"snakeCase":{"unsafeName":"foo_1","safeName":"foo_1"},"screamingSnakeCase":{"unsafeName":"FOO_1","safeName":"FOO_1"},"pascalCase":{"unsafeName":"Foo1","safeName":"Foo1"}},"wireValue":"foo1"},"properties":[]},"foo2":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","discriminantValue":{"name":{"originalName":"foo2","camelCase":{"unsafeName":"foo2","safeName":"foo2"},"snakeCase":{"unsafeName":"foo_2","safeName":"foo_2"},"screamingSnakeCase":{"unsafeName":"FOO_2","safeName":"FOO_2"},"pascalCase":{"unsafeName":"Foo2","safeName":"Foo2"}},"wireValue":"foo2"},"properties":[]}}},"type_types:UnionWithSubTypes":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"UnionWithSubTypes","camelCase":{"unsafeName":"unionWithSubTypes","safeName":"unionWithSubTypes"},"snakeCase":{"unsafeName":"union_with_sub_types","safeName":"union_with_sub_types"},"screamingSnakeCase":{"unsafeName":"UNION_WITH_SUB_TYPES","safeName":"UNION_WITH_SUB_TYPES"},"pascalCase":{"unsafeName":"UnionWithSubTypes","safeName":"UnionWithSubTypes"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"foo":{"type":"samePropertiesAsObject","typeId":"type_types:Foo","discriminantValue":{"name":{"originalName":"foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"wireValue":"foo"},"properties":[]},"fooExtended":{"type":"samePropertiesAsObject","typeId":"type_types:FooExtended","discriminantValue":{"name":{"originalName":"fooExtended","camelCase":{"unsafeName":"fooExtended","safeName":"fooExtended"},"snakeCase":{"unsafeName":"foo_extended","safeName":"foo_extended"},"screamingSnakeCase":{"unsafeName":"FOO_EXTENDED","safeName":"FOO_EXTENDED"},"pascalCase":{"unsafeName":"FooExtended","safeName":"FooExtended"}},"wireValue":"fooExtended"},"properties":[]}}},"type_types:Foo":{"type":"object","declaration":{"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_types:FooExtended":{"type":"object","declaration":{"name":{"originalName":"FooExtended","camelCase":{"unsafeName":"fooExtended","safeName":"fooExtended"},"snakeCase":{"unsafeName":"foo_extended","safeName":"foo_extended"},"screamingSnakeCase":{"unsafeName":"FOO_EXTENDED","safeName":"FOO_EXTENDED"},"pascalCase":{"unsafeName":"FooExtended","safeName":"FooExtended"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"typeReference":{"type":"primitive","value":"STRING"}},{"name":{"name":{"originalName":"age","camelCase":{"unsafeName":"age","safeName":"age"},"snakeCase":{"unsafeName":"age","safeName":"age"},"screamingSnakeCase":{"unsafeName":"AGE","safeName":"AGE"},"pascalCase":{"unsafeName":"Age","safeName":"Age"}},"wireValue":"age"},"typeReference":{"type":"primitive","value":"INTEGER"}}]},"type_types:Bar":{"type":"object","declaration":{"name":{"originalName":"Bar","camelCase":{"unsafeName":"bar","safeName":"bar"},"snakeCase":{"unsafeName":"bar","safeName":"bar"},"screamingSnakeCase":{"unsafeName":"BAR","safeName":"BAR"},"pascalCase":{"unsafeName":"Bar","safeName":"Bar"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}}},"properties":[{"name":{"name":{"originalName":"name","camelCase":{"unsafeName":"name","safeName":"name"},"snakeCase":{"unsafeName":"name","safeName":"name"},"screamingSnakeCase":{"unsafeName":"NAME","safeName":"NAME"},"pascalCase":{"unsafeName":"Name","safeName":"Name"}},"wireValue":"name"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_union:GetShapeRequest":{"type":"object","declaration":{"name":{"originalName":"GetShapeRequest","camelCase":{"unsafeName":"getShapeRequest","safeName":"getShapeRequest"},"snakeCase":{"unsafeName":"get_shape_request","safeName":"get_shape_request"},"screamingSnakeCase":{"unsafeName":"GET_SHAPE_REQUEST","safeName":"GET_SHAPE_REQUEST"},"pascalCase":{"unsafeName":"GetShapeRequest","safeName":"GetShapeRequest"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}}},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}}]},"type_union:Shape":{"type":"discriminatedUnion","declaration":{"name":{"originalName":"Shape","camelCase":{"unsafeName":"shape","safeName":"shape"},"snakeCase":{"unsafeName":"shape","safeName":"shape"},"screamingSnakeCase":{"unsafeName":"SHAPE","safeName":"SHAPE"},"pascalCase":{"unsafeName":"Shape","safeName":"Shape"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}}},"discriminant":{"name":{"originalName":"type","camelCase":{"unsafeName":"type","safeName":"type"},"snakeCase":{"unsafeName":"type","safeName":"type"},"screamingSnakeCase":{"unsafeName":"TYPE","safeName":"TYPE"},"pascalCase":{"unsafeName":"Type","safeName":"Type"}},"wireValue":"type"},"types":{"circle":{"type":"samePropertiesAsObject","typeId":"type_union:Circle","discriminantValue":{"name":{"originalName":"circle","camelCase":{"unsafeName":"circle","safeName":"circle"},"snakeCase":{"unsafeName":"circle","safeName":"circle"},"screamingSnakeCase":{"unsafeName":"CIRCLE","safeName":"CIRCLE"},"pascalCase":{"unsafeName":"Circle","safeName":"Circle"}},"wireValue":"circle"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}}]},"square":{"type":"samePropertiesAsObject","typeId":"type_union:Square","discriminantValue":{"name":{"originalName":"square","camelCase":{"unsafeName":"square","safeName":"square"},"snakeCase":{"unsafeName":"square","safeName":"square"},"screamingSnakeCase":{"unsafeName":"SQUARE","safeName":"SQUARE"},"pascalCase":{"unsafeName":"Square","safeName":"Square"}},"wireValue":"square"},"properties":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}}]}}},"type_union:Circle":{"type":"object","declaration":{"name":{"originalName":"Circle","camelCase":{"unsafeName":"circle","safeName":"circle"},"snakeCase":{"unsafeName":"circle","safeName":"circle"},"screamingSnakeCase":{"unsafeName":"CIRCLE","safeName":"CIRCLE"},"pascalCase":{"unsafeName":"Circle","safeName":"Circle"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}}},"properties":[{"name":{"name":{"originalName":"radius","camelCase":{"unsafeName":"radius","safeName":"radius"},"snakeCase":{"unsafeName":"radius","safeName":"radius"},"screamingSnakeCase":{"unsafeName":"RADIUS","safeName":"RADIUS"},"pascalCase":{"unsafeName":"Radius","safeName":"Radius"}},"wireValue":"radius"},"typeReference":{"type":"primitive","value":"DOUBLE"}}]},"type_union:Square":{"type":"object","declaration":{"name":{"originalName":"Square","camelCase":{"unsafeName":"square","safeName":"square"},"snakeCase":{"unsafeName":"square","safeName":"square"},"screamingSnakeCase":{"unsafeName":"SQUARE","safeName":"SQUARE"},"pascalCase":{"unsafeName":"Square","safeName":"Square"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}}},"properties":[{"name":{"name":{"originalName":"length","camelCase":{"unsafeName":"length","safeName":"length"},"snakeCase":{"unsafeName":"length","safeName":"length"},"screamingSnakeCase":{"unsafeName":"LENGTH","safeName":"LENGTH"},"pascalCase":{"unsafeName":"Length","safeName":"Length"}},"wireValue":"length"},"typeReference":{"type":"primitive","value":"DOUBLE"}}]}},"headers":[],"endpoints":{"endpoint_bigunion.get":{"auth":null,"declaration":{"name":{"originalName":"get","camelCase":{"unsafeName":"get","safeName":"get"},"snakeCase":{"unsafeName":"get","safeName":"get"},"screamingSnakeCase":{"unsafeName":"GET","safeName":"GET"},"pascalCase":{"unsafeName":"Get","safeName":"Get"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"location":{"method":"GET","path":"/{id}"},"request":{"type":"body","pathParameters":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}}],"body":null},"response":{"type":"json"}},"endpoint_bigunion.update":{"auth":null,"declaration":{"name":{"originalName":"update","camelCase":{"unsafeName":"update","safeName":"update"},"snakeCase":{"unsafeName":"update","safeName":"update"},"screamingSnakeCase":{"unsafeName":"UPDATE","safeName":"UPDATE"},"pascalCase":{"unsafeName":"Update","safeName":"Update"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"location":{"method":"PATCH","path":"/"},"request":{"type":"body","pathParameters":[],"body":{"type":"typeReference","value":{"type":"named","value":"type_bigunion:BigUnion"}}},"response":{"type":"json"}},"endpoint_bigunion.update-many":{"auth":null,"declaration":{"name":{"originalName":"update-many","camelCase":{"unsafeName":"updateMany","safeName":"updateMany"},"snakeCase":{"unsafeName":"update_many","safeName":"update_many"},"screamingSnakeCase":{"unsafeName":"UPDATE_MANY","safeName":"UPDATE_MANY"},"pascalCase":{"unsafeName":"UpdateMany","safeName":"UpdateMany"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}}},"location":{"method":"PATCH","path":"/many"},"request":{"type":"body","pathParameters":[],"body":{"type":"typeReference","value":{"type":"list","value":{"type":"named","value":"type_bigunion:BigUnion"}}}},"response":{"type":"json"}},"endpoint_union.get":{"auth":null,"declaration":{"name":{"originalName":"get","camelCase":{"unsafeName":"get","safeName":"get"},"snakeCase":{"unsafeName":"get","safeName":"get"},"screamingSnakeCase":{"unsafeName":"GET","safeName":"GET"},"pascalCase":{"unsafeName":"Get","safeName":"Get"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}}},"location":{"method":"GET","path":"/{id}"},"request":{"type":"body","pathParameters":[{"name":{"name":{"originalName":"id","camelCase":{"unsafeName":"id","safeName":"id"},"snakeCase":{"unsafeName":"id","safeName":"id"},"screamingSnakeCase":{"unsafeName":"ID","safeName":"ID"},"pascalCase":{"unsafeName":"Id","safeName":"Id"}},"wireValue":"id"},"typeReference":{"type":"primitive","value":"STRING"}}],"body":null},"response":{"type":"json"}},"endpoint_union.update":{"auth":null,"declaration":{"name":{"originalName":"update","camelCase":{"unsafeName":"update","safeName":"update"},"snakeCase":{"unsafeName":"update","safeName":"update"},"screamingSnakeCase":{"unsafeName":"UPDATE","safeName":"UPDATE"},"pascalCase":{"unsafeName":"Update","safeName":"Update"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}}},"location":{"method":"PATCH","path":"/"},"request":{"type":"body","pathParameters":[],"body":{"type":"typeReference","value":{"type":"named","value":"type_union:Shape"}}},"response":{"type":"json"}}},"environments":null},"subpackages":{"subpackage_bigunion":{"name":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}},"fernFilepath":{"allParts":[{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}],"packagePath":[],"file":{"originalName":"bigunion","camelCase":{"unsafeName":"bigunion","safeName":"bigunion"},"snakeCase":{"unsafeName":"bigunion","safeName":"bigunion"},"screamingSnakeCase":{"unsafeName":"BIGUNION","safeName":"BIGUNION"},"pascalCase":{"unsafeName":"Bigunion","safeName":"Bigunion"}}},"service":"service_bigunion","types":["type_bigunion:BigUnion","type_bigunion:NormalSweet","type_bigunion:ThankfulFactor","type_bigunion:JumboEnd","type_bigunion:HastyPain","type_bigunion:MistySnow","type_bigunion:DistinctFailure","type_bigunion:PracticalPrinciple","type_bigunion:LimpingStep","type_bigunion:VibrantExcitement","type_bigunion:ActiveDiamond","type_bigunion:PopularLimit","type_bigunion:FalseMirror","type_bigunion:PrimaryBlock","type_bigunion:RotatingRatio","type_bigunion:ColorfulCover","type_bigunion:DisloyalValue","type_bigunion:GruesomeCoach","type_bigunion:TotalWork","type_bigunion:HarmoniousPlay","type_bigunion:UniqueStress","type_bigunion:UnwillingSmoke","type_bigunion:FrozenSleep","type_bigunion:DiligentDeal","type_bigunion:AttractiveScript","type_bigunion:HoarseMouse","type_bigunion:CircularCard","type_bigunion:PotableBad","type_bigunion:TriangularRepair","type_bigunion:GaseousRoad"],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":true,"docs":null},"subpackage_types":{"name":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}},"fernFilepath":{"allParts":[{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}],"packagePath":[],"file":{"originalName":"types","camelCase":{"unsafeName":"types","safeName":"types"},"snakeCase":{"unsafeName":"types","safeName":"types"},"screamingSnakeCase":{"unsafeName":"TYPES","safeName":"TYPES"},"pascalCase":{"unsafeName":"Types","safeName":"Types"}}},"service":null,"types":["type_types:Union","type_types:UnionWithDiscriminant","type_types:UnionWithPrimitive","type_types:UnionWithDuplicatePrimitive","type_types:UnionWithoutKey","type_types:UnionWithNoProperties","type_types:UnionWithMultipleNoProperties","type_types:UnionWithLiteral","type_types:UnionWithBaseProperties","type_types:UnionWithTime","type_types:UnionWithOptionalTime","type_types:UnionWithSingleElement","type_types:UnionWithDuplicateTypes","type_types:UnionWithSubTypes","type_types:Foo","type_types:FooExtended","type_types:Bar"],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":false,"docs":null},"subpackage_union":{"name":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}},"fernFilepath":{"allParts":[{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}],"packagePath":[],"file":{"originalName":"union","camelCase":{"unsafeName":"union","safeName":"union"},"snakeCase":{"unsafeName":"union","safeName":"union"},"screamingSnakeCase":{"unsafeName":"UNION","safeName":"UNION"},"pascalCase":{"unsafeName":"Union","safeName":"Union"}}},"service":"service_union","types":["type_union:GetShapeRequest","type_union:Shape","type_union:Circle","type_union:Square"],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":true,"docs":null}},"rootPackage":{"fernFilepath":{"allParts":[],"packagePath":[],"file":null},"websocket":null,"service":null,"types":[],"errors":[],"subpackages":["subpackage_bigunion","subpackage_types","subpackage_union"],"webhooks":null,"navigationConfig":null,"hasEndpointsInTree":true,"docs":null},"sdkConfig":{"isAuthMandatory":false,"hasStreamingEndpoints":false,"hasPaginatedEndpoints":false,"hasFileDownloadEndpoints":false,"platformHeaders":{"language":"X-Fern-Language","sdkName":"X-Fern-SDK-Name","sdkVersion":"X-Fern-SDK-Version","userAgent":null}}} \ No newline at end of file diff --git a/seed/csharp-model/unions/src/SeedUnions/Core/Public/FileParameter.cs b/seed/csharp-model/unions/src/SeedUnions/Core/Public/FileParameter.cs index 5dd91ab2030..c1346d1db89 100644 --- a/seed/csharp-model/unions/src/SeedUnions/Core/Public/FileParameter.cs +++ b/seed/csharp-model/unions/src/SeedUnions/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/unknown/src/SeedUnknownAsAny/Core/Public/FileParameter.cs b/seed/csharp-model/unknown/src/SeedUnknownAsAny/Core/Public/FileParameter.cs index de16420e580..c69b07d6da0 100644 --- a/seed/csharp-model/unknown/src/SeedUnknownAsAny/Core/Public/FileParameter.cs +++ b/seed/csharp-model/unknown/src/SeedUnknownAsAny/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/validation/src/SeedValidation/Core/Public/FileParameter.cs b/seed/csharp-model/validation/src/SeedValidation/Core/Public/FileParameter.cs index 5c6a4009c81..f214f823728 100644 --- a/seed/csharp-model/validation/src/SeedValidation/Core/Public/FileParameter.cs +++ b/seed/csharp-model/validation/src/SeedValidation/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/variables/src/SeedVariables/Core/Public/FileParameter.cs b/seed/csharp-model/variables/src/SeedVariables/Core/Public/FileParameter.cs index 361655b36a0..82c393de713 100644 --- a/seed/csharp-model/variables/src/SeedVariables/Core/Public/FileParameter.cs +++ b/seed/csharp-model/variables/src/SeedVariables/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/version-no-default/src/SeedVersion/Core/Public/FileParameter.cs b/seed/csharp-model/version-no-default/src/SeedVersion/Core/Public/FileParameter.cs index 0f712ceacd5..6dc794aeac5 100644 --- a/seed/csharp-model/version-no-default/src/SeedVersion/Core/Public/FileParameter.cs +++ b/seed/csharp-model/version-no-default/src/SeedVersion/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/version/src/SeedVersion/Core/Public/FileParameter.cs b/seed/csharp-model/version/src/SeedVersion/Core/Public/FileParameter.cs index 0f712ceacd5..6dc794aeac5 100644 --- a/seed/csharp-model/version/src/SeedVersion/Core/Public/FileParameter.cs +++ b/seed/csharp-model/version/src/SeedVersion/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-model/websocket/src/SeedWebsocket/Core/Public/FileParameter.cs b/seed/csharp-model/websocket/src/SeedWebsocket/Core/Public/FileParameter.cs index 80299a3bca4..37ed174f5fb 100644 --- a/seed/csharp-model/websocket/src/SeedWebsocket/Core/Public/FileParameter.cs +++ b/seed/csharp-model/websocket/src/SeedWebsocket/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/accept-header/src/SeedAccept/Core/IRequestOptions.cs b/seed/csharp-sdk/accept-header/src/SeedAccept/Core/IRequestOptions.cs index 490b915c951..6856ca1131b 100644 --- a/seed/csharp-sdk/accept-header/src/SeedAccept/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/accept-header/src/SeedAccept/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/accept-header/src/SeedAccept/Core/Public/ClientOptions.cs b/seed/csharp-sdk/accept-header/src/SeedAccept/Core/Public/ClientOptions.cs index e7af0b60808..1aa1573aa58 100644 --- a/seed/csharp-sdk/accept-header/src/SeedAccept/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/accept-header/src/SeedAccept/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/accept-header/src/SeedAccept/Core/Public/FileParameter.cs b/seed/csharp-sdk/accept-header/src/SeedAccept/Core/Public/FileParameter.cs index 5af2475c4dd..5615002ed06 100644 --- a/seed/csharp-sdk/accept-header/src/SeedAccept/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/accept-header/src/SeedAccept/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/accept-header/src/SeedAccept/Core/Public/RequestOptions.cs b/seed/csharp-sdk/accept-header/src/SeedAccept/Core/Public/RequestOptions.cs index ea44a7cdffc..777b262c407 100644 --- a/seed/csharp-sdk/accept-header/src/SeedAccept/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/accept-header/src/SeedAccept/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/accept-header/src/SeedAccept/SeedAcceptClient.cs b/seed/csharp-sdk/accept-header/src/SeedAccept/SeedAcceptClient.cs index d7f93c11a82..1c77e01a5d4 100644 --- a/seed/csharp-sdk/accept-header/src/SeedAccept/SeedAcceptClient.cs +++ b/seed/csharp-sdk/accept-header/src/SeedAccept/SeedAcceptClient.cs @@ -30,5 +30,5 @@ public SeedAcceptClient(string? token = null, ClientOptions? clientOptions = nul Service = new ServiceClient(_client); } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } } diff --git a/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/IRequestOptions.cs b/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/IRequestOptions.cs index b5675c4909f..ce46d70a961 100644 --- a/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/Public/ClientOptions.cs b/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/Public/ClientOptions.cs index baca764de56..e556392ad72 100644 --- a/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/Public/FileParameter.cs b/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/Public/FileParameter.cs index 1b9d68d8ba1..d25743e74d4 100644 --- a/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/Public/RequestOptions.cs b/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/Public/RequestOptions.cs index 2be613d5c48..51d04a44d24 100644 --- a/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/alias-extends/src/SeedAliasExtends/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/alias/src/SeedAlias/Core/IRequestOptions.cs b/seed/csharp-sdk/alias/src/SeedAlias/Core/IRequestOptions.cs index e5d8d51c8ca..fab3d05d122 100644 --- a/seed/csharp-sdk/alias/src/SeedAlias/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/alias/src/SeedAlias/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/alias/src/SeedAlias/Core/Public/ClientOptions.cs b/seed/csharp-sdk/alias/src/SeedAlias/Core/Public/ClientOptions.cs index 54ba20bc709..268a689fe58 100644 --- a/seed/csharp-sdk/alias/src/SeedAlias/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/alias/src/SeedAlias/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/alias/src/SeedAlias/Core/Public/FileParameter.cs b/seed/csharp-sdk/alias/src/SeedAlias/Core/Public/FileParameter.cs index 58078ca8750..f43f769d2ad 100644 --- a/seed/csharp-sdk/alias/src/SeedAlias/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/alias/src/SeedAlias/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/alias/src/SeedAlias/Core/Public/RequestOptions.cs b/seed/csharp-sdk/alias/src/SeedAlias/Core/Public/RequestOptions.cs index 9d25646a257..bde01719f06 100644 --- a/seed/csharp-sdk/alias/src/SeedAlias/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/alias/src/SeedAlias/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/IRequestOptions.cs b/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/IRequestOptions.cs index e801c2ef172..9ec74524653 100644 --- a/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/Public/ClientOptions.cs b/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/Public/ClientOptions.cs index 3c6e6387e77..0bf7f2ce90a 100644 --- a/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/Public/FileParameter.cs b/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/Public/FileParameter.cs index bbe5574a4e8..3ec65fe0e70 100644 --- a/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/Public/RequestOptions.cs b/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/Public/RequestOptions.cs index 695c19ebef1..697152326af 100644 --- a/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/any-auth/src/SeedAnyAuth/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/any-auth/src/SeedAnyAuth/SeedAnyAuthClient.cs b/seed/csharp-sdk/any-auth/src/SeedAnyAuth/SeedAnyAuthClient.cs index 513be67fb01..dc186a3ad0c 100644 --- a/seed/csharp-sdk/any-auth/src/SeedAnyAuth/SeedAnyAuthClient.cs +++ b/seed/csharp-sdk/any-auth/src/SeedAnyAuth/SeedAnyAuthClient.cs @@ -44,9 +44,9 @@ public SeedAnyAuthClient( User = new UserClient(_client); } - public AuthClient Auth { get; init; } + public AuthClient Auth { get; } - public UserClient User { get; init; } + public UserClient User { get; } private static string GetFromEnvironmentOrThrow(string env, string message) { diff --git a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/IRequestOptions.cs b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/IRequestOptions.cs index e9bb1bed3b9..91beb7d24e3 100644 --- a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/ClientOptions.cs b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/ClientOptions.cs index e2e496eb1f7..7a8e19b5c2e 100644 --- a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/FileParameter.cs b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/FileParameter.cs index ab236cf8f95..2c6034398e8 100644 --- a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/RequestOptions.cs b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/RequestOptions.cs index 3b8cc616a65..ac442b789e9 100644 --- a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/SeedApiWideBasePathClient.cs b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/SeedApiWideBasePathClient.cs index 17096d9e1e1..e4f554bfec8 100644 --- a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/SeedApiWideBasePathClient.cs +++ b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/SeedApiWideBasePathClient.cs @@ -29,5 +29,5 @@ public SeedApiWideBasePathClient(ClientOptions? clientOptions = null) Service = new ServiceClient(_client); } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } } diff --git a/seed/csharp-sdk/audiences/src/SeedAudiences/Core/IRequestOptions.cs b/seed/csharp-sdk/audiences/src/SeedAudiences/Core/IRequestOptions.cs index f8ce90afa98..6b2d9cb236f 100644 --- a/seed/csharp-sdk/audiences/src/SeedAudiences/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/audiences/src/SeedAudiences/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/audiences/src/SeedAudiences/Core/Public/ClientOptions.cs b/seed/csharp-sdk/audiences/src/SeedAudiences/Core/Public/ClientOptions.cs index 9cf9aa0aafc..2661e94593b 100644 --- a/seed/csharp-sdk/audiences/src/SeedAudiences/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/audiences/src/SeedAudiences/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/audiences/src/SeedAudiences/Core/Public/FileParameter.cs b/seed/csharp-sdk/audiences/src/SeedAudiences/Core/Public/FileParameter.cs index ac20013e45d..c9b7cd268e5 100644 --- a/seed/csharp-sdk/audiences/src/SeedAudiences/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/audiences/src/SeedAudiences/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/audiences/src/SeedAudiences/Core/Public/RequestOptions.cs b/seed/csharp-sdk/audiences/src/SeedAudiences/Core/Public/RequestOptions.cs index 5ab83d8da8d..86b1e46c0ad 100644 --- a/seed/csharp-sdk/audiences/src/SeedAudiences/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/audiences/src/SeedAudiences/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/audiences/src/SeedAudiences/SeedAudiencesClient.cs b/seed/csharp-sdk/audiences/src/SeedAudiences/SeedAudiencesClient.cs index 7cbba7e7f44..9f84a6a964a 100644 --- a/seed/csharp-sdk/audiences/src/SeedAudiences/SeedAudiencesClient.cs +++ b/seed/csharp-sdk/audiences/src/SeedAudiences/SeedAudiencesClient.cs @@ -38,15 +38,15 @@ public SeedAudiencesClient(ClientOptions? clientOptions = null) Foo = new FooClient(_client); } - public CommonsClient Commons { get; init; } + public CommonsClient Commons { get; } - public FolderAClient FolderA { get; init; } + public FolderAClient FolderA { get; } - public FolderBClient FolderB { get; init; } + public FolderBClient FolderB { get; } - public FolderCClient FolderC { get; init; } + public FolderCClient FolderC { get; } - public FolderDClient FolderD { get; init; } + public FolderDClient FolderD { get; } - public FooClient Foo { get; init; } + public FooClient Foo { get; } } diff --git a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/IRequestOptions.cs b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/IRequestOptions.cs index fa98358902c..0ecb7365a7c 100644 --- a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/ClientOptions.cs b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/ClientOptions.cs index 57882429802..bc5132f75d9 100644 --- a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/ClientOptions.cs @@ -15,30 +15,66 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); - public string? XApiVersion { get; init; } = null; + public string? XApiVersion { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = null; /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/FileParameter.cs b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/FileParameter.cs index 55824949e95..c17c8ce2a11 100644 --- a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/RequestOptions.cs b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/RequestOptions.cs index 4faf6d84998..2356f267086 100644 --- a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/Public/RequestOptions.cs @@ -16,40 +16,87 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } - public string? XApiVersion { get; init; } + public string? XApiVersion { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/SeedAuthEnvironmentVariablesClient.cs b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/SeedAuthEnvironmentVariablesClient.cs index 3833de5046c..0703c20aa8c 100644 --- a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/SeedAuthEnvironmentVariablesClient.cs +++ b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/SeedAuthEnvironmentVariablesClient.cs @@ -44,7 +44,7 @@ public SeedAuthEnvironmentVariablesClient( Service = new ServiceClient(_client); } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } private static string GetFromEnvironmentOrThrow(string env, string message) { diff --git a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/IRequestOptions.cs b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/IRequestOptions.cs index 0bea8bd1a8c..c2db1a747d7 100644 --- a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/ClientOptions.cs b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/ClientOptions.cs index d24a20b3012..41ad885f362 100644 --- a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/FileParameter.cs b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/FileParameter.cs index 9660209f564..de0606a06a6 100644 --- a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/RequestOptions.cs b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/RequestOptions.cs index 7b752aa6fd5..e37fc323278 100644 --- a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/SeedBasicAuthEnvironmentVariablesClient.cs b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/SeedBasicAuthEnvironmentVariablesClient.cs index a5783d4b4d1..fc6ea0b00ce 100644 --- a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/SeedBasicAuthEnvironmentVariablesClient.cs +++ b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/SeedBasicAuthEnvironmentVariablesClient.cs @@ -42,9 +42,9 @@ public SeedBasicAuthEnvironmentVariablesClient( Errors = new ErrorsClient(_client); } - public BasicAuthClient BasicAuth { get; init; } + public BasicAuthClient BasicAuth { get; } - public ErrorsClient Errors { get; init; } + public ErrorsClient Errors { get; } private static string GetFromEnvironmentOrThrow(string env, string message) { diff --git a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/IRequestOptions.cs b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/IRequestOptions.cs index c8353823940..980bddbff19 100644 --- a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/Public/ClientOptions.cs b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/Public/ClientOptions.cs index e6a59c8ccd3..6ea7d9a6e49 100644 --- a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/Public/FileParameter.cs b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/Public/FileParameter.cs index 575394f2b64..a586c7a2d9b 100644 --- a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/Public/RequestOptions.cs b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/Public/RequestOptions.cs index f9fc6544a1b..1714a3507c7 100644 --- a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/SeedBasicAuthClient.cs b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/SeedBasicAuthClient.cs index e59fecc0977..df326b1d338 100644 --- a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/SeedBasicAuthClient.cs +++ b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/SeedBasicAuthClient.cs @@ -34,7 +34,7 @@ public SeedBasicAuthClient( Errors = new ErrorsClient(_client); } - public BasicAuthClient BasicAuth { get; init; } + public BasicAuthClient BasicAuth { get; } - public ErrorsClient Errors { get; init; } + public ErrorsClient Errors { get; } } diff --git a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/IRequestOptions.cs b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/IRequestOptions.cs index 98021049bf1..112347ec5d6 100644 --- a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/ClientOptions.cs b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/ClientOptions.cs index 51b02a44476..4912985d08a 100644 --- a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/ClientOptions.cs @@ -15,30 +15,66 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); - public string? Version { get; init; } = null; + public string? Version { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = null; /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/FileParameter.cs b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/FileParameter.cs index 44d6f26b118..51c078fc2b1 100644 --- a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/RequestOptions.cs b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/RequestOptions.cs index e8f324cb98e..8267a72f58d 100644 --- a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/Public/RequestOptions.cs @@ -16,40 +16,87 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } - public string? Version { get; init; } + public string? Version { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/SeedBearerTokenEnvironmentVariableClient.cs b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/SeedBearerTokenEnvironmentVariableClient.cs index 7299d286995..fa59e64a567 100644 --- a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/SeedBearerTokenEnvironmentVariableClient.cs +++ b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/SeedBearerTokenEnvironmentVariableClient.cs @@ -42,7 +42,7 @@ public SeedBearerTokenEnvironmentVariableClient( Service = new ServiceClient(_client); } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } private static string GetFromEnvironmentOrThrow(string env, string message) { diff --git a/seed/csharp-sdk/bytes/src/SeedBytes/Core/IRequestOptions.cs b/seed/csharp-sdk/bytes/src/SeedBytes/Core/IRequestOptions.cs index b9953f1754b..ec0beb75730 100644 --- a/seed/csharp-sdk/bytes/src/SeedBytes/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/bytes/src/SeedBytes/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/bytes/src/SeedBytes/Core/Public/ClientOptions.cs b/seed/csharp-sdk/bytes/src/SeedBytes/Core/Public/ClientOptions.cs index 5637a162be7..c717ef101a5 100644 --- a/seed/csharp-sdk/bytes/src/SeedBytes/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/bytes/src/SeedBytes/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/bytes/src/SeedBytes/Core/Public/FileParameter.cs b/seed/csharp-sdk/bytes/src/SeedBytes/Core/Public/FileParameter.cs index f8f63e299af..4486f242873 100644 --- a/seed/csharp-sdk/bytes/src/SeedBytes/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/bytes/src/SeedBytes/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/bytes/src/SeedBytes/Core/Public/RequestOptions.cs b/seed/csharp-sdk/bytes/src/SeedBytes/Core/Public/RequestOptions.cs index 9bf4e1b43fb..1ff53560871 100644 --- a/seed/csharp-sdk/bytes/src/SeedBytes/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/bytes/src/SeedBytes/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/bytes/src/SeedBytes/SeedBytesClient.cs b/seed/csharp-sdk/bytes/src/SeedBytes/SeedBytesClient.cs index 888986741aa..b9f81ee0239 100644 --- a/seed/csharp-sdk/bytes/src/SeedBytes/SeedBytesClient.cs +++ b/seed/csharp-sdk/bytes/src/SeedBytes/SeedBytesClient.cs @@ -29,5 +29,5 @@ public SeedBytesClient(ClientOptions? clientOptions = null) Service = new ServiceClient(_client); } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } } diff --git a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/Public/ClientOptions.cs index 7de8ff27f53..a5328968c05 100644 --- a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/SeedApiClient.cs index 31ef19db73c..1174e06ebf5 100644 --- a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/SeedApiClient.cs @@ -30,7 +30,7 @@ public SeedApiClient(ClientOptions? clientOptions = null) Ast = new AstClient(_client); } - public AClient A { get; init; } + public AClient A { get; } - public AstClient Ast { get; init; } + public AstClient Ast { get; } } diff --git a/seed/csharp-sdk/circular-references/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/circular-references/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/circular-references/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/circular-references/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/circular-references/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/circular-references/src/SeedApi/Core/Public/ClientOptions.cs index 7de8ff27f53..a5328968c05 100644 --- a/seed/csharp-sdk/circular-references/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/circular-references/src/SeedApi/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/circular-references/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/circular-references/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/circular-references/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/circular-references/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/circular-references/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/circular-references/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/circular-references/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/circular-references/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/circular-references/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/circular-references/src/SeedApi/SeedApiClient.cs index 7e9843d8a28..58b63519e62 100644 --- a/seed/csharp-sdk/circular-references/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/circular-references/src/SeedApi/SeedApiClient.cs @@ -30,7 +30,7 @@ public SeedApiClient(ClientOptions? clientOptions = null) Ast = new AstClient(_client); } - public AClient A { get; init; } + public AClient A { get; } - public AstClient Ast { get; init; } + public AstClient Ast { get; } } diff --git a/seed/csharp-sdk/content-type/.editorconfig b/seed/csharp-sdk/content-type/.editorconfig new file mode 100644 index 00000000000..a450a4ea14b --- /dev/null +++ b/seed/csharp-sdk/content-type/.editorconfig @@ -0,0 +1,34 @@ +root = true + +[*.cs] +resharper_arrange_object_creation_when_type_evident_highlighting = hint +resharper_auto_property_can_be_made_get_only_global_highlighting = hint +resharper_check_namespace_highlighting = hint +resharper_class_never_instantiated_global_highlighting = hint +resharper_collection_never_updated_global_highlighting = hint +resharper_convert_type_check_pattern_to_null_check_highlighting = hint +resharper_inconsistent_naming_highlighting = hint +resharper_member_can_be_private_global_highlighting = hint +resharper_not_accessed_field_local_highlighting = hint +resharper_partial_type_with_single_part_highlighting = hint +resharper_prefer_concrete_value_over_default_highlighting = none +resharper_private_field_can_be_converted_to_local_variable_highlighting = hint +resharper_property_can_be_made_init_only_global_highlighting = hint +resharper_redundant_name_qualifier_highlighting = none +resharper_redundant_using_directive_highlighting = hint +resharper_replace_slice_with_range_indexer_highlighting = none +resharper_unused_auto_property_accessor_global_highlighting = hint +resharper_unused_auto_property_accessor_local_highlighting = hint +resharper_unused_member_global_highlighting = hint +resharper_unused_type_global_highlighting = hint +resharper_use_string_interpolation_highlighting = hint +resharper_property_can_be_made_init_only_local_highlighting = hint +resharper_member_hides_static_from_outer_class_highlighting = hint +resharper_class_never_instantiated_local_highlighting = hint +dotnet_diagnostic.CS1591.severity = suggestion + +[src/**/Types/*.cs] +resharper_check_namespace_highlighting = none + +[src/**/Core/Public/*.cs] +resharper_check_namespace_highlighting = none \ No newline at end of file diff --git a/seed/csharp-sdk/content-type/.github/workflows/ci.yml b/seed/csharp-sdk/content-type/.github/workflows/ci.yml new file mode 100644 index 00000000000..03bb29b44a1 --- /dev/null +++ b/seed/csharp-sdk/content-type/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: ci + +on: [push] + +jobs: + compile: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - uses: actions/checkout@master + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Install tools + run: | + dotnet tool restore + + - name: Build Release + run: dotnet build src -c Release /p:ContinuousIntegrationBuild=true + + unit-tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - uses: actions/checkout@master + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Install tools + run: | + dotnet tool restore + + - name: Run Tests + run: | + dotnet test src + + + publish: + needs: [compile] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Publish + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_TOKEN }} + run: | + dotnet pack src -c Release + dotnet nuget push src/SeedContentTypes/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source "nuget.org" diff --git a/seed/csharp-sdk/content-type/.gitignore b/seed/csharp-sdk/content-type/.gitignore new file mode 100644 index 00000000000..11014f2b33d --- /dev/null +++ b/seed/csharp-sdk/content-type/.gitignore @@ -0,0 +1,484 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +## This is based on `dotnet new gitignore` and customized by Fern + +# dotenv files +.env + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +# [Rr]elease/ (Ignored by Fern) +# [Rr]eleases/ (Ignored by Fern) +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +# [Ll]og/ (Ignored by Fern) +# [Ll]ogs/ (Ignored by Fern) + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml +.idea + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/content-type/.mock/definition/api.yml b/seed/csharp-sdk/content-type/.mock/definition/api.yml new file mode 100644 index 00000000000..ea70b01ab76 --- /dev/null +++ b/seed/csharp-sdk/content-type/.mock/definition/api.yml @@ -0,0 +1 @@ +name: content-types \ No newline at end of file diff --git a/seed/csharp-sdk/content-type/.mock/definition/service.yml b/seed/csharp-sdk/content-type/.mock/definition/service.yml new file mode 100644 index 00000000000..8f029ae49e0 --- /dev/null +++ b/seed/csharp-sdk/content-type/.mock/definition/service.yml @@ -0,0 +1,16 @@ +service: + auth: false + base-path: '' + endpoints: + patch: + method: PATCH + path: / + request: + body: + properties: + application: nullable + require_auth: nullable + content-type: application/merge-patch+json + name: PatchProxyRequest + source: + openapi: ../specs/vault/swagger.json diff --git a/seed/csharp-sdk/content-type/.mock/fern.config.json b/seed/csharp-sdk/content-type/.mock/fern.config.json new file mode 100644 index 00000000000..4c8e54ac313 --- /dev/null +++ b/seed/csharp-sdk/content-type/.mock/fern.config.json @@ -0,0 +1 @@ +{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/csharp-sdk/content-type/.mock/generators.yml b/seed/csharp-sdk/content-type/.mock/generators.yml new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/seed/csharp-sdk/content-type/.mock/generators.yml @@ -0,0 +1 @@ +{} diff --git a/seed/csharp-sdk/content-type/README.md b/seed/csharp-sdk/content-type/README.md new file mode 100644 index 00000000000..9d84367b3ab --- /dev/null +++ b/seed/csharp-sdk/content-type/README.md @@ -0,0 +1,89 @@ +# Seed C# Library + +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Seed%2FC%23) +[![nuget shield](https://img.shields.io/nuget/v/SeedContentTypes)](https://nuget.org/packages/SeedContentTypes) + +The Seed C# library provides convenient access to the Seed API from C#. + +## Installation + +```sh +dotnet add package SeedContentTypes +``` + +## Usage + +Instantiate and use the client with the following: + +```csharp +using SeedContentTypes; + +var client = new SeedContentTypesClient(); +await client.Service.PatchAsync( + new PatchProxyRequest { Application = "application", RequireAuth = true } +); +``` + +## Exception Handling + +When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error +will be thrown. + +```csharp +using SeedContentTypes; + +try { + var response = await client.Service.PatchAsync(...); +} catch (SeedContentTypesApiException e) { + System.Console.WriteLine(e.Body); + System.Console.WriteLine(e.StatusCode); +} +``` + +## Advanced + +### Retries + +The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long +as the request is deemed retryable and the number of retry attempts has not grown larger than the configured +retry limit (default: 2). + +A request is deemed retryable when any of the following HTTP status codes is returned: + +- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) +- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) +- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) + +Use the `MaxRetries` request option to configure this behavior. + +```csharp +var response = await client.Service.PatchAsync( + ..., + new RequestOptions { + MaxRetries: 0 // Override MaxRetries at the request level + } +); +``` + +### Timeouts + +The SDK defaults to a 30 second timeout. Use the `Timeout` option to configure this behavior. + +```csharp +var response = await client.Service.PatchAsync( + ..., + new RequestOptions { + Timeout: TimeSpan.FromSeconds(3) // Override timeout to 3s + } +); +``` + +## Contributing + +While we value open-source contributions to this SDK, this library is generated programmatically. +Additions made directly to this library would have to be moved over to our generation code, +otherwise they would be overwritten upon the next generated release. Feel free to open a PR as +a proof of concept, but know that we will not be able to merge it as-is. We suggest opening +an issue first to discuss with us! + +On the other hand, contributions to the README are always very welcome! \ No newline at end of file diff --git a/seed/csharp-sdk/content-type/reference.md b/seed/csharp-sdk/content-type/reference.md new file mode 100644 index 00000000000..a7c7d99ad8d --- /dev/null +++ b/seed/csharp-sdk/content-type/reference.md @@ -0,0 +1,43 @@ +# Reference +## Service +
client.Service.PatchAsync(PatchProxyRequest { ... }) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Service.PatchAsync( + new PatchProxyRequest { Application = "application", RequireAuth = true } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `PatchProxyRequest` + +
+
+
+
+ + +
+
+
diff --git a/seed/csharp-sdk/content-type/snippet-templates.json b/seed/csharp-sdk/content-type/snippet-templates.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/csharp-sdk/content-type/snippet.json b/seed/csharp-sdk/content-type/snippet.json new file mode 100644 index 00000000000..cf6ba09a978 --- /dev/null +++ b/seed/csharp-sdk/content-type/snippet.json @@ -0,0 +1,17 @@ +{ + "types": {}, + "endpoints": [ + { + "example_identifier": null, + "id": { + "path": "/", + "method": "PATCH", + "identifier_override": "endpoint_service.patch" + }, + "snippet": { + "type": "csharp", + "client": "using SeedContentTypes;\n\nvar client = new SeedContentTypesClient();\nawait client.Service.PatchAsync(\n new PatchProxyRequest { Application = \"application\", RequireAuth = true }\n);\n" + } + } + ] +} \ No newline at end of file diff --git a/seed/csharp-sdk/content-type/src/SeedApi.DynamicSnippets/Example0.cs b/seed/csharp-sdk/content-type/src/SeedApi.DynamicSnippets/Example0.cs new file mode 100644 index 00000000000..8613beb8206 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedApi.DynamicSnippets/Example0.cs @@ -0,0 +1,23 @@ +using global::System.Threading.Tasks; +using SeedContentTypes; + +namespace Usage; + +public class Example0 +{ + public async global::System.Threading.Tasks.Task Do() { + var client = new SeedContentTypesClient( + clientOptions: new ClientOptions{ + BaseUrl = "https://api.fern.com" + } + ); + + await client.Service.PatchAsync( + new PatchProxyRequest{ + Application = "application", + RequireAuth = true + } + ); + } + +} diff --git a/seed/csharp-sdk/content-type/src/SeedApi.DynamicSnippets/SeedApi.DynamicSnippets.csproj b/seed/csharp-sdk/content-type/src/SeedApi.DynamicSnippets/SeedApi.DynamicSnippets.csproj new file mode 100644 index 00000000000..8231b79f17c --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedApi.DynamicSnippets/SeedApi.DynamicSnippets.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + 12 + enable + enable + + + + + + \ No newline at end of file diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/DateOnlyJsonTests.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/DateOnlyJsonTests.cs new file mode 100644 index 00000000000..882da6acf4c --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/DateOnlyJsonTests.cs @@ -0,0 +1,76 @@ +using NUnit.Framework; +using SeedContentTypes.Core; + +namespace SeedContentTypes.Test.Core.Json; + +[TestFixture] +public class DateOnlyJsonTests +{ + [Test] + public void SerializeDateOnly_ShouldMatchExpectedFormat() + { + (DateOnly dateOnly, string expected)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (new DateOnly(2023, 1, 1), "\"2023-01-01\""), + (new DateOnly(2023, 12, 31), "\"2023-12-31\""), + (new DateOnly(2023, 6, 15), "\"2023-06-15\""), + (new DateOnly(2023, 3, 10), "\"2023-03-10\""), + ]; + foreach (var (dateOnly, expected) in testCases) + { + var json = JsonUtils.Serialize(dateOnly); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeDateOnly_ShouldMatchExpectedDateOnly() + { + (DateOnly expected, string json)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (new DateOnly(2023, 1, 1), "\"2023-01-01\""), + (new DateOnly(2023, 12, 31), "\"2023-12-31\""), + (new DateOnly(2023, 6, 15), "\"2023-06-15\""), + (new DateOnly(2023, 3, 10), "\"2023-03-10\""), + ]; + + foreach (var (expected, json) in testCases) + { + var dateOnly = JsonUtils.Deserialize(json); + Assert.That(dateOnly, Is.EqualTo(expected)); + } + } + + [Test] + public void SerializeNullableDateOnly_ShouldMatchExpectedFormat() + { + (DateOnly? dateOnly, string expected)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (null, "null"), + ]; + foreach (var (dateOnly, expected) in testCases) + { + var json = JsonUtils.Serialize(dateOnly); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeNullableDateOnly_ShouldMatchExpectedDateOnly() + { + (DateOnly? expected, string json)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateOnly = JsonUtils.Deserialize(json); + Assert.That(dateOnly, Is.EqualTo(expected)); + } + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/DateTimeJsonTests.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/DateTimeJsonTests.cs new file mode 100644 index 00000000000..124430db4ef --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/DateTimeJsonTests.cs @@ -0,0 +1,110 @@ +using NUnit.Framework; +using SeedContentTypes.Core; + +namespace SeedContentTypes.Test.Core.Json; + +[TestFixture] +public class DateTimeJsonTests +{ + [Test] + public void SerializeDateTime_ShouldMatchExpectedFormat() + { + (DateTime dateTime, string expected)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), "\"2023-01-01T00:00:00.000Z\""), + ( + new DateTime(2023, 12, 31, 23, 59, 59, DateTimeKind.Utc), + "\"2023-12-31T23:59:59.000Z\"" + ), + (new DateTime(2023, 6, 15, 12, 0, 0, DateTimeKind.Utc), "\"2023-06-15T12:00:00.000Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.000Z\"" + ), + ( + new DateTime(2023, 3, 10, 8, 45, 30, 123, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.123Z\"" + ), + ]; + foreach (var (dateTime, expected) in testCases) + { + var json = JsonUtils.Serialize(dateTime); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeDateTime_ShouldMatchExpectedDateTime() + { + (DateTime expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), "\"2023-01-01T00:00:00.000Z\""), + ( + new DateTime(2023, 12, 31, 23, 59, 59, DateTimeKind.Utc), + "\"2023-12-31T23:59:59.000Z\"" + ), + (new DateTime(2023, 6, 15, 12, 0, 0, DateTimeKind.Utc), "\"2023-06-15T12:00:00.000Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.000Z\"" + ), + (new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), "\"2023-03-10T08:45:30Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, 123, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.123Z\"" + ), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } + + [Test] + public void SerializeNullableDateTime_ShouldMatchExpectedFormat() + { + (DateTime? expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeNullableDateTime_ShouldMatchExpectedDateTime() + { + (DateTime? expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/EnumSerializerTests.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/EnumSerializerTests.cs new file mode 100644 index 00000000000..21950a9b28d --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/EnumSerializerTests.cs @@ -0,0 +1,60 @@ +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using NUnit.Framework; +using SeedContentTypes.Core; + +namespace SeedContentTypes.Test.Core.Json; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class StringEnumSerializerTests +{ + private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true }; + + private const DummyEnum KnownEnumValue2 = DummyEnum.KnownValue2; + private const string KnownEnumValue2String = "known_value2"; + + private const string JsonWithKnownEnum2 = $$""" + { + "enum_property": "{{KnownEnumValue2String}}" + } + """; + + [Test] + public void ShouldParseKnownEnumValue2() + { + var obj = JsonSerializer.Deserialize(JsonWithKnownEnum2, JsonOptions); + Assert.That(obj, Is.Not.Null); + Assert.That(obj.EnumProperty, Is.EqualTo(KnownEnumValue2)); + } + + [Test] + public void ShouldSerializeKnownEnumValue2() + { + var json = JsonSerializer.SerializeToElement( + new DummyObject { EnumProperty = KnownEnumValue2 }, + JsonOptions + ); + TestContext.Out.WriteLine("Serialized JSON: \n" + json); + var enumString = json.GetProperty("enum_property").GetString(); + Assert.That(enumString, Is.Not.Null); + Assert.That(enumString, Is.EqualTo(KnownEnumValue2String)); + } +} + +public class DummyObject +{ + [JsonPropertyName("enum_property")] + public DummyEnum EnumProperty { get; set; } +} + +[JsonConverter(typeof(EnumSerializer))] +public enum DummyEnum +{ + [EnumMember(Value = "known_value1")] + KnownValue1, + + [EnumMember(Value = "known_value2")] + KnownValue2, +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/JsonAccessAttributeTests.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/JsonAccessAttributeTests.cs new file mode 100644 index 00000000000..783763a148b --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/JsonAccessAttributeTests.cs @@ -0,0 +1,46 @@ +using global::System.Text.Json.Serialization; +using NUnit.Framework; +using SeedContentTypes.Core; + +namespace SeedContentTypes.Test.Core.Json; + +[TestFixture] +public class JsonAccessAttributeTests +{ + private class MyClass + { + [JsonPropertyName("read_only_prop")] + [JsonAccess(JsonAccessType.ReadOnly)] + public string? ReadOnlyProp { get; set; } + + [JsonPropertyName("write_only_prop")] + [JsonAccess(JsonAccessType.WriteOnly)] + public string? WriteOnlyProp { get; set; } + + [JsonPropertyName("normal_prop")] + public string? NormalProp { get; set; } + } + + [Test] + public void JsonAccessAttribute_ShouldWorkAsExpected() + { + const string json = + """ { "read_only_prop": "read", "write_only_prop": "write", "normal_prop": "normal_prop" } """; + var obj = JsonUtils.Deserialize(json); + + Assert.Multiple(() => + { + Assert.That(obj.ReadOnlyProp, Is.EqualTo("read")); + Assert.That(obj.WriteOnlyProp, Is.Null); + Assert.That(obj.NormalProp, Is.EqualTo("normal_prop")); + }); + + obj.WriteOnlyProp = "write"; + obj.NormalProp = "new_value"; + + var serializedJson = JsonUtils.Serialize(obj); + const string expectedJson = + "{ \"write_only_prop\": \"write\",\n \"normal_prop\": \"new_value\" }"; + Assert.That(serializedJson, Is.EqualTo(expectedJson).IgnoreWhiteSpace); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/OneOfSerializerTests.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/OneOfSerializerTests.cs new file mode 100644 index 00000000000..d52b073f676 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/Json/OneOfSerializerTests.cs @@ -0,0 +1,314 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using NUnit.Framework; +using OneOf; +using SeedContentTypes.Core; + +namespace SeedContentTypes.Test.Core.Json; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class OneOfSerializerTests +{ + private class Foo + { + [JsonPropertyName("string_prop")] + public required string StringProp { get; set; } + } + + private class Bar + { + [JsonPropertyName("int_prop")] + public required int IntProp { get; set; } + } + + private static readonly OneOf OneOf1 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT2(new { }); + private const string OneOf1String = "{}"; + + private static readonly OneOf OneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT0("test"); + private const string OneOf2String = "\"test\""; + + private static readonly OneOf OneOf3 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT1(123); + private const string OneOf3String = "123"; + + private static readonly OneOf OneOf4 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT3(new Foo { StringProp = "test" }); + private const string OneOf4String = "{\"string_prop\": \"test\"}"; + + private static readonly OneOf OneOf5 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string OneOf5String = "{\"int_prop\": 5}"; + + [Test] + public void Serialize_OneOfs_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void OneOfs_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value)).IgnoreWhiteSpace); + } + }); + } + + private static readonly OneOf? NullableOneOf1 = null; + private const string NullableOneOf1String = "null"; + + private static readonly OneOf? NullableOneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string NullableOneOf2String = "{\"int_prop\": 5}"; + + [Test] + public void Serialize_NullableOneOfs_Should_Return_Expected_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void NullableOneOfs_Should_Deserialize_From_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize?>(json); + Assert.That(result?.Index, Is.EqualTo(oneOf?.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result?.Value)).IgnoreWhiteSpace); + } + }); + } + + private static readonly OneOf OneOfWithNullable1 = OneOf< + string, + int, + Foo? + >.FromT2(null); + private const string OneOfWithNullable1String = "null"; + + private static readonly OneOf OneOfWithNullable2 = OneOf< + string, + int, + Foo? + >.FromT2(new Foo { StringProp = "test" }); + private const string OneOfWithNullable2String = "{\"string_prop\": \"test\"}"; + + private static readonly OneOf OneOfWithNullable3 = OneOf< + string, + int, + Foo? + >.FromT0("test"); + private const string OneOfWithNullable3String = "\"test\""; + + [Test] + public void Serialize_OneOfWithNullables_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOfWithNullable1, OneOfWithNullable1String), + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void OneOfWithNullables_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + // (OneOfWithNullable1, OneOfWithNullable1String), // not possible with .NET's JSON serializer + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value)).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void Serialize_OneOfWithObjectLast_Should_Return_Expected_String() + { + var oneOfWithObjectLast = OneOf.FromT4( + new { random = "data" } + ); + const string oneOfWithObjectLastString = "{\"random\": \"data\"}"; + + var result = JsonUtils.Serialize(oneOfWithObjectLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectLastString).IgnoreWhiteSpace); + } + + [Test] + public void OneOfWithObjectLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectLastString = "{\"random\": \"data\"}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(4)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That( + JsonUtils.Serialize(result.Value), + Is.EqualTo(oneOfWithObjectLastString).IgnoreWhiteSpace + ); + }); + } + + [Test] + public void Serialize_OneOfWithObjectNotLast_Should_Return_Expected_String() + { + var oneOfWithObjectNotLast = OneOf.FromT1( + new { random = "data" } + ); + const string oneOfWithObjectNotLastString = "{\"random\": \"data\"}"; + + var result = JsonUtils.Serialize(oneOfWithObjectNotLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectNotLastString).IgnoreWhiteSpace); + } + + [Test] + public void OneOfWithObjectNotLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectNotLastString = "{\"random\": \"data\"}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectNotLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(1)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That( + JsonUtils.Serialize(result.Value), + Is.EqualTo(oneOfWithObjectNotLastString).IgnoreWhiteSpace + ); + }); + } + + [Test] + public void Serialize_OneOfSingleType_Should_Return_Expected_String() + { + var oneOfSingle = OneOf.FromT0("single"); + const string oneOfSingleString = "\"single\""; + + var result = JsonUtils.Serialize(oneOfSingle); + Assert.That(result, Is.EqualTo(oneOfSingleString)); + } + + [Test] + public void OneOfSingleType_Should_Deserialize_From_String() + { + const string oneOfSingleString = "\"single\""; + var result = JsonUtils.Deserialize>(oneOfSingleString); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(0)); + Assert.That(result.Value, Is.EqualTo("single")); + }); + } + + [Test] + public void Deserialize_InvalidData_Should_Throw_Exception() + { + const string invalidJson = "{\"invalid\": \"data\"}"; + + Assert.Throws(() => + { + JsonUtils.Deserialize>(invalidJson); + }); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/QueryStringConverterTests.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/QueryStringConverterTests.cs new file mode 100644 index 00000000000..cbe2edb5774 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/QueryStringConverterTests.cs @@ -0,0 +1,122 @@ +using NUnit.Framework; +using SeedContentTypes.Core; + +namespace SeedContentTypes.Test.Core; + +[TestFixture] +public class QueryStringConverterTests +{ + [Test] + public void ToQueryStringCollection_Form() + { + var obj = new + { + Name = "John", + Age = 30, + Address = new + { + Street = "123 Main St", + City = "Anytown", + Coordinates = new[] { 39.781721f, -89.650148f }, + }, + Tags = new[] { "Developer", "Blogger" }, + }; + var result = QueryStringConverter.ToForm(obj); + var expected = new List> + { + new("Name", "John"), + new("Age", "30"), + new("Address[Street]", "123 Main St"), + new("Address[City]", "Anytown"), + new("Address[Coordinates]", "39.78172,-89.65015"), + new("Tags", "Developer,Blogger"), + }; + Assert.That(result, Is.EqualTo(expected)); + } + + [Test] + public void ToQueryStringCollection_ExplodedForm() + { + var obj = new + { + Name = "John", + Age = 30, + Address = new + { + Street = "123 Main St", + City = "Anytown", + Coordinates = new[] { 39.781721f, -89.650148f }, + }, + Tags = new[] { "Developer", "Blogger" }, + }; + var result = QueryStringConverter.ToExplodedForm(obj); + var expected = new List> + { + new("Name", "John"), + new("Age", "30"), + new("Address[Street]", "123 Main St"), + new("Address[City]", "Anytown"), + new("Address[Coordinates]", "39.78172"), + new("Address[Coordinates]", "-89.65015"), + new("Tags", "Developer"), + new("Tags", "Blogger"), + }; + Assert.That(result, Is.EqualTo(expected)); + } + + [Test] + public void ToQueryStringCollection_DeepObject() + { + var obj = new + { + Name = "John", + Age = 30, + Address = new + { + Street = "123 Main St", + City = "Anytown", + Coordinates = new[] { 39.781721f, -89.650148f }, + }, + Tags = new[] { "Developer", "Blogger" }, + }; + var result = QueryStringConverter.ToDeepObject(obj); + var expected = new List> + { + new("Name", "John"), + new("Age", "30"), + new("Address[Street]", "123 Main St"), + new("Address[City]", "Anytown"), + new("Address[Coordinates][0]", "39.78172"), + new("Address[Coordinates][1]", "-89.65015"), + new("Tags[0]", "Developer"), + new("Tags[1]", "Blogger"), + }; + Assert.That(result, Is.EqualTo(expected)); + } + + [Test] + public void ToQueryStringCollection_OnString_ThrowsException() + { + var exception = Assert.Throws(() => QueryStringConverter.ToForm("invalid")); + Assert.That( + exception.Message, + Is.EqualTo( + "Only objects can be converted to query string collections. Given type is String." + ) + ); + } + + [Test] + public void ToQueryStringCollection_OnArray_ThrowsException() + { + var exception = Assert.Throws( + () => QueryStringConverter.ToForm(Array.Empty()) + ); + Assert.That( + exception.Message, + Is.EqualTo( + "Only objects can be converted to query string collections. Given type is Array." + ) + ); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/RawClientTests/AdditionalHeadersTests.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/RawClientTests/AdditionalHeadersTests.cs new file mode 100644 index 00000000000..6b07ac9a15d --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/RawClientTests/AdditionalHeadersTests.cs @@ -0,0 +1,137 @@ +using NUnit.Framework; +using SeedContentTypes.Core; +using WireMock.Server; +using SystemTask = global::System.Threading.Tasks.Task; +using WireMockRequest = WireMock.RequestBuilders.Request; +using WireMockResponse = WireMock.ResponseBuilders.Response; + +// ReSharper disable NullableWarningSuppressionIsUsed + +namespace SeedContentTypes.Test.Core.RawClientTests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class AdditionalHeadersTests +{ + private WireMockServer _server; + private HttpClient _httpClient; + private RawClient _rawClient; + private string _baseUrl; + + [SetUp] + public void SetUp() + { + _server = WireMockServer.Start(); + _baseUrl = _server.Url ?? ""; + _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; + _rawClient = new RawClient( + new ClientOptions + { + HttpClient = _httpClient, + Headers = new Headers( + new Dictionary + { + ["a"] = "client_headers", + ["b"] = "client_headers", + ["c"] = "client_headers", + ["d"] = "client_headers", + ["e"] = "client_headers", + ["f"] = "client_headers", + ["client_multiple"] = "client_headers", + } + ), + AdditionalHeaders = new List> + { + new("b", "client_additional_headers"), + new("c", "client_additional_headers"), + new("d", "client_additional_headers"), + new("e", null), + new("client_multiple", "client_additional_headers1"), + new("client_multiple", "client_additional_headers2"), + }, + } + ); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalHeaderParameters() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Headers = new Headers( + new Dictionary + { + ["c"] = "request_headers", + ["d"] = "request_headers", + ["request_multiple"] = "request_headers", + } + ), + Options = new RequestOptions + { + AdditionalHeaders = new List> + { + new("d", "request_additional_headers"), + new("f", null), + new("request_multiple", "request_additional_headers1"), + new("request_multiple", "request_additional_headers2"), + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Success")); + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + var headers = + _server.LogEntries[0].RequestMessage.Headers + ?? throw new Exception("Headers are null"); + + Assert.That(headers, Contains.Key("client_multiple")); + Assert.That(headers!["client_multiple"][0], Does.Contain("client_additional_headers1")); + Assert.That(headers["client_multiple"][0], Does.Contain("client_additional_headers2")); + + Assert.That(headers, Contains.Key("request_multiple")); + Assert.That( + headers["request_multiple"][0], + Does.Contain("request_additional_headers1") + ); + Assert.That( + headers["request_multiple"][0], + Does.Contain("request_additional_headers2") + ); + + Assert.That(headers, Contains.Key("a")); + Assert.That(headers["a"][0], Does.Contain("client_headers")); + + Assert.That(headers, Contains.Key("b")); + Assert.That(headers["b"][0], Does.Contain("client_additional_headers")); + + Assert.That(headers, Contains.Key("c")); + Assert.That(headers["c"][0], Does.Contain("request_headers")); + + Assert.That(headers, Contains.Key("d")); + Assert.That(headers["d"][0], Does.Contain("request_additional_headers")); + + Assert.That(headers, Does.Not.ContainKey("e")); + Assert.That(headers, Does.Not.ContainKey("f")); + }); + } + + [TearDown] + public void TearDown() + { + _server.Dispose(); + _httpClient.Dispose(); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/RawClientTests/AdditionalParametersTests.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/RawClientTests/AdditionalParametersTests.cs new file mode 100644 index 00000000000..0b839459c25 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/RawClientTests/AdditionalParametersTests.cs @@ -0,0 +1,300 @@ +using NUnit.Framework; +using SeedContentTypes.Core; +using WireMock.Matchers; +using WireMock.Server; +using SystemTask = global::System.Threading.Tasks.Task; +using WireMockRequest = WireMock.RequestBuilders.Request; +using WireMockResponse = WireMock.ResponseBuilders.Response; + +namespace SeedContentTypes.Test.Core.RawClientTests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class AdditionalParametersTests +{ + private WireMockServer _server; + private HttpClient _httpClient; + private RawClient _rawClient; + private string _baseUrl; + + [SetUp] + public void SetUp() + { + _server = WireMockServer.Start(); + _baseUrl = _server.Url ?? ""; + _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; + _rawClient = new RawClient(new ClientOptions { HttpClient = _httpClient }); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalQueryParameters() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").WithParam("foo", "bar").UsingGet()) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest() + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Options = new RequestOptions + { + AdditionalQueryParameters = new List> + { + new("foo", "bar"), + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalQueryParameters_Override() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").WithParam("foo", "null").UsingGet()) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest() + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Query = new Dictionary { { "foo", "bar" } }, + Options = new RequestOptions + { + AdditionalQueryParameters = new List> + { + new("foo", "null"), + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalQueryParameters_Merge() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest() + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Query = new Dictionary { { "foo", "baz" } }, + Options = new RequestOptions + { + AdditionalQueryParameters = new List> + { + new("foo", "one"), + new("foo", "two"), + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + + var requestUrl = _server.LogEntries.First().RequestMessage.Url; + Assert.That(requestUrl, Does.Contain("foo=one")); + Assert.That(requestUrl, Does.Contain("foo=two")); + Assert.That(requestUrl, Does.Not.Contain("foo=baz")); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalBodyProperties() + { + string expectedBody = "{\n \"foo\": \"bar\",\n \"baz\": \"qux\"\n}"; + _server + .Given( + WireMockRequest + .Create() + .WithPath("/test") + .UsingPost() + .WithBody(new JsonMatcher(expectedBody)) + ) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + Body = new Dictionary { { "foo", "bar" } }, + Options = new RequestOptions + { + AdditionalBodyProperties = new Dictionary { { "baz", "qux" } }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalBodyProperties_Override() + { + string expectedBody = "{\n \"foo\": null\n}"; + _server + .Given( + WireMockRequest + .Create() + .WithPath("/test") + .UsingPost() + .WithBody(new JsonMatcher(expectedBody)) + ) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + Body = new Dictionary { { "foo", "bar" } }, + Options = new RequestOptions + { + AdditionalBodyProperties = new Dictionary { { "foo", null } }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalBodyProperties_DeepMerge() + { + const string expectedBody = """ + { + "foo": { + "inner1": "original", + "inner2": "overridden", + "inner3": { + "deepProp1": "deep-override", + "deepProp2": "original", + "deepProp3": null, + "deepProp4": "new-value" + } + }, + "bar": "new-value", + "baz": ["new","value"] + } + """; + + _server + .Given( + WireMockRequest + .Create() + .WithPath("/test-deep-merge") + .UsingPost() + .WithBody(new JsonMatcher(expectedBody)) + ) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test-deep-merge", + Body = new Dictionary + { + { + "foo", + new Dictionary + { + { "inner1", "original" }, + { "inner2", "original" }, + { + "inner3", + new Dictionary + { + { "deepProp1", "deep-original" }, + { "deepProp2", "original" }, + { "deepProp3", "" }, + } + }, + } + }, + { + "baz", + new List { "original" } + }, + }, + Options = new RequestOptions + { + AdditionalBodyProperties = new Dictionary + { + { + "foo", + new Dictionary + { + { "inner2", "overridden" }, + { + "inner3", + new Dictionary + { + { "deepProp1", "deep-override" }, + { "deepProp3", null }, + { "deepProp4", "new-value" }, + } + }, + } + }, + { "bar", "new-value" }, + { + "baz", + new List { "new", "value" } + }, + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [TearDown] + public void TearDown() + { + _server.Dispose(); + _httpClient.Dispose(); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/RawClientTests/MultipartFormTests.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/RawClientTests/MultipartFormTests.cs new file mode 100644 index 00000000000..b1842e9e878 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/RawClientTests/MultipartFormTests.cs @@ -0,0 +1,1120 @@ +using global::System.Net.Http; +using global::System.Text; +using global::System.Text.Json.Serialization; +using NUnit.Framework; +using SeedContentTypes.Core; +using SystemTask = global::System.Threading.Tasks.Task; + +namespace SeedContentTypes.Test.Core.RawClientTests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class MultipartFormTests +{ + private static SimpleObject _simpleObject = new(); + + private static string _simpleFormEncoded = + "meta=data&Date=2023-10-01&Time=12:00:00&Duration=01:00:00&Id=1a1bb98f-47c6-407b-9481-78476affe52a&IsActive=true&Count=42&Initial=A&Values=data,2023-10-01,12:00:00,01:00:00,1a1bb98f-47c6-407b-9481-78476affe52a,true,42,A"; + + private static string _simpleExplodedFormEncoded = + "meta=data&Date=2023-10-01&Time=12:00:00&Duration=01:00:00&Id=1a1bb98f-47c6-407b-9481-78476affe52a&IsActive=true&Count=42&Initial=A&Values=data&Values=2023-10-01&Values=12:00:00&Values=01:00:00&Values=1a1bb98f-47c6-407b-9481-78476affe52a&Values=true&Values=42&Values=A"; + + private static ComplexObject _complexObject = new(); + + private static string _complexJson = """ + { + "meta": "data", + "Nested": { + "foo": "value" + }, + "NestedDictionary": { + "key": { + "foo": "value" + } + }, + "ListOfObjects": [ + { + "foo": "value" + }, + { + "foo": "value2" + } + ], + "Date": "2023-10-01", + "Time": "12:00:00", + "Duration": "01:00:00", + "Id": "1a1bb98f-47c6-407b-9481-78476affe52a", + "IsActive": true, + "Count": 42, + "Initial": "A" + } + """; + + [Test] + public async SystemTask ShouldAddStringPart() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringPart("string", partInput); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=string + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringParts() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringParts("strings", [partInput, partInput]); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask GivenNull_ShouldNotAddStringPart() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringPart("string", null); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringParts_WithNullsInList() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringParts("strings", [partInput, null, partInput]); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringPart_WithContentType() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringPart("string", partInput, "text/xml"); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/xml + Content-Disposition: form-data; name=string + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringPart_WithContentTypeAndCharset() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringPart("string", partInput, "text/xml; charset=utf-8"); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/xml; charset=utf-8 + Content-Disposition: form-data; name=string + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringParts_WithContentType() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringParts("strings", [partInput, partInput], "text/xml"); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/xml + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary} + Content-Type: text/xml + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringParts_WithContentTypeAndCharset() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringParts( + "strings", + [partInput, partInput], + "text/xml; charset=utf-8" + ); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/xml; charset=utf-8 + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary} + Content-Type: text/xml; charset=utf-8 + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithFileName() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter { Stream = partInput, FileName = "test.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithoutFileName() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", partInput); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithContentType() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter + { + Stream = partInput, + FileName = "test.txt", + ContentType = "text/plain", + }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file, "ignored-fallback-content-type"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithContentTypeAndCharset() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter + { + Stream = partInput, + FileName = "test.txt", + ContentType = "text/plain; charset=utf-8", + }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file, "ignored-fallback-content-type"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain; charset=utf-8 + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithFallbackContentType() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter { Stream = partInput, FileName = "test.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file, "text/plain"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithFallbackContentTypeAndCharset() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter { Stream = partInput, FileName = "test.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file, "text/plain; charset=utf-8"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain; charset=utf-8 + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameters() + { + var (partInput1, partExpectedString1) = GetFileParameterTestData(); + var (partInput2, partExpectedString2) = GetFileParameterTestData(); + var file1 = new FileParameter { Stream = partInput1, FileName = "test1.txt" }; + var file2 = new FileParameter { Stream = partInput2, FileName = "test2.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterParts("file", [file1, file2]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test1.txt; filename*=utf-8''test1.txt + + {partExpectedString1} + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test2.txt; filename*=utf-8''test2.txt + + {partExpectedString2} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameters_WithNullsInList() + { + var (partInput1, partExpectedString1) = GetFileParameterTestData(); + var (partInput2, partExpectedString2) = GetFileParameterTestData(); + var file1 = new FileParameter { Stream = partInput1, FileName = "test1.txt" }; + var file2 = new FileParameter { Stream = partInput2, FileName = "test2.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterParts("file", [file1, null, file2]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test1.txt; filename*=utf-8''test1.txt + + {partExpectedString1} + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test2.txt; filename*=utf-8''test2.txt + + {partExpectedString2} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask GivenNull_ShouldNotAddFileParameter() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", null); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddJsonPart_WithComplexObject() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonPart("object", _complexObject); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/json + Content-Disposition: form-data; name=object + + {_complexJson} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddJsonPart_WithComplexObjectList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonParts("objects", [_complexObject, _complexObject]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/json + Content-Disposition: form-data; name=objects + + {_complexJson} + --{boundary} + Content-Type: application/json + Content-Disposition: form-data; name=objects + + {_complexJson} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask GivenNull_ShouldNotAddJsonPart() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonPart("object", null); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddJsonParts_WithNullsInList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonParts("objects", [_complexObject, null]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/json + Content-Disposition: form-data; name=objects + + {_complexJson} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddJsonParts_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonParts("objects", [new { }], "application/json-patch+json"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $$""" + --{{boundary}} + Content-Type: application/json-patch+json + Content-Disposition: form-data; name=objects + + {} + --{{boundary}}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedParts_WithSimpleObject() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedPart("object", _simpleObject); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=object + + {EscapeFormEncodedString(_simpleFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedParts_WithSimpleObjectList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts("objects", [_simpleObject, _simpleObject]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleFormEncoded)} + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldNotAddFormEncodedParts_WithNull() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts("object", null); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldNotAddFormEncodedParts_WithNullsInList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts("objects", [_simpleObject, null]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedPart_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedPart( + "objects", + new { foo = "bar" }, + "application/x-www-form-urlencoded" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedPart_WithContentTypeAndCharset() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedPart( + "objects", + new { foo = "bar" }, + "application/x-www-form-urlencoded; charset=utf-8" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded; charset=utf-8 + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedParts_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts( + "objects", + [new { foo = "bar" }], + "application/x-www-form-urlencoded" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedParts_WithContentTypeAndCharset() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts( + "objects", + [new { foo = "bar" }], + "application/x-www-form-urlencoded; charset=utf-8" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded; charset=utf-8 + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedParts_WithSimpleObject() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedPart("object", _simpleObject); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=object + + {EscapeFormEncodedString(_simpleExplodedFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedParts_WithSimpleObjectList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedParts("objects", [_simpleObject, _simpleObject]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleExplodedFormEncoded)} + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleExplodedFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldNotAddExplodedFormEncodedParts_WithNull() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedPart("object", null); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldNotAddExplodedFormEncodedParts_WithNullsInList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedParts("objects", [_simpleObject, null]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleExplodedFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedPart_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedPart( + "objects", + new { foo = "bar" }, + "application/x-www-form-urlencoded" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedPart_WithContentTypeAndCharset() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedPart( + "objects", + new { foo = "bar" }, + "application/x-www-form-urlencoded; charset=utf-8" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded; charset=utf-8 + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedParts_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedParts( + "objects", + [new { foo = "bar" }], + "application/x-www-form-urlencoded" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedParts_WithContentTypeAndCharset() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedParts( + "objects", + [new { foo = "bar" }], + "application/x-www-form-urlencoded; charset=utf-8" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded; charset=utf-8 + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + private static string EscapeFormEncodedString(string input) + { + return string.Join( + "&", + input + .Split('&') + .Select(x => x.Split('=')) + .Select(x => $"{Uri.EscapeDataString(x[0])}={Uri.EscapeDataString(x[1])}") + ); + } + + private static string GetBoundary(MultipartFormDataContent content) + { + return content + .Headers.ContentType?.Parameters.Single(p => + p.Name.Equals("boundary", StringComparison.OrdinalIgnoreCase) + ) + .Value?.Trim('"') ?? throw new Exception("Boundary not found"); + } + + private static MultipartFormRequest CreateMultipartFormRequest() + { + return new MultipartFormRequest + { + BaseUrl = "https://localhost", + Method = HttpMethod.Post, + Path = "", + }; + } + + private static (Stream partInput, string partExpectedString) GetFileParameterTestData() + { + const string partExpectedString = "file content"; + var partInput = new MemoryStream(Encoding.Default.GetBytes(partExpectedString)); + return (partInput, partExpectedString); + } + + private class SimpleObject + { + [JsonPropertyName("meta")] + public string Meta { get; set; } = "data"; + public DateOnly Date { get; set; } = DateOnly.Parse("2023-10-01"); + public TimeOnly Time { get; set; } = TimeOnly.Parse("12:00:00"); + public TimeSpan Duration { get; set; } = TimeSpan.FromHours(1); + public Guid Id { get; set; } = Guid.Parse("1a1bb98f-47c6-407b-9481-78476affe52a"); + public bool IsActive { get; set; } = true; + public int Count { get; set; } = 42; + public char Initial { get; set; } = 'A'; + public IEnumerable Values { get; set; } = + [ + "data", + DateOnly.Parse("2023-10-01"), + TimeOnly.Parse("12:00:00"), + TimeSpan.FromHours(1), + Guid.Parse("1a1bb98f-47c6-407b-9481-78476affe52a"), + true, + 42, + 'A', + ]; + } + + private class ComplexObject + { + [JsonPropertyName("meta")] + public string Meta { get; set; } = "data"; + + public object Nested { get; set; } = new { foo = "value" }; + + public Dictionary NestedDictionary { get; set; } = + new() { { "key", new { foo = "value" } } }; + + public IEnumerable ListOfObjects { get; set; } = + new List { new { foo = "value" }, new { foo = "value2" } }; + + public DateOnly Date { get; set; } = DateOnly.Parse("2023-10-01"); + public TimeOnly Time { get; set; } = TimeOnly.Parse("12:00:00"); + public TimeSpan Duration { get; set; } = TimeSpan.FromHours(1); + public Guid Id { get; set; } = Guid.Parse("1a1bb98f-47c6-407b-9481-78476affe52a"); + public bool IsActive { get; set; } = true; + public int Count { get; set; } = 42; + public char Initial { get; set; } = 'A'; + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/RawClientTests/RetriesTests.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/RawClientTests/RetriesTests.cs new file mode 100644 index 00000000000..9edcb6dda16 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Core/RawClientTests/RetriesTests.cs @@ -0,0 +1,214 @@ +using global::System.Net.Http; +using NUnit.Framework; +using SeedContentTypes.Core; +using WireMock.Server; +using SystemTask = global::System.Threading.Tasks.Task; +using WireMockRequest = WireMock.RequestBuilders.Request; +using WireMockResponse = WireMock.ResponseBuilders.Response; + +namespace SeedContentTypes.Test.Core.RawClientTests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class RetriesTests +{ + private const int MaxRetries = 3; + private WireMockServer _server; + private HttpClient _httpClient; + private RawClient _rawClient; + private string _baseUrl; + + [SetUp] + public void SetUp() + { + _server = WireMockServer.Start(); + _baseUrl = _server.Url ?? ""; + _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; + _rawClient = new RawClient( + new ClientOptions { HttpClient = _httpClient, MaxRetries = MaxRetries } + ) + { + BaseRetryDelay = 0, + }; + } + + [Test] + [TestCase(408)] + [TestCase(429)] + [TestCase(500)] + [TestCase(504)] + public async SystemTask SendRequestAsync_ShouldRetry_OnRetryableStatusCodes(int statusCode) + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WhenStateIs("Server Error") + .WillSetStateTo("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WhenStateIs("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new EmptyRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + using (Assert.EnterMultipleScope()) + { + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries, Has.Count.EqualTo(MaxRetries)); + } + } + + [Test] + [TestCase(400)] + [TestCase(409)] + public async SystemTask SendRequestAsync_ShouldRetry_OnNonRetryableStatusCodes(int statusCode) + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode).WithBody("Failure")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Body = new { }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(statusCode)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Failure")); + + Assert.That(_server.LogEntries, Has.Count.EqualTo(1)); + }); + } + + [Test] + public async SystemTask SendRequestAsync_ShouldNotRetry_WithStreamRequest() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(429).WithBody("Failure")); + + var request = new StreamRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + Body = new MemoryStream(), + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(429)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Failure")); + Assert.That(_server.LogEntries, Has.Count.EqualTo(1)); + }); + } + + [Test] + public async SystemTask SendRequestAsync_ShouldNotRetry_WithMultiPartFormRequest_WithStream() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(429).WithBody("Failure")); + + var request = new MultipartFormRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + }; + request.AddFileParameterPart("file", new MemoryStream()); + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(429)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Failure")); + Assert.That(_server.LogEntries, Has.Count.EqualTo(1)); + }); + } + + [Test] + public async SystemTask SendRequestAsync_ShouldRetry_WithMultiPartFormRequest_WithoutStream() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(429)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WhenStateIs("Server Error") + .WillSetStateTo("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(429)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WhenStateIs("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new MultipartFormRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + }; + request.AddJsonPart("object", new { }); + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Success")); + Assert.That(_server.LogEntries, Has.Count.EqualTo(MaxRetries)); + }); + } + + [TearDown] + public void TearDown() + { + _server.Dispose(); + _httpClient.Dispose(); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/SeedContentTypes.Test.Custom.props b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/SeedContentTypes.Test.Custom.props new file mode 100644 index 00000000000..55e683b0772 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/SeedContentTypes.Test.Custom.props @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/SeedContentTypes.Test.csproj b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/SeedContentTypes.Test.csproj new file mode 100644 index 00000000000..72abc7e39f5 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/SeedContentTypes.Test.csproj @@ -0,0 +1,37 @@ + + + + net8.0 + 12 + enable + enable + false + true + true + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + \ No newline at end of file diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/TestClient.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/TestClient.cs new file mode 100644 index 00000000000..b62f0f2c1c7 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/TestClient.cs @@ -0,0 +1,6 @@ +using NUnit.Framework; + +namespace SeedContentTypes.Test; + +[TestFixture] +public class TestClient; diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Unit/MockServer/BaseMockServerTest.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Unit/MockServer/BaseMockServerTest.cs new file mode 100644 index 00000000000..f4f70d91f8a --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Unit/MockServer/BaseMockServerTest.cs @@ -0,0 +1,38 @@ +using NUnit.Framework; +using SeedContentTypes; +using WireMock.Logging; +using WireMock.Server; +using WireMock.Settings; + +namespace SeedContentTypes.Test.Unit.MockServer; + +[SetUpFixture] +public class BaseMockServerTest +{ + protected static WireMockServer Server { get; set; } = null!; + + protected static SeedContentTypesClient Client { get; set; } = null!; + + protected static RequestOptions RequestOptions { get; set; } = new(); + + [OneTimeSetUp] + public void GlobalSetup() + { + // Start the WireMock server + Server = WireMockServer.Start( + new WireMockServerSettings { Logger = new WireMockConsoleLogger() } + ); + + // Initialize the Client + Client = new SeedContentTypesClient( + clientOptions: new ClientOptions { BaseUrl = Server.Urls[0], MaxRetries = 0 } + ); + } + + [OneTimeTearDown] + public void GlobalTeardown() + { + Server.Stop(); + Server.Dispose(); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Unit/MockServer/PatchTest.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Unit/MockServer/PatchTest.cs new file mode 100644 index 00000000000..75cd6f35019 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Unit/MockServer/PatchTest.cs @@ -0,0 +1,37 @@ +using NUnit.Framework; +using SeedContentTypes; + +namespace SeedContentTypes.Test.Unit.MockServer; + +[TestFixture] +public class PatchTest : BaseMockServerTest +{ + [Test] + public void MockServerTest() + { + const string requestJson = """ + { + "application": "application", + "require_auth": true + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/") + .WithHeader("Content-Type", "application/merge-patch+json") + .UsingPatch() + .WithBodyAsJson(requestJson) + ) + .RespondWith(WireMock.ResponseBuilders.Response.Create().WithStatusCode(200)); + + Assert.DoesNotThrowAsync( + async () => + await Client.Service.PatchAsync( + new PatchProxyRequest { Application = "application", RequireAuth = true } + ) + ); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs new file mode 100644 index 00000000000..1704c99af44 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/JsonElementComparer.cs @@ -0,0 +1,236 @@ +using System.Text.Json; +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for EqualConstraint to handle JsonElement objects. +/// +public static class JsonElementComparerExtensions +{ + /// + /// Extension method for comparing JsonElement objects in NUnit tests. + /// Property order doesn't matter, but array order does matter. + /// Includes special handling for DateTime string formats. + /// + /// The Is.EqualTo() constraint instance. + /// A constraint that can compare JsonElements with detailed diffs. + public static EqualConstraint UsingJsonElementComparer(this EqualConstraint constraint) + { + return constraint.Using(new JsonElementComparer()); + } +} + +/// +/// Equality comparer for JsonElement with detailed reporting. +/// Property order doesn't matter, but array order does matter. +/// Now includes special handling for DateTime string formats with improved null handling. +/// +public class JsonElementComparer : IEqualityComparer +{ + private string _failurePath = string.Empty; + + /// + public bool Equals(JsonElement x, JsonElement y) + { + _failurePath = string.Empty; + return CompareJsonElements(x, y, string.Empty); + } + + /// + public int GetHashCode(JsonElement obj) + { + return JsonSerializer.Serialize(obj).GetHashCode(); + } + + private bool CompareJsonElements(JsonElement x, JsonElement y, string path) + { + // If value kinds don't match, they're not equivalent + if (x.ValueKind != y.ValueKind) + { + _failurePath = $"{path}: Expected {x.ValueKind} but got {y.ValueKind}"; + return false; + } + + switch (x.ValueKind) + { + case JsonValueKind.Object: + return CompareJsonObjects(x, y, path); + + case JsonValueKind.Array: + return CompareJsonArraysInOrder(x, y, path); + + case JsonValueKind.String: + string? xStr = x.GetString(); + string? yStr = y.GetString(); + + // Handle null strings + if (xStr is null && yStr is null) + return true; + + if (xStr is null || yStr is null) + { + _failurePath = + $"{path}: Expected {(xStr is null ? "null" : $"\"{xStr}\"")} but got {(yStr is null ? "null" : $"\"{yStr}\"")}"; + return false; + } + + // Check if they are identical strings + if (xStr == yStr) + return true; + + // Try to handle DateTime strings + if (IsLikelyDateTimeString(xStr) && IsLikelyDateTimeString(yStr)) + { + if (AreEquivalentDateTimeStrings(xStr, yStr)) + return true; + } + + _failurePath = $"{path}: Expected \"{xStr}\" but got \"{yStr}\""; + return false; + + case JsonValueKind.Number: + if (x.GetDecimal() != y.GetDecimal()) + { + _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + + return true; + + case JsonValueKind.True: + case JsonValueKind.False: + if (x.GetBoolean() != y.GetBoolean()) + { + _failurePath = $"{path}: Expected {x.GetBoolean()} but got {y.GetBoolean()}"; + return false; + } + + return true; + + case JsonValueKind.Null: + return true; + + default: + _failurePath = $"{path}: Unsupported JsonValueKind {x.ValueKind}"; + return false; + } + } + + private bool IsLikelyDateTimeString(string? str) + { + // Simple heuristic to identify likely ISO date time strings + return str != null + && (str.Contains("T") && (str.EndsWith("Z") || str.Contains("+") || str.Contains("-"))); + } + + private bool AreEquivalentDateTimeStrings(string str1, string str2) + { + // Try to parse both as DateTime + if (DateTime.TryParse(str1, out DateTime dt1) && DateTime.TryParse(str2, out DateTime dt2)) + { + return dt1 == dt2; + } + + return false; + } + + private bool CompareJsonObjects(JsonElement x, JsonElement y, string path) + { + // Create dictionaries for both JSON objects + var xProps = new Dictionary(); + var yProps = new Dictionary(); + + foreach (var prop in x.EnumerateObject()) + xProps[prop.Name] = prop.Value; + + foreach (var prop in y.EnumerateObject()) + yProps[prop.Name] = prop.Value; + + // Check if all properties in x exist in y + foreach (var key in xProps.Keys) + { + if (!yProps.ContainsKey(key)) + { + _failurePath = $"{path}: Missing property '{key}'"; + return false; + } + } + + // Check if y has extra properties + foreach (var key in yProps.Keys) + { + if (!xProps.ContainsKey(key)) + { + _failurePath = $"{path}: Unexpected property '{key}'"; + return false; + } + } + + // Compare each property value + foreach (var key in xProps.Keys) + { + var propPath = string.IsNullOrEmpty(path) ? key : $"{path}.{key}"; + if (!CompareJsonElements(xProps[key], yProps[key], propPath)) + { + return false; + } + } + + return true; + } + + private bool CompareJsonArraysInOrder(JsonElement x, JsonElement y, string path) + { + var xArray = x.EnumerateArray(); + var yArray = y.EnumerateArray(); + + // Count x elements + var xCount = 0; + var xElements = new List(); + foreach (var item in xArray) + { + xElements.Add(item); + xCount++; + } + + // Count y elements + var yCount = 0; + var yElements = new List(); + foreach (var item in yArray) + { + yElements.Add(item); + yCount++; + } + + // Check if counts match + if (xCount != yCount) + { + _failurePath = $"{path}: Expected {xCount} items but found {yCount}"; + return false; + } + + // Compare elements in order + for (var i = 0; i < xCount; i++) + { + var itemPath = $"{path}[{i}]"; + if (!CompareJsonElements(xElements[i], yElements[i], itemPath)) + { + return false; + } + } + + return true; + } + + /// + public override string ToString() + { + if (!string.IsNullOrEmpty(_failurePath)) + { + return $"JSON comparison failed at {_failurePath}"; + } + + return "JsonElementEqualityComparer"; + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/NUnitExtensions.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/NUnitExtensions.cs new file mode 100644 index 00000000000..426df124538 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/NUnitExtensions.cs @@ -0,0 +1,28 @@ +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for NUnit constraints. +/// +public static class NUnitExtensions +{ + /// + /// Modifies the EqualConstraint to use our own set of default comparers. + /// + /// + /// + public static EqualConstraint UsingDefaults(this EqualConstraint constraint) => + constraint + .UsingPropertiesComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingOneOfComparer() + .UsingJsonElementComparer(); +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/OneOfComparer.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/OneOfComparer.cs new file mode 100644 index 00000000000..0c975b471ff --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/OneOfComparer.cs @@ -0,0 +1,43 @@ +using NUnit.Framework.Constraints; +using OneOf; + +namespace NUnit.Framework; + +/// +/// Extensions for EqualConstraint to handle OneOf values. +/// +public static class EqualConstraintExtensions +{ + /// + /// Modifies the EqualConstraint to handle OneOf instances by comparing their inner values. + /// This works alongside other comparison modifiers like UsingPropertiesComparer. + /// + /// The EqualConstraint to modify. + /// The same constraint instance for method chaining. + public static EqualConstraint UsingOneOfComparer(this EqualConstraint constraint) + { + // Register a comparer factory for IOneOf types + constraint.Using( + (x, y) => + { + // ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract + if (x.Value is null && y.Value is null) + { + return true; + } + + if (x.Value is null) + { + return false; + } + + var propertiesComparer = new NUnitEqualityComparer(); + var tolerance = Tolerance.Default; + propertiesComparer.CompareProperties = true; + return propertiesComparer.AreEqual(x.Value, y.Value, ref tolerance); + } + ); + + return constraint; + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/ReadOnlyMemoryComparer.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/ReadOnlyMemoryComparer.cs new file mode 100644 index 00000000000..fc0b595a5e5 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes.Test/Utils/ReadOnlyMemoryComparer.cs @@ -0,0 +1,87 @@ +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for NUnit constraints. +/// +public static class ReadOnlyMemoryComparerExtensions +{ + /// + /// Extension method for comparing ReadOnlyMemory<T> in NUnit tests. + /// + /// The type of elements in the ReadOnlyMemory. + /// The Is.EqualTo() constraint instance. + /// A constraint that can compare ReadOnlyMemory<T>. + public static EqualConstraint UsingReadOnlyMemoryComparer(this EqualConstraint constraint) + where T : IComparable + { + return constraint.Using(new ReadOnlyMemoryComparer()); + } +} + +/// +/// Comparer for ReadOnlyMemory<T>. Compares sequences by value. +/// +/// +/// The type of elements in the ReadOnlyMemory. +/// +public class ReadOnlyMemoryComparer : IComparer> + where T : IComparable +{ + /// + public int Compare(ReadOnlyMemory x, ReadOnlyMemory y) + { + // Check if sequences are equal + var xSpan = x.Span; + var ySpan = y.Span; + + // Optimized case for IEquatable implementations + if (typeof(IEquatable).IsAssignableFrom(typeof(T))) + { + var areEqual = xSpan.SequenceEqual(ySpan); + if (areEqual) + { + return 0; // Sequences are equal + } + } + else + { + // Manual equality check for non-IEquatable types + if (xSpan.Length == ySpan.Length) + { + var areEqual = true; + for (var i = 0; i < xSpan.Length; i++) + { + if (!EqualityComparer.Default.Equals(xSpan[i], ySpan[i])) + { + areEqual = false; + break; + } + } + + if (areEqual) + { + return 0; // Sequences are equal + } + } + } + + // For non-equal sequences, we need to return a consistent ordering + // First compare lengths + if (x.Length != y.Length) + return x.Length.CompareTo(y.Length); + + // Same length but different content - compare first differing element + for (var i = 0; i < x.Length; i++) + { + if (!EqualityComparer.Default.Equals(xSpan[i], ySpan[i])) + { + return xSpan[i].CompareTo(ySpan[i]); + } + } + + // Should never reach here if not equal + return 0; + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/ApiResponse.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/ApiResponse.cs new file mode 100644 index 00000000000..fc328a20805 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/ApiResponse.cs @@ -0,0 +1,13 @@ +using System.Net.Http; + +namespace SeedContentTypes.Core; + +/// +/// The response object returned from the API. +/// +internal record ApiResponse +{ + internal required int StatusCode { get; init; } + + internal required HttpResponseMessage Raw { get; init; } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/BaseRequest.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/BaseRequest.cs new file mode 100644 index 00000000000..e4a00d8f0ad --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/BaseRequest.cs @@ -0,0 +1,63 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; + +namespace SeedContentTypes.Core; + +internal abstract record BaseRequest +{ + internal required string BaseUrl { get; init; } + + internal required HttpMethod Method { get; init; } + + internal required string Path { get; init; } + + internal string? ContentType { get; init; } + + internal Dictionary Query { get; init; } = new(); + + internal Headers Headers { get; init; } = new(); + + internal IRequestOptions? Options { get; init; } + + internal abstract HttpContent? CreateContent(); + + protected static ( + Encoding encoding, + string? charset, + string mediaType + ) ParseContentTypeOrDefault( + string? contentType, + Encoding encodingFallback, + string mediaTypeFallback + ) + { + var encoding = encodingFallback; + var mediaType = mediaTypeFallback; + string? charset = null; + if (string.IsNullOrEmpty(contentType)) + { + return (encoding, charset, mediaType); + } + + if (!MediaTypeHeaderValue.TryParse(contentType, out var mediaTypeHeaderValue)) + { + return (encoding, charset, mediaType); + } + + if (!string.IsNullOrEmpty(mediaTypeHeaderValue.CharSet)) + { + charset = mediaTypeHeaderValue.CharSet; + encoding = Encoding.GetEncoding(mediaTypeHeaderValue.CharSet); + } + + if (!string.IsNullOrEmpty(mediaTypeHeaderValue.MediaType)) + { + mediaType = mediaTypeHeaderValue.MediaType; + } + + return (encoding, charset, mediaType); + } + + protected static Encoding Utf8NoBom => EncodingCache.Utf8NoBom; +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/CollectionItemSerializer.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/CollectionItemSerializer.cs new file mode 100644 index 00000000000..ac2ecc55ed9 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/CollectionItemSerializer.cs @@ -0,0 +1,89 @@ +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedContentTypes.Core; + +/// +/// Json collection converter. +/// +/// Type of item to convert. +/// Converter to use for individual items. +internal class CollectionItemSerializer + : JsonConverter> + where TConverterType : JsonConverter +{ + /// + /// Reads a json string and deserializes it into an object. + /// + /// Json reader. + /// Type to convert. + /// Serializer options. + /// Created object. + public override IEnumerable? Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType == JsonTokenType.Null) + { + return default; + } + + var jsonSerializerOptions = new JsonSerializerOptions(options); + jsonSerializerOptions.Converters.Clear(); + jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); + + var returnValue = new List(); + + while (reader.TokenType != JsonTokenType.EndArray) + { + if (reader.TokenType != JsonTokenType.StartArray) + { + var item = (TDatatype)( + JsonSerializer.Deserialize(ref reader, typeof(TDatatype), jsonSerializerOptions) + ?? throw new Exception( + $"Failed to deserialize collection item of type {typeof(TDatatype)}" + ) + ); + returnValue.Add(item); + } + + reader.Read(); + } + + return returnValue; + } + + /// + /// Writes a json string. + /// + /// Json writer. + /// Value to write. + /// Serializer options. + public override void Write( + Utf8JsonWriter writer, + IEnumerable? value, + JsonSerializerOptions options + ) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + var jsonSerializerOptions = new JsonSerializerOptions(options); + jsonSerializerOptions.Converters.Clear(); + jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); + + writer.WriteStartArray(); + + foreach (var data in value) + { + JsonSerializer.Serialize(writer, data, jsonSerializerOptions); + } + + writer.WriteEndArray(); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Constants.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Constants.cs new file mode 100644 index 00000000000..4ff044e137d --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Constants.cs @@ -0,0 +1,7 @@ +namespace SeedContentTypes.Core; + +internal static class Constants +{ + public const string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffK"; + public const string DateFormat = "yyyy-MM-dd"; +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/DateOnlyConverter.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/DateOnlyConverter.cs new file mode 100644 index 00000000000..a1a5c8e4aa7 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/DateOnlyConverter.cs @@ -0,0 +1,748 @@ +// ReSharper disable All +#pragma warning disable + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using global::System.Diagnostics; +using global::System.Diagnostics.CodeAnalysis; +using global::System.Globalization; +using global::System.Runtime.CompilerServices; +using global::System.Runtime.InteropServices; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +// ReSharper disable SuggestVarOrType_SimpleTypes +// ReSharper disable SuggestVarOrType_BuiltInTypes + +namespace SeedContentTypes.Core +{ + /// + /// Custom converter for handling the data type with the System.Text.Json library. + /// + /// + /// This class backported from: + /// + /// System.Text.Json.Serialization.Converters.DateOnlyConverter + /// + public sealed class DateOnlyConverter : JsonConverter + { + private const int FormatLength = 10; // YYYY-MM-DD + + private const int MaxEscapedFormatLength = + FormatLength * JsonConstants.MaxExpansionFactorWhileEscaping; + + /// + public override DateOnly Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType != JsonTokenType.String) + { + ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); + } + + return ReadCore(ref reader); + } + + /// + public override DateOnly ReadAsPropertyName( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); + return ReadCore(ref reader); + } + + private static DateOnly ReadCore(ref Utf8JsonReader reader) + { + if ( + !JsonHelpers.IsInRangeInclusive( + reader.ValueLength(), + FormatLength, + MaxEscapedFormatLength + ) + ) + { + ThrowHelper.ThrowFormatException(DataType.DateOnly); + } + + scoped ReadOnlySpan source; + if (!reader.HasValueSequence && !reader.ValueIsEscaped) + { + source = reader.ValueSpan; + } + else + { + Span stackSpan = stackalloc byte[MaxEscapedFormatLength]; + int bytesWritten = reader.CopyString(stackSpan); + source = stackSpan.Slice(0, bytesWritten); + } + + if (!JsonHelpers.TryParseAsIso(source, out DateOnly value)) + { + ThrowHelper.ThrowFormatException(DataType.DateOnly); + } + + return value; + } + + /// + public override void Write( + Utf8JsonWriter writer, + DateOnly value, + JsonSerializerOptions options + ) + { +#if NET8_0_OR_GREATER + Span buffer = stackalloc byte[FormatLength]; +#else + Span buffer = stackalloc char[FormatLength]; +#endif + // ReSharper disable once RedundantAssignment + bool formattedSuccessfully = value.TryFormat( + buffer, + out int charsWritten, + "O".AsSpan(), + CultureInfo.InvariantCulture + ); + Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); + writer.WriteStringValue(buffer); + } + + /// + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DateOnly value, + JsonSerializerOptions options + ) + { +#if NET8_0_OR_GREATER + Span buffer = stackalloc byte[FormatLength]; +#else + Span buffer = stackalloc char[FormatLength]; +#endif + // ReSharper disable once RedundantAssignment + bool formattedSuccessfully = value.TryFormat( + buffer, + out int charsWritten, + "O".AsSpan(), + CultureInfo.InvariantCulture + ); + Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); + writer.WritePropertyName(buffer); + } + } + + internal static class JsonConstants + { + // The maximum number of fraction digits the Json DateTime parser allows + public const int DateTimeParseNumFractionDigits = 16; + + // In the worst case, an ASCII character represented as a single utf-8 byte could expand 6x when escaped. + public const int MaxExpansionFactorWhileEscaping = 6; + + // The largest fraction expressible by TimeSpan and DateTime formats + public const int MaxDateTimeFraction = 9_999_999; + + // TimeSpan and DateTime formats allow exactly up to many digits for specifying the fraction after the seconds. + public const int DateTimeNumFractionDigits = 7; + + public const byte UtcOffsetToken = (byte)'Z'; + + public const byte TimePrefix = (byte)'T'; + + public const byte Period = (byte)'.'; + + public const byte Hyphen = (byte)'-'; + + public const byte Colon = (byte)':'; + + public const byte Plus = (byte)'+'; + } + + // ReSharper disable SuggestVarOrType_Elsewhere + // ReSharper disable SuggestVarOrType_SimpleTypes + // ReSharper disable SuggestVarOrType_BuiltInTypes + + + internal static class JsonHelpers + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsInRangeInclusive(int value, int lowerBound, int upperBound) => + (uint)(value - lowerBound) <= (uint)(upperBound - lowerBound); + + public static bool IsDigit(byte value) => (uint)(value - '0') <= '9' - '0'; + + [StructLayout(LayoutKind.Auto)] + private struct DateTimeParseData + { + public int Year; + public int Month; + public int Day; + public bool IsCalendarDateOnly; + public int Hour; + public int Minute; + public int Second; + public int Fraction; // This value should never be greater than 9_999_999. + public int OffsetHours; + public int OffsetMinutes; + + // ReSharper disable once NotAccessedField.Local + public byte OffsetToken; + } + + public static bool TryParseAsIso(ReadOnlySpan source, out DateOnly value) + { + if ( + TryParseDateTimeOffset(source, out DateTimeParseData parseData) + && parseData.IsCalendarDateOnly + && TryCreateDateTime(parseData, DateTimeKind.Unspecified, out DateTime dateTime) + ) + { + value = DateOnly.FromDateTime(dateTime); + return true; + } + + value = default; + return false; + } + + /// + /// ISO 8601 date time parser (ISO 8601-1:2019). + /// + /// The date/time to parse in UTF-8 format. + /// The parsed for the given . + /// + /// Supports extended calendar date (5.2.2.1) and complete (5.4.2.1) calendar date/time of day + /// representations with optional specification of seconds and fractional seconds. + /// + /// Times can be explicitly specified as UTC ("Z" - 5.3.3) or offsets from UTC ("+/-hh:mm" 5.3.4.2). + /// If unspecified they are considered to be local per spec. + /// + /// Examples: (TZD is either "Z" or hh:mm offset from UTC) + /// + /// YYYY-MM-DD (e.g. 1997-07-16) + /// YYYY-MM-DDThh:mm (e.g. 1997-07-16T19:20) + /// YYYY-MM-DDThh:mm:ss (e.g. 1997-07-16T19:20:30) + /// YYYY-MM-DDThh:mm:ss.s (e.g. 1997-07-16T19:20:30.45) + /// YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00) + /// YYYY-MM-DDThh:mm:ssTZD (e.g. 1997-07-16T19:20:3001:00) + /// YYYY-MM-DDThh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45Z) + /// + /// Generally speaking we always require the "extended" option when one exists (3.1.3.5). + /// The extended variants have separator characters between components ('-', ':', '.', etc.). + /// Spaces are not permitted. + /// + /// "true" if successfully parsed. + private static bool TryParseDateTimeOffset( + ReadOnlySpan source, + out DateTimeParseData parseData + ) + { + parseData = default; + + // too short datetime + Debug.Assert(source.Length >= 10); + + // Parse the calendar date + // ----------------------- + // ISO 8601-1:2019 5.2.2.1b "Calendar date complete extended format" + // [dateX] = [year]["-"][month]["-"][day] + // [year] = [YYYY] [0000 - 9999] (4.3.2) + // [month] = [MM] [01 - 12] (4.3.3) + // [day] = [DD] [01 - 28, 29, 30, 31] (4.3.4) + // + // Note: 5.2.2.2 "Representations with reduced precision" allows for + // just [year]["-"][month] (a) and just [year] (b), but we currently + // don't permit it. + + { + uint digit1 = source[0] - (uint)'0'; + uint digit2 = source[1] - (uint)'0'; + uint digit3 = source[2] - (uint)'0'; + uint digit4 = source[3] - (uint)'0'; + + if (digit1 > 9 || digit2 > 9 || digit3 > 9 || digit4 > 9) + { + return false; + } + + parseData.Year = (int)(digit1 * 1000 + digit2 * 100 + digit3 * 10 + digit4); + } + + if ( + source[4] != JsonConstants.Hyphen + || !TryGetNextTwoDigits(source.Slice(start: 5, length: 2), ref parseData.Month) + || source[7] != JsonConstants.Hyphen + || !TryGetNextTwoDigits(source.Slice(start: 8, length: 2), ref parseData.Day) + ) + { + return false; + } + + // We now have YYYY-MM-DD [dateX] + // ReSharper disable once ConvertIfStatementToSwitchStatement + if (source.Length == 10) + { + parseData.IsCalendarDateOnly = true; + return true; + } + + // Parse the time of day + // --------------------- + // + // ISO 8601-1:2019 5.3.1.2b "Local time of day complete extended format" + // [timeX] = ["T"][hour][":"][min][":"][sec] + // [hour] = [hh] [00 - 23] (4.3.8a) + // [minute] = [mm] [00 - 59] (4.3.9a) + // [sec] = [ss] [00 - 59, 60 with a leap second] (4.3.10a) + // + // ISO 8601-1:2019 5.3.3 "UTC of day" + // [timeX]["Z"] + // + // ISO 8601-1:2019 5.3.4.2 "Local time of day with the time shift between + // local timescale and UTC" (Extended format) + // + // [shiftX] = ["+"|"-"][hour][":"][min] + // + // Notes: + // + // "T" is optional per spec, but _only_ when times are used alone. In our + // case, we're reading out a complete date & time and as such require "T". + // (5.4.2.1b). + // + // For [timeX] We allow seconds to be omitted per 5.3.1.3a "Representations + // with reduced precision". 5.3.1.3b allows just specifying the hour, but + // we currently don't permit this. + // + // Decimal fractions are allowed for hours, minutes and seconds (5.3.14). + // We only allow fractions for seconds currently. Lower order components + // can't follow, i.e. you can have T23.3, but not T23.3:04. There must be + // one digit, but the max number of digits is implementation defined. We + // currently allow up to 16 digits of fractional seconds only. While we + // support 16 fractional digits we only parse the first seven, anything + // past that is considered a zero. This is to stay compatible with the + // DateTime implementation which is limited to this resolution. + + if (source.Length < 16) + { + // Source does not have enough characters for YYYY-MM-DDThh:mm + return false; + } + + // Parse THH:MM (e.g. "T10:32") + if ( + source[10] != JsonConstants.TimePrefix + || source[13] != JsonConstants.Colon + || !TryGetNextTwoDigits(source.Slice(start: 11, length: 2), ref parseData.Hour) + || !TryGetNextTwoDigits(source.Slice(start: 14, length: 2), ref parseData.Minute) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm + Debug.Assert(source.Length >= 16); + if (source.Length == 16) + { + return true; + } + + byte curByte = source[16]; + int sourceIndex = 17; + + // Either a TZD ['Z'|'+'|'-'] or a seconds separator [':'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + case JsonConstants.Colon: + break; + default: + return false; + } + + // Try reading the seconds + if ( + source.Length < 19 + || !TryGetNextTwoDigits(source.Slice(start: 17, length: 2), ref parseData.Second) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm:ss + Debug.Assert(source.Length >= 19); + if (source.Length == 19) + { + return true; + } + + curByte = source[19]; + sourceIndex = 20; + + // Either a TZD ['Z'|'+'|'-'] or a seconds decimal fraction separator ['.'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + case JsonConstants.Period: + break; + default: + return false; + } + + // Source does not have enough characters for second fractions (i.e. ".s") + // YYYY-MM-DDThh:mm:ss.s + if (source.Length < 21) + { + return false; + } + + // Parse fraction. This value should never be greater than 9_999_999 + int numDigitsRead = 0; + int fractionEnd = Math.Min( + sourceIndex + JsonConstants.DateTimeParseNumFractionDigits, + source.Length + ); + + while (sourceIndex < fractionEnd && IsDigit(curByte = source[sourceIndex])) + { + if (numDigitsRead < JsonConstants.DateTimeNumFractionDigits) + { + parseData.Fraction = parseData.Fraction * 10 + (int)(curByte - (uint)'0'); + numDigitsRead++; + } + + sourceIndex++; + } + + if (parseData.Fraction != 0) + { + while (numDigitsRead < JsonConstants.DateTimeNumFractionDigits) + { + parseData.Fraction *= 10; + numDigitsRead++; + } + } + + // We now have YYYY-MM-DDThh:mm:ss.s + Debug.Assert(sourceIndex <= source.Length); + if (sourceIndex == source.Length) + { + return true; + } + + curByte = source[sourceIndex++]; + + // TZD ['Z'|'+'|'-'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + default: + return false; + } + + static bool ParseOffset(ref DateTimeParseData parseData, ReadOnlySpan offsetData) + { + // Parse the hours for the offset + if ( + offsetData.Length < 2 + || !TryGetNextTwoDigits(offsetData.Slice(0, 2), ref parseData.OffsetHours) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm:ss.s+|-hh + + if (offsetData.Length == 2) + { + // Just hours offset specified + return true; + } + + // Ensure we have enough for ":mm" + return offsetData.Length == 5 + && offsetData[2] == JsonConstants.Colon + && TryGetNextTwoDigits(offsetData.Slice(3), ref parseData.OffsetMinutes); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + // ReSharper disable once RedundantAssignment + private static bool TryGetNextTwoDigits(ReadOnlySpan source, ref int value) + { + Debug.Assert(source.Length == 2); + + uint digit1 = source[0] - (uint)'0'; + uint digit2 = source[1] - (uint)'0'; + + if (digit1 > 9 || digit2 > 9) + { + value = 0; + return false; + } + + value = (int)(digit1 * 10 + digit2); + return true; + } + + // The following methods are borrowed verbatim from src/Common/src/CoreLib/System/Buffers/Text/Utf8Parser/Utf8Parser.Date.Helpers.cs + + /// + /// Overflow-safe DateTime factory. + /// + private static bool TryCreateDateTime( + DateTimeParseData parseData, + DateTimeKind kind, + out DateTime value + ) + { + if (parseData.Year == 0) + { + value = default; + return false; + } + + Debug.Assert(parseData.Year <= 9999); // All of our callers to date parse the year from fixed 4-digit fields so this value is trusted. + + if ((uint)parseData.Month - 1 >= 12) + { + value = default; + return false; + } + + uint dayMinusOne = (uint)parseData.Day - 1; + if ( + dayMinusOne >= 28 + && dayMinusOne >= DateTime.DaysInMonth(parseData.Year, parseData.Month) + ) + { + value = default; + return false; + } + + if ((uint)parseData.Hour > 23) + { + value = default; + return false; + } + + if ((uint)parseData.Minute > 59) + { + value = default; + return false; + } + + // This needs to allow leap seconds when appropriate. + // See https://github.com/dotnet/runtime/issues/30135. + if ((uint)parseData.Second > 59) + { + value = default; + return false; + } + + Debug.Assert(parseData.Fraction is >= 0 and <= JsonConstants.MaxDateTimeFraction); // All of our callers to date parse the fraction from fixed 7-digit fields so this value is trusted. + + ReadOnlySpan days = DateTime.IsLeapYear(parseData.Year) + ? DaysToMonth366 + : DaysToMonth365; + int yearMinusOne = parseData.Year - 1; + int totalDays = + yearMinusOne * 365 + + yearMinusOne / 4 + - yearMinusOne / 100 + + yearMinusOne / 400 + + days[parseData.Month - 1] + + parseData.Day + - 1; + long ticks = totalDays * TimeSpan.TicksPerDay; + int totalSeconds = parseData.Hour * 3600 + parseData.Minute * 60 + parseData.Second; + ticks += totalSeconds * TimeSpan.TicksPerSecond; + ticks += parseData.Fraction; + value = new DateTime(ticks: ticks, kind: kind); + return true; + } + + private static ReadOnlySpan DaysToMonth365 => + [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; + private static ReadOnlySpan DaysToMonth366 => + [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]; + } + + internal static class ThrowHelper + { + private const string ExceptionSourceValueToRethrowAsJsonException = + "System.Text.Json.Rethrowable"; + + [DoesNotReturn] + public static void ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType) + { + throw GetInvalidOperationException("string", tokenType); + } + + public static void ThrowFormatException(DataType dataType) + { + throw new FormatException(SR.Format(SR.UnsupportedFormat, dataType)) + { + Source = ExceptionSourceValueToRethrowAsJsonException, + }; + } + + private static Exception GetInvalidOperationException( + string message, + JsonTokenType tokenType + ) + { + return GetInvalidOperationException(SR.Format(SR.InvalidCast, tokenType, message)); + } + + private static InvalidOperationException GetInvalidOperationException(string message) + { + return new InvalidOperationException(message) + { + Source = ExceptionSourceValueToRethrowAsJsonException, + }; + } + } + + internal static class Utf8JsonReaderExtensions + { + internal static int ValueLength(this Utf8JsonReader reader) => + reader.HasValueSequence + ? checked((int)reader.ValueSequence.Length) + : reader.ValueSpan.Length; + } + + internal enum DataType + { + TimeOnly, + DateOnly, + } + + [SuppressMessage("ReSharper", "InconsistentNaming")] + internal static class SR + { + private static readonly bool s_usingResourceKeys = + AppContext.TryGetSwitch( + "System.Resources.UseSystemResourceKeys", + out bool usingResourceKeys + ) && usingResourceKeys; + + public static string UnsupportedFormat => Strings.UnsupportedFormat; + + public static string InvalidCast => Strings.InvalidCast; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static string Format(string resourceFormat, object? p1) => + s_usingResourceKeys + ? string.Join(", ", resourceFormat, p1) + : string.Format(resourceFormat, p1); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static string Format(string resourceFormat, object? p1, object? p2) => + s_usingResourceKeys + ? string.Join(", ", resourceFormat, p1, p2) + : string.Format(resourceFormat, p1, p2); + } + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute( + "System.Resources.Tools.StronglyTypedResourceBuilder", + "17.0.0.0" + )] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Strings + { + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( + "Microsoft.Performance", + "CA1811:AvoidUncalledPrivateCode" + )] + internal Strings() { } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute( + global::System.ComponentModel.EditorBrowsableState.Advanced + )] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = + new global::System.Resources.ResourceManager( + "System.Text.Json.Resources.Strings", + typeof(Strings).Assembly + ); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute( + global::System.ComponentModel.EditorBrowsableState.Advanced + )] + internal static global::System.Globalization.CultureInfo Culture + { + get { return resourceCulture; } + set { resourceCulture = value; } + } + + /// + /// Looks up a localized string similar to Cannot get the value of a token type '{0}' as a {1}.. + /// + internal static string InvalidCast + { + get { return ResourceManager.GetString("InvalidCast", resourceCulture); } + } + + /// + /// Looks up a localized string similar to The JSON value is not in a supported {0} format.. + /// + internal static string UnsupportedFormat + { + get { return ResourceManager.GetString("UnsupportedFormat", resourceCulture); } + } + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/DateTimeSerializer.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/DateTimeSerializer.cs new file mode 100644 index 00000000000..3d56aa93897 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/DateTimeSerializer.cs @@ -0,0 +1,22 @@ +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedContentTypes.Core; + +internal class DateTimeSerializer : JsonConverter +{ + public override DateTime Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + return DateTime.Parse(reader.GetString()!, null, DateTimeStyles.RoundtripKind); + } + + public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString(Constants.DateTimeFormat)); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/EmptyRequest.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/EmptyRequest.cs new file mode 100644 index 00000000000..576dc87a050 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/EmptyRequest.cs @@ -0,0 +1,11 @@ +using System.Net.Http; + +namespace SeedContentTypes.Core; + +/// +/// The request object to send without a request body. +/// +internal record EmptyRequest : BaseRequest +{ + internal override HttpContent? CreateContent() => null; +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/EncodingCache.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/EncodingCache.cs new file mode 100644 index 00000000000..8e03595f02e --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/EncodingCache.cs @@ -0,0 +1,11 @@ +using System.Text; + +namespace SeedContentTypes.Core; + +internal static class EncodingCache +{ + internal static readonly Encoding Utf8NoBom = new UTF8Encoding( + encoderShouldEmitUTF8Identifier: false, + throwOnInvalidBytes: true + ); +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/EnumSerializer.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/EnumSerializer.cs new file mode 100644 index 00000000000..01755796d38 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/EnumSerializer.cs @@ -0,0 +1,53 @@ +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedContentTypes.Core; + +internal class EnumSerializer : JsonConverter + where TEnum : struct, Enum +{ + private readonly Dictionary _enumToString = new(); + private readonly Dictionary _stringToEnum = new(); + + public EnumSerializer() + { + var type = typeof(TEnum); + var values = Enum.GetValues(type); + + foreach (var value in values) + { + var enumValue = (TEnum)value; + var enumMember = type.GetField(enumValue.ToString())!; + var attr = enumMember + .GetCustomAttributes(typeof(EnumMemberAttribute), false) + .Cast() + .FirstOrDefault(); + + var stringValue = + attr?.Value + ?? value.ToString() + ?? throw new Exception("Unexpected null enum toString value"); + + _enumToString.Add(enumValue, stringValue); + _stringToEnum.Add(stringValue, enumValue); + } + } + + public override TEnum Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write(Utf8JsonWriter writer, TEnum value, JsonSerializerOptions options) + { + writer.WriteStringValue(_enumToString[value]); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Extensions.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Extensions.cs new file mode 100644 index 00000000000..5e904f580e3 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Extensions.cs @@ -0,0 +1,14 @@ +using System.Runtime.Serialization; + +namespace SeedContentTypes.Core; + +internal static class Extensions +{ + public static string Stringify(this Enum value) + { + var field = value.GetType().GetField(value.ToString()); + var attribute = (EnumMemberAttribute) + Attribute.GetCustomAttribute(field, typeof(EnumMemberAttribute)); + return attribute?.Value ?? value.ToString(); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/FormUrlEncoder.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/FormUrlEncoder.cs new file mode 100644 index 00000000000..d828b9c36d1 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/FormUrlEncoder.cs @@ -0,0 +1,33 @@ +using global::System.Net.Http; + +namespace SeedContentTypes.Core; + +/// +/// Encodes an object into a form URL-encoded content. +/// +public static class FormUrlEncoder +{ + /// + /// Encodes an object into a form URL-encoded content using Deep Object notation. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + internal static FormUrlEncodedContent EncodeAsDeepObject(object value) => + new(QueryStringConverter.ToDeepObject(value)); + + /// + /// Encodes an object into a form URL-encoded content using Exploded Form notation. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + internal static FormUrlEncodedContent EncodeAsExplodedForm(object value) => + new(QueryStringConverter.ToExplodedForm(value)); + + /// + /// Encodes an object into a form URL-encoded content using Form notation without exploding parameters. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + internal static FormUrlEncodedContent EncodeAsForm(object value) => + new(QueryStringConverter.ToForm(value)); +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/HeaderValue.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/HeaderValue.cs new file mode 100644 index 00000000000..b7fc75e1a12 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/HeaderValue.cs @@ -0,0 +1,17 @@ +using OneOf; + +namespace SeedContentTypes.Core; + +internal sealed class HeaderValue(OneOf> value) + : OneOfBase>(value) +{ + public static implicit operator HeaderValue(string value) + { + return new HeaderValue(value); + } + + public static implicit operator HeaderValue(Func value) + { + return new HeaderValue(value); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Headers.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Headers.cs new file mode 100644 index 00000000000..c32ee872fa3 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Headers.cs @@ -0,0 +1,28 @@ +namespace SeedContentTypes.Core; + +/// +/// Represents the headers sent with the request. +/// +internal sealed class Headers : Dictionary +{ + internal Headers() { } + + /// + /// Initializes a new instance of the Headers class with the specified value. + /// + /// + internal Headers(Dictionary value) + { + foreach (var kvp in value) + { + this[kvp.Key] = new HeaderValue(kvp.Value); + } + } + + /// + /// Initializes a new instance of the Headers class with the specified value. + /// + /// + internal Headers(IEnumerable> value) + : base(value.ToDictionary(e => e.Key, e => e.Value)) { } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/HttpMethodExtensions.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/HttpMethodExtensions.cs new file mode 100644 index 00000000000..6df4b4bbea8 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/HttpMethodExtensions.cs @@ -0,0 +1,8 @@ +using System.Net.Http; + +namespace SeedContentTypes.Core; + +internal static class HttpMethodExtensions +{ + public static readonly HttpMethod Patch = new("PATCH"); +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/IIsRetryableContent.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/IIsRetryableContent.cs new file mode 100644 index 00000000000..779f10bb30e --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/IIsRetryableContent.cs @@ -0,0 +1,6 @@ +namespace SeedContentTypes.Core; + +public interface IIsRetryableContent +{ + public bool IsRetryable { get; } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/IRequestOptions.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/IRequestOptions.cs new file mode 100644 index 00000000000..fc9a8ea1c40 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/IRequestOptions.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; + +namespace SeedContentTypes.Core; + +internal interface IRequestOptions +{ + /// + /// The Base URL for the API. + /// + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// The http client used to make requests. + /// + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// The http headers sent with the request. + /// + internal Headers Headers { get; init; } + + /// + /// Additional headers to be sent with the request. + /// Headers previously set with matching keys will be overwritten. + /// + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// The http client used to make requests. + /// + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// The timeout for the request. + /// + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// Additional query parameters sent with the request. + /// + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// Additional body properties sent with the request. + /// This is only applied to JSON requests. + /// + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/JsonAccessAttribute.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/JsonAccessAttribute.cs new file mode 100644 index 00000000000..1edcce487e7 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/JsonAccessAttribute.cs @@ -0,0 +1,13 @@ +namespace SeedContentTypes.Core; + +[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] +internal class JsonAccessAttribute(JsonAccessType accessType) : Attribute +{ + internal JsonAccessType AccessType { get; init; } = accessType; +} + +internal enum JsonAccessType +{ + ReadOnly, + WriteOnly, +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/JsonConfiguration.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/JsonConfiguration.cs new file mode 100644 index 00000000000..db2755adf20 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/JsonConfiguration.cs @@ -0,0 +1,156 @@ +using global::System.Text.Json; +using global::System.Text.Json.Nodes; +using global::System.Text.Json.Serialization; +using global::System.Text.Json.Serialization.Metadata; + +namespace SeedContentTypes.Core; + +internal static partial class JsonOptions +{ + internal static readonly JsonSerializerOptions JsonSerializerOptions; + + static JsonOptions() + { + var options = new JsonSerializerOptions + { + Converters = { new DateTimeSerializer(), +#if USE_PORTABLE_DATE_ONLY + new DateOnlyConverter(), +#endif + new OneOfSerializer() }, +#if DEBUG + WriteIndented = true, +#endif + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = new DefaultJsonTypeInfoResolver + { + Modifiers = + { + static typeInfo => + { + if (typeInfo.Kind != JsonTypeInfoKind.Object) + return; + + foreach (var propertyInfo in typeInfo.Properties) + { + var jsonAccessAttribute = propertyInfo + .AttributeProvider?.GetCustomAttributes( + typeof(JsonAccessAttribute), + true + ) + .OfType() + .FirstOrDefault(); + + if (jsonAccessAttribute != null) + { + propertyInfo.IsRequired = false; + switch (jsonAccessAttribute.AccessType) + { + case JsonAccessType.ReadOnly: + propertyInfo.Get = null; + propertyInfo.ShouldSerialize = (_, _) => false; + break; + case JsonAccessType.WriteOnly: + propertyInfo.Set = null; + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + var jsonIgnoreAttribute = propertyInfo + .AttributeProvider?.GetCustomAttributes( + typeof(JsonIgnoreAttribute), + true + ) + .OfType() + .FirstOrDefault(); + + if (jsonIgnoreAttribute is not null) + { + propertyInfo.IsRequired = false; + } + } + }, + }, + }, + }; + ConfigureJsonSerializerOptions(options); + JsonSerializerOptions = options; + } + + static partial void ConfigureJsonSerializerOptions(JsonSerializerOptions defaultOptions); +} + +internal static class JsonUtils +{ + internal static string Serialize(T obj) => + JsonSerializer.Serialize(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonElement SerializeToElement(T obj) => + JsonSerializer.SerializeToElement(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonDocument SerializeToDocument(T obj) => + JsonSerializer.SerializeToDocument(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonNode? SerializeToNode(T obj) => + JsonSerializer.SerializeToNode(obj, JsonOptions.JsonSerializerOptions); + + internal static byte[] SerializeToUtf8Bytes(T obj) => + JsonSerializer.SerializeToUtf8Bytes(obj, JsonOptions.JsonSerializerOptions); + + internal static string SerializeWithAdditionalProperties( + T obj, + object? additionalProperties = null + ) + { + if (additionalProperties == null) + { + return Serialize(obj); + } + var additionalPropertiesJsonNode = SerializeToNode(additionalProperties); + if (additionalPropertiesJsonNode is not JsonObject additionalPropertiesJsonObject) + { + throw new InvalidOperationException( + "The additional properties must serialize to a JSON object." + ); + } + var jsonNode = SerializeToNode(obj); + if (jsonNode is not JsonObject jsonObject) + { + throw new InvalidOperationException( + "The serialized object must be a JSON object to add properties." + ); + } + MergeJsonObjects(jsonObject, additionalPropertiesJsonObject); + return jsonObject.ToJsonString(JsonOptions.JsonSerializerOptions); + } + + private static void MergeJsonObjects(JsonObject baseObject, JsonObject overrideObject) + { + foreach (var property in overrideObject) + { + if (!baseObject.TryGetPropertyValue(property.Key, out JsonNode? existingValue)) + { + baseObject[property.Key] = + property.Value != null ? JsonNode.Parse(property.Value.ToJsonString()) : null; + continue; + } + if ( + existingValue is JsonObject nestedBaseObject + && property.Value is JsonObject nestedOverrideObject + ) + { + // If both values are objects, recursively merge them. + MergeJsonObjects(nestedBaseObject, nestedOverrideObject); + continue; + } + // Otherwise, the overrideObject takes precedence. + baseObject[property.Key] = + property.Value != null ? JsonNode.Parse(property.Value.ToJsonString()) : null; + } + } + + internal static T Deserialize(string json) => + JsonSerializer.Deserialize(json, JsonOptions.JsonSerializerOptions)!; +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/JsonRequest.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/JsonRequest.cs new file mode 100644 index 00000000000..bc3be994d1d --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/JsonRequest.cs @@ -0,0 +1,36 @@ +using System.Net.Http; + +namespace SeedContentTypes.Core; + +/// +/// The request object to be sent for JSON APIs. +/// +internal record JsonRequest : BaseRequest +{ + internal object? Body { get; init; } + + internal override HttpContent? CreateContent() + { + if (Body is null && Options?.AdditionalBodyProperties is null) + { + return null; + } + + var (encoding, charset, mediaType) = ParseContentTypeOrDefault( + ContentType, + Utf8NoBom, + "application/json" + ); + var content = new StringContent( + JsonUtils.SerializeWithAdditionalProperties(Body, Options?.AdditionalBodyProperties), + encoding, + mediaType + ); + if (string.IsNullOrEmpty(charset) && content.Headers.ContentType is not null) + { + content.Headers.ContentType.CharSet = ""; + } + + return content; + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/MultipartFormRequest.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/MultipartFormRequest.cs new file mode 100644 index 00000000000..3cfa9e11d67 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/MultipartFormRequest.cs @@ -0,0 +1,275 @@ +using System.Net.Http; +using System.Net.Http.Headers; + +namespace SeedContentTypes.Core; + +/// +/// The request object to be sent for multipart form data. +/// +internal record MultipartFormRequest : BaseRequest +{ + private readonly List> _partAdders = []; + + internal void AddJsonPart(string name, object? value) => AddJsonPart(name, value, null); + + internal void AddJsonPart(string name, object? value, string? contentType) + { + if (value is null) + { + return; + } + + _partAdders.Add(form => + { + var (encoding, charset, mediaType) = ParseContentTypeOrDefault( + contentType, + Utf8NoBom, + "application/json" + ); + var content = new StringContent(JsonUtils.Serialize(value), encoding, mediaType); + if (string.IsNullOrEmpty(charset) && content.Headers.ContentType is not null) + { + content.Headers.ContentType.CharSet = ""; + } + + form.Add(content, name); + }); + } + + internal void AddJsonParts(string name, IEnumerable? value) => + AddJsonParts(name, value, null); + + internal void AddJsonParts(string name, IEnumerable? value, string? contentType) + { + if (value is null) + { + return; + } + + foreach (var item in value) + { + AddJsonPart(name, item, contentType); + } + } + + internal void AddStringPart(string name, object? value) => AddStringPart(name, value, null); + + internal void AddStringPart(string name, object? value, string? contentType) + { + if (value is null) + { + return; + } + + AddStringPart(name, ValueConvert.ToString(value), contentType); + } + + internal void AddStringPart(string name, string? value) => AddStringPart(name, value, null); + + internal void AddStringPart(string name, string? value, string? contentType) + { + if (value is null) + { + return; + } + + _partAdders.Add(form => + { + var (encoding, charset, mediaType) = ParseContentTypeOrDefault( + contentType, + Utf8NoBom, + "text/plain" + ); + var content = new StringContent(value, encoding, mediaType); + if (string.IsNullOrEmpty(charset) && content.Headers.ContentType is not null) + { + content.Headers.ContentType.CharSet = ""; + } + + form.Add(content, name); + }); + } + + internal void AddStringParts(string name, IEnumerable? value) => + AddStringParts(name, value, null); + + internal void AddStringParts(string name, IEnumerable? value, string? contentType) + { + if (value is null) + { + return; + } + + AddStringPart(name, ValueConvert.ToString(value), contentType); + } + + internal void AddStringParts(string name, IEnumerable? value) => + AddStringParts(name, value, null); + + internal void AddStringParts(string name, IEnumerable? value, string? contentType) + { + if (value is null) + { + return; + } + + foreach (var item in value) + { + AddStringPart(name, item, contentType); + } + } + + internal void AddStreamPart(string name, Stream? stream, string? fileName) => + AddStreamPart(name, stream, fileName, null); + + internal void AddStreamPart(string name, Stream? stream, string? fileName, string? contentType) + { + if (stream is null) + { + return; + } + + _partAdders.Add(form => + { + var content = new StreamContent(stream) + { + Headers = + { + ContentType = MediaTypeHeaderValue.Parse( + contentType ?? "application/octet-stream" + ), + }, + }; + + if (fileName is not null) + { + form.Add(content, name, fileName); + } + else + { + form.Add(content, name); + } + }); + } + + internal void AddFileParameterPart(string name, FileParameter? file) => + AddFileParameterPart(name, file, null); + + internal void AddFileParameterPart( + string name, + FileParameter? file, + string? fallbackContentType + ) => + AddStreamPart(name, file?.Stream, file?.FileName, file?.ContentType ?? fallbackContentType); + + internal void AddFileParameterParts(string name, IEnumerable? files) => + AddFileParameterParts(name, files, null); + + internal void AddFileParameterParts( + string name, + IEnumerable? files, + string? fallbackContentType + ) + { + if (files is null) + { + return; + } + + foreach (var file in files) + { + AddFileParameterPart(name, file, fallbackContentType); + } + } + + internal void AddFormEncodedPart(string name, object? value) => + AddFormEncodedPart(name, value, null); + + internal void AddFormEncodedPart(string name, object? value, string? contentType) + { + if (value is null) + { + return; + } + + _partAdders.Add(form => + { + var content = FormUrlEncoder.EncodeAsForm(value); + if (!string.IsNullOrEmpty(contentType)) + { + content.Headers.ContentType = MediaTypeHeaderValue.Parse(contentType); + } + + form.Add(content, name); + }); + } + + internal void AddFormEncodedParts(string name, IEnumerable? value) => + AddFormEncodedParts(name, value, null); + + internal void AddFormEncodedParts(string name, IEnumerable? value, string? contentType) + { + if (value is null) + { + return; + } + + foreach (var item in value) + { + AddFormEncodedPart(name, item, contentType); + } + } + + internal void AddExplodedFormEncodedPart(string name, object? value) => + AddExplodedFormEncodedPart(name, value, null); + + internal void AddExplodedFormEncodedPart(string name, object? value, string? contentType) + { + if (value is null) + { + return; + } + + _partAdders.Add(form => + { + var content = FormUrlEncoder.EncodeAsExplodedForm(value); + if (!string.IsNullOrEmpty(contentType)) + { + content.Headers.ContentType = MediaTypeHeaderValue.Parse(contentType); + } + + form.Add(content, name); + }); + } + + internal void AddExplodedFormEncodedParts(string name, IEnumerable? value) => + AddExplodedFormEncodedParts(name, value, null); + + internal void AddExplodedFormEncodedParts( + string name, + IEnumerable? value, + string? contentType + ) + { + if (value is null) + { + return; + } + + foreach (var item in value) + { + AddExplodedFormEncodedPart(name, item, contentType); + } + } + + internal override HttpContent CreateContent() + { + var form = new MultipartFormDataContent(); + foreach (var adder in _partAdders) + { + adder(form); + } + + return form; + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/OneOfSerializer.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/OneOfSerializer.cs new file mode 100644 index 00000000000..c6184dfc2fd --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/OneOfSerializer.cs @@ -0,0 +1,91 @@ +using System.Reflection; +using System.Text.Json; +using System.Text.Json.Serialization; +using OneOf; + +namespace SeedContentTypes.Core; + +internal class OneOfSerializer : JsonConverter +{ + public override IOneOf? Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType is JsonTokenType.Null) + return default; + + foreach (var (type, cast) in GetOneOfTypes(typeToConvert)) + { + try + { + var readerCopy = reader; + var result = JsonSerializer.Deserialize(ref readerCopy, type, options); + reader.Skip(); + return (IOneOf)cast.Invoke(null, [result])!; + } + catch (JsonException) { } + } + + throw new JsonException( + $"Cannot deserialize into one of the supported types for {typeToConvert}" + ); + } + + public override void Write(Utf8JsonWriter writer, IOneOf value, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, value.Value, options); + } + + private static (global::System.Type type, MethodInfo cast)[] GetOneOfTypes( + global::System.Type typeToConvert + ) + { + var type = typeToConvert; + if (Nullable.GetUnderlyingType(type) is { } underlyingType) + { + type = underlyingType; + } + + var casts = type.GetRuntimeMethods() + .Where(m => m.IsSpecialName && m.Name == "op_Implicit") + .ToArray(); + while (type != null) + { + if ( + type.IsGenericType + && (type.Name.StartsWith("OneOf`") || type.Name.StartsWith("OneOfBase`")) + ) + { + var genericArguments = type.GetGenericArguments(); + if (genericArguments.Length == 1) + { + return [(genericArguments[0], casts[0])]; + } + + // if object type is present, make sure it is last + var indexOfObjectType = Array.IndexOf(genericArguments, typeof(object)); + if (indexOfObjectType != -1 && genericArguments.Length - 1 != indexOfObjectType) + { + genericArguments = genericArguments + .OrderBy(t => t == typeof(object) ? 1 : 0) + .ToArray(); + } + + return genericArguments + .Select(t => (t, casts.First(c => c.GetParameters()[0].ParameterType == t))) + .ToArray(); + } + + type = type.BaseType; + } + + throw new InvalidOperationException($"{type} isn't OneOf or OneOfBase"); + } + + public override bool CanConvert(global::System.Type typeToConvert) + { + return typeof(IOneOf).IsAssignableFrom(typeToConvert); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/ClientOptions.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/ClientOptions.cs new file mode 100644 index 00000000000..0b094194d0c --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/ClientOptions.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using SeedContentTypes.Core; + +namespace SeedContentTypes; + +public partial class ClientOptions +{ + /// + /// The http headers sent with the request. + /// + internal Headers Headers { get; init; } = new(); + + /// + /// The Base URL for the API. + /// + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; + + /// + /// The http client used to make requests. + /// + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); + + /// + /// Additional headers to be sent with HTTP requests. + /// Headers with matching keys will be overwritten by headers set on the request. + /// + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; + + /// + /// The http client used to make requests. + /// + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; + + /// + /// The timeout for the request. + /// + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); + + /// + /// Clones this and returns a new instance + /// + internal ClientOptions Clone() + { + return new ClientOptions + { + BaseUrl = BaseUrl, + HttpClient = HttpClient, + MaxRetries = MaxRetries, + Timeout = Timeout, + Headers = new Headers(new Dictionary(Headers)), + }; + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/FileParameter.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/FileParameter.cs new file mode 100644 index 00000000000..620b10faaa5 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/FileParameter.cs @@ -0,0 +1,63 @@ +namespace SeedContentTypes; + +/// +/// File parameter for uploading files. +/// +public record FileParameter : IDisposable +#if NET6_0_OR_GREATER + , IAsyncDisposable +#endif +{ + private bool _disposed; + + /// + /// The name of the file to be uploaded. + /// + public string? FileName { get; set; } + + /// + /// The content type of the file to be uploaded. + /// + public string? ContentType { get; set; } + + /// + /// The content of the file to be uploaded. + /// + public required Stream Stream { get; set; } + + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + protected virtual void Dispose(bool disposing) + { + if (_disposed) + return; + if (disposing) + { + Stream.Dispose(); + } + + _disposed = true; + } + +#if NET6_0_OR_GREATER + /// + public async ValueTask DisposeAsync() + { + if (!_disposed) + { + await Stream.DisposeAsync().ConfigureAwait(false); + _disposed = true; + } + + GC.SuppressFinalize(this); + } +#endif + + public static implicit operator FileParameter(Stream stream) => new() { Stream = stream }; +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/RequestOptions.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/RequestOptions.cs new file mode 100644 index 00000000000..76c9e6b7439 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/RequestOptions.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using SeedContentTypes.Core; + +namespace SeedContentTypes; + +public partial class RequestOptions : IRequestOptions +{ + /// + /// The http headers sent with the request. + /// + Headers IRequestOptions.Headers { get; init; } = new(); + + /// + /// The Base URL for the API. + /// + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// The http client used to make requests. + /// + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// Additional headers to be sent with the request. + /// Headers previously set with matching keys will be overwritten. + /// + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; + + /// + /// The http client used to make requests. + /// + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// The timeout for the request. + /// + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// Additional query parameters sent with the request. + /// + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); + + /// + /// Additional body properties sent with the request. + /// This is only applied to JSON requests. + /// + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/SeedContentTypesApiException.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/SeedContentTypesApiException.cs new file mode 100644 index 00000000000..97b6f612c74 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/SeedContentTypesApiException.cs @@ -0,0 +1,18 @@ +namespace SeedContentTypes; + +/// +/// This exception type will be thrown for any non-2XX API responses. +/// +public class SeedContentTypesApiException(string message, int statusCode, object body) + : SeedContentTypesException(message) +{ + /// + /// The error code of the response that triggered the exception. + /// + public int StatusCode => statusCode; + + /// + /// The body of the response that triggered the exception. + /// + public object Body => body; +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/SeedContentTypesException.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/SeedContentTypesException.cs new file mode 100644 index 00000000000..36498d1224c --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/SeedContentTypesException.cs @@ -0,0 +1,9 @@ +using System; + +namespace SeedContentTypes; + +/// +/// Base exception class for all exceptions thrown by the SDK. +/// +public class SeedContentTypesException(string message, Exception? innerException = null) + : Exception(message, innerException); diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/Version.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/Version.cs new file mode 100644 index 00000000000..725686846ff --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/Public/Version.cs @@ -0,0 +1,6 @@ +namespace SeedContentTypes; + +internal class Version +{ + public const string Current = "0.0.1"; +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/QueryStringConverter.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/QueryStringConverter.cs new file mode 100644 index 00000000000..0b0c4d187b8 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/QueryStringConverter.cs @@ -0,0 +1,229 @@ +using global::System.Text.Json; + +namespace SeedContentTypes.Core; + +/// +/// Converts an object into a query string collection. +/// +internal static class QueryStringConverter +{ + /// + /// Converts an object into a query string collection using Deep Object notation. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + /// A collection of key value pairs. The keys and values are not URL encoded. + internal static IEnumerable> ToDeepObject(object value) + { + var queryCollection = new List>(); + var json = JsonUtils.SerializeToElement(value); + AssertRootJson(json); + JsonToDeepObject(json, "", queryCollection); + return queryCollection; + } + + /// + /// Converts an object into a query string collection using Exploded Form notation. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + /// A collection of key value pairs. The keys and values are not URL encoded. + internal static IEnumerable> ToExplodedForm(object value) + { + var queryCollection = new List>(); + var json = JsonUtils.SerializeToElement(value); + AssertRootJson(json); + JsonToFormExploded(json, "", queryCollection); + return queryCollection; + } + + /// + /// Converts an object into a query string collection using Form notation without exploding parameters. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + /// A collection of key value pairs. The keys and values are not URL encoded. + internal static IEnumerable> ToForm(object value) + { + var queryCollection = new List>(); + var json = JsonUtils.SerializeToElement(value); + AssertRootJson(json); + JsonToForm(json, "", queryCollection); + return queryCollection; + } + + private static void AssertRootJson(JsonElement json) + { + switch (json.ValueKind) + { + case JsonValueKind.Object: + break; + case JsonValueKind.Array: + case JsonValueKind.Undefined: + case JsonValueKind.String: + case JsonValueKind.Number: + case JsonValueKind.True: + case JsonValueKind.False: + case JsonValueKind.Null: + default: + throw new Exception( + $"Only objects can be converted to query string collections. Given type is {json.ValueKind}." + ); + } + } + + private static void JsonToForm( + JsonElement element, + string prefix, + List> parameters + ) + { + switch (element.ValueKind) + { + case JsonValueKind.Object: + foreach (var property in element.EnumerateObject()) + { + var newPrefix = string.IsNullOrEmpty(prefix) + ? property.Name + : $"{prefix}[{property.Name}]"; + + JsonToForm(property.Value, newPrefix, parameters); + } + break; + case JsonValueKind.Array: + var arrayValues = element.EnumerateArray().Select(ValueToString).ToArray(); + parameters.Add( + new KeyValuePair(prefix, string.Join(",", arrayValues)) + ); + break; + case JsonValueKind.Null: + break; + case JsonValueKind.Undefined: + case JsonValueKind.String: + case JsonValueKind.Number: + case JsonValueKind.True: + case JsonValueKind.False: + default: + parameters.Add(new KeyValuePair(prefix, ValueToString(element))); + break; + } + } + + private static void JsonToFormExploded( + JsonElement element, + string prefix, + List> parameters + ) + { + switch (element.ValueKind) + { + case JsonValueKind.Object: + foreach (var property in element.EnumerateObject()) + { + var newPrefix = string.IsNullOrEmpty(prefix) + ? property.Name + : $"{prefix}[{property.Name}]"; + + JsonToFormExploded(property.Value, newPrefix, parameters); + } + + break; + case JsonValueKind.Array: + foreach (var item in element.EnumerateArray()) + { + if ( + item.ValueKind != JsonValueKind.Object + && item.ValueKind != JsonValueKind.Array + ) + { + parameters.Add( + new KeyValuePair(prefix, ValueToString(item)) + ); + } + else + { + JsonToFormExploded(item, prefix, parameters); + } + } + + break; + case JsonValueKind.Null: + break; + case JsonValueKind.Undefined: + case JsonValueKind.String: + case JsonValueKind.Number: + case JsonValueKind.True: + case JsonValueKind.False: + default: + parameters.Add(new KeyValuePair(prefix, ValueToString(element))); + break; + } + } + + private static void JsonToDeepObject( + JsonElement element, + string prefix, + List> parameters + ) + { + switch (element.ValueKind) + { + case JsonValueKind.Object: + foreach (var property in element.EnumerateObject()) + { + var newPrefix = string.IsNullOrEmpty(prefix) + ? property.Name + : $"{prefix}[{property.Name}]"; + + JsonToDeepObject(property.Value, newPrefix, parameters); + } + + break; + case JsonValueKind.Array: + var index = 0; + foreach (var item in element.EnumerateArray()) + { + var newPrefix = $"{prefix}[{index++}]"; + + if ( + item.ValueKind != JsonValueKind.Object + && item.ValueKind != JsonValueKind.Array + ) + { + parameters.Add( + new KeyValuePair(newPrefix, ValueToString(item)) + ); + } + else + { + JsonToDeepObject(item, newPrefix, parameters); + } + } + + break; + case JsonValueKind.Null: + break; + case JsonValueKind.Undefined: + case JsonValueKind.String: + case JsonValueKind.Number: + case JsonValueKind.True: + case JsonValueKind.False: + default: + parameters.Add(new KeyValuePair(prefix, ValueToString(element))); + break; + } + } + + private static string ValueToString(JsonElement element) + { + return element.ValueKind switch + { + JsonValueKind.String => element.GetString() ?? "", + JsonValueKind.Number => element.GetRawText(), + JsonValueKind.True => "true", + JsonValueKind.False => "false", + JsonValueKind.Null => "", + _ => element.GetRawText(), + }; + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/RawClient.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/RawClient.cs new file mode 100644 index 00000000000..135f6ea92ba --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/RawClient.cs @@ -0,0 +1,409 @@ +using global::System.Net.Http; +using global::System.Net.Http.Headers; +using global::System.Text; +using SystemTask = global::System.Threading.Tasks.Task; + +namespace SeedContentTypes.Core; + +/// +/// Utility class for making raw HTTP requests to the API. +/// +internal partial class RawClient(ClientOptions clientOptions) +{ + private const int MaxRetryDelayMs = 60000; + internal int BaseRetryDelay { get; set; } = 1000; + + /// + /// The client options applied on every request. + /// + internal readonly ClientOptions Options = clientOptions; + + [Obsolete("Use SendRequestAsync instead.")] + internal Task MakeRequestAsync( + SeedContentTypes.Core.BaseRequest request, + CancellationToken cancellationToken = default + ) + { + return SendRequestAsync(request, cancellationToken); + } + + internal async Task SendRequestAsync( + SeedContentTypes.Core.BaseRequest request, + CancellationToken cancellationToken = default + ) + { + // Apply the request timeout. + var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + var timeout = request.Options?.Timeout ?? Options.Timeout; + cts.CancelAfter(timeout); + + var httpRequest = CreateHttpRequest(request); + // Send the request. + return await SendWithRetriesAsync(httpRequest, request.Options, cts.Token) + .ConfigureAwait(false); + } + + internal async Task SendRequestAsync( + HttpRequestMessage request, + IRequestOptions? options, + CancellationToken cancellationToken = default + ) + { + // Apply the request timeout. + var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + var timeout = options?.Timeout ?? Options.Timeout; + cts.CancelAfter(timeout); + + // Send the request. + return await SendWithRetriesAsync(request, options, cts.Token).ConfigureAwait(false); + } + + private static async Task CloneRequestAsync(HttpRequestMessage request) + { + var clonedRequest = new HttpRequestMessage(request.Method, request.RequestUri); + clonedRequest.Version = request.Version; + switch (request.Content) + { + case MultipartContent oldMultipartFormContent: + var originalBoundary = + oldMultipartFormContent + .Headers.ContentType?.Parameters.First(p => + p.Name.Equals("boundary", StringComparison.OrdinalIgnoreCase) + ) + .Value?.Trim('"') ?? Guid.NewGuid().ToString(); + var newMultipartContent = oldMultipartFormContent switch + { + MultipartFormDataContent => new MultipartFormDataContent(originalBoundary), + _ => new MultipartContent(), + }; + foreach (var content in oldMultipartFormContent) + { + var ms = new MemoryStream(); + await content.CopyToAsync(ms).ConfigureAwait(false); + ms.Position = 0; + var newPart = new StreamContent(ms); + foreach (var header in oldMultipartFormContent.Headers) + { + newPart.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + + newMultipartContent.Add(newPart); + } + + clonedRequest.Content = newMultipartContent; + break; + default: + clonedRequest.Content = request.Content; + break; + } + + foreach (var header in request.Headers) + { + clonedRequest.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + + return clonedRequest; + } + + /// + /// Sends the request with retries, unless the request content is not retryable, + /// such as stream requests and multipart form data with stream content. + /// + private async Task SendWithRetriesAsync( + HttpRequestMessage request, + IRequestOptions? options, + CancellationToken cancellationToken + ) + { + var httpClient = options?.HttpClient ?? Options.HttpClient; + var maxRetries = options?.MaxRetries ?? Options.MaxRetries; + var response = await httpClient.SendAsync(request, cancellationToken).ConfigureAwait(false); + var isRetryableContent = IsRetryableContent(request); + + if (!isRetryableContent) + { + return new SeedContentTypes.Core.ApiResponse + { + StatusCode = (int)response.StatusCode, + Raw = response, + }; + } + + for (var i = 0; i < maxRetries; i++) + { + if (!ShouldRetry(response)) + { + break; + } + + var delayMs = Math.Min(BaseRetryDelay * (int)Math.Pow(2, i), MaxRetryDelayMs); + await SystemTask.Delay(delayMs, cancellationToken).ConfigureAwait(false); + using var retryRequest = await CloneRequestAsync(request).ConfigureAwait(false); + response = await httpClient + .SendAsync(retryRequest, cancellationToken) + .ConfigureAwait(false); + } + + return new SeedContentTypes.Core.ApiResponse + { + StatusCode = (int)response.StatusCode, + Raw = response, + }; + } + + private static bool ShouldRetry(HttpResponseMessage response) + { + var statusCode = (int)response.StatusCode; + return statusCode is 408 or 429 or >= 500; + } + + private static bool IsRetryableContent(HttpRequestMessage request) + { + return request.Content switch + { + IIsRetryableContent c => c.IsRetryable, + StreamContent => false, + MultipartContent content => !content.Any(c => c is StreamContent), + _ => true, + }; + } + + internal HttpRequestMessage CreateHttpRequest(SeedContentTypes.Core.BaseRequest request) + { + var url = BuildUrl(request); + var httpRequest = new HttpRequestMessage(request.Method, url); + httpRequest.Content = request.CreateContent(); + var mergedHeaders = new Dictionary>(); + MergeHeaders(mergedHeaders, Options.Headers); + MergeAdditionalHeaders(mergedHeaders, Options.AdditionalHeaders); + MergeHeaders(mergedHeaders, request.Headers); + MergeHeaders(mergedHeaders, request.Options?.Headers); + + MergeAdditionalHeaders(mergedHeaders, request.Options?.AdditionalHeaders ?? []); + SetHeaders(httpRequest, mergedHeaders); + return httpRequest; + } + + private static string BuildUrl(SeedContentTypes.Core.BaseRequest request) + { + var baseUrl = request.Options?.BaseUrl ?? request.BaseUrl; + var trimmedBaseUrl = baseUrl.TrimEnd('/'); + var trimmedBasePath = request.Path.TrimStart('/'); + var url = $"{trimmedBaseUrl}/{trimmedBasePath}"; + + var queryParameters = GetQueryParameters(request); + if (!queryParameters.Any()) + return url; + + url += "?"; + url = queryParameters.Aggregate( + url, + (current, queryItem) => + { + if ( + queryItem.Value + is global::System.Collections.IEnumerable collection + and not string + ) + { + var items = collection + .Cast() + .Select(value => $"{queryItem.Key}={value}") + .ToList(); + if (items.Any()) + { + current += string.Join("&", items) + "&"; + } + } + else + { + current += $"{queryItem.Key}={queryItem.Value}&"; + } + + return current; + } + ); + url = url[..^1]; + return url; + } + + private static List> GetQueryParameters( + SeedContentTypes.Core.BaseRequest request + ) + { + var result = TransformToKeyValuePairs(request.Query); + if ( + request.Options?.AdditionalQueryParameters is null + || !request.Options.AdditionalQueryParameters.Any() + ) + { + return result; + } + + var additionalKeys = request + .Options.AdditionalQueryParameters.Select(p => p.Key) + .Distinct(); + foreach (var key in additionalKeys) + { + result.RemoveAll(kv => kv.Key == key); + } + + result.AddRange(request.Options.AdditionalQueryParameters); + return result; + } + + private static List> TransformToKeyValuePairs( + Dictionary inputDict + ) + { + var result = new List>(); + foreach (var kvp in inputDict) + { + switch (kvp.Value) + { + case string str: + result.Add(new KeyValuePair(kvp.Key, str)); + break; + case IEnumerable strList: + { + foreach (var value in strList) + { + result.Add(new KeyValuePair(kvp.Key, value)); + } + + break; + } + } + } + + return result; + } + + private static void MergeHeaders( + Dictionary> mergedHeaders, + Headers? headers + ) + { + if (headers is null) + { + return; + } + + foreach (var header in headers) + { + var value = header.Value?.Match(str => str, func => func.Invoke()); + if (value != null) + { + mergedHeaders[header.Key] = [value]; + } + } + } + + private static void MergeAdditionalHeaders( + Dictionary> mergedHeaders, + IEnumerable>? headers + ) + { + if (headers is null) + { + return; + } + + var usedKeys = new HashSet(); + foreach (var header in headers) + { + if (header.Value is null) + { + mergedHeaders.Remove(header.Key); + usedKeys.Remove(header.Key); + continue; + } + + if (usedKeys.Contains(header.Key)) + { + mergedHeaders[header.Key].Add(header.Value); + } + else + { + mergedHeaders[header.Key] = [header.Value]; + usedKeys.Add(header.Key); + } + } + } + + private void SetHeaders( + HttpRequestMessage httpRequest, + Dictionary> mergedHeaders + ) + { + foreach (var kv in mergedHeaders) + { + foreach (var header in kv.Value) + { + if (header is null) + { + continue; + } + + httpRequest.Headers.TryAddWithoutValidation(kv.Key, header); + } + } + } + + private static (Encoding encoding, string? charset, string mediaType) ParseContentTypeOrDefault( + string? contentType, + Encoding encodingFallback, + string mediaTypeFallback + ) + { + var encoding = encodingFallback; + var mediaType = mediaTypeFallback; + string? charset = null; + if (string.IsNullOrEmpty(contentType)) + { + return (encoding, charset, mediaType); + } + + if (!MediaTypeHeaderValue.TryParse(contentType, out var mediaTypeHeaderValue)) + { + return (encoding, charset, mediaType); + } + + if (!string.IsNullOrEmpty(mediaTypeHeaderValue.CharSet)) + { + charset = mediaTypeHeaderValue.CharSet; + encoding = Encoding.GetEncoding(mediaTypeHeaderValue.CharSet); + } + + if (!string.IsNullOrEmpty(mediaTypeHeaderValue.MediaType)) + { + mediaType = mediaTypeHeaderValue.MediaType; + } + + return (encoding, charset, mediaType); + } + + /// + [Obsolete("Use SeedContentTypes.Core.ApiResponse instead.")] + internal record ApiResponse : SeedContentTypes.Core.ApiResponse; + + /// + [Obsolete("Use SeedContentTypes.Core.BaseRequest instead.")] + internal abstract record BaseApiRequest : SeedContentTypes.Core.BaseRequest; + + /// + [Obsolete("Use SeedContentTypes.Core.EmptyRequest instead.")] + internal abstract record EmptyApiRequest : SeedContentTypes.Core.EmptyRequest; + + /// + [Obsolete("Use SeedContentTypes.Core.JsonRequest instead.")] + internal abstract record JsonApiRequest : SeedContentTypes.Core.JsonRequest; + + /// + [Obsolete("Use SeedContentTypes.Core.MultipartFormRequest instead.")] + internal abstract record MultipartFormRequest : SeedContentTypes.Core.MultipartFormRequest; + + /// + [Obsolete("Use SeedContentTypes.Core.StreamRequest instead.")] + internal abstract record StreamApiRequest : SeedContentTypes.Core.StreamRequest; +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/StreamRequest.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/StreamRequest.cs new file mode 100644 index 00000000000..bdd87e5466e --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/StreamRequest.cs @@ -0,0 +1,29 @@ +using System.Net.Http; +using System.Net.Http.Headers; + +namespace SeedContentTypes.Core; + +/// +/// The request object to be sent for streaming uploads. +/// +internal record StreamRequest : BaseRequest +{ + internal Stream? Body { get; init; } + + internal override HttpContent? CreateContent() + { + if (Body is null) + { + return null; + } + + var content = new StreamContent(Body) + { + Headers = + { + ContentType = MediaTypeHeaderValue.Parse(ContentType ?? "application/octet-stream"), + }, + }; + return content; + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/ValueConvert.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/ValueConvert.cs new file mode 100644 index 00000000000..5e859f3b936 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Core/ValueConvert.cs @@ -0,0 +1,109 @@ +using global::System.Globalization; + +namespace SeedContentTypes.Core; + +/// +/// Convert values to string for path and query parameters. +/// +public static class ValueConvert +{ + internal static string ToPathParameterString(T value) => ToString(value); + + internal static string ToPathParameterString(bool v) => ToString(v); + + internal static string ToPathParameterString(int v) => ToString(v); + + internal static string ToPathParameterString(long v) => ToString(v); + + internal static string ToPathParameterString(float v) => ToString(v); + + internal static string ToPathParameterString(double v) => ToString(v); + + internal static string ToPathParameterString(decimal v) => ToString(v); + + internal static string ToPathParameterString(short v) => ToString(v); + + internal static string ToPathParameterString(ushort v) => ToString(v); + + internal static string ToPathParameterString(uint v) => ToString(v); + + internal static string ToPathParameterString(ulong v) => ToString(v); + + internal static string ToPathParameterString(char v) => ToString(v); + + internal static string ToPathParameterString(Guid v) => ToString(v); + + internal static string ToQueryStringValue(T value) => value is null ? "" : ToString(value); + + internal static string ToQueryStringValue(bool v) => ToString(v); + + internal static string ToQueryStringValue(int v) => ToString(v); + + internal static string ToQueryStringValue(long v) => ToString(v); + + internal static string ToQueryStringValue(float v) => ToString(v); + + internal static string ToQueryStringValue(double v) => ToString(v); + + internal static string ToQueryStringValue(decimal v) => ToString(v); + + internal static string ToQueryStringValue(short v) => ToString(v); + + internal static string ToQueryStringValue(ushort v) => ToString(v); + + internal static string ToQueryStringValue(uint v) => ToString(v); + + internal static string ToQueryStringValue(ulong v) => ToString(v); + + internal static string ToQueryStringValue(char v) => ToString(v); + + internal static string ToQueryStringValue(Guid v) => ToString(v); + + internal static string ToString(T value) + { + return value switch + { + null => "null", + string str => str, + true => "true", + false => "false", + int i => ToString(i), + long l => ToString(l), + float f => ToString(f), + double d => ToString(d), + decimal dec => ToString(dec), + short s => ToString(s), + ushort u => ToString(u), + uint u => ToString(u), + ulong u => ToString(u), + char c => ToString(c), + Guid guid => ToString(guid), + Enum e => JsonUtils.Serialize(e).Trim('"'), + _ => JsonUtils.Serialize(value).Trim('"'), + }; + } + + internal static string ToString(bool v) => v ? "true" : "false"; + + internal static string ToString(int v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(long v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(float v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(double v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(decimal v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(short v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(ushort v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(uint v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(ulong v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(char v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(Guid v) => v.ToString("D"); +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/SeedContentTypes.Custom.props b/seed/csharp-sdk/content-type/src/SeedContentTypes/SeedContentTypes.Custom.props new file mode 100644 index 00000000000..70df2849401 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/SeedContentTypes.Custom.props @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/SeedContentTypes.csproj b/seed/csharp-sdk/content-type/src/SeedContentTypes/SeedContentTypes.csproj new file mode 100644 index 00000000000..425f6acdcf2 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/SeedContentTypes.csproj @@ -0,0 +1,53 @@ + + + + net462;net8.0;net7.0;net6.0;netstandard2.0 + enable + 12 + enable + 0.0.1 + $(Version) + $(Version) + README.md + https://github.com/content-type/fern + true + + + + false + + + $(DefineConstants);USE_PORTABLE_DATE_ONLY + true + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + + + + <_Parameter1>SeedContentTypes.Test + + + + + diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/SeedContentTypesClient.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/SeedContentTypesClient.cs new file mode 100644 index 00000000000..21ac92e308e --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/SeedContentTypesClient.cs @@ -0,0 +1,33 @@ +using SeedContentTypes.Core; + +namespace SeedContentTypes; + +public partial class SeedContentTypesClient +{ + private readonly RawClient _client; + + public SeedContentTypesClient(ClientOptions? clientOptions = null) + { + var defaultHeaders = new Headers( + new Dictionary() + { + { "X-Fern-Language", "C#" }, + { "X-Fern-SDK-Name", "SeedContentTypes" }, + { "X-Fern-SDK-Version", Version.Current }, + { "User-Agent", "Ferncontent-type/0.0.1" }, + } + ); + clientOptions ??= new ClientOptions(); + foreach (var header in defaultHeaders) + { + if (!clientOptions.Headers.ContainsKey(header.Key)) + { + clientOptions.Headers[header.Key] = header.Value; + } + } + _client = new RawClient(clientOptions); + Service = new ServiceClient(_client); + } + + public ServiceClient Service { get; } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Service/Requests/PatchProxyRequest.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Service/Requests/PatchProxyRequest.cs new file mode 100644 index 00000000000..7a22dacee84 --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Service/Requests/PatchProxyRequest.cs @@ -0,0 +1,19 @@ +using System.Text.Json.Serialization; +using SeedContentTypes.Core; + +namespace SeedContentTypes; + +public record PatchProxyRequest +{ + [JsonPropertyName("application")] + public string? Application { get; set; } + + [JsonPropertyName("require_auth")] + public bool? RequireAuth { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/content-type/src/SeedContentTypes/Service/ServiceClient.cs b/seed/csharp-sdk/content-type/src/SeedContentTypes/Service/ServiceClient.cs new file mode 100644 index 00000000000..a8ed4ae9c6f --- /dev/null +++ b/seed/csharp-sdk/content-type/src/SeedContentTypes/Service/ServiceClient.cs @@ -0,0 +1,54 @@ +using System.Threading; +using global::System.Threading.Tasks; +using SeedContentTypes.Core; + +namespace SeedContentTypes; + +public partial class ServiceClient +{ + private RawClient _client; + + internal ServiceClient(RawClient client) + { + _client = client; + } + + /// + /// await client.Service.PatchAsync( + /// new PatchProxyRequest { Application = "application", RequireAuth = true } + /// ); + /// + public async global::System.Threading.Tasks.Task PatchAsync( + PatchProxyRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .SendRequestAsync( + new JsonRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = "", + Body = request, + ContentType = "application/merge-patch+json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + return; + } + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new SeedContentTypesApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } +} diff --git a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/IRequestOptions.cs b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/IRequestOptions.cs index e2e9de8873c..91fcbeaa3e7 100644 --- a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/ClientOptions.cs b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/ClientOptions.cs index 3b6e8112e2e..820430326be 100644 --- a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/FileParameter.cs b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/FileParameter.cs index fd3724549d6..e9d49e1df3a 100644 --- a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/RequestOptions.cs b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/RequestOptions.cs index 480ee6f2d70..db030d5fa0d 100644 --- a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/SeedCrossPackageTypeNamesClient.cs b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/SeedCrossPackageTypeNamesClient.cs index 277ca0aac30..03a0d0de639 100644 --- a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/SeedCrossPackageTypeNamesClient.cs +++ b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/SeedCrossPackageTypeNamesClient.cs @@ -38,15 +38,15 @@ public SeedCrossPackageTypeNamesClient(ClientOptions? clientOptions = null) Foo = new FooClient(_client); } - public CommonsClient Commons { get; init; } + public CommonsClient Commons { get; } - public FolderAClient FolderA { get; init; } + public FolderAClient FolderA { get; } - public FolderBClient FolderB { get; init; } + public FolderBClient FolderB { get; } - public FolderCClient FolderC { get; init; } + public FolderCClient FolderC { get; } - public FolderDClient FolderD { get; init; } + public FolderDClient FolderD { get; } - public FooClient Foo { get; init; } + public FooClient Foo { get; } } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/ClientOptions.cs index 41ed2bde4e3..470ccc9c258 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/ClientOptions.cs @@ -21,33 +21,69 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = SeedApiEnvironment.Default; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = SeedApiEnvironment.Default; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// The options used for gRPC client endpoints. /// - public GrpcChannelOptions? GrpcOptions { get; init; } + public GrpcChannelOptions? GrpcOptions { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/GrpcRequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/GrpcRequestOptions.cs index 25f74c606a9..d769ec3cb53 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/GrpcRequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/GrpcRequestOptions.cs @@ -8,25 +8,55 @@ public partial class GrpcRequestOptions /// /// The maximum number of retry attempts. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Options for write operations. /// - public WriteOptions? WriteOptions { get; init; } + public WriteOptions? WriteOptions { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Client-side call credentials. Provide authorization with per-call granularity. /// - public CallCredentials? CallCredentials { get; init; } + public CallCredentials? CallCredentials { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Headers to be sent with this particular request. /// - internal Headers Headers { get; init; } = new(); + internal Headers Headers { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new(); } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/SeedApiClient.cs index 2a333050f65..ed3b7073229 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/include-exception-handler/src/SeedApi/SeedApiClient.cs @@ -29,5 +29,5 @@ public SeedApiClient(ClientOptions? clientOptions = null) Dataservice = new DataserviceClient(_client); } - public DataserviceClient Dataservice { get; init; } + public DataserviceClient Dataservice { get; } } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/ClientOptions.cs index b001f6b14b8..bc003f3feb6 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/ClientOptions.cs @@ -16,33 +16,69 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = SeedApiEnvironment.Default; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = SeedApiEnvironment.Default; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// The options used for gRPC client endpoints. /// - public GrpcChannelOptions? GrpcOptions { get; init; } + public GrpcChannelOptions? GrpcOptions { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/GrpcRequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/GrpcRequestOptions.cs index 25f74c606a9..d769ec3cb53 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/GrpcRequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/GrpcRequestOptions.cs @@ -8,25 +8,55 @@ public partial class GrpcRequestOptions /// /// The maximum number of retry attempts. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Options for write operations. /// - public WriteOptions? WriteOptions { get; init; } + public WriteOptions? WriteOptions { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Client-side call credentials. Provide authorization with per-call granularity. /// - public CallCredentials? CallCredentials { get; init; } + public CallCredentials? CallCredentials { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Headers to be sent with this particular request. /// - internal Headers Headers { get; init; } = new(); + internal Headers Headers { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new(); } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/SeedApiClient.cs index 2a333050f65..ed3b7073229 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/no-custom-config/src/SeedApi/SeedApiClient.cs @@ -29,5 +29,5 @@ public SeedApiClient(ClientOptions? clientOptions = null) Dataservice = new DataserviceClient(_client); } - public DataserviceClient Dataservice { get; init; } + public DataserviceClient Dataservice { get; } } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/ClientOptions.cs index b001f6b14b8..bc003f3feb6 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/ClientOptions.cs @@ -16,33 +16,69 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = SeedApiEnvironment.Default; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = SeedApiEnvironment.Default; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// The options used for gRPC client endpoints. /// - public GrpcChannelOptions? GrpcOptions { get; init; } + public GrpcChannelOptions? GrpcOptions { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/GrpcRequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/GrpcRequestOptions.cs index 25f74c606a9..d769ec3cb53 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/GrpcRequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/GrpcRequestOptions.cs @@ -8,25 +8,55 @@ public partial class GrpcRequestOptions /// /// The maximum number of retry attempts. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Options for write operations. /// - public WriteOptions? WriteOptions { get; init; } + public WriteOptions? WriteOptions { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Client-side call credentials. Provide authorization with per-call granularity. /// - public CallCredentials? CallCredentials { get; init; } + public CallCredentials? CallCredentials { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Headers to be sent with this particular request. /// - internal Headers Headers { get; init; } = new(); + internal Headers Headers { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new(); } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/SeedApiClient.cs index 2a333050f65..ed3b7073229 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/package-id/src/SeedApi/SeedApiClient.cs @@ -29,5 +29,5 @@ public SeedApiClient(ClientOptions? clientOptions = null) Dataservice = new DataserviceClient(_client); } - public DataserviceClient Dataservice { get; init; } + public DataserviceClient Dataservice { get; } } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/ClientOptions.cs index b001f6b14b8..bc003f3feb6 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/ClientOptions.cs @@ -16,33 +16,69 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = SeedApiEnvironment.Default; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = SeedApiEnvironment.Default; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// The options used for gRPC client endpoints. /// - public GrpcChannelOptions? GrpcOptions { get; init; } + public GrpcChannelOptions? GrpcOptions { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/GrpcRequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/GrpcRequestOptions.cs index 25f74c606a9..d769ec3cb53 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/GrpcRequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/GrpcRequestOptions.cs @@ -8,25 +8,55 @@ public partial class GrpcRequestOptions /// /// The maximum number of retry attempts. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Options for write operations. /// - public WriteOptions? WriteOptions { get; init; } + public WriteOptions? WriteOptions { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Client-side call credentials. Provide authorization with per-call granularity. /// - public CallCredentials? CallCredentials { get; init; } + public CallCredentials? CallCredentials { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Headers to be sent with this particular request. /// - internal Headers Headers { get; init; } = new(); + internal Headers Headers { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new(); } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/SeedApiClient.cs index 2a333050f65..ed3b7073229 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/read-only-memory/src/SeedApi/SeedApiClient.cs @@ -29,5 +29,5 @@ public SeedApiClient(ClientOptions? clientOptions = null) Dataservice = new DataserviceClient(_client); } - public DataserviceClient Dataservice { get; init; } + public DataserviceClient Dataservice { get; } } diff --git a/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/ClientOptions.cs index 81d0c27fd00..721c0a9b1c9 100644 --- a/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/ClientOptions.cs @@ -16,33 +16,69 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// The options used for gRPC client endpoints. /// - public GrpcChannelOptions? GrpcOptions { get; init; } + public GrpcChannelOptions? GrpcOptions { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/GrpcRequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/GrpcRequestOptions.cs index 25f74c606a9..d769ec3cb53 100644 --- a/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/GrpcRequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/GrpcRequestOptions.cs @@ -8,25 +8,55 @@ public partial class GrpcRequestOptions /// /// The maximum number of retry attempts. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Options for write operations. /// - public WriteOptions? WriteOptions { get; init; } + public WriteOptions? WriteOptions { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Client-side call credentials. Provide authorization with per-call granularity. /// - public CallCredentials? CallCredentials { get; init; } + public CallCredentials? CallCredentials { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Headers to be sent with this particular request. /// - internal Headers Headers { get; init; } = new(); + internal Headers Headers { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new(); } diff --git a/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/SeedApiClient.cs index 7b7d07faaea..d0fc9e4ad07 100644 --- a/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/csharp-grpc-proto/src/SeedApi/SeedApiClient.cs @@ -29,5 +29,5 @@ public SeedApiClient(ClientOptions? clientOptions = null) Userservice = new UserserviceClient(_client); } - public UserserviceClient Userservice { get; init; } + public UserserviceClient Userservice { get; } } diff --git a/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/IRequestOptions.cs b/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/IRequestOptions.cs index 60e7906df37..1a61ebfd765 100644 --- a/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/ClientOptions.cs b/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/ClientOptions.cs index 14cd36f323c..81e5630d665 100644 --- a/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/FileParameter.cs b/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/FileParameter.cs index 7be49470276..7c0f68a0801 100644 --- a/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/RequestOptions.cs b/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/RequestOptions.cs index 095e6f317cb..283c7845401 100644 --- a/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/SeedCsharpNamespaceConflictClient.cs b/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/SeedCsharpNamespaceConflictClient.cs index f3a55f631d4..f2ad0e37c1b 100644 --- a/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/SeedCsharpNamespaceConflictClient.cs +++ b/seed/csharp-sdk/csharp-namespace-conflict/src/SeedCsharpNamespaceConflict/SeedCsharpNamespaceConflictClient.cs @@ -33,9 +33,9 @@ public SeedCsharpNamespaceConflictClient(ClientOptions? clientOptions = null) Tasktest = new TasktestClient(_client); } - public AClient A { get; init; } + public AClient A { get; } - public BClient B { get; init; } + public BClient B { get; } - public TasktestClient Tasktest { get; init; } + public TasktestClient Tasktest { get; } } diff --git a/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/IRequestOptions.cs b/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/IRequestOptions.cs index 60a00a67e34..7394eb2169f 100644 --- a/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/Public/ClientOptions.cs b/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/Public/ClientOptions.cs index 10aebfd3eca..ccbea4b8dcb 100644 --- a/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/Public/FileParameter.cs b/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/Public/FileParameter.cs index d39e99370a2..176ba07a17e 100644 --- a/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/Public/RequestOptions.cs b/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/Public/RequestOptions.cs index a5c902a915b..a55a0982158 100644 --- a/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/csharp-property-access/src/SeedCsharpAccess/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/IRequestOptions.cs b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/IRequestOptions.cs index 91025683a7a..0508cc93f48 100644 --- a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/Public/ClientOptions.cs b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/Public/ClientOptions.cs index ab216223ec9..84f4ce97f22 100644 --- a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/Public/FileParameter.cs b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/Public/FileParameter.cs index 8113f86b7cf..a6e263fb210 100644 --- a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/Public/RequestOptions.cs b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/Public/RequestOptions.cs index bbfac65b186..cd3dcf0c9c9 100644 --- a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/SeedCustomAuthClient.cs b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/SeedCustomAuthClient.cs index ee03b5e028b..304e33446b6 100644 --- a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/SeedCustomAuthClient.cs +++ b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/SeedCustomAuthClient.cs @@ -34,7 +34,7 @@ public SeedCustomAuthClient( Errors = new ErrorsClient(_client); } - public CustomAuthClient CustomAuth { get; init; } + public CustomAuthClient CustomAuth { get; } - public ErrorsClient Errors { get; init; } + public ErrorsClient Errors { get; } } diff --git a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/IRequestOptions.cs b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/IRequestOptions.cs index d7f02827e74..ddffdbc9cb0 100644 --- a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/Public/ClientOptions.cs b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/Public/ClientOptions.cs index ed78bcc2a29..b577cdab1da 100644 --- a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/Public/FileParameter.cs b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/Public/FileParameter.cs index 50c7cf006a8..5b60e9a9755 100644 --- a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/Public/RequestOptions.cs b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/Public/RequestOptions.cs index cc615ae2be0..e0b3c0ed549 100644 --- a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/SeedEnumClient.cs b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/SeedEnumClient.cs index 1ceff1d4475..60917b5ab30 100644 --- a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/SeedEnumClient.cs +++ b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/SeedEnumClient.cs @@ -32,11 +32,11 @@ public SeedEnumClient(ClientOptions? clientOptions = null) Unknown = new UnknownClient(_client); } - public InlinedRequestClient InlinedRequest { get; init; } + public InlinedRequestClient InlinedRequest { get; } - public PathParamClient PathParam { get; init; } + public PathParamClient PathParam { get; } - public QueryParamClient QueryParam { get; init; } + public QueryParamClient QueryParam { get; } - public UnknownClient Unknown { get; init; } + public UnknownClient Unknown { get; } } diff --git a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/IRequestOptions.cs b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/IRequestOptions.cs index d7f02827e74..ddffdbc9cb0 100644 --- a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/Public/ClientOptions.cs b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/Public/ClientOptions.cs index ed78bcc2a29..b577cdab1da 100644 --- a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/Public/FileParameter.cs b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/Public/FileParameter.cs index 50c7cf006a8..5b60e9a9755 100644 --- a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/Public/RequestOptions.cs b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/Public/RequestOptions.cs index cc615ae2be0..e0b3c0ed549 100644 --- a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/SeedEnumClient.cs b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/SeedEnumClient.cs index 1ceff1d4475..60917b5ab30 100644 --- a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/SeedEnumClient.cs +++ b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/SeedEnumClient.cs @@ -32,11 +32,11 @@ public SeedEnumClient(ClientOptions? clientOptions = null) Unknown = new UnknownClient(_client); } - public InlinedRequestClient InlinedRequest { get; init; } + public InlinedRequestClient InlinedRequest { get; } - public PathParamClient PathParam { get; init; } + public PathParamClient PathParam { get; } - public QueryParamClient QueryParam { get; init; } + public QueryParamClient QueryParam { get; } - public UnknownClient Unknown { get; init; } + public UnknownClient Unknown { get; } } diff --git a/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/IRequestOptions.cs b/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/IRequestOptions.cs index 78fb1f9ac4d..89a2c836bbc 100644 --- a/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/Public/ClientOptions.cs b/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/Public/ClientOptions.cs index ef9888ed6ed..26264d1f876 100644 --- a/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/Public/FileParameter.cs b/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/Public/FileParameter.cs index 98ca831515b..9e72372c3f0 100644 --- a/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/Public/RequestOptions.cs b/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/Public/RequestOptions.cs index a00343f3d05..3792e9e0f7c 100644 --- a/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/error-property/src/SeedErrorProperty/SeedErrorPropertyClient.cs b/seed/csharp-sdk/error-property/src/SeedErrorProperty/SeedErrorPropertyClient.cs index 94bbb3a5e00..978798be44f 100644 --- a/seed/csharp-sdk/error-property/src/SeedErrorProperty/SeedErrorPropertyClient.cs +++ b/seed/csharp-sdk/error-property/src/SeedErrorProperty/SeedErrorPropertyClient.cs @@ -30,7 +30,7 @@ public SeedErrorPropertyClient(ClientOptions? clientOptions = null) PropertyBasedError = new PropertyBasedErrorClient(_client); } - public ErrorsClient Errors { get; init; } + public ErrorsClient Errors { get; } - public PropertyBasedErrorClient PropertyBasedError { get; init; } + public PropertyBasedErrorClient PropertyBasedError { get; } } diff --git a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/IRequestOptions.cs b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/IRequestOptions.cs index dc0ec919b6c..ccfc9f07c5c 100644 --- a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/Public/ClientOptions.cs b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/Public/ClientOptions.cs index 94fe01741a3..2ab11f054ec 100644 --- a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/Public/FileParameter.cs b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/Public/FileParameter.cs index d083e9ac0b6..98f6dc9692d 100644 --- a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/Public/RequestOptions.cs b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/Public/RequestOptions.cs index 0daff2cce29..0fe7630c34e 100644 --- a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/SeedExamplesClient.cs b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/SeedExamplesClient.cs index c1d59efdf63..a8083d4a06a 100644 --- a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/SeedExamplesClient.cs +++ b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/SeedExamplesClient.cs @@ -41,15 +41,15 @@ public SeedExamplesClient(string token, ClientOptions? clientOptions = null) Types = new TypesClient(_client); } - public CommonsClient Commons { get; init; } + public CommonsClient Commons { get; } - public FileClient File { get; init; } + public FileClient File { get; } - public HealthClient Health { get; init; } + public HealthClient Health { get; } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } - public TypesClient Types { get; init; } + public TypesClient Types { get; } /// /// await client.EchoAsync("Hello world!\\n\\nwith\\n\\tnewlines"); diff --git a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/IRequestOptions.cs b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/IRequestOptions.cs index dc0ec919b6c..ccfc9f07c5c 100644 --- a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/Public/ClientOptions.cs b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/Public/ClientOptions.cs index 94fe01741a3..2ab11f054ec 100644 --- a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/Public/FileParameter.cs b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/Public/FileParameter.cs index d083e9ac0b6..98f6dc9692d 100644 --- a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/Public/RequestOptions.cs b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/Public/RequestOptions.cs index 0daff2cce29..0fe7630c34e 100644 --- a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/SeedExamplesClient.cs b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/SeedExamplesClient.cs index c1d59efdf63..a8083d4a06a 100644 --- a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/SeedExamplesClient.cs +++ b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/SeedExamplesClient.cs @@ -41,15 +41,15 @@ public SeedExamplesClient(string token, ClientOptions? clientOptions = null) Types = new TypesClient(_client); } - public CommonsClient Commons { get; init; } + public CommonsClient Commons { get; } - public FileClient File { get; init; } + public FileClient File { get; } - public HealthClient Health { get; init; } + public HealthClient Health { get; } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } - public TypesClient Types { get; init; } + public TypesClient Types { get; } /// /// await client.EchoAsync("Hello world!\\n\\nwith\\n\\tnewlines"); diff --git a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/IRequestOptions.cs b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/IRequestOptions.cs index 6f1a0a5fab7..90e6e568e23 100644 --- a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/Public/ClientOptions.cs b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/Public/ClientOptions.cs index 73d3a07207c..ab7f76e29b8 100644 --- a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/Public/FileParameter.cs b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/Public/FileParameter.cs index b14ad88caa1..688152a5957 100644 --- a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/Public/RequestOptions.cs b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/Public/RequestOptions.cs index 0cb636643d7..9c024916806 100644 --- a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/SeedExhaustiveClient.cs b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/SeedExhaustiveClient.cs index 57ea50cb5ed..9b03ed81767 100644 --- a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/SeedExhaustiveClient.cs +++ b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/SeedExhaustiveClient.cs @@ -43,17 +43,17 @@ public SeedExhaustiveClient(string token, ClientOptions? clientOptions = null) Types = new TypesClient(_client); } - public EndpointsClient Endpoints { get; init; } + public EndpointsClient Endpoints { get; } - public GeneralErrorsClient GeneralErrors { get; init; } + public GeneralErrorsClient GeneralErrors { get; } - public InlinedRequestsClient InlinedRequests { get; init; } + public InlinedRequestsClient InlinedRequests { get; } - public NoAuthClient NoAuth { get; init; } + public NoAuthClient NoAuth { get; } - public NoReqBodyClient NoReqBody { get; init; } + public NoReqBodyClient NoReqBody { get; } - public ReqWithHeadersClient ReqWithHeaders { get; init; } + public ReqWithHeadersClient ReqWithHeaders { get; } - public TypesClient Types { get; init; } + public TypesClient Types { get; } } diff --git a/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/IRequestOptions.cs b/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/IRequestOptions.cs index 6f1a0a5fab7..90e6e568e23 100644 --- a/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/Public/ClientOptions.cs b/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/Public/ClientOptions.cs index 9a966211b8d..57aac36638b 100644 --- a/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/Public/ClientOptions.cs @@ -20,28 +20,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/Public/FileParameter.cs b/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/Public/FileParameter.cs index b14ad88caa1..688152a5957 100644 --- a/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/Public/RequestOptions.cs b/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/Public/RequestOptions.cs index 0cb636643d7..9c024916806 100644 --- a/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/SeedExhaustiveClient.cs b/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/SeedExhaustiveClient.cs index d19c1158c12..a5bde9da5ab 100644 --- a/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/SeedExhaustiveClient.cs +++ b/seed/csharp-sdk/exhaustive/include-exception-handler/src/SeedExhaustive/SeedExhaustiveClient.cs @@ -38,17 +38,17 @@ public SeedExhaustiveClient(string token, ClientOptions? clientOptions = null) Types = new TypesClient(_client); } - public EndpointsClient Endpoints { get; init; } + public EndpointsClient Endpoints { get; } - public GeneralErrorsClient GeneralErrors { get; init; } + public GeneralErrorsClient GeneralErrors { get; } - public InlinedRequestsClient InlinedRequests { get; init; } + public InlinedRequestsClient InlinedRequests { get; } - public NoAuthClient NoAuth { get; init; } + public NoAuthClient NoAuth { get; } - public NoReqBodyClient NoReqBody { get; init; } + public NoReqBodyClient NoReqBody { get; } - public ReqWithHeadersClient ReqWithHeaders { get; init; } + public ReqWithHeadersClient ReqWithHeaders { get; } - public TypesClient Types { get; init; } + public TypesClient Types { get; } } diff --git a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/IRequestOptions.cs b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/IRequestOptions.cs index 6f1a0a5fab7..90e6e568e23 100644 --- a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/Public/ClientOptions.cs b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/Public/ClientOptions.cs index 73d3a07207c..ab7f76e29b8 100644 --- a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/Public/FileParameter.cs b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/Public/FileParameter.cs index b14ad88caa1..688152a5957 100644 --- a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/Public/RequestOptions.cs b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/Public/RequestOptions.cs index 0cb636643d7..9c024916806 100644 --- a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/SeedExhaustiveClient.cs b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/SeedExhaustiveClient.cs index d19c1158c12..a5bde9da5ab 100644 --- a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/SeedExhaustiveClient.cs +++ b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/SeedExhaustiveClient.cs @@ -38,17 +38,17 @@ public SeedExhaustiveClient(string token, ClientOptions? clientOptions = null) Types = new TypesClient(_client); } - public EndpointsClient Endpoints { get; init; } + public EndpointsClient Endpoints { get; } - public GeneralErrorsClient GeneralErrors { get; init; } + public GeneralErrorsClient GeneralErrors { get; } - public InlinedRequestsClient InlinedRequests { get; init; } + public InlinedRequestsClient InlinedRequests { get; } - public NoAuthClient NoAuth { get; init; } + public NoAuthClient NoAuth { get; } - public NoReqBodyClient NoReqBody { get; init; } + public NoReqBodyClient NoReqBody { get; } - public ReqWithHeadersClient ReqWithHeaders { get; init; } + public ReqWithHeadersClient ReqWithHeaders { get; } - public TypesClient Types { get; init; } + public TypesClient Types { get; } } diff --git a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/IRequestOptions.cs b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/IRequestOptions.cs index 6f1a0a5fab7..90e6e568e23 100644 --- a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/Public/ClientOptions.cs b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/Public/ClientOptions.cs index 509ba5495da..e78dec0d751 100644 --- a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/Public/ClientOptions.cs @@ -14,28 +14,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/Public/FileParameter.cs b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/Public/FileParameter.cs index b14ad88caa1..688152a5957 100644 --- a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/Public/RequestOptions.cs b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/Public/RequestOptions.cs index a1d9f235cb8..3a8aca51970 100644 --- a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Core/Public/RequestOptions.cs @@ -15,38 +15,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/SeedExhaustiveClient.cs b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/SeedExhaustiveClient.cs index d19c1158c12..a5bde9da5ab 100644 --- a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/SeedExhaustiveClient.cs +++ b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/SeedExhaustiveClient.cs @@ -38,17 +38,17 @@ public SeedExhaustiveClient(string token, ClientOptions? clientOptions = null) Types = new TypesClient(_client); } - public EndpointsClient Endpoints { get; init; } + public EndpointsClient Endpoints { get; } - public GeneralErrorsClient GeneralErrors { get; init; } + public GeneralErrorsClient GeneralErrors { get; } - public InlinedRequestsClient InlinedRequests { get; init; } + public InlinedRequestsClient InlinedRequests { get; } - public NoAuthClient NoAuth { get; init; } + public NoAuthClient NoAuth { get; } - public NoReqBodyClient NoReqBody { get; init; } + public NoReqBodyClient NoReqBody { get; } - public ReqWithHeadersClient ReqWithHeaders { get; init; } + public ReqWithHeadersClient ReqWithHeaders { get; } - public TypesClient Types { get; init; } + public TypesClient Types { get; } } diff --git a/seed/csharp-sdk/extends/src/SeedExtends/Core/IRequestOptions.cs b/seed/csharp-sdk/extends/src/SeedExtends/Core/IRequestOptions.cs index 0e682ee05c4..51a57207d13 100644 --- a/seed/csharp-sdk/extends/src/SeedExtends/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/extends/src/SeedExtends/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/extends/src/SeedExtends/Core/Public/ClientOptions.cs b/seed/csharp-sdk/extends/src/SeedExtends/Core/Public/ClientOptions.cs index 33e6c314449..aa483ecf4a8 100644 --- a/seed/csharp-sdk/extends/src/SeedExtends/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/extends/src/SeedExtends/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/extends/src/SeedExtends/Core/Public/FileParameter.cs b/seed/csharp-sdk/extends/src/SeedExtends/Core/Public/FileParameter.cs index a39eb8e3a3f..2de81e4633c 100644 --- a/seed/csharp-sdk/extends/src/SeedExtends/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/extends/src/SeedExtends/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/extends/src/SeedExtends/Core/Public/RequestOptions.cs b/seed/csharp-sdk/extends/src/SeedExtends/Core/Public/RequestOptions.cs index c677de03759..21627585b08 100644 --- a/seed/csharp-sdk/extends/src/SeedExtends/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/extends/src/SeedExtends/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/IRequestOptions.cs b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/IRequestOptions.cs index 31f9a36e293..5b89e81b168 100644 --- a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/Public/ClientOptions.cs b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/Public/ClientOptions.cs index 7f9d4b17cb6..6017904f7c0 100644 --- a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/Public/FileParameter.cs b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/Public/FileParameter.cs index 7386e64bf7d..f05c0c74d36 100644 --- a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/Public/RequestOptions.cs b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/Public/RequestOptions.cs index 4cc1b4adc49..4cd320b8de3 100644 --- a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/SeedExtraPropertiesClient.cs b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/SeedExtraPropertiesClient.cs index 50a53d364ed..e47ad6da9bf 100644 --- a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/SeedExtraPropertiesClient.cs +++ b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/SeedExtraPropertiesClient.cs @@ -29,5 +29,5 @@ public SeedExtraPropertiesClient(ClientOptions? clientOptions = null) User = new UserClient(_client); } - public UserClient User { get; init; } + public UserClient User { get; } } diff --git a/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/IRequestOptions.cs b/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/IRequestOptions.cs index 934dabf3a46..6e4715236bc 100644 --- a/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/Public/ClientOptions.cs b/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/Public/ClientOptions.cs index 19eec81d0f6..2f5cf2809c6 100644 --- a/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/Public/FileParameter.cs b/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/Public/FileParameter.cs index 88140ff40b8..7f9656bd031 100644 --- a/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/Public/RequestOptions.cs b/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/Public/RequestOptions.cs index dd5fc74342b..d204c5c8976 100644 --- a/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/file-download/src/SeedFileDownload/SeedFileDownloadClient.cs b/seed/csharp-sdk/file-download/src/SeedFileDownload/SeedFileDownloadClient.cs index 0faf9a99cfa..0899481264d 100644 --- a/seed/csharp-sdk/file-download/src/SeedFileDownload/SeedFileDownloadClient.cs +++ b/seed/csharp-sdk/file-download/src/SeedFileDownload/SeedFileDownloadClient.cs @@ -29,5 +29,5 @@ public SeedFileDownloadClient(ClientOptions? clientOptions = null) Service = new ServiceClient(_client); } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } } diff --git a/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/IRequestOptions.cs b/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/IRequestOptions.cs index b79ca8a8d0b..83b31df108b 100644 --- a/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/Public/ClientOptions.cs b/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/Public/ClientOptions.cs index 1b4a90764e1..0bc342a0601 100644 --- a/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/Public/FileParameter.cs b/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/Public/FileParameter.cs index 860937485a7..1c748f89ca8 100644 --- a/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/Public/RequestOptions.cs b/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/Public/RequestOptions.cs index 2c4908bc9d8..325f638739f 100644 --- a/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/file-upload/src/SeedFileUpload/SeedFileUploadClient.cs b/seed/csharp-sdk/file-upload/src/SeedFileUpload/SeedFileUploadClient.cs index 0f4054aae59..f5f61eec54a 100644 --- a/seed/csharp-sdk/file-upload/src/SeedFileUpload/SeedFileUploadClient.cs +++ b/seed/csharp-sdk/file-upload/src/SeedFileUpload/SeedFileUploadClient.cs @@ -29,5 +29,5 @@ public SeedFileUploadClient(ClientOptions? clientOptions = null) Service = new ServiceClient(_client); } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } } diff --git a/seed/csharp-sdk/folders/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/folders/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/folders/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/folders/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/folders/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/folders/src/SeedApi/Core/Public/ClientOptions.cs index 7de8ff27f53..a5328968c05 100644 --- a/seed/csharp-sdk/folders/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/folders/src/SeedApi/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/folders/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/folders/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/folders/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/folders/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/folders/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/folders/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/folders/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/folders/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/folders/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/folders/src/SeedApi/SeedApiClient.cs index 203dc4b58fc..b9b030988aa 100644 --- a/seed/csharp-sdk/folders/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/folders/src/SeedApi/SeedApiClient.cs @@ -35,9 +35,9 @@ public SeedApiClient(ClientOptions? clientOptions = null) Folder = new FolderClient(_client); } - public AClient A { get; init; } + public AClient A { get; } - public FolderClient Folder { get; init; } + public FolderClient Folder { get; } /// /// await client.FooAsync(); diff --git a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/IIdempotentRequestOptions.cs b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/IIdempotentRequestOptions.cs index 8295cf76b64..bdc32e7de40 100644 --- a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/IIdempotentRequestOptions.cs +++ b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/IIdempotentRequestOptions.cs @@ -2,7 +2,19 @@ namespace SeedIdempotencyHeaders.Core; internal interface IIdempotentRequestOptions : IRequestOptions { - public string IdempotencyKey { get; init; } - public int IdempotencyExpiration { get; init; } + public string IdempotencyKey { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + public int IdempotencyExpiration { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } internal Headers GetIdempotencyHeaders(); } diff --git a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/IRequestOptions.cs b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/IRequestOptions.cs index 509951417a5..c220afc4853 100644 --- a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/ClientOptions.cs b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/ClientOptions.cs index b8821af418e..2230e96d0eb 100644 --- a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/FileParameter.cs b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/FileParameter.cs index 8e2b0db70a6..bfa78de5c25 100644 --- a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/IdempotentRequestOptions.cs b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/IdempotentRequestOptions.cs index 6801fac4c21..69960f4fa47 100644 --- a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/IdempotentRequestOptions.cs +++ b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/IdempotentRequestOptions.cs @@ -16,44 +16,97 @@ public partial class IdempotentRequestOptions : IIdempotentRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } - public string IdempotencyKey { get; init; } + public string IdempotencyKey { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } - public int IdempotencyExpiration { get; init; } + public int IdempotencyExpiration { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } Headers IIdempotentRequestOptions.GetIdempotencyHeaders() { diff --git a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/RequestOptions.cs b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/RequestOptions.cs index 9ce335fb295..ea1478741ff 100644 --- a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/SeedIdempotencyHeadersClient.cs b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/SeedIdempotencyHeadersClient.cs index 9af6b8096bb..c2c710ffefd 100644 --- a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/SeedIdempotencyHeadersClient.cs +++ b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/SeedIdempotencyHeadersClient.cs @@ -30,5 +30,5 @@ public SeedIdempotencyHeadersClient(string? token = null, ClientOptions? clientO Payment = new PaymentClient(_client); } - public PaymentClient Payment { get; init; } + public PaymentClient Payment { get; } } diff --git a/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/Public/ClientOptions.cs index 7de8ff27f53..a5328968c05 100644 --- a/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/SeedApiClient.cs index b9dfcce7487..6048374feac 100644 --- a/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/imdb/exception-class-names/src/SeedApi/SeedApiClient.cs @@ -30,5 +30,5 @@ public SeedApiClient(string token, ClientOptions? clientOptions = null) Imdb = new ImdbClient(_client); } - public ImdbClient Imdb { get; init; } + public ImdbClient Imdb { get; } } diff --git a/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/BaseClient.cs b/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/BaseClient.cs index 0e85bdceea8..7cd172ef4d7 100644 --- a/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/BaseClient.cs +++ b/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/BaseClient.cs @@ -30,5 +30,5 @@ public BaseClient(string token, ClientOptions? clientOptions = null) Imdb = new ImdbClient(_client); } - public ImdbClient Imdb { get; init; } + public ImdbClient Imdb { get; } } diff --git a/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/Public/ClientOptions.cs index 7de8ff27f53..a5328968c05 100644 --- a/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/imdb/exported-client-class-name/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/Public/ClientOptions.cs index 7de8ff27f53..a5328968c05 100644 --- a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/SeedApiClient.cs index b9dfcce7487..6048374feac 100644 --- a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/SeedApiClient.cs @@ -30,5 +30,5 @@ public SeedApiClient(string token, ClientOptions? clientOptions = null) Imdb = new ImdbClient(_client); } - public ImdbClient Imdb { get; init; } + public ImdbClient Imdb { get; } } diff --git a/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/Public/ClientOptions.cs index ed31fe975f6..15a11585c71 100644 --- a/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/Public/ClientOptions.cs @@ -20,28 +20,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/SeedApiClient.cs index b9dfcce7487..6048374feac 100644 --- a/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/imdb/include-exception-handler/src/SeedApi/SeedApiClient.cs @@ -30,5 +30,5 @@ public SeedApiClient(string token, ClientOptions? clientOptions = null) Imdb = new ImdbClient(_client); } - public ImdbClient Imdb { get; init; } + public ImdbClient Imdb { get; } } diff --git a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/Public/ClientOptions.cs index 7de8ff27f53..a5328968c05 100644 --- a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/SeedApiClient.cs index b9dfcce7487..6048374feac 100644 --- a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/SeedApiClient.cs @@ -30,5 +30,5 @@ public SeedApiClient(string token, ClientOptions? clientOptions = null) Imdb = new ImdbClient(_client); } - public ImdbClient Imdb { get; init; } + public ImdbClient Imdb { get; } } diff --git a/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/IRequestOptions.cs b/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/IRequestOptions.cs index bf0f0548e34..86d83d9b5d3 100644 --- a/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/Public/ClientOptions.cs b/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/Public/ClientOptions.cs index 1778ca73193..ef8d440f165 100644 --- a/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/Public/FileParameter.cs b/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/Public/FileParameter.cs index cd02ece26b0..19c61220c60 100644 --- a/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/Public/RequestOptions.cs b/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/Public/RequestOptions.cs index 66401fd26b0..58c474d4d27 100644 --- a/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/license/custom-license/src/SeedLicense/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/IRequestOptions.cs b/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/IRequestOptions.cs index bf0f0548e34..86d83d9b5d3 100644 --- a/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/Public/ClientOptions.cs b/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/Public/ClientOptions.cs index 1778ca73193..ef8d440f165 100644 --- a/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/Public/FileParameter.cs b/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/Public/FileParameter.cs index cd02ece26b0..19c61220c60 100644 --- a/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/Public/RequestOptions.cs b/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/Public/RequestOptions.cs index 66401fd26b0..58c474d4d27 100644 --- a/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/license/mit-license/src/SeedLicense/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/literal/src/SeedLiteral/Core/IRequestOptions.cs b/seed/csharp-sdk/literal/src/SeedLiteral/Core/IRequestOptions.cs index 13dd23a87b4..e3fe08c4d67 100644 --- a/seed/csharp-sdk/literal/src/SeedLiteral/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/literal/src/SeedLiteral/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/literal/src/SeedLiteral/Core/Public/ClientOptions.cs b/seed/csharp-sdk/literal/src/SeedLiteral/Core/Public/ClientOptions.cs index 84e0905f9fe..a5a4a25cd2b 100644 --- a/seed/csharp-sdk/literal/src/SeedLiteral/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/literal/src/SeedLiteral/Core/Public/ClientOptions.cs @@ -15,32 +15,74 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); - public string? Version { get; init; } = null; + public string? Version { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = null; - public bool? AuditLogging { get; init; } = null; + public bool? AuditLogging { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = null; /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/literal/src/SeedLiteral/Core/Public/FileParameter.cs b/seed/csharp-sdk/literal/src/SeedLiteral/Core/Public/FileParameter.cs index c5d0ff64cae..90d73ec170d 100644 --- a/seed/csharp-sdk/literal/src/SeedLiteral/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/literal/src/SeedLiteral/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/literal/src/SeedLiteral/Core/Public/RequestOptions.cs b/seed/csharp-sdk/literal/src/SeedLiteral/Core/Public/RequestOptions.cs index e7b090bf3db..ec5f69f1ac1 100644 --- a/seed/csharp-sdk/literal/src/SeedLiteral/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/literal/src/SeedLiteral/Core/Public/RequestOptions.cs @@ -16,42 +16,95 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } - public string? Version { get; init; } + public string? Version { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } - public bool? AuditLogging { get; init; } + public bool? AuditLogging { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/literal/src/SeedLiteral/SeedLiteralClient.cs b/seed/csharp-sdk/literal/src/SeedLiteral/SeedLiteralClient.cs index 03329a89a30..bc741edfef6 100644 --- a/seed/csharp-sdk/literal/src/SeedLiteral/SeedLiteralClient.cs +++ b/seed/csharp-sdk/literal/src/SeedLiteral/SeedLiteralClient.cs @@ -43,13 +43,13 @@ public SeedLiteralClient(ClientOptions? clientOptions = null) Reference = new ReferenceClient(_client); } - public HeadersClient Headers { get; init; } + public HeadersClient Headers { get; } - public InlinedClient Inlined { get; init; } + public InlinedClient Inlined { get; } - public PathClient Path { get; init; } + public PathClient Path { get; } - public QueryClient Query { get; init; } + public QueryClient Query { get; } - public ReferenceClient Reference { get; init; } + public ReferenceClient Reference { get; } } diff --git a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/IRequestOptions.cs b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/IRequestOptions.cs index ee1030cc63d..8fabad97f0c 100644 --- a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/Public/ClientOptions.cs b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/Public/ClientOptions.cs index 75669c26334..c53c40909df 100644 --- a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/Public/FileParameter.cs b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/Public/FileParameter.cs index 06ec8e183df..53551a60141 100644 --- a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/Public/RequestOptions.cs b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/Public/RequestOptions.cs index 26fef6f8f12..d80d769204c 100644 --- a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/SeedMixedCaseClient.cs b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/SeedMixedCaseClient.cs index d5194d59450..71ba5cebe69 100644 --- a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/SeedMixedCaseClient.cs +++ b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/SeedMixedCaseClient.cs @@ -29,5 +29,5 @@ public SeedMixedCaseClient(ClientOptions? clientOptions = null) Service = new ServiceClient(_client); } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } } diff --git a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/IRequestOptions.cs b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/IRequestOptions.cs index a2b819b07bf..7487cbc5bca 100644 --- a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/ClientOptions.cs b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/ClientOptions.cs index 741ebe996e2..f62a07c74e0 100644 --- a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/FileParameter.cs b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/FileParameter.cs index 1e4b519e349..c7b7e2bcb1b 100644 --- a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/RequestOptions.cs b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/RequestOptions.cs index 20560ab174c..7fd7c6d2992 100644 --- a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/SeedMixedFileDirectoryClient.cs b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/SeedMixedFileDirectoryClient.cs index df1e8e317b4..36e58da5a36 100644 --- a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/SeedMixedFileDirectoryClient.cs +++ b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/SeedMixedFileDirectoryClient.cs @@ -30,7 +30,7 @@ public SeedMixedFileDirectoryClient(ClientOptions? clientOptions = null) User = new UserClient(_client); } - public OrganizationClient Organization { get; init; } + public OrganizationClient Organization { get; } - public UserClient User { get; init; } + public UserClient User { get; } } diff --git a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/IRequestOptions.cs b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/IRequestOptions.cs index 2e35fc96b41..94829a375a8 100644 --- a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/Public/ClientOptions.cs b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/Public/ClientOptions.cs index 48e2b9fc25a..1c436159d05 100644 --- a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/Public/FileParameter.cs b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/Public/FileParameter.cs index 8a083e72130..3fde937cd4d 100644 --- a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/Public/RequestOptions.cs b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/Public/RequestOptions.cs index af0f204b664..cf732534f8e 100644 --- a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/SeedMultiLineDocsClient.cs b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/SeedMultiLineDocsClient.cs index b2cb4a9c5d9..802d21fbd2e 100644 --- a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/SeedMultiLineDocsClient.cs +++ b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/SeedMultiLineDocsClient.cs @@ -29,5 +29,5 @@ public SeedMultiLineDocsClient(ClientOptions? clientOptions = null) User = new UserClient(_client); } - public UserClient User { get; init; } + public UserClient User { get; } } diff --git a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/IRequestOptions.cs b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/IRequestOptions.cs index f51e65c70f2..0618b14ca03 100644 --- a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/ClientOptions.cs b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/ClientOptions.cs index 0570bb2dc57..b9c0ba9a8c4 100644 --- a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Environment for the API. /// - public SeedMultiUrlEnvironmentNoDefaultEnvironment Environment { get; init; } = null; + public SeedMultiUrlEnvironmentNoDefaultEnvironment Environment { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = null; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/FileParameter.cs b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/FileParameter.cs index 264c18f0f2f..37a82d4397e 100644 --- a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/RequestOptions.cs b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/RequestOptions.cs index a68e5c49928..4ad48ae5a8c 100644 --- a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/SeedMultiUrlEnvironmentNoDefaultEnvironment.cs b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/SeedMultiUrlEnvironmentNoDefaultEnvironment.cs index 5cf9c20f50f..1fcba05285e 100644 --- a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/SeedMultiUrlEnvironmentNoDefaultEnvironment.cs +++ b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/Public/SeedMultiUrlEnvironmentNoDefaultEnvironment.cs @@ -19,10 +19,22 @@ public class SeedMultiUrlEnvironmentNoDefaultEnvironment /// /// URL for the ec2 service /// - public string Ec2 { get; init; } + public string Ec2 { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// URL for the s3 service /// - public string S3 { get; init; } + public string S3 { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/SeedMultiUrlEnvironmentNoDefaultClient.cs b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/SeedMultiUrlEnvironmentNoDefaultClient.cs index 72ae7fbcea9..0c9cc46722e 100644 --- a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/SeedMultiUrlEnvironmentNoDefaultClient.cs +++ b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/SeedMultiUrlEnvironmentNoDefaultClient.cs @@ -34,7 +34,7 @@ public SeedMultiUrlEnvironmentNoDefaultClient( S3 = new S3Client(_client); } - public Ec2Client Ec2 { get; init; } + public Ec2Client Ec2 { get; } - public S3Client S3 { get; init; } + public S3Client S3 { get; } } diff --git a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/IRequestOptions.cs b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/IRequestOptions.cs index b0a50b7c96b..9748d0e838f 100644 --- a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/ClientOptions.cs b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/ClientOptions.cs index 248dfa47f35..4b3f3ca905d 100644 --- a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Environment for the API. /// - public CustomEnvironment Environment { get; init; } = CustomEnvironment.Production; + public CustomEnvironment Environment { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = CustomEnvironment.Production; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/CustomEnvironment.cs b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/CustomEnvironment.cs index 2137415d29c..7204bb599b1 100644 --- a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/CustomEnvironment.cs +++ b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/CustomEnvironment.cs @@ -17,10 +17,22 @@ public class CustomEnvironment /// /// URL for the ec2 service /// - public string Ec2 { get; init; } + public string Ec2 { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// URL for the s3 service /// - public string S3 { get; init; } + public string S3 { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/FileParameter.cs b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/FileParameter.cs index a94f5cf9a6b..413ab264256 100644 --- a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/RequestOptions.cs b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/RequestOptions.cs index 9c67f2708e4..94c13abadfa 100644 --- a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/SeedMultiUrlEnvironmentClient.cs b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/SeedMultiUrlEnvironmentClient.cs index d14e3d734aa..00f8dd80a61 100644 --- a/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/SeedMultiUrlEnvironmentClient.cs +++ b/seed/csharp-sdk/multi-url-environment/environment-class-name/src/SeedMultiUrlEnvironment/SeedMultiUrlEnvironmentClient.cs @@ -31,7 +31,7 @@ public SeedMultiUrlEnvironmentClient(string? token = null, ClientOptions? client S3 = new S3Client(_client); } - public Ec2Client Ec2 { get; init; } + public Ec2Client Ec2 { get; } - public S3Client S3 { get; init; } + public S3Client S3 { get; } } diff --git a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/IRequestOptions.cs b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/IRequestOptions.cs index b0a50b7c96b..9748d0e838f 100644 --- a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/ClientOptions.cs b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/ClientOptions.cs index 81a04054bda..0c8597931b4 100644 --- a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/ClientOptions.cs @@ -15,29 +15,58 @@ public partial class ClientOptions /// /// The Environment for the API. /// - public SeedMultiUrlEnvironmentEnvironment Environment { get; init; } = - SeedMultiUrlEnvironmentEnvironment.PRODUCTION; + public SeedMultiUrlEnvironmentEnvironment Environment { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = SeedMultiUrlEnvironmentEnvironment.PRODUCTION; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/FileParameter.cs b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/FileParameter.cs index a94f5cf9a6b..413ab264256 100644 --- a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/RequestOptions.cs b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/RequestOptions.cs index 9c67f2708e4..94c13abadfa 100644 --- a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/SeedMultiUrlEnvironmentEnvironment.cs b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/SeedMultiUrlEnvironmentEnvironment.cs index ac01012bc4d..a0e08c50276 100644 --- a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/SeedMultiUrlEnvironmentEnvironment.cs +++ b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/Core/Public/SeedMultiUrlEnvironmentEnvironment.cs @@ -19,10 +19,22 @@ public class SeedMultiUrlEnvironmentEnvironment /// /// URL for the ec2 service /// - public string Ec2 { get; init; } + public string Ec2 { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// URL for the s3 service /// - public string S3 { get; init; } + public string S3 { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/SeedMultiUrlEnvironmentClient.cs b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/SeedMultiUrlEnvironmentClient.cs index d14e3d734aa..00f8dd80a61 100644 --- a/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/SeedMultiUrlEnvironmentClient.cs +++ b/seed/csharp-sdk/multi-url-environment/no-pascal-case-environments/src/SeedMultiUrlEnvironment/SeedMultiUrlEnvironmentClient.cs @@ -31,7 +31,7 @@ public SeedMultiUrlEnvironmentClient(string? token = null, ClientOptions? client S3 = new S3Client(_client); } - public Ec2Client Ec2 { get; init; } + public Ec2Client Ec2 { get; } - public S3Client S3 { get; init; } + public S3Client S3 { get; } } diff --git a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/IRequestOptions.cs b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/IRequestOptions.cs index 5f53e575ee5..60ea568bfcf 100644 --- a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/Public/ClientOptions.cs b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/Public/ClientOptions.cs index 2716f551c4c..61138248642 100644 --- a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/Public/FileParameter.cs b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/Public/FileParameter.cs index 1e15762ac28..c0ea41021e7 100644 --- a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/Public/RequestOptions.cs b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/Public/RequestOptions.cs index cd05fa78ddd..6f2b3b67d8a 100644 --- a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/SeedNoEnvironmentClient.cs b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/SeedNoEnvironmentClient.cs index 806e27ae0b1..75dedb1e494 100644 --- a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/SeedNoEnvironmentClient.cs +++ b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/SeedNoEnvironmentClient.cs @@ -30,5 +30,5 @@ public SeedNoEnvironmentClient(string? token = null, ClientOptions? clientOption Dummy = new DummyClient(_client); } - public DummyClient Dummy { get; init; } + public DummyClient Dummy { get; } } diff --git a/seed/csharp-sdk/nullable/src/SeedNullable/Core/IRequestOptions.cs b/seed/csharp-sdk/nullable/src/SeedNullable/Core/IRequestOptions.cs index 223a5eec6e3..de2e2bf85d5 100644 --- a/seed/csharp-sdk/nullable/src/SeedNullable/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/nullable/src/SeedNullable/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/nullable/src/SeedNullable/Core/Public/ClientOptions.cs b/seed/csharp-sdk/nullable/src/SeedNullable/Core/Public/ClientOptions.cs index 633f6bab956..41b7cf36cd7 100644 --- a/seed/csharp-sdk/nullable/src/SeedNullable/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/nullable/src/SeedNullable/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/nullable/src/SeedNullable/Core/Public/FileParameter.cs b/seed/csharp-sdk/nullable/src/SeedNullable/Core/Public/FileParameter.cs index c13e5cf06f6..aca9ac913cf 100644 --- a/seed/csharp-sdk/nullable/src/SeedNullable/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/nullable/src/SeedNullable/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/nullable/src/SeedNullable/Core/Public/RequestOptions.cs b/seed/csharp-sdk/nullable/src/SeedNullable/Core/Public/RequestOptions.cs index 76d048caac8..321196207d5 100644 --- a/seed/csharp-sdk/nullable/src/SeedNullable/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/nullable/src/SeedNullable/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/nullable/src/SeedNullable/SeedNullableClient.cs b/seed/csharp-sdk/nullable/src/SeedNullable/SeedNullableClient.cs index 8e6723397a1..23701d878e3 100644 --- a/seed/csharp-sdk/nullable/src/SeedNullable/SeedNullableClient.cs +++ b/seed/csharp-sdk/nullable/src/SeedNullable/SeedNullableClient.cs @@ -29,5 +29,5 @@ public SeedNullableClient(ClientOptions? clientOptions = null) Nullable = new NullableClient(_client); } - public NullableClient Nullable { get; init; } + public NullableClient Nullable { get; } } diff --git a/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/IRequestOptions.cs b/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/IRequestOptions.cs index 62dc130a082..a730e7bcd9d 100644 --- a/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs b/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs index 2bad03a0b3b..31ed8a84e78 100644 --- a/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs b/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs index 42e5f448791..659899a7c75 100644 --- a/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs b/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs index 4096f024a0c..94f2f7f29d8 100644 --- a/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs b/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs index 322e3e9e43f..2aa14ade3c4 100644 --- a/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials-custom/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs @@ -41,5 +41,5 @@ public SeedOauthClientCredentialsClient( Auth = new AuthClient(_client); } - public AuthClient Auth { get; init; } + public AuthClient Auth { get; } } diff --git a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/IRequestOptions.cs b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/IRequestOptions.cs index d7bd38884ce..46d86ad20aa 100644 --- a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/ClientOptions.cs b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/ClientOptions.cs index ad94f9bb470..cb8cf0e7b7d 100644 --- a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/FileParameter.cs b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/FileParameter.cs index 6bc23e084d4..f9016ab8a33 100644 --- a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/RequestOptions.cs b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/RequestOptions.cs index 394225a241f..70c7df39504 100644 --- a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/SeedOauthClientCredentialsDefaultClient.cs b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/SeedOauthClientCredentialsDefaultClient.cs index 9c176f0a88d..d51e1972ae2 100644 --- a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/SeedOauthClientCredentialsDefaultClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/SeedOauthClientCredentialsDefaultClient.cs @@ -41,5 +41,5 @@ public SeedOauthClientCredentialsDefaultClient( Auth = new AuthClient(_client); } - public AuthClient Auth { get; init; } + public AuthClient Auth { get; } } diff --git a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/IRequestOptions.cs b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/IRequestOptions.cs index 56df4f98f68..99727d95e38 100644 --- a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/ClientOptions.cs b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/ClientOptions.cs index 4cc95f91988..7edb4521659 100644 --- a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/FileParameter.cs b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/FileParameter.cs index 74724396f1d..ab070887e53 100644 --- a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/RequestOptions.cs b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/RequestOptions.cs index 9a06ec4299e..95942ae1183 100644 --- a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/SeedOauthClientCredentialsEnvironmentVariablesClient.cs b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/SeedOauthClientCredentialsEnvironmentVariablesClient.cs index bd32da483ea..ea43524bde6 100644 --- a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/SeedOauthClientCredentialsEnvironmentVariablesClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/SeedOauthClientCredentialsEnvironmentVariablesClient.cs @@ -49,7 +49,7 @@ public SeedOauthClientCredentialsEnvironmentVariablesClient( Auth = new AuthClient(_client); } - public AuthClient Auth { get; init; } + public AuthClient Auth { get; } private static string GetFromEnvironmentOrThrow(string env, string message) { diff --git a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/IRequestOptions.cs b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/IRequestOptions.cs index 62dc130a082..a730e7bcd9d 100644 --- a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs index 2bad03a0b3b..31ed8a84e78 100644 --- a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs index 42e5f448791..659899a7c75 100644 --- a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs index 4096f024a0c..94f2f7f29d8 100644 --- a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs index bb2d3a6dfa0..cc24a43d1b3 100644 --- a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs @@ -42,5 +42,5 @@ public SeedOauthClientCredentialsClient( Auth = new AuthClient(_client); } - public AuthClient Auth { get; init; } + public AuthClient Auth { get; } } diff --git a/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/IRequestOptions.cs b/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/IRequestOptions.cs index 62dc130a082..a730e7bcd9d 100644 --- a/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs b/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs index ac95e947bd8..bdd9cda747c 100644 --- a/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs @@ -20,28 +20,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs b/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs index 42e5f448791..659899a7c75 100644 --- a/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs b/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs index 4096f024a0c..94f2f7f29d8 100644 --- a/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs b/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs index ac194bfa831..0660ed9e89e 100644 --- a/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials/include-exception-handler/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs @@ -41,5 +41,5 @@ public SeedOauthClientCredentialsClient( Auth = new AuthClient(_client); } - public AuthClient Auth { get; init; } + public AuthClient Auth { get; } } diff --git a/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/IRequestOptions.cs b/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/IRequestOptions.cs index 62dc130a082..a730e7bcd9d 100644 --- a/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs b/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs index 2bad03a0b3b..31ed8a84e78 100644 --- a/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs b/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs index 42e5f448791..659899a7c75 100644 --- a/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs b/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs index 4096f024a0c..94f2f7f29d8 100644 --- a/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs b/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs index ac194bfa831..0660ed9e89e 100644 --- a/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials/no-custom-config/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs @@ -41,5 +41,5 @@ public SeedOauthClientCredentialsClient( Auth = new AuthClient(_client); } - public AuthClient Auth { get; init; } + public AuthClient Auth { get; } } diff --git a/seed/csharp-sdk/object/src/SeedObject/Core/IRequestOptions.cs b/seed/csharp-sdk/object/src/SeedObject/Core/IRequestOptions.cs index 05ea893e1de..325af33afc9 100644 --- a/seed/csharp-sdk/object/src/SeedObject/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/object/src/SeedObject/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/object/src/SeedObject/Core/Public/ClientOptions.cs b/seed/csharp-sdk/object/src/SeedObject/Core/Public/ClientOptions.cs index d64b4b07d26..7302de34382 100644 --- a/seed/csharp-sdk/object/src/SeedObject/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/object/src/SeedObject/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/object/src/SeedObject/Core/Public/FileParameter.cs b/seed/csharp-sdk/object/src/SeedObject/Core/Public/FileParameter.cs index 4191220dd93..59054bda81c 100644 --- a/seed/csharp-sdk/object/src/SeedObject/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/object/src/SeedObject/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/object/src/SeedObject/Core/Public/RequestOptions.cs b/seed/csharp-sdk/object/src/SeedObject/Core/Public/RequestOptions.cs index c540e0a3996..bc8865eea13 100644 --- a/seed/csharp-sdk/object/src/SeedObject/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/object/src/SeedObject/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/IRequestOptions.cs b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/IRequestOptions.cs index 7fe717cb667..e292f3c3859 100644 --- a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/Public/ClientOptions.cs b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/Public/ClientOptions.cs index d250c06352c..5785c68664a 100644 --- a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/Public/FileParameter.cs b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/Public/FileParameter.cs index 44e541f68bf..ef8fe4b0f33 100644 --- a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/Public/RequestOptions.cs b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/Public/RequestOptions.cs index 3cb61e0cba1..27c26e74b8e 100644 --- a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs index 5a191de8b1e..89e430258ce 100644 --- a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs +++ b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs @@ -31,7 +31,7 @@ public SeedObjectsWithImportsClient(ClientOptions? clientOptions = null) File = new FileClient(_client); } - public CommonsClient Commons { get; init; } + public CommonsClient Commons { get; } - public FileClient File { get; init; } + public FileClient File { get; } } diff --git a/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/IRequestOptions.cs b/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/IRequestOptions.cs index 7fe717cb667..e292f3c3859 100644 --- a/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/Public/ClientOptions.cs b/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/Public/ClientOptions.cs index d250c06352c..5785c68664a 100644 --- a/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/Public/FileParameter.cs b/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/Public/FileParameter.cs index 44e541f68bf..ef8fe4b0f33 100644 --- a/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/Public/RequestOptions.cs b/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/Public/RequestOptions.cs index 3cb61e0cba1..27c26e74b8e 100644 --- a/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs b/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs index e6b5be017a4..d4230c764fb 100644 --- a/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs +++ b/seed/csharp-sdk/optional/no-simplify-object-dictionaries/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs @@ -29,5 +29,5 @@ public SeedObjectsWithImportsClient(ClientOptions? clientOptions = null) Optional = new OptionalClient(_client); } - public OptionalClient Optional { get; init; } + public OptionalClient Optional { get; } } diff --git a/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/IRequestOptions.cs b/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/IRequestOptions.cs index e5fe4bcbf70..bba0685f4a1 100644 --- a/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/Public/ClientOptions.cs b/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/Public/ClientOptions.cs index 30ff10b912e..4cda7457a98 100644 --- a/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/Public/FileParameter.cs b/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/Public/FileParameter.cs index 3fc9e6cb3dc..c3d49bff127 100644 --- a/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/Public/RequestOptions.cs b/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/Public/RequestOptions.cs index edb2db2305e..805b4f4d4bd 100644 --- a/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/package-yml/src/SeedPackageYml/SeedPackageYmlClient.cs b/seed/csharp-sdk/package-yml/src/SeedPackageYml/SeedPackageYmlClient.cs index 9581b6fb229..a847d0695e9 100644 --- a/seed/csharp-sdk/package-yml/src/SeedPackageYml/SeedPackageYmlClient.cs +++ b/seed/csharp-sdk/package-yml/src/SeedPackageYml/SeedPackageYmlClient.cs @@ -32,7 +32,7 @@ public SeedPackageYmlClient(ClientOptions? clientOptions = null) Service = new ServiceClient(_client); } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } /// /// await client.EchoAsync("id-ksfd9c1", new EchoRequest { Name = "Hello world!", Size = 20 }); diff --git a/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/IRequestOptions.cs b/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/IRequestOptions.cs index be71dba073b..ac59861e231 100644 --- a/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/Public/ClientOptions.cs b/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/Public/ClientOptions.cs index 1461df843fa..ab423e50529 100644 --- a/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/Public/ClientOptions.cs @@ -20,28 +20,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/Public/FileParameter.cs b/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/Public/FileParameter.cs index 4b64635606c..e9ee63627aa 100644 --- a/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/Public/RequestOptions.cs b/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/Public/RequestOptions.cs index e82d383f171..b798b9f07bf 100644 --- a/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/SeedPaginationClient.cs b/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/SeedPaginationClient.cs index 7cb8f5e134b..30f3195ddcd 100644 --- a/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/SeedPaginationClient.cs +++ b/seed/csharp-sdk/pagination/custom-pager-with-exception-handler/src/SeedPagination/SeedPaginationClient.cs @@ -31,7 +31,7 @@ public SeedPaginationClient(string token, ClientOptions? clientOptions = null) Users = new UsersClient(_client); } - public ComplexClient Complex { get; init; } + public ComplexClient Complex { get; } - public UsersClient Users { get; init; } + public UsersClient Users { get; } } diff --git a/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/IRequestOptions.cs b/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/IRequestOptions.cs index be71dba073b..ac59861e231 100644 --- a/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/Public/ClientOptions.cs b/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/Public/ClientOptions.cs index 4bb1dfef496..8ffecbb9cc6 100644 --- a/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/Public/FileParameter.cs b/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/Public/FileParameter.cs index 4b64635606c..e9ee63627aa 100644 --- a/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/Public/RequestOptions.cs b/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/Public/RequestOptions.cs index e82d383f171..b798b9f07bf 100644 --- a/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/SeedPaginationClient.cs b/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/SeedPaginationClient.cs index 7cb8f5e134b..30f3195ddcd 100644 --- a/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/SeedPaginationClient.cs +++ b/seed/csharp-sdk/pagination/custom-pager/src/SeedPagination/SeedPaginationClient.cs @@ -31,7 +31,7 @@ public SeedPaginationClient(string token, ClientOptions? clientOptions = null) Users = new UsersClient(_client); } - public ComplexClient Complex { get; init; } + public ComplexClient Complex { get; } - public UsersClient Users { get; init; } + public UsersClient Users { get; } } diff --git a/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/IRequestOptions.cs b/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/IRequestOptions.cs index be71dba073b..ac59861e231 100644 --- a/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/Public/ClientOptions.cs b/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/Public/ClientOptions.cs index 4bb1dfef496..8ffecbb9cc6 100644 --- a/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/Public/FileParameter.cs b/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/Public/FileParameter.cs index 4b64635606c..e9ee63627aa 100644 --- a/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/Public/RequestOptions.cs b/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/Public/RequestOptions.cs index e82d383f171..b798b9f07bf 100644 --- a/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/SeedPaginationClient.cs b/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/SeedPaginationClient.cs index 7cb8f5e134b..30f3195ddcd 100644 --- a/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/SeedPaginationClient.cs +++ b/seed/csharp-sdk/pagination/no-custom-config/src/SeedPagination/SeedPaginationClient.cs @@ -31,7 +31,7 @@ public SeedPaginationClient(string token, ClientOptions? clientOptions = null) Users = new UsersClient(_client); } - public ComplexClient Complex { get; init; } + public ComplexClient Complex { get; } - public UsersClient Users { get; init; } + public UsersClient Users { get; } } diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/IRequestOptions.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/IRequestOptions.cs index c9610569e48..068fe4ae5be 100644 --- a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/ClientOptions.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/ClientOptions.cs index f46c72fb449..ea0af09b895 100644 --- a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/FileParameter.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/FileParameter.cs index 2c7eb860438..292a313d282 100644 --- a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/RequestOptions.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/RequestOptions.cs index 597c067f362..7a08c78d5ba 100644 --- a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/SeedPathParametersClient.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/SeedPathParametersClient.cs index 110d9d7453e..2fac6a44d0b 100644 --- a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/SeedPathParametersClient.cs +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/SeedPathParametersClient.cs @@ -30,7 +30,7 @@ public SeedPathParametersClient(ClientOptions? clientOptions = null) User = new UserClient(_client); } - public OrganizationsClient Organizations { get; init; } + public OrganizationsClient Organizations { get; } - public UserClient User { get; init; } + public UserClient User { get; } } diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/IRequestOptions.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/IRequestOptions.cs index c9610569e48..068fe4ae5be 100644 --- a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/ClientOptions.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/ClientOptions.cs index f46c72fb449..ea0af09b895 100644 --- a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/FileParameter.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/FileParameter.cs index 2c7eb860438..292a313d282 100644 --- a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/RequestOptions.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/RequestOptions.cs index 597c067f362..7a08c78d5ba 100644 --- a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParametersClient.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParametersClient.cs index 110d9d7453e..2fac6a44d0b 100644 --- a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParametersClient.cs +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParametersClient.cs @@ -30,7 +30,7 @@ public SeedPathParametersClient(ClientOptions? clientOptions = null) User = new UserClient(_client); } - public OrganizationsClient Organizations { get; init; } + public OrganizationsClient Organizations { get; } - public UserClient User { get; init; } + public UserClient User { get; } } diff --git a/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/IRequestOptions.cs b/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/IRequestOptions.cs index 9df6602b653..45107d1c6f2 100644 --- a/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/Public/ClientOptions.cs b/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/Public/ClientOptions.cs index 514287bb1b5..fee5f2a598d 100644 --- a/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/Public/FileParameter.cs b/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/Public/FileParameter.cs index 79882ca04e4..da0be3a9909 100644 --- a/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/Public/RequestOptions.cs b/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/Public/RequestOptions.cs index 943c42ce43a..8eab81ca29d 100644 --- a/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/plain-text/src/SeedPlainText/SeedPlainTextClient.cs b/seed/csharp-sdk/plain-text/src/SeedPlainText/SeedPlainTextClient.cs index 34bd63a590c..f7c6ef27f22 100644 --- a/seed/csharp-sdk/plain-text/src/SeedPlainText/SeedPlainTextClient.cs +++ b/seed/csharp-sdk/plain-text/src/SeedPlainText/SeedPlainTextClient.cs @@ -29,5 +29,5 @@ public SeedPlainTextClient(ClientOptions? clientOptions = null) Service = new ServiceClient(_client); } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } } diff --git a/seed/csharp-sdk/public-object/.editorconfig b/seed/csharp-sdk/public-object/.editorconfig new file mode 100644 index 00000000000..a450a4ea14b --- /dev/null +++ b/seed/csharp-sdk/public-object/.editorconfig @@ -0,0 +1,34 @@ +root = true + +[*.cs] +resharper_arrange_object_creation_when_type_evident_highlighting = hint +resharper_auto_property_can_be_made_get_only_global_highlighting = hint +resharper_check_namespace_highlighting = hint +resharper_class_never_instantiated_global_highlighting = hint +resharper_collection_never_updated_global_highlighting = hint +resharper_convert_type_check_pattern_to_null_check_highlighting = hint +resharper_inconsistent_naming_highlighting = hint +resharper_member_can_be_private_global_highlighting = hint +resharper_not_accessed_field_local_highlighting = hint +resharper_partial_type_with_single_part_highlighting = hint +resharper_prefer_concrete_value_over_default_highlighting = none +resharper_private_field_can_be_converted_to_local_variable_highlighting = hint +resharper_property_can_be_made_init_only_global_highlighting = hint +resharper_redundant_name_qualifier_highlighting = none +resharper_redundant_using_directive_highlighting = hint +resharper_replace_slice_with_range_indexer_highlighting = none +resharper_unused_auto_property_accessor_global_highlighting = hint +resharper_unused_auto_property_accessor_local_highlighting = hint +resharper_unused_member_global_highlighting = hint +resharper_unused_type_global_highlighting = hint +resharper_use_string_interpolation_highlighting = hint +resharper_property_can_be_made_init_only_local_highlighting = hint +resharper_member_hides_static_from_outer_class_highlighting = hint +resharper_class_never_instantiated_local_highlighting = hint +dotnet_diagnostic.CS1591.severity = suggestion + +[src/**/Types/*.cs] +resharper_check_namespace_highlighting = none + +[src/**/Core/Public/*.cs] +resharper_check_namespace_highlighting = none \ No newline at end of file diff --git a/seed/csharp-sdk/public-object/.github/workflows/ci.yml b/seed/csharp-sdk/public-object/.github/workflows/ci.yml new file mode 100644 index 00000000000..b898349fd20 --- /dev/null +++ b/seed/csharp-sdk/public-object/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: ci + +on: [push] + +jobs: + compile: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - uses: actions/checkout@master + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Install tools + run: | + dotnet tool restore + + - name: Build Release + run: dotnet build src -c Release /p:ContinuousIntegrationBuild=true + + unit-tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - uses: actions/checkout@master + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Install tools + run: | + dotnet tool restore + + - name: Run Tests + run: | + dotnet test src + + + publish: + needs: [compile] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Publish + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_TOKEN }} + run: | + dotnet pack src -c Release + dotnet nuget push src/SeedPublicObject/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source "nuget.org" diff --git a/seed/csharp-sdk/public-object/.gitignore b/seed/csharp-sdk/public-object/.gitignore new file mode 100644 index 00000000000..11014f2b33d --- /dev/null +++ b/seed/csharp-sdk/public-object/.gitignore @@ -0,0 +1,484 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +## This is based on `dotnet new gitignore` and customized by Fern + +# dotenv files +.env + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +# [Rr]elease/ (Ignored by Fern) +# [Rr]eleases/ (Ignored by Fern) +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +# [Ll]og/ (Ignored by Fern) +# [Ll]ogs/ (Ignored by Fern) + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml +.idea + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/public-object/.mock/definition/api.yml b/seed/csharp-sdk/public-object/.mock/definition/api.yml new file mode 100644 index 00000000000..80a86663e3b --- /dev/null +++ b/seed/csharp-sdk/public-object/.mock/definition/api.yml @@ -0,0 +1 @@ +name: public-object diff --git a/seed/csharp-sdk/public-object/.mock/definition/service.yml b/seed/csharp-sdk/public-object/.mock/definition/service.yml new file mode 100644 index 00000000000..af9c663168f --- /dev/null +++ b/seed/csharp-sdk/public-object/.mock/definition/service.yml @@ -0,0 +1,8 @@ +service: + auth: false + base-path: / + endpoints: + get: + path: /helloworld.txt + method: GET + response: file diff --git a/seed/csharp-sdk/public-object/.mock/fern.config.json b/seed/csharp-sdk/public-object/.mock/fern.config.json new file mode 100644 index 00000000000..4c8e54ac313 --- /dev/null +++ b/seed/csharp-sdk/public-object/.mock/fern.config.json @@ -0,0 +1 @@ +{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/csharp-sdk/public-object/.mock/generators.yml b/seed/csharp-sdk/public-object/.mock/generators.yml new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/seed/csharp-sdk/public-object/.mock/generators.yml @@ -0,0 +1 @@ +{} diff --git a/seed/csharp-sdk/public-object/snippet-templates.json b/seed/csharp-sdk/public-object/snippet-templates.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/csharp-sdk/public-object/snippet.json b/seed/csharp-sdk/public-object/snippet.json new file mode 100644 index 00000000000..a489e9e12dc --- /dev/null +++ b/seed/csharp-sdk/public-object/snippet.json @@ -0,0 +1,4 @@ +{ + "types": {}, + "endpoints": [] +} \ No newline at end of file diff --git a/seed/csharp-sdk/public-object/src/SeedApi.DynamicSnippets/SeedApi.DynamicSnippets.csproj b/seed/csharp-sdk/public-object/src/SeedApi.DynamicSnippets/SeedApi.DynamicSnippets.csproj new file mode 100644 index 00000000000..8231b79f17c --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedApi.DynamicSnippets/SeedApi.DynamicSnippets.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + 12 + enable + enable + + + + + + \ No newline at end of file diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/DateOnlyJsonTests.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/DateOnlyJsonTests.cs new file mode 100644 index 00000000000..a5dea8a0ac7 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/DateOnlyJsonTests.cs @@ -0,0 +1,76 @@ +using NUnit.Framework; +using SeedPublicObject.Core; + +namespace SeedPublicObject.Test.Core.Json; + +[TestFixture] +public class DateOnlyJsonTests +{ + [Test] + public void SerializeDateOnly_ShouldMatchExpectedFormat() + { + (DateOnly dateOnly, string expected)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (new DateOnly(2023, 1, 1), "\"2023-01-01\""), + (new DateOnly(2023, 12, 31), "\"2023-12-31\""), + (new DateOnly(2023, 6, 15), "\"2023-06-15\""), + (new DateOnly(2023, 3, 10), "\"2023-03-10\""), + ]; + foreach (var (dateOnly, expected) in testCases) + { + var json = JsonUtils.Serialize(dateOnly); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeDateOnly_ShouldMatchExpectedDateOnly() + { + (DateOnly expected, string json)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (new DateOnly(2023, 1, 1), "\"2023-01-01\""), + (new DateOnly(2023, 12, 31), "\"2023-12-31\""), + (new DateOnly(2023, 6, 15), "\"2023-06-15\""), + (new DateOnly(2023, 3, 10), "\"2023-03-10\""), + ]; + + foreach (var (expected, json) in testCases) + { + var dateOnly = JsonUtils.Deserialize(json); + Assert.That(dateOnly, Is.EqualTo(expected)); + } + } + + [Test] + public void SerializeNullableDateOnly_ShouldMatchExpectedFormat() + { + (DateOnly? dateOnly, string expected)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (null, "null"), + ]; + foreach (var (dateOnly, expected) in testCases) + { + var json = JsonUtils.Serialize(dateOnly); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeNullableDateOnly_ShouldMatchExpectedDateOnly() + { + (DateOnly? expected, string json)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateOnly = JsonUtils.Deserialize(json); + Assert.That(dateOnly, Is.EqualTo(expected)); + } + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/DateTimeJsonTests.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/DateTimeJsonTests.cs new file mode 100644 index 00000000000..3cbcdc19730 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/DateTimeJsonTests.cs @@ -0,0 +1,110 @@ +using NUnit.Framework; +using SeedPublicObject.Core; + +namespace SeedPublicObject.Test.Core.Json; + +[TestFixture] +public class DateTimeJsonTests +{ + [Test] + public void SerializeDateTime_ShouldMatchExpectedFormat() + { + (DateTime dateTime, string expected)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), "\"2023-01-01T00:00:00.000Z\""), + ( + new DateTime(2023, 12, 31, 23, 59, 59, DateTimeKind.Utc), + "\"2023-12-31T23:59:59.000Z\"" + ), + (new DateTime(2023, 6, 15, 12, 0, 0, DateTimeKind.Utc), "\"2023-06-15T12:00:00.000Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.000Z\"" + ), + ( + new DateTime(2023, 3, 10, 8, 45, 30, 123, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.123Z\"" + ), + ]; + foreach (var (dateTime, expected) in testCases) + { + var json = JsonUtils.Serialize(dateTime); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeDateTime_ShouldMatchExpectedDateTime() + { + (DateTime expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), "\"2023-01-01T00:00:00.000Z\""), + ( + new DateTime(2023, 12, 31, 23, 59, 59, DateTimeKind.Utc), + "\"2023-12-31T23:59:59.000Z\"" + ), + (new DateTime(2023, 6, 15, 12, 0, 0, DateTimeKind.Utc), "\"2023-06-15T12:00:00.000Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.000Z\"" + ), + (new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), "\"2023-03-10T08:45:30Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, 123, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.123Z\"" + ), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } + + [Test] + public void SerializeNullableDateTime_ShouldMatchExpectedFormat() + { + (DateTime? expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeNullableDateTime_ShouldMatchExpectedDateTime() + { + (DateTime? expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/EnumSerializerTests.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/EnumSerializerTests.cs new file mode 100644 index 00000000000..b3e24a0f2e0 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/EnumSerializerTests.cs @@ -0,0 +1,60 @@ +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using NUnit.Framework; +using SeedPublicObject.Core; + +namespace SeedPublicObject.Test.Core.Json; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class StringEnumSerializerTests +{ + private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true }; + + private const DummyEnum KnownEnumValue2 = DummyEnum.KnownValue2; + private const string KnownEnumValue2String = "known_value2"; + + private const string JsonWithKnownEnum2 = $$""" + { + "enum_property": "{{KnownEnumValue2String}}" + } + """; + + [Test] + public void ShouldParseKnownEnumValue2() + { + var obj = JsonSerializer.Deserialize(JsonWithKnownEnum2, JsonOptions); + Assert.That(obj, Is.Not.Null); + Assert.That(obj.EnumProperty, Is.EqualTo(KnownEnumValue2)); + } + + [Test] + public void ShouldSerializeKnownEnumValue2() + { + var json = JsonSerializer.SerializeToElement( + new DummyObject { EnumProperty = KnownEnumValue2 }, + JsonOptions + ); + TestContext.Out.WriteLine("Serialized JSON: \n" + json); + var enumString = json.GetProperty("enum_property").GetString(); + Assert.That(enumString, Is.Not.Null); + Assert.That(enumString, Is.EqualTo(KnownEnumValue2String)); + } +} + +public class DummyObject +{ + [JsonPropertyName("enum_property")] + public DummyEnum EnumProperty { get; set; } +} + +[JsonConverter(typeof(EnumSerializer))] +public enum DummyEnum +{ + [EnumMember(Value = "known_value1")] + KnownValue1, + + [EnumMember(Value = "known_value2")] + KnownValue2, +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/JsonAccessAttributeTests.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/JsonAccessAttributeTests.cs new file mode 100644 index 00000000000..e35ee172d32 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/JsonAccessAttributeTests.cs @@ -0,0 +1,46 @@ +using global::System.Text.Json.Serialization; +using NUnit.Framework; +using SeedPublicObject.Core; + +namespace SeedPublicObject.Test.Core.Json; + +[TestFixture] +public class JsonAccessAttributeTests +{ + private class MyClass + { + [JsonPropertyName("read_only_prop")] + [JsonAccess(JsonAccessType.ReadOnly)] + public string? ReadOnlyProp { get; set; } + + [JsonPropertyName("write_only_prop")] + [JsonAccess(JsonAccessType.WriteOnly)] + public string? WriteOnlyProp { get; set; } + + [JsonPropertyName("normal_prop")] + public string? NormalProp { get; set; } + } + + [Test] + public void JsonAccessAttribute_ShouldWorkAsExpected() + { + const string json = + """ { "read_only_prop": "read", "write_only_prop": "write", "normal_prop": "normal_prop" } """; + var obj = JsonUtils.Deserialize(json); + + Assert.Multiple(() => + { + Assert.That(obj.ReadOnlyProp, Is.EqualTo("read")); + Assert.That(obj.WriteOnlyProp, Is.Null); + Assert.That(obj.NormalProp, Is.EqualTo("normal_prop")); + }); + + obj.WriteOnlyProp = "write"; + obj.NormalProp = "new_value"; + + var serializedJson = JsonUtils.Serialize(obj); + const string expectedJson = + "{ \"write_only_prop\": \"write\",\n \"normal_prop\": \"new_value\" }"; + Assert.That(serializedJson, Is.EqualTo(expectedJson).IgnoreWhiteSpace); + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/OneOfSerializerTests.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/OneOfSerializerTests.cs new file mode 100644 index 00000000000..06bebece75e --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/Json/OneOfSerializerTests.cs @@ -0,0 +1,314 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using NUnit.Framework; +using OneOf; +using SeedPublicObject.Core; + +namespace SeedPublicObject.Test.Core.Json; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class OneOfSerializerTests +{ + private class Foo + { + [JsonPropertyName("string_prop")] + public required string StringProp { get; set; } + } + + private class Bar + { + [JsonPropertyName("int_prop")] + public required int IntProp { get; set; } + } + + private static readonly OneOf OneOf1 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT2(new { }); + private const string OneOf1String = "{}"; + + private static readonly OneOf OneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT0("test"); + private const string OneOf2String = "\"test\""; + + private static readonly OneOf OneOf3 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT1(123); + private const string OneOf3String = "123"; + + private static readonly OneOf OneOf4 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT3(new Foo { StringProp = "test" }); + private const string OneOf4String = "{\"string_prop\": \"test\"}"; + + private static readonly OneOf OneOf5 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string OneOf5String = "{\"int_prop\": 5}"; + + [Test] + public void Serialize_OneOfs_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void OneOfs_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value)).IgnoreWhiteSpace); + } + }); + } + + private static readonly OneOf? NullableOneOf1 = null; + private const string NullableOneOf1String = "null"; + + private static readonly OneOf? NullableOneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string NullableOneOf2String = "{\"int_prop\": 5}"; + + [Test] + public void Serialize_NullableOneOfs_Should_Return_Expected_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void NullableOneOfs_Should_Deserialize_From_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize?>(json); + Assert.That(result?.Index, Is.EqualTo(oneOf?.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result?.Value)).IgnoreWhiteSpace); + } + }); + } + + private static readonly OneOf OneOfWithNullable1 = OneOf< + string, + int, + Foo? + >.FromT2(null); + private const string OneOfWithNullable1String = "null"; + + private static readonly OneOf OneOfWithNullable2 = OneOf< + string, + int, + Foo? + >.FromT2(new Foo { StringProp = "test" }); + private const string OneOfWithNullable2String = "{\"string_prop\": \"test\"}"; + + private static readonly OneOf OneOfWithNullable3 = OneOf< + string, + int, + Foo? + >.FromT0("test"); + private const string OneOfWithNullable3String = "\"test\""; + + [Test] + public void Serialize_OneOfWithNullables_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOfWithNullable1, OneOfWithNullable1String), + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void OneOfWithNullables_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + // (OneOfWithNullable1, OneOfWithNullable1String), // not possible with .NET's JSON serializer + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value)).IgnoreWhiteSpace); + } + }); + } + + [Test] + public void Serialize_OneOfWithObjectLast_Should_Return_Expected_String() + { + var oneOfWithObjectLast = OneOf.FromT4( + new { random = "data" } + ); + const string oneOfWithObjectLastString = "{\"random\": \"data\"}"; + + var result = JsonUtils.Serialize(oneOfWithObjectLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectLastString).IgnoreWhiteSpace); + } + + [Test] + public void OneOfWithObjectLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectLastString = "{\"random\": \"data\"}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(4)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That( + JsonUtils.Serialize(result.Value), + Is.EqualTo(oneOfWithObjectLastString).IgnoreWhiteSpace + ); + }); + } + + [Test] + public void Serialize_OneOfWithObjectNotLast_Should_Return_Expected_String() + { + var oneOfWithObjectNotLast = OneOf.FromT1( + new { random = "data" } + ); + const string oneOfWithObjectNotLastString = "{\"random\": \"data\"}"; + + var result = JsonUtils.Serialize(oneOfWithObjectNotLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectNotLastString).IgnoreWhiteSpace); + } + + [Test] + public void OneOfWithObjectNotLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectNotLastString = "{\"random\": \"data\"}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectNotLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(1)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That( + JsonUtils.Serialize(result.Value), + Is.EqualTo(oneOfWithObjectNotLastString).IgnoreWhiteSpace + ); + }); + } + + [Test] + public void Serialize_OneOfSingleType_Should_Return_Expected_String() + { + var oneOfSingle = OneOf.FromT0("single"); + const string oneOfSingleString = "\"single\""; + + var result = JsonUtils.Serialize(oneOfSingle); + Assert.That(result, Is.EqualTo(oneOfSingleString)); + } + + [Test] + public void OneOfSingleType_Should_Deserialize_From_String() + { + const string oneOfSingleString = "\"single\""; + var result = JsonUtils.Deserialize>(oneOfSingleString); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(0)); + Assert.That(result.Value, Is.EqualTo("single")); + }); + } + + [Test] + public void Deserialize_InvalidData_Should_Throw_Exception() + { + const string invalidJson = "{\"invalid\": \"data\"}"; + + Assert.Throws(() => + { + JsonUtils.Deserialize>(invalidJson); + }); + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/QueryStringConverterTests.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/QueryStringConverterTests.cs new file mode 100644 index 00000000000..669bd5b7c9c --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/QueryStringConverterTests.cs @@ -0,0 +1,122 @@ +using NUnit.Framework; +using SeedPublicObject.Core; + +namespace SeedPublicObject.Test.Core; + +[TestFixture] +public class QueryStringConverterTests +{ + [Test] + public void ToQueryStringCollection_Form() + { + var obj = new + { + Name = "John", + Age = 30, + Address = new + { + Street = "123 Main St", + City = "Anytown", + Coordinates = new[] { 39.781721f, -89.650148f }, + }, + Tags = new[] { "Developer", "Blogger" }, + }; + var result = QueryStringConverter.ToForm(obj); + var expected = new List> + { + new("Name", "John"), + new("Age", "30"), + new("Address[Street]", "123 Main St"), + new("Address[City]", "Anytown"), + new("Address[Coordinates]", "39.78172,-89.65015"), + new("Tags", "Developer,Blogger"), + }; + Assert.That(result, Is.EqualTo(expected)); + } + + [Test] + public void ToQueryStringCollection_ExplodedForm() + { + var obj = new + { + Name = "John", + Age = 30, + Address = new + { + Street = "123 Main St", + City = "Anytown", + Coordinates = new[] { 39.781721f, -89.650148f }, + }, + Tags = new[] { "Developer", "Blogger" }, + }; + var result = QueryStringConverter.ToExplodedForm(obj); + var expected = new List> + { + new("Name", "John"), + new("Age", "30"), + new("Address[Street]", "123 Main St"), + new("Address[City]", "Anytown"), + new("Address[Coordinates]", "39.78172"), + new("Address[Coordinates]", "-89.65015"), + new("Tags", "Developer"), + new("Tags", "Blogger"), + }; + Assert.That(result, Is.EqualTo(expected)); + } + + [Test] + public void ToQueryStringCollection_DeepObject() + { + var obj = new + { + Name = "John", + Age = 30, + Address = new + { + Street = "123 Main St", + City = "Anytown", + Coordinates = new[] { 39.781721f, -89.650148f }, + }, + Tags = new[] { "Developer", "Blogger" }, + }; + var result = QueryStringConverter.ToDeepObject(obj); + var expected = new List> + { + new("Name", "John"), + new("Age", "30"), + new("Address[Street]", "123 Main St"), + new("Address[City]", "Anytown"), + new("Address[Coordinates][0]", "39.78172"), + new("Address[Coordinates][1]", "-89.65015"), + new("Tags[0]", "Developer"), + new("Tags[1]", "Blogger"), + }; + Assert.That(result, Is.EqualTo(expected)); + } + + [Test] + public void ToQueryStringCollection_OnString_ThrowsException() + { + var exception = Assert.Throws(() => QueryStringConverter.ToForm("invalid")); + Assert.That( + exception.Message, + Is.EqualTo( + "Only objects can be converted to query string collections. Given type is String." + ) + ); + } + + [Test] + public void ToQueryStringCollection_OnArray_ThrowsException() + { + var exception = Assert.Throws( + () => QueryStringConverter.ToForm(Array.Empty()) + ); + Assert.That( + exception.Message, + Is.EqualTo( + "Only objects can be converted to query string collections. Given type is Array." + ) + ); + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/RawClientTests/AdditionalHeadersTests.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/RawClientTests/AdditionalHeadersTests.cs new file mode 100644 index 00000000000..1c440f4c165 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/RawClientTests/AdditionalHeadersTests.cs @@ -0,0 +1,137 @@ +using NUnit.Framework; +using SeedPublicObject.Core; +using WireMock.Server; +using SystemTask = global::System.Threading.Tasks.Task; +using WireMockRequest = WireMock.RequestBuilders.Request; +using WireMockResponse = WireMock.ResponseBuilders.Response; + +// ReSharper disable NullableWarningSuppressionIsUsed + +namespace SeedPublicObject.Test.Core.RawClientTests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class AdditionalHeadersTests +{ + private WireMockServer _server; + private HttpClient _httpClient; + private RawClient _rawClient; + private string _baseUrl; + + [SetUp] + public void SetUp() + { + _server = WireMockServer.Start(); + _baseUrl = _server.Url ?? ""; + _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; + _rawClient = new RawClient( + new ClientOptions + { + HttpClient = _httpClient, + Headers = new Headers( + new Dictionary + { + ["a"] = "client_headers", + ["b"] = "client_headers", + ["c"] = "client_headers", + ["d"] = "client_headers", + ["e"] = "client_headers", + ["f"] = "client_headers", + ["client_multiple"] = "client_headers", + } + ), + AdditionalHeaders = new List> + { + new("b", "client_additional_headers"), + new("c", "client_additional_headers"), + new("d", "client_additional_headers"), + new("e", null), + new("client_multiple", "client_additional_headers1"), + new("client_multiple", "client_additional_headers2"), + }, + } + ); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalHeaderParameters() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Headers = new Headers( + new Dictionary + { + ["c"] = "request_headers", + ["d"] = "request_headers", + ["request_multiple"] = "request_headers", + } + ), + Options = new RequestOptions + { + AdditionalHeaders = new List> + { + new("d", "request_additional_headers"), + new("f", null), + new("request_multiple", "request_additional_headers1"), + new("request_multiple", "request_additional_headers2"), + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Success")); + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + var headers = + _server.LogEntries[0].RequestMessage.Headers + ?? throw new Exception("Headers are null"); + + Assert.That(headers, Contains.Key("client_multiple")); + Assert.That(headers!["client_multiple"][0], Does.Contain("client_additional_headers1")); + Assert.That(headers["client_multiple"][0], Does.Contain("client_additional_headers2")); + + Assert.That(headers, Contains.Key("request_multiple")); + Assert.That( + headers["request_multiple"][0], + Does.Contain("request_additional_headers1") + ); + Assert.That( + headers["request_multiple"][0], + Does.Contain("request_additional_headers2") + ); + + Assert.That(headers, Contains.Key("a")); + Assert.That(headers["a"][0], Does.Contain("client_headers")); + + Assert.That(headers, Contains.Key("b")); + Assert.That(headers["b"][0], Does.Contain("client_additional_headers")); + + Assert.That(headers, Contains.Key("c")); + Assert.That(headers["c"][0], Does.Contain("request_headers")); + + Assert.That(headers, Contains.Key("d")); + Assert.That(headers["d"][0], Does.Contain("request_additional_headers")); + + Assert.That(headers, Does.Not.ContainKey("e")); + Assert.That(headers, Does.Not.ContainKey("f")); + }); + } + + [TearDown] + public void TearDown() + { + _server.Dispose(); + _httpClient.Dispose(); + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/RawClientTests/AdditionalParametersTests.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/RawClientTests/AdditionalParametersTests.cs new file mode 100644 index 00000000000..e4ce0254f3b --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/RawClientTests/AdditionalParametersTests.cs @@ -0,0 +1,300 @@ +using NUnit.Framework; +using SeedPublicObject.Core; +using WireMock.Matchers; +using WireMock.Server; +using SystemTask = global::System.Threading.Tasks.Task; +using WireMockRequest = WireMock.RequestBuilders.Request; +using WireMockResponse = WireMock.ResponseBuilders.Response; + +namespace SeedPublicObject.Test.Core.RawClientTests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class AdditionalParametersTests +{ + private WireMockServer _server; + private HttpClient _httpClient; + private RawClient _rawClient; + private string _baseUrl; + + [SetUp] + public void SetUp() + { + _server = WireMockServer.Start(); + _baseUrl = _server.Url ?? ""; + _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; + _rawClient = new RawClient(new ClientOptions { HttpClient = _httpClient }); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalQueryParameters() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").WithParam("foo", "bar").UsingGet()) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest() + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Options = new RequestOptions + { + AdditionalQueryParameters = new List> + { + new("foo", "bar"), + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalQueryParameters_Override() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").WithParam("foo", "null").UsingGet()) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest() + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Query = new Dictionary { { "foo", "bar" } }, + Options = new RequestOptions + { + AdditionalQueryParameters = new List> + { + new("foo", "null"), + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalQueryParameters_Merge() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest() + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Query = new Dictionary { { "foo", "baz" } }, + Options = new RequestOptions + { + AdditionalQueryParameters = new List> + { + new("foo", "one"), + new("foo", "two"), + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + + var requestUrl = _server.LogEntries.First().RequestMessage.Url; + Assert.That(requestUrl, Does.Contain("foo=one")); + Assert.That(requestUrl, Does.Contain("foo=two")); + Assert.That(requestUrl, Does.Not.Contain("foo=baz")); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalBodyProperties() + { + string expectedBody = "{\n \"foo\": \"bar\",\n \"baz\": \"qux\"\n}"; + _server + .Given( + WireMockRequest + .Create() + .WithPath("/test") + .UsingPost() + .WithBody(new JsonMatcher(expectedBody)) + ) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + Body = new Dictionary { { "foo", "bar" } }, + Options = new RequestOptions + { + AdditionalBodyProperties = new Dictionary { { "baz", "qux" } }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalBodyProperties_Override() + { + string expectedBody = "{\n \"foo\": null\n}"; + _server + .Given( + WireMockRequest + .Create() + .WithPath("/test") + .UsingPost() + .WithBody(new JsonMatcher(expectedBody)) + ) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + Body = new Dictionary { { "foo", "bar" } }, + Options = new RequestOptions + { + AdditionalBodyProperties = new Dictionary { { "foo", null } }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [Test] + public async SystemTask SendRequestAsync_AdditionalBodyProperties_DeepMerge() + { + const string expectedBody = """ + { + "foo": { + "inner1": "original", + "inner2": "overridden", + "inner3": { + "deepProp1": "deep-override", + "deepProp2": "original", + "deepProp3": null, + "deepProp4": "new-value" + } + }, + "bar": "new-value", + "baz": ["new","value"] + } + """; + + _server + .Given( + WireMockRequest + .Create() + .WithPath("/test-deep-merge") + .UsingPost() + .WithBody(new JsonMatcher(expectedBody)) + ) + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test-deep-merge", + Body = new Dictionary + { + { + "foo", + new Dictionary + { + { "inner1", "original" }, + { "inner2", "original" }, + { + "inner3", + new Dictionary + { + { "deepProp1", "deep-original" }, + { "deepProp2", "original" }, + { "deepProp3", "" }, + } + }, + } + }, + { + "baz", + new List { "original" } + }, + }, + Options = new RequestOptions + { + AdditionalBodyProperties = new Dictionary + { + { + "foo", + new Dictionary + { + { "inner2", "overridden" }, + { + "inner3", + new Dictionary + { + { "deepProp1", "deep-override" }, + { "deepProp3", null }, + { "deepProp4", "new-value" }, + } + }, + } + }, + { "bar", "new-value" }, + { + "baz", + new List { "new", "value" } + }, + }, + }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); + } + + [TearDown] + public void TearDown() + { + _server.Dispose(); + _httpClient.Dispose(); + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/RawClientTests/MultipartFormTests.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/RawClientTests/MultipartFormTests.cs new file mode 100644 index 00000000000..c1b57125322 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/RawClientTests/MultipartFormTests.cs @@ -0,0 +1,1120 @@ +using global::System.Net.Http; +using global::System.Text; +using global::System.Text.Json.Serialization; +using NUnit.Framework; +using SeedPublicObject.Core; +using SystemTask = global::System.Threading.Tasks.Task; + +namespace SeedPublicObject.Test.Core.RawClientTests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class MultipartFormTests +{ + private static SimpleObject _simpleObject = new(); + + private static string _simpleFormEncoded = + "meta=data&Date=2023-10-01&Time=12:00:00&Duration=01:00:00&Id=1a1bb98f-47c6-407b-9481-78476affe52a&IsActive=true&Count=42&Initial=A&Values=data,2023-10-01,12:00:00,01:00:00,1a1bb98f-47c6-407b-9481-78476affe52a,true,42,A"; + + private static string _simpleExplodedFormEncoded = + "meta=data&Date=2023-10-01&Time=12:00:00&Duration=01:00:00&Id=1a1bb98f-47c6-407b-9481-78476affe52a&IsActive=true&Count=42&Initial=A&Values=data&Values=2023-10-01&Values=12:00:00&Values=01:00:00&Values=1a1bb98f-47c6-407b-9481-78476affe52a&Values=true&Values=42&Values=A"; + + private static ComplexObject _complexObject = new(); + + private static string _complexJson = """ + { + "meta": "data", + "Nested": { + "foo": "value" + }, + "NestedDictionary": { + "key": { + "foo": "value" + } + }, + "ListOfObjects": [ + { + "foo": "value" + }, + { + "foo": "value2" + } + ], + "Date": "2023-10-01", + "Time": "12:00:00", + "Duration": "01:00:00", + "Id": "1a1bb98f-47c6-407b-9481-78476affe52a", + "IsActive": true, + "Count": 42, + "Initial": "A" + } + """; + + [Test] + public async SystemTask ShouldAddStringPart() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringPart("string", partInput); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=string + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringParts() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringParts("strings", [partInput, partInput]); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask GivenNull_ShouldNotAddStringPart() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringPart("string", null); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringParts_WithNullsInList() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringParts("strings", [partInput, null, partInput]); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringPart_WithContentType() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringPart("string", partInput, "text/xml"); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/xml + Content-Disposition: form-data; name=string + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringPart_WithContentTypeAndCharset() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringPart("string", partInput, "text/xml; charset=utf-8"); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/xml; charset=utf-8 + Content-Disposition: form-data; name=string + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringParts_WithContentType() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringParts("strings", [partInput, partInput], "text/xml"); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/xml + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary} + Content-Type: text/xml + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddStringParts_WithContentTypeAndCharset() + { + const string partInput = "string content"; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddStringParts( + "strings", + [partInput, partInput], + "text/xml; charset=utf-8" + ); + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/xml; charset=utf-8 + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary} + Content-Type: text/xml; charset=utf-8 + Content-Disposition: form-data; name=strings + + {partInput} + --{boundary}-- + """; + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithFileName() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter { Stream = partInput, FileName = "test.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithoutFileName() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", partInput); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithContentType() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter + { + Stream = partInput, + FileName = "test.txt", + ContentType = "text/plain", + }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file, "ignored-fallback-content-type"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithContentTypeAndCharset() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter + { + Stream = partInput, + FileName = "test.txt", + ContentType = "text/plain; charset=utf-8", + }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file, "ignored-fallback-content-type"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain; charset=utf-8 + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithFallbackContentType() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter { Stream = partInput, FileName = "test.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file, "text/plain"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameter_WithFallbackContentTypeAndCharset() + { + var (partInput, partExpectedString) = GetFileParameterTestData(); + var file = new FileParameter { Stream = partInput, FileName = "test.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", file, "text/plain; charset=utf-8"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: text/plain; charset=utf-8 + Content-Disposition: form-data; name=file; filename=test.txt; filename*=utf-8''test.txt + + {partExpectedString} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameters() + { + var (partInput1, partExpectedString1) = GetFileParameterTestData(); + var (partInput2, partExpectedString2) = GetFileParameterTestData(); + var file1 = new FileParameter { Stream = partInput1, FileName = "test1.txt" }; + var file2 = new FileParameter { Stream = partInput2, FileName = "test2.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterParts("file", [file1, file2]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test1.txt; filename*=utf-8''test1.txt + + {partExpectedString1} + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test2.txt; filename*=utf-8''test2.txt + + {partExpectedString2} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFileParameters_WithNullsInList() + { + var (partInput1, partExpectedString1) = GetFileParameterTestData(); + var (partInput2, partExpectedString2) = GetFileParameterTestData(); + var file1 = new FileParameter { Stream = partInput1, FileName = "test1.txt" }; + var file2 = new FileParameter { Stream = partInput2, FileName = "test2.txt" }; + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterParts("file", [file1, null, file2]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test1.txt; filename*=utf-8''test1.txt + + {partExpectedString1} + --{boundary} + Content-Type: application/octet-stream + Content-Disposition: form-data; name=file; filename=test2.txt; filename*=utf-8''test2.txt + + {partExpectedString2} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask GivenNull_ShouldNotAddFileParameter() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFileParameterPart("file", null); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddJsonPart_WithComplexObject() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonPart("object", _complexObject); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/json + Content-Disposition: form-data; name=object + + {_complexJson} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddJsonPart_WithComplexObjectList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonParts("objects", [_complexObject, _complexObject]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/json + Content-Disposition: form-data; name=objects + + {_complexJson} + --{boundary} + Content-Type: application/json + Content-Disposition: form-data; name=objects + + {_complexJson} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask GivenNull_ShouldNotAddJsonPart() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonPart("object", null); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddJsonParts_WithNullsInList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonParts("objects", [_complexObject, null]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/json + Content-Disposition: form-data; name=objects + + {_complexJson} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddJsonParts_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddJsonParts("objects", [new { }], "application/json-patch+json"); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $$""" + --{{boundary}} + Content-Type: application/json-patch+json + Content-Disposition: form-data; name=objects + + {} + --{{boundary}}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedParts_WithSimpleObject() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedPart("object", _simpleObject); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=object + + {EscapeFormEncodedString(_simpleFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedParts_WithSimpleObjectList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts("objects", [_simpleObject, _simpleObject]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleFormEncoded)} + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldNotAddFormEncodedParts_WithNull() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts("object", null); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldNotAddFormEncodedParts_WithNullsInList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts("objects", [_simpleObject, null]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedPart_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedPart( + "objects", + new { foo = "bar" }, + "application/x-www-form-urlencoded" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedPart_WithContentTypeAndCharset() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedPart( + "objects", + new { foo = "bar" }, + "application/x-www-form-urlencoded; charset=utf-8" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded; charset=utf-8 + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedParts_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts( + "objects", + [new { foo = "bar" }], + "application/x-www-form-urlencoded" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddFormEncodedParts_WithContentTypeAndCharset() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddFormEncodedParts( + "objects", + [new { foo = "bar" }], + "application/x-www-form-urlencoded; charset=utf-8" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded; charset=utf-8 + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedParts_WithSimpleObject() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedPart("object", _simpleObject); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=object + + {EscapeFormEncodedString(_simpleExplodedFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedParts_WithSimpleObjectList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedParts("objects", [_simpleObject, _simpleObject]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleExplodedFormEncoded)} + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleExplodedFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldNotAddExplodedFormEncodedParts_WithNull() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedPart("object", null); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldNotAddExplodedFormEncodedParts_WithNullsInList() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedParts("objects", [_simpleObject, null]); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + {EscapeFormEncodedString(_simpleExplodedFormEncoded)} + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedPart_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedPart( + "objects", + new { foo = "bar" }, + "application/x-www-form-urlencoded" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedPart_WithContentTypeAndCharset() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedPart( + "objects", + new { foo = "bar" }, + "application/x-www-form-urlencoded; charset=utf-8" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded; charset=utf-8 + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedParts_WithContentType() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedParts( + "objects", + [new { foo = "bar" }], + "application/x-www-form-urlencoded" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + [Test] + public async SystemTask ShouldAddExplodedFormEncodedParts_WithContentTypeAndCharset() + { + var multipartFormRequest = CreateMultipartFormRequest(); + multipartFormRequest.AddExplodedFormEncodedParts( + "objects", + [new { foo = "bar" }], + "application/x-www-form-urlencoded; charset=utf-8" + ); + + var httpContent = multipartFormRequest.CreateContent(); + Assert.That(httpContent, Is.InstanceOf()); + var multipartContent = (MultipartFormDataContent)httpContent; + + var boundary = GetBoundary(multipartContent); + var expected = $""" + --{boundary} + Content-Type: application/x-www-form-urlencoded; charset=utf-8 + Content-Disposition: form-data; name=objects + + foo=bar + --{boundary}-- + """; + + var actual = await multipartContent.ReadAsStringAsync(); + Assert.That(actual, Is.EqualTo(expected).IgnoreWhiteSpace); + } + + private static string EscapeFormEncodedString(string input) + { + return string.Join( + "&", + input + .Split('&') + .Select(x => x.Split('=')) + .Select(x => $"{Uri.EscapeDataString(x[0])}={Uri.EscapeDataString(x[1])}") + ); + } + + private static string GetBoundary(MultipartFormDataContent content) + { + return content + .Headers.ContentType?.Parameters.Single(p => + p.Name.Equals("boundary", StringComparison.OrdinalIgnoreCase) + ) + .Value?.Trim('"') ?? throw new Exception("Boundary not found"); + } + + private static MultipartFormRequest CreateMultipartFormRequest() + { + return new MultipartFormRequest + { + BaseUrl = "https://localhost", + Method = HttpMethod.Post, + Path = "", + }; + } + + private static (Stream partInput, string partExpectedString) GetFileParameterTestData() + { + const string partExpectedString = "file content"; + var partInput = new MemoryStream(Encoding.Default.GetBytes(partExpectedString)); + return (partInput, partExpectedString); + } + + private class SimpleObject + { + [JsonPropertyName("meta")] + public string Meta { get; set; } = "data"; + public DateOnly Date { get; set; } = DateOnly.Parse("2023-10-01"); + public TimeOnly Time { get; set; } = TimeOnly.Parse("12:00:00"); + public TimeSpan Duration { get; set; } = TimeSpan.FromHours(1); + public Guid Id { get; set; } = Guid.Parse("1a1bb98f-47c6-407b-9481-78476affe52a"); + public bool IsActive { get; set; } = true; + public int Count { get; set; } = 42; + public char Initial { get; set; } = 'A'; + public IEnumerable Values { get; set; } = + [ + "data", + DateOnly.Parse("2023-10-01"), + TimeOnly.Parse("12:00:00"), + TimeSpan.FromHours(1), + Guid.Parse("1a1bb98f-47c6-407b-9481-78476affe52a"), + true, + 42, + 'A', + ]; + } + + private class ComplexObject + { + [JsonPropertyName("meta")] + public string Meta { get; set; } = "data"; + + public object Nested { get; set; } = new { foo = "value" }; + + public Dictionary NestedDictionary { get; set; } = + new() { { "key", new { foo = "value" } } }; + + public IEnumerable ListOfObjects { get; set; } = + new List { new { foo = "value" }, new { foo = "value2" } }; + + public DateOnly Date { get; set; } = DateOnly.Parse("2023-10-01"); + public TimeOnly Time { get; set; } = TimeOnly.Parse("12:00:00"); + public TimeSpan Duration { get; set; } = TimeSpan.FromHours(1); + public Guid Id { get; set; } = Guid.Parse("1a1bb98f-47c6-407b-9481-78476affe52a"); + public bool IsActive { get; set; } = true; + public int Count { get; set; } = 42; + public char Initial { get; set; } = 'A'; + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/RawClientTests/RetriesTests.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/RawClientTests/RetriesTests.cs new file mode 100644 index 00000000000..0b0f718cde1 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Core/RawClientTests/RetriesTests.cs @@ -0,0 +1,214 @@ +using global::System.Net.Http; +using NUnit.Framework; +using SeedPublicObject.Core; +using WireMock.Server; +using SystemTask = global::System.Threading.Tasks.Task; +using WireMockRequest = WireMock.RequestBuilders.Request; +using WireMockResponse = WireMock.ResponseBuilders.Response; + +namespace SeedPublicObject.Test.Core.RawClientTests; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class RetriesTests +{ + private const int MaxRetries = 3; + private WireMockServer _server; + private HttpClient _httpClient; + private RawClient _rawClient; + private string _baseUrl; + + [SetUp] + public void SetUp() + { + _server = WireMockServer.Start(); + _baseUrl = _server.Url ?? ""; + _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; + _rawClient = new RawClient( + new ClientOptions { HttpClient = _httpClient, MaxRetries = MaxRetries } + ) + { + BaseRetryDelay = 0, + }; + } + + [Test] + [TestCase(408)] + [TestCase(429)] + [TestCase(500)] + [TestCase(504)] + public async SystemTask SendRequestAsync_ShouldRetry_OnRetryableStatusCodes(int statusCode) + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WhenStateIs("Server Error") + .WillSetStateTo("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WhenStateIs("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new EmptyRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + using (Assert.EnterMultipleScope()) + { + Assert.That(content, Is.EqualTo("Success")); + + Assert.That(_server.LogEntries, Has.Count.EqualTo(MaxRetries)); + } + } + + [Test] + [TestCase(400)] + [TestCase(409)] + public async SystemTask SendRequestAsync_ShouldRetry_OnNonRetryableStatusCodes(int statusCode) + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingGet()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(statusCode).WithBody("Failure")); + + var request = new JsonRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Get, + Path = "/test", + Body = new { }, + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(statusCode)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Failure")); + + Assert.That(_server.LogEntries, Has.Count.EqualTo(1)); + }); + } + + [Test] + public async SystemTask SendRequestAsync_ShouldNotRetry_WithStreamRequest() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(429).WithBody("Failure")); + + var request = new StreamRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + Body = new MemoryStream(), + }; + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(429)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Failure")); + Assert.That(_server.LogEntries, Has.Count.EqualTo(1)); + }); + } + + [Test] + public async SystemTask SendRequestAsync_ShouldNotRetry_WithMultiPartFormRequest_WithStream() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(429).WithBody("Failure")); + + var request = new MultipartFormRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + }; + request.AddFileParameterPart("file", new MemoryStream()); + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(429)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Failure")); + Assert.That(_server.LogEntries, Has.Count.EqualTo(1)); + }); + } + + [Test] + public async SystemTask SendRequestAsync_ShouldRetry_WithMultiPartFormRequest_WithoutStream() + { + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WillSetStateTo("Server Error") + .RespondWith(WireMockResponse.Create().WithStatusCode(429)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WhenStateIs("Server Error") + .WillSetStateTo("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(429)); + + _server + .Given(WireMockRequest.Create().WithPath("/test").UsingPost()) + .InScenario("Retry") + .WhenStateIs("Success") + .RespondWith(WireMockResponse.Create().WithStatusCode(200).WithBody("Success")); + + var request = new MultipartFormRequest + { + BaseUrl = _baseUrl, + Method = HttpMethod.Post, + Path = "/test", + }; + request.AddJsonPart("object", new { }); + + var response = await _rawClient.SendRequestAsync(request); + Assert.That(response.StatusCode, Is.EqualTo(200)); + + var content = await response.Raw.Content.ReadAsStringAsync(); + Assert.Multiple(() => + { + Assert.That(content, Is.EqualTo("Success")); + Assert.That(_server.LogEntries, Has.Count.EqualTo(MaxRetries)); + }); + } + + [TearDown] + public void TearDown() + { + _server.Dispose(); + _httpClient.Dispose(); + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/SeedPublicObject.Test.Custom.props b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/SeedPublicObject.Test.Custom.props new file mode 100644 index 00000000000..55e683b0772 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/SeedPublicObject.Test.Custom.props @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/SeedPublicObject.Test.csproj b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/SeedPublicObject.Test.csproj new file mode 100644 index 00000000000..6e52893b477 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/SeedPublicObject.Test.csproj @@ -0,0 +1,37 @@ + + + + net8.0 + 12 + enable + enable + false + true + true + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + \ No newline at end of file diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/TestClient.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/TestClient.cs new file mode 100644 index 00000000000..ccf49e8e637 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/TestClient.cs @@ -0,0 +1,6 @@ +using NUnit.Framework; + +namespace SeedPublicObject.Test; + +[TestFixture] +public class TestClient; diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs new file mode 100644 index 00000000000..1704c99af44 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/JsonElementComparer.cs @@ -0,0 +1,236 @@ +using System.Text.Json; +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for EqualConstraint to handle JsonElement objects. +/// +public static class JsonElementComparerExtensions +{ + /// + /// Extension method for comparing JsonElement objects in NUnit tests. + /// Property order doesn't matter, but array order does matter. + /// Includes special handling for DateTime string formats. + /// + /// The Is.EqualTo() constraint instance. + /// A constraint that can compare JsonElements with detailed diffs. + public static EqualConstraint UsingJsonElementComparer(this EqualConstraint constraint) + { + return constraint.Using(new JsonElementComparer()); + } +} + +/// +/// Equality comparer for JsonElement with detailed reporting. +/// Property order doesn't matter, but array order does matter. +/// Now includes special handling for DateTime string formats with improved null handling. +/// +public class JsonElementComparer : IEqualityComparer +{ + private string _failurePath = string.Empty; + + /// + public bool Equals(JsonElement x, JsonElement y) + { + _failurePath = string.Empty; + return CompareJsonElements(x, y, string.Empty); + } + + /// + public int GetHashCode(JsonElement obj) + { + return JsonSerializer.Serialize(obj).GetHashCode(); + } + + private bool CompareJsonElements(JsonElement x, JsonElement y, string path) + { + // If value kinds don't match, they're not equivalent + if (x.ValueKind != y.ValueKind) + { + _failurePath = $"{path}: Expected {x.ValueKind} but got {y.ValueKind}"; + return false; + } + + switch (x.ValueKind) + { + case JsonValueKind.Object: + return CompareJsonObjects(x, y, path); + + case JsonValueKind.Array: + return CompareJsonArraysInOrder(x, y, path); + + case JsonValueKind.String: + string? xStr = x.GetString(); + string? yStr = y.GetString(); + + // Handle null strings + if (xStr is null && yStr is null) + return true; + + if (xStr is null || yStr is null) + { + _failurePath = + $"{path}: Expected {(xStr is null ? "null" : $"\"{xStr}\"")} but got {(yStr is null ? "null" : $"\"{yStr}\"")}"; + return false; + } + + // Check if they are identical strings + if (xStr == yStr) + return true; + + // Try to handle DateTime strings + if (IsLikelyDateTimeString(xStr) && IsLikelyDateTimeString(yStr)) + { + if (AreEquivalentDateTimeStrings(xStr, yStr)) + return true; + } + + _failurePath = $"{path}: Expected \"{xStr}\" but got \"{yStr}\""; + return false; + + case JsonValueKind.Number: + if (x.GetDecimal() != y.GetDecimal()) + { + _failurePath = $"{path}: Expected {x.GetDecimal()} but got {y.GetDecimal()}"; + return false; + } + + return true; + + case JsonValueKind.True: + case JsonValueKind.False: + if (x.GetBoolean() != y.GetBoolean()) + { + _failurePath = $"{path}: Expected {x.GetBoolean()} but got {y.GetBoolean()}"; + return false; + } + + return true; + + case JsonValueKind.Null: + return true; + + default: + _failurePath = $"{path}: Unsupported JsonValueKind {x.ValueKind}"; + return false; + } + } + + private bool IsLikelyDateTimeString(string? str) + { + // Simple heuristic to identify likely ISO date time strings + return str != null + && (str.Contains("T") && (str.EndsWith("Z") || str.Contains("+") || str.Contains("-"))); + } + + private bool AreEquivalentDateTimeStrings(string str1, string str2) + { + // Try to parse both as DateTime + if (DateTime.TryParse(str1, out DateTime dt1) && DateTime.TryParse(str2, out DateTime dt2)) + { + return dt1 == dt2; + } + + return false; + } + + private bool CompareJsonObjects(JsonElement x, JsonElement y, string path) + { + // Create dictionaries for both JSON objects + var xProps = new Dictionary(); + var yProps = new Dictionary(); + + foreach (var prop in x.EnumerateObject()) + xProps[prop.Name] = prop.Value; + + foreach (var prop in y.EnumerateObject()) + yProps[prop.Name] = prop.Value; + + // Check if all properties in x exist in y + foreach (var key in xProps.Keys) + { + if (!yProps.ContainsKey(key)) + { + _failurePath = $"{path}: Missing property '{key}'"; + return false; + } + } + + // Check if y has extra properties + foreach (var key in yProps.Keys) + { + if (!xProps.ContainsKey(key)) + { + _failurePath = $"{path}: Unexpected property '{key}'"; + return false; + } + } + + // Compare each property value + foreach (var key in xProps.Keys) + { + var propPath = string.IsNullOrEmpty(path) ? key : $"{path}.{key}"; + if (!CompareJsonElements(xProps[key], yProps[key], propPath)) + { + return false; + } + } + + return true; + } + + private bool CompareJsonArraysInOrder(JsonElement x, JsonElement y, string path) + { + var xArray = x.EnumerateArray(); + var yArray = y.EnumerateArray(); + + // Count x elements + var xCount = 0; + var xElements = new List(); + foreach (var item in xArray) + { + xElements.Add(item); + xCount++; + } + + // Count y elements + var yCount = 0; + var yElements = new List(); + foreach (var item in yArray) + { + yElements.Add(item); + yCount++; + } + + // Check if counts match + if (xCount != yCount) + { + _failurePath = $"{path}: Expected {xCount} items but found {yCount}"; + return false; + } + + // Compare elements in order + for (var i = 0; i < xCount; i++) + { + var itemPath = $"{path}[{i}]"; + if (!CompareJsonElements(xElements[i], yElements[i], itemPath)) + { + return false; + } + } + + return true; + } + + /// + public override string ToString() + { + if (!string.IsNullOrEmpty(_failurePath)) + { + return $"JSON comparison failed at {_failurePath}"; + } + + return "JsonElementEqualityComparer"; + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/NUnitExtensions.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/NUnitExtensions.cs new file mode 100644 index 00000000000..426df124538 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/NUnitExtensions.cs @@ -0,0 +1,28 @@ +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for NUnit constraints. +/// +public static class NUnitExtensions +{ + /// + /// Modifies the EqualConstraint to use our own set of default comparers. + /// + /// + /// + public static EqualConstraint UsingDefaults(this EqualConstraint constraint) => + constraint + .UsingPropertiesComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingReadOnlyMemoryComparer() + .UsingOneOfComparer() + .UsingJsonElementComparer(); +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/OneOfComparer.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/OneOfComparer.cs new file mode 100644 index 00000000000..0c975b471ff --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/OneOfComparer.cs @@ -0,0 +1,43 @@ +using NUnit.Framework.Constraints; +using OneOf; + +namespace NUnit.Framework; + +/// +/// Extensions for EqualConstraint to handle OneOf values. +/// +public static class EqualConstraintExtensions +{ + /// + /// Modifies the EqualConstraint to handle OneOf instances by comparing their inner values. + /// This works alongside other comparison modifiers like UsingPropertiesComparer. + /// + /// The EqualConstraint to modify. + /// The same constraint instance for method chaining. + public static EqualConstraint UsingOneOfComparer(this EqualConstraint constraint) + { + // Register a comparer factory for IOneOf types + constraint.Using( + (x, y) => + { + // ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract + if (x.Value is null && y.Value is null) + { + return true; + } + + if (x.Value is null) + { + return false; + } + + var propertiesComparer = new NUnitEqualityComparer(); + var tolerance = Tolerance.Default; + propertiesComparer.CompareProperties = true; + return propertiesComparer.AreEqual(x.Value, y.Value, ref tolerance); + } + ); + + return constraint; + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/ReadOnlyMemoryComparer.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/ReadOnlyMemoryComparer.cs new file mode 100644 index 00000000000..fc0b595a5e5 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject.Test/Utils/ReadOnlyMemoryComparer.cs @@ -0,0 +1,87 @@ +using NUnit.Framework.Constraints; + +namespace NUnit.Framework; + +/// +/// Extensions for NUnit constraints. +/// +public static class ReadOnlyMemoryComparerExtensions +{ + /// + /// Extension method for comparing ReadOnlyMemory<T> in NUnit tests. + /// + /// The type of elements in the ReadOnlyMemory. + /// The Is.EqualTo() constraint instance. + /// A constraint that can compare ReadOnlyMemory<T>. + public static EqualConstraint UsingReadOnlyMemoryComparer(this EqualConstraint constraint) + where T : IComparable + { + return constraint.Using(new ReadOnlyMemoryComparer()); + } +} + +/// +/// Comparer for ReadOnlyMemory<T>. Compares sequences by value. +/// +/// +/// The type of elements in the ReadOnlyMemory. +/// +public class ReadOnlyMemoryComparer : IComparer> + where T : IComparable +{ + /// + public int Compare(ReadOnlyMemory x, ReadOnlyMemory y) + { + // Check if sequences are equal + var xSpan = x.Span; + var ySpan = y.Span; + + // Optimized case for IEquatable implementations + if (typeof(IEquatable).IsAssignableFrom(typeof(T))) + { + var areEqual = xSpan.SequenceEqual(ySpan); + if (areEqual) + { + return 0; // Sequences are equal + } + } + else + { + // Manual equality check for non-IEquatable types + if (xSpan.Length == ySpan.Length) + { + var areEqual = true; + for (var i = 0; i < xSpan.Length; i++) + { + if (!EqualityComparer.Default.Equals(xSpan[i], ySpan[i])) + { + areEqual = false; + break; + } + } + + if (areEqual) + { + return 0; // Sequences are equal + } + } + } + + // For non-equal sequences, we need to return a consistent ordering + // First compare lengths + if (x.Length != y.Length) + return x.Length.CompareTo(y.Length); + + // Same length but different content - compare first differing element + for (var i = 0; i < x.Length; i++) + { + if (!EqualityComparer.Default.Equals(xSpan[i], ySpan[i])) + { + return xSpan[i].CompareTo(ySpan[i]); + } + } + + // Should never reach here if not equal + return 0; + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/ApiResponse.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/ApiResponse.cs new file mode 100644 index 00000000000..72c642b931c --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/ApiResponse.cs @@ -0,0 +1,13 @@ +using System.Net.Http; + +namespace SeedPublicObject.Core; + +/// +/// The response object returned from the API. +/// +internal record ApiResponse +{ + internal required int StatusCode { get; init; } + + internal required HttpResponseMessage Raw { get; init; } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/BaseRequest.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/BaseRequest.cs new file mode 100644 index 00000000000..91e8496a9c6 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/BaseRequest.cs @@ -0,0 +1,63 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; + +namespace SeedPublicObject.Core; + +internal abstract record BaseRequest +{ + internal required string BaseUrl { get; init; } + + internal required HttpMethod Method { get; init; } + + internal required string Path { get; init; } + + internal string? ContentType { get; init; } + + internal Dictionary Query { get; init; } = new(); + + internal Headers Headers { get; init; } = new(); + + internal IRequestOptions? Options { get; init; } + + internal abstract HttpContent? CreateContent(); + + protected static ( + Encoding encoding, + string? charset, + string mediaType + ) ParseContentTypeOrDefault( + string? contentType, + Encoding encodingFallback, + string mediaTypeFallback + ) + { + var encoding = encodingFallback; + var mediaType = mediaTypeFallback; + string? charset = null; + if (string.IsNullOrEmpty(contentType)) + { + return (encoding, charset, mediaType); + } + + if (!MediaTypeHeaderValue.TryParse(contentType, out var mediaTypeHeaderValue)) + { + return (encoding, charset, mediaType); + } + + if (!string.IsNullOrEmpty(mediaTypeHeaderValue.CharSet)) + { + charset = mediaTypeHeaderValue.CharSet; + encoding = Encoding.GetEncoding(mediaTypeHeaderValue.CharSet); + } + + if (!string.IsNullOrEmpty(mediaTypeHeaderValue.MediaType)) + { + mediaType = mediaTypeHeaderValue.MediaType; + } + + return (encoding, charset, mediaType); + } + + protected static Encoding Utf8NoBom => EncodingCache.Utf8NoBom; +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/CollectionItemSerializer.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/CollectionItemSerializer.cs new file mode 100644 index 00000000000..25a8268f28e --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/CollectionItemSerializer.cs @@ -0,0 +1,89 @@ +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedPublicObject.Core; + +/// +/// Json collection converter. +/// +/// Type of item to convert. +/// Converter to use for individual items. +internal class CollectionItemSerializer + : JsonConverter> + where TConverterType : JsonConverter +{ + /// + /// Reads a json string and deserializes it into an object. + /// + /// Json reader. + /// Type to convert. + /// Serializer options. + /// Created object. + public override IEnumerable? Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType == JsonTokenType.Null) + { + return default; + } + + var jsonSerializerOptions = new JsonSerializerOptions(options); + jsonSerializerOptions.Converters.Clear(); + jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); + + var returnValue = new List(); + + while (reader.TokenType != JsonTokenType.EndArray) + { + if (reader.TokenType != JsonTokenType.StartArray) + { + var item = (TDatatype)( + JsonSerializer.Deserialize(ref reader, typeof(TDatatype), jsonSerializerOptions) + ?? throw new Exception( + $"Failed to deserialize collection item of type {typeof(TDatatype)}" + ) + ); + returnValue.Add(item); + } + + reader.Read(); + } + + return returnValue; + } + + /// + /// Writes a json string. + /// + /// Json writer. + /// Value to write. + /// Serializer options. + public override void Write( + Utf8JsonWriter writer, + IEnumerable? value, + JsonSerializerOptions options + ) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + var jsonSerializerOptions = new JsonSerializerOptions(options); + jsonSerializerOptions.Converters.Clear(); + jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); + + writer.WriteStartArray(); + + foreach (var data in value) + { + JsonSerializer.Serialize(writer, data, jsonSerializerOptions); + } + + writer.WriteEndArray(); + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Constants.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Constants.cs new file mode 100644 index 00000000000..33f91506846 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Constants.cs @@ -0,0 +1,7 @@ +namespace SeedPublicObject.Core; + +internal static class Constants +{ + public const string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffK"; + public const string DateFormat = "yyyy-MM-dd"; +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/DateOnlyConverter.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/DateOnlyConverter.cs new file mode 100644 index 00000000000..4359bbec949 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/DateOnlyConverter.cs @@ -0,0 +1,748 @@ +// ReSharper disable All +#pragma warning disable + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using global::System.Diagnostics; +using global::System.Diagnostics.CodeAnalysis; +using global::System.Globalization; +using global::System.Runtime.CompilerServices; +using global::System.Runtime.InteropServices; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +// ReSharper disable SuggestVarOrType_SimpleTypes +// ReSharper disable SuggestVarOrType_BuiltInTypes + +namespace SeedPublicObject.Core +{ + /// + /// Custom converter for handling the data type with the System.Text.Json library. + /// + /// + /// This class backported from: + /// + /// System.Text.Json.Serialization.Converters.DateOnlyConverter + /// + public sealed class DateOnlyConverter : JsonConverter + { + private const int FormatLength = 10; // YYYY-MM-DD + + private const int MaxEscapedFormatLength = + FormatLength * JsonConstants.MaxExpansionFactorWhileEscaping; + + /// + public override DateOnly Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType != JsonTokenType.String) + { + ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); + } + + return ReadCore(ref reader); + } + + /// + public override DateOnly ReadAsPropertyName( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); + return ReadCore(ref reader); + } + + private static DateOnly ReadCore(ref Utf8JsonReader reader) + { + if ( + !JsonHelpers.IsInRangeInclusive( + reader.ValueLength(), + FormatLength, + MaxEscapedFormatLength + ) + ) + { + ThrowHelper.ThrowFormatException(DataType.DateOnly); + } + + scoped ReadOnlySpan source; + if (!reader.HasValueSequence && !reader.ValueIsEscaped) + { + source = reader.ValueSpan; + } + else + { + Span stackSpan = stackalloc byte[MaxEscapedFormatLength]; + int bytesWritten = reader.CopyString(stackSpan); + source = stackSpan.Slice(0, bytesWritten); + } + + if (!JsonHelpers.TryParseAsIso(source, out DateOnly value)) + { + ThrowHelper.ThrowFormatException(DataType.DateOnly); + } + + return value; + } + + /// + public override void Write( + Utf8JsonWriter writer, + DateOnly value, + JsonSerializerOptions options + ) + { +#if NET8_0_OR_GREATER + Span buffer = stackalloc byte[FormatLength]; +#else + Span buffer = stackalloc char[FormatLength]; +#endif + // ReSharper disable once RedundantAssignment + bool formattedSuccessfully = value.TryFormat( + buffer, + out int charsWritten, + "O".AsSpan(), + CultureInfo.InvariantCulture + ); + Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); + writer.WriteStringValue(buffer); + } + + /// + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DateOnly value, + JsonSerializerOptions options + ) + { +#if NET8_0_OR_GREATER + Span buffer = stackalloc byte[FormatLength]; +#else + Span buffer = stackalloc char[FormatLength]; +#endif + // ReSharper disable once RedundantAssignment + bool formattedSuccessfully = value.TryFormat( + buffer, + out int charsWritten, + "O".AsSpan(), + CultureInfo.InvariantCulture + ); + Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); + writer.WritePropertyName(buffer); + } + } + + internal static class JsonConstants + { + // The maximum number of fraction digits the Json DateTime parser allows + public const int DateTimeParseNumFractionDigits = 16; + + // In the worst case, an ASCII character represented as a single utf-8 byte could expand 6x when escaped. + public const int MaxExpansionFactorWhileEscaping = 6; + + // The largest fraction expressible by TimeSpan and DateTime formats + public const int MaxDateTimeFraction = 9_999_999; + + // TimeSpan and DateTime formats allow exactly up to many digits for specifying the fraction after the seconds. + public const int DateTimeNumFractionDigits = 7; + + public const byte UtcOffsetToken = (byte)'Z'; + + public const byte TimePrefix = (byte)'T'; + + public const byte Period = (byte)'.'; + + public const byte Hyphen = (byte)'-'; + + public const byte Colon = (byte)':'; + + public const byte Plus = (byte)'+'; + } + + // ReSharper disable SuggestVarOrType_Elsewhere + // ReSharper disable SuggestVarOrType_SimpleTypes + // ReSharper disable SuggestVarOrType_BuiltInTypes + + + internal static class JsonHelpers + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsInRangeInclusive(int value, int lowerBound, int upperBound) => + (uint)(value - lowerBound) <= (uint)(upperBound - lowerBound); + + public static bool IsDigit(byte value) => (uint)(value - '0') <= '9' - '0'; + + [StructLayout(LayoutKind.Auto)] + private struct DateTimeParseData + { + public int Year; + public int Month; + public int Day; + public bool IsCalendarDateOnly; + public int Hour; + public int Minute; + public int Second; + public int Fraction; // This value should never be greater than 9_999_999. + public int OffsetHours; + public int OffsetMinutes; + + // ReSharper disable once NotAccessedField.Local + public byte OffsetToken; + } + + public static bool TryParseAsIso(ReadOnlySpan source, out DateOnly value) + { + if ( + TryParseDateTimeOffset(source, out DateTimeParseData parseData) + && parseData.IsCalendarDateOnly + && TryCreateDateTime(parseData, DateTimeKind.Unspecified, out DateTime dateTime) + ) + { + value = DateOnly.FromDateTime(dateTime); + return true; + } + + value = default; + return false; + } + + /// + /// ISO 8601 date time parser (ISO 8601-1:2019). + /// + /// The date/time to parse in UTF-8 format. + /// The parsed for the given . + /// + /// Supports extended calendar date (5.2.2.1) and complete (5.4.2.1) calendar date/time of day + /// representations with optional specification of seconds and fractional seconds. + /// + /// Times can be explicitly specified as UTC ("Z" - 5.3.3) or offsets from UTC ("+/-hh:mm" 5.3.4.2). + /// If unspecified they are considered to be local per spec. + /// + /// Examples: (TZD is either "Z" or hh:mm offset from UTC) + /// + /// YYYY-MM-DD (e.g. 1997-07-16) + /// YYYY-MM-DDThh:mm (e.g. 1997-07-16T19:20) + /// YYYY-MM-DDThh:mm:ss (e.g. 1997-07-16T19:20:30) + /// YYYY-MM-DDThh:mm:ss.s (e.g. 1997-07-16T19:20:30.45) + /// YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00) + /// YYYY-MM-DDThh:mm:ssTZD (e.g. 1997-07-16T19:20:3001:00) + /// YYYY-MM-DDThh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45Z) + /// + /// Generally speaking we always require the "extended" option when one exists (3.1.3.5). + /// The extended variants have separator characters between components ('-', ':', '.', etc.). + /// Spaces are not permitted. + /// + /// "true" if successfully parsed. + private static bool TryParseDateTimeOffset( + ReadOnlySpan source, + out DateTimeParseData parseData + ) + { + parseData = default; + + // too short datetime + Debug.Assert(source.Length >= 10); + + // Parse the calendar date + // ----------------------- + // ISO 8601-1:2019 5.2.2.1b "Calendar date complete extended format" + // [dateX] = [year]["-"][month]["-"][day] + // [year] = [YYYY] [0000 - 9999] (4.3.2) + // [month] = [MM] [01 - 12] (4.3.3) + // [day] = [DD] [01 - 28, 29, 30, 31] (4.3.4) + // + // Note: 5.2.2.2 "Representations with reduced precision" allows for + // just [year]["-"][month] (a) and just [year] (b), but we currently + // don't permit it. + + { + uint digit1 = source[0] - (uint)'0'; + uint digit2 = source[1] - (uint)'0'; + uint digit3 = source[2] - (uint)'0'; + uint digit4 = source[3] - (uint)'0'; + + if (digit1 > 9 || digit2 > 9 || digit3 > 9 || digit4 > 9) + { + return false; + } + + parseData.Year = (int)(digit1 * 1000 + digit2 * 100 + digit3 * 10 + digit4); + } + + if ( + source[4] != JsonConstants.Hyphen + || !TryGetNextTwoDigits(source.Slice(start: 5, length: 2), ref parseData.Month) + || source[7] != JsonConstants.Hyphen + || !TryGetNextTwoDigits(source.Slice(start: 8, length: 2), ref parseData.Day) + ) + { + return false; + } + + // We now have YYYY-MM-DD [dateX] + // ReSharper disable once ConvertIfStatementToSwitchStatement + if (source.Length == 10) + { + parseData.IsCalendarDateOnly = true; + return true; + } + + // Parse the time of day + // --------------------- + // + // ISO 8601-1:2019 5.3.1.2b "Local time of day complete extended format" + // [timeX] = ["T"][hour][":"][min][":"][sec] + // [hour] = [hh] [00 - 23] (4.3.8a) + // [minute] = [mm] [00 - 59] (4.3.9a) + // [sec] = [ss] [00 - 59, 60 with a leap second] (4.3.10a) + // + // ISO 8601-1:2019 5.3.3 "UTC of day" + // [timeX]["Z"] + // + // ISO 8601-1:2019 5.3.4.2 "Local time of day with the time shift between + // local timescale and UTC" (Extended format) + // + // [shiftX] = ["+"|"-"][hour][":"][min] + // + // Notes: + // + // "T" is optional per spec, but _only_ when times are used alone. In our + // case, we're reading out a complete date & time and as such require "T". + // (5.4.2.1b). + // + // For [timeX] We allow seconds to be omitted per 5.3.1.3a "Representations + // with reduced precision". 5.3.1.3b allows just specifying the hour, but + // we currently don't permit this. + // + // Decimal fractions are allowed for hours, minutes and seconds (5.3.14). + // We only allow fractions for seconds currently. Lower order components + // can't follow, i.e. you can have T23.3, but not T23.3:04. There must be + // one digit, but the max number of digits is implementation defined. We + // currently allow up to 16 digits of fractional seconds only. While we + // support 16 fractional digits we only parse the first seven, anything + // past that is considered a zero. This is to stay compatible with the + // DateTime implementation which is limited to this resolution. + + if (source.Length < 16) + { + // Source does not have enough characters for YYYY-MM-DDThh:mm + return false; + } + + // Parse THH:MM (e.g. "T10:32") + if ( + source[10] != JsonConstants.TimePrefix + || source[13] != JsonConstants.Colon + || !TryGetNextTwoDigits(source.Slice(start: 11, length: 2), ref parseData.Hour) + || !TryGetNextTwoDigits(source.Slice(start: 14, length: 2), ref parseData.Minute) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm + Debug.Assert(source.Length >= 16); + if (source.Length == 16) + { + return true; + } + + byte curByte = source[16]; + int sourceIndex = 17; + + // Either a TZD ['Z'|'+'|'-'] or a seconds separator [':'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + case JsonConstants.Colon: + break; + default: + return false; + } + + // Try reading the seconds + if ( + source.Length < 19 + || !TryGetNextTwoDigits(source.Slice(start: 17, length: 2), ref parseData.Second) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm:ss + Debug.Assert(source.Length >= 19); + if (source.Length == 19) + { + return true; + } + + curByte = source[19]; + sourceIndex = 20; + + // Either a TZD ['Z'|'+'|'-'] or a seconds decimal fraction separator ['.'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + case JsonConstants.Period: + break; + default: + return false; + } + + // Source does not have enough characters for second fractions (i.e. ".s") + // YYYY-MM-DDThh:mm:ss.s + if (source.Length < 21) + { + return false; + } + + // Parse fraction. This value should never be greater than 9_999_999 + int numDigitsRead = 0; + int fractionEnd = Math.Min( + sourceIndex + JsonConstants.DateTimeParseNumFractionDigits, + source.Length + ); + + while (sourceIndex < fractionEnd && IsDigit(curByte = source[sourceIndex])) + { + if (numDigitsRead < JsonConstants.DateTimeNumFractionDigits) + { + parseData.Fraction = parseData.Fraction * 10 + (int)(curByte - (uint)'0'); + numDigitsRead++; + } + + sourceIndex++; + } + + if (parseData.Fraction != 0) + { + while (numDigitsRead < JsonConstants.DateTimeNumFractionDigits) + { + parseData.Fraction *= 10; + numDigitsRead++; + } + } + + // We now have YYYY-MM-DDThh:mm:ss.s + Debug.Assert(sourceIndex <= source.Length); + if (sourceIndex == source.Length) + { + return true; + } + + curByte = source[sourceIndex++]; + + // TZD ['Z'|'+'|'-'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + default: + return false; + } + + static bool ParseOffset(ref DateTimeParseData parseData, ReadOnlySpan offsetData) + { + // Parse the hours for the offset + if ( + offsetData.Length < 2 + || !TryGetNextTwoDigits(offsetData.Slice(0, 2), ref parseData.OffsetHours) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm:ss.s+|-hh + + if (offsetData.Length == 2) + { + // Just hours offset specified + return true; + } + + // Ensure we have enough for ":mm" + return offsetData.Length == 5 + && offsetData[2] == JsonConstants.Colon + && TryGetNextTwoDigits(offsetData.Slice(3), ref parseData.OffsetMinutes); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + // ReSharper disable once RedundantAssignment + private static bool TryGetNextTwoDigits(ReadOnlySpan source, ref int value) + { + Debug.Assert(source.Length == 2); + + uint digit1 = source[0] - (uint)'0'; + uint digit2 = source[1] - (uint)'0'; + + if (digit1 > 9 || digit2 > 9) + { + value = 0; + return false; + } + + value = (int)(digit1 * 10 + digit2); + return true; + } + + // The following methods are borrowed verbatim from src/Common/src/CoreLib/System/Buffers/Text/Utf8Parser/Utf8Parser.Date.Helpers.cs + + /// + /// Overflow-safe DateTime factory. + /// + private static bool TryCreateDateTime( + DateTimeParseData parseData, + DateTimeKind kind, + out DateTime value + ) + { + if (parseData.Year == 0) + { + value = default; + return false; + } + + Debug.Assert(parseData.Year <= 9999); // All of our callers to date parse the year from fixed 4-digit fields so this value is trusted. + + if ((uint)parseData.Month - 1 >= 12) + { + value = default; + return false; + } + + uint dayMinusOne = (uint)parseData.Day - 1; + if ( + dayMinusOne >= 28 + && dayMinusOne >= DateTime.DaysInMonth(parseData.Year, parseData.Month) + ) + { + value = default; + return false; + } + + if ((uint)parseData.Hour > 23) + { + value = default; + return false; + } + + if ((uint)parseData.Minute > 59) + { + value = default; + return false; + } + + // This needs to allow leap seconds when appropriate. + // See https://github.com/dotnet/runtime/issues/30135. + if ((uint)parseData.Second > 59) + { + value = default; + return false; + } + + Debug.Assert(parseData.Fraction is >= 0 and <= JsonConstants.MaxDateTimeFraction); // All of our callers to date parse the fraction from fixed 7-digit fields so this value is trusted. + + ReadOnlySpan days = DateTime.IsLeapYear(parseData.Year) + ? DaysToMonth366 + : DaysToMonth365; + int yearMinusOne = parseData.Year - 1; + int totalDays = + yearMinusOne * 365 + + yearMinusOne / 4 + - yearMinusOne / 100 + + yearMinusOne / 400 + + days[parseData.Month - 1] + + parseData.Day + - 1; + long ticks = totalDays * TimeSpan.TicksPerDay; + int totalSeconds = parseData.Hour * 3600 + parseData.Minute * 60 + parseData.Second; + ticks += totalSeconds * TimeSpan.TicksPerSecond; + ticks += parseData.Fraction; + value = new DateTime(ticks: ticks, kind: kind); + return true; + } + + private static ReadOnlySpan DaysToMonth365 => + [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; + private static ReadOnlySpan DaysToMonth366 => + [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]; + } + + internal static class ThrowHelper + { + private const string ExceptionSourceValueToRethrowAsJsonException = + "System.Text.Json.Rethrowable"; + + [DoesNotReturn] + public static void ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType) + { + throw GetInvalidOperationException("string", tokenType); + } + + public static void ThrowFormatException(DataType dataType) + { + throw new FormatException(SR.Format(SR.UnsupportedFormat, dataType)) + { + Source = ExceptionSourceValueToRethrowAsJsonException, + }; + } + + private static Exception GetInvalidOperationException( + string message, + JsonTokenType tokenType + ) + { + return GetInvalidOperationException(SR.Format(SR.InvalidCast, tokenType, message)); + } + + private static InvalidOperationException GetInvalidOperationException(string message) + { + return new InvalidOperationException(message) + { + Source = ExceptionSourceValueToRethrowAsJsonException, + }; + } + } + + internal static class Utf8JsonReaderExtensions + { + internal static int ValueLength(this Utf8JsonReader reader) => + reader.HasValueSequence + ? checked((int)reader.ValueSequence.Length) + : reader.ValueSpan.Length; + } + + internal enum DataType + { + TimeOnly, + DateOnly, + } + + [SuppressMessage("ReSharper", "InconsistentNaming")] + internal static class SR + { + private static readonly bool s_usingResourceKeys = + AppContext.TryGetSwitch( + "System.Resources.UseSystemResourceKeys", + out bool usingResourceKeys + ) && usingResourceKeys; + + public static string UnsupportedFormat => Strings.UnsupportedFormat; + + public static string InvalidCast => Strings.InvalidCast; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static string Format(string resourceFormat, object? p1) => + s_usingResourceKeys + ? string.Join(", ", resourceFormat, p1) + : string.Format(resourceFormat, p1); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static string Format(string resourceFormat, object? p1, object? p2) => + s_usingResourceKeys + ? string.Join(", ", resourceFormat, p1, p2) + : string.Format(resourceFormat, p1, p2); + } + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute( + "System.Resources.Tools.StronglyTypedResourceBuilder", + "17.0.0.0" + )] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Strings + { + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( + "Microsoft.Performance", + "CA1811:AvoidUncalledPrivateCode" + )] + internal Strings() { } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute( + global::System.ComponentModel.EditorBrowsableState.Advanced + )] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = + new global::System.Resources.ResourceManager( + "System.Text.Json.Resources.Strings", + typeof(Strings).Assembly + ); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute( + global::System.ComponentModel.EditorBrowsableState.Advanced + )] + internal static global::System.Globalization.CultureInfo Culture + { + get { return resourceCulture; } + set { resourceCulture = value; } + } + + /// + /// Looks up a localized string similar to Cannot get the value of a token type '{0}' as a {1}.. + /// + internal static string InvalidCast + { + get { return ResourceManager.GetString("InvalidCast", resourceCulture); } + } + + /// + /// Looks up a localized string similar to The JSON value is not in a supported {0} format.. + /// + internal static string UnsupportedFormat + { + get { return ResourceManager.GetString("UnsupportedFormat", resourceCulture); } + } + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/DateTimeSerializer.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/DateTimeSerializer.cs new file mode 100644 index 00000000000..4c5e36b8517 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/DateTimeSerializer.cs @@ -0,0 +1,22 @@ +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedPublicObject.Core; + +internal class DateTimeSerializer : JsonConverter +{ + public override DateTime Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + return DateTime.Parse(reader.GetString()!, null, DateTimeStyles.RoundtripKind); + } + + public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString(Constants.DateTimeFormat)); + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/EmptyRequest.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/EmptyRequest.cs new file mode 100644 index 00000000000..79915b22c71 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/EmptyRequest.cs @@ -0,0 +1,11 @@ +using System.Net.Http; + +namespace SeedPublicObject.Core; + +/// +/// The request object to send without a request body. +/// +internal record EmptyRequest : BaseRequest +{ + internal override HttpContent? CreateContent() => null; +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/EncodingCache.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/EncodingCache.cs new file mode 100644 index 00000000000..27b1526a805 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/EncodingCache.cs @@ -0,0 +1,11 @@ +using System.Text; + +namespace SeedPublicObject.Core; + +internal static class EncodingCache +{ + internal static readonly Encoding Utf8NoBom = new UTF8Encoding( + encoderShouldEmitUTF8Identifier: false, + throwOnInvalidBytes: true + ); +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/EnumSerializer.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/EnumSerializer.cs new file mode 100644 index 00000000000..3059129be3a --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/EnumSerializer.cs @@ -0,0 +1,53 @@ +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedPublicObject.Core; + +internal class EnumSerializer : JsonConverter + where TEnum : struct, Enum +{ + private readonly Dictionary _enumToString = new(); + private readonly Dictionary _stringToEnum = new(); + + public EnumSerializer() + { + var type = typeof(TEnum); + var values = Enum.GetValues(type); + + foreach (var value in values) + { + var enumValue = (TEnum)value; + var enumMember = type.GetField(enumValue.ToString())!; + var attr = enumMember + .GetCustomAttributes(typeof(EnumMemberAttribute), false) + .Cast() + .FirstOrDefault(); + + var stringValue = + attr?.Value + ?? value.ToString() + ?? throw new Exception("Unexpected null enum toString value"); + + _enumToString.Add(enumValue, stringValue); + _stringToEnum.Add(stringValue, enumValue); + } + } + + public override TEnum Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write(Utf8JsonWriter writer, TEnum value, JsonSerializerOptions options) + { + writer.WriteStringValue(_enumToString[value]); + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Extensions.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Extensions.cs new file mode 100644 index 00000000000..e5572ce1cdb --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Extensions.cs @@ -0,0 +1,14 @@ +using System.Runtime.Serialization; + +namespace SeedPublicObject.Core; + +internal static class Extensions +{ + public static string Stringify(this Enum value) + { + var field = value.GetType().GetField(value.ToString()); + var attribute = (EnumMemberAttribute) + Attribute.GetCustomAttribute(field, typeof(EnumMemberAttribute)); + return attribute?.Value ?? value.ToString(); + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/FormUrlEncoder.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/FormUrlEncoder.cs new file mode 100644 index 00000000000..cb960d14c61 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/FormUrlEncoder.cs @@ -0,0 +1,33 @@ +using global::System.Net.Http; + +namespace SeedPublicObject.Core; + +/// +/// Encodes an object into a form URL-encoded content. +/// +public static class FormUrlEncoder +{ + /// + /// Encodes an object into a form URL-encoded content using Deep Object notation. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + internal static FormUrlEncodedContent EncodeAsDeepObject(object value) => + new(QueryStringConverter.ToDeepObject(value)); + + /// + /// Encodes an object into a form URL-encoded content using Exploded Form notation. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + internal static FormUrlEncodedContent EncodeAsExplodedForm(object value) => + new(QueryStringConverter.ToExplodedForm(value)); + + /// + /// Encodes an object into a form URL-encoded content using Form notation without exploding parameters. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + internal static FormUrlEncodedContent EncodeAsForm(object value) => + new(QueryStringConverter.ToForm(value)); +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/HeaderValue.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/HeaderValue.cs new file mode 100644 index 00000000000..410fe16fd04 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/HeaderValue.cs @@ -0,0 +1,17 @@ +using OneOf; + +namespace SeedPublicObject.Core; + +internal sealed class HeaderValue(OneOf> value) + : OneOfBase>(value) +{ + public static implicit operator HeaderValue(string value) + { + return new HeaderValue(value); + } + + public static implicit operator HeaderValue(Func value) + { + return new HeaderValue(value); + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Headers.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Headers.cs new file mode 100644 index 00000000000..62de9c84303 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Headers.cs @@ -0,0 +1,28 @@ +namespace SeedPublicObject.Core; + +/// +/// Represents the headers sent with the request. +/// +internal sealed class Headers : Dictionary +{ + internal Headers() { } + + /// + /// Initializes a new instance of the Headers class with the specified value. + /// + /// + internal Headers(Dictionary value) + { + foreach (var kvp in value) + { + this[kvp.Key] = new HeaderValue(kvp.Value); + } + } + + /// + /// Initializes a new instance of the Headers class with the specified value. + /// + /// + internal Headers(IEnumerable> value) + : base(value.ToDictionary(e => e.Key, e => e.Value)) { } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/HttpMethodExtensions.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/HttpMethodExtensions.cs new file mode 100644 index 00000000000..863b5d9cf78 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/HttpMethodExtensions.cs @@ -0,0 +1,8 @@ +using System.Net.Http; + +namespace SeedPublicObject.Core; + +internal static class HttpMethodExtensions +{ + public static readonly HttpMethod Patch = new("PATCH"); +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/IIsRetryableContent.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/IIsRetryableContent.cs new file mode 100644 index 00000000000..1892ed2eeb4 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/IIsRetryableContent.cs @@ -0,0 +1,6 @@ +namespace SeedPublicObject.Core; + +public interface IIsRetryableContent +{ + public bool IsRetryable { get; } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/IRequestOptions.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/IRequestOptions.cs new file mode 100644 index 00000000000..8513d17a368 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/IRequestOptions.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; + +namespace SeedPublicObject.Core; + +internal interface IRequestOptions +{ + /// + /// The Base URL for the API. + /// + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// The http client used to make requests. + /// + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// The http headers sent with the request. + /// + internal Headers Headers { get; init; } + + /// + /// Additional headers to be sent with the request. + /// Headers previously set with matching keys will be overwritten. + /// + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// The http client used to make requests. + /// + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// The timeout for the request. + /// + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// Additional query parameters sent with the request. + /// + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// Additional body properties sent with the request. + /// This is only applied to JSON requests. + /// + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/JsonAccessAttribute.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/JsonAccessAttribute.cs new file mode 100644 index 00000000000..cc7f7c22e2e --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/JsonAccessAttribute.cs @@ -0,0 +1,13 @@ +namespace SeedPublicObject.Core; + +[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] +internal class JsonAccessAttribute(JsonAccessType accessType) : Attribute +{ + internal JsonAccessType AccessType { get; init; } = accessType; +} + +internal enum JsonAccessType +{ + ReadOnly, + WriteOnly, +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/JsonConfiguration.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/JsonConfiguration.cs new file mode 100644 index 00000000000..350939cbd76 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/JsonConfiguration.cs @@ -0,0 +1,156 @@ +using global::System.Text.Json; +using global::System.Text.Json.Nodes; +using global::System.Text.Json.Serialization; +using global::System.Text.Json.Serialization.Metadata; + +namespace SeedPublicObject.Core; + +internal static partial class JsonOptions +{ + internal static readonly JsonSerializerOptions JsonSerializerOptions; + + static JsonOptions() + { + var options = new JsonSerializerOptions + { + Converters = { new DateTimeSerializer(), +#if USE_PORTABLE_DATE_ONLY + new DateOnlyConverter(), +#endif + new OneOfSerializer() }, +#if DEBUG + WriteIndented = true, +#endif + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = new DefaultJsonTypeInfoResolver + { + Modifiers = + { + static typeInfo => + { + if (typeInfo.Kind != JsonTypeInfoKind.Object) + return; + + foreach (var propertyInfo in typeInfo.Properties) + { + var jsonAccessAttribute = propertyInfo + .AttributeProvider?.GetCustomAttributes( + typeof(JsonAccessAttribute), + true + ) + .OfType() + .FirstOrDefault(); + + if (jsonAccessAttribute != null) + { + propertyInfo.IsRequired = false; + switch (jsonAccessAttribute.AccessType) + { + case JsonAccessType.ReadOnly: + propertyInfo.Get = null; + propertyInfo.ShouldSerialize = (_, _) => false; + break; + case JsonAccessType.WriteOnly: + propertyInfo.Set = null; + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + var jsonIgnoreAttribute = propertyInfo + .AttributeProvider?.GetCustomAttributes( + typeof(JsonIgnoreAttribute), + true + ) + .OfType() + .FirstOrDefault(); + + if (jsonIgnoreAttribute is not null) + { + propertyInfo.IsRequired = false; + } + } + }, + }, + }, + }; + ConfigureJsonSerializerOptions(options); + JsonSerializerOptions = options; + } + + static partial void ConfigureJsonSerializerOptions(JsonSerializerOptions defaultOptions); +} + +internal static class JsonUtils +{ + internal static string Serialize(T obj) => + JsonSerializer.Serialize(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonElement SerializeToElement(T obj) => + JsonSerializer.SerializeToElement(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonDocument SerializeToDocument(T obj) => + JsonSerializer.SerializeToDocument(obj, JsonOptions.JsonSerializerOptions); + + internal static JsonNode? SerializeToNode(T obj) => + JsonSerializer.SerializeToNode(obj, JsonOptions.JsonSerializerOptions); + + internal static byte[] SerializeToUtf8Bytes(T obj) => + JsonSerializer.SerializeToUtf8Bytes(obj, JsonOptions.JsonSerializerOptions); + + internal static string SerializeWithAdditionalProperties( + T obj, + object? additionalProperties = null + ) + { + if (additionalProperties == null) + { + return Serialize(obj); + } + var additionalPropertiesJsonNode = SerializeToNode(additionalProperties); + if (additionalPropertiesJsonNode is not JsonObject additionalPropertiesJsonObject) + { + throw new InvalidOperationException( + "The additional properties must serialize to a JSON object." + ); + } + var jsonNode = SerializeToNode(obj); + if (jsonNode is not JsonObject jsonObject) + { + throw new InvalidOperationException( + "The serialized object must be a JSON object to add properties." + ); + } + MergeJsonObjects(jsonObject, additionalPropertiesJsonObject); + return jsonObject.ToJsonString(JsonOptions.JsonSerializerOptions); + } + + private static void MergeJsonObjects(JsonObject baseObject, JsonObject overrideObject) + { + foreach (var property in overrideObject) + { + if (!baseObject.TryGetPropertyValue(property.Key, out JsonNode? existingValue)) + { + baseObject[property.Key] = + property.Value != null ? JsonNode.Parse(property.Value.ToJsonString()) : null; + continue; + } + if ( + existingValue is JsonObject nestedBaseObject + && property.Value is JsonObject nestedOverrideObject + ) + { + // If both values are objects, recursively merge them. + MergeJsonObjects(nestedBaseObject, nestedOverrideObject); + continue; + } + // Otherwise, the overrideObject takes precedence. + baseObject[property.Key] = + property.Value != null ? JsonNode.Parse(property.Value.ToJsonString()) : null; + } + } + + internal static T Deserialize(string json) => + JsonSerializer.Deserialize(json, JsonOptions.JsonSerializerOptions)!; +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/JsonRequest.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/JsonRequest.cs new file mode 100644 index 00000000000..fa2b2aed976 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/JsonRequest.cs @@ -0,0 +1,36 @@ +using System.Net.Http; + +namespace SeedPublicObject.Core; + +/// +/// The request object to be sent for JSON APIs. +/// +internal record JsonRequest : BaseRequest +{ + internal object? Body { get; init; } + + internal override HttpContent? CreateContent() + { + if (Body is null && Options?.AdditionalBodyProperties is null) + { + return null; + } + + var (encoding, charset, mediaType) = ParseContentTypeOrDefault( + ContentType, + Utf8NoBom, + "application/json" + ); + var content = new StringContent( + JsonUtils.SerializeWithAdditionalProperties(Body, Options?.AdditionalBodyProperties), + encoding, + mediaType + ); + if (string.IsNullOrEmpty(charset) && content.Headers.ContentType is not null) + { + content.Headers.ContentType.CharSet = ""; + } + + return content; + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/MultipartFormRequest.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/MultipartFormRequest.cs new file mode 100644 index 00000000000..1e7f4bc808f --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/MultipartFormRequest.cs @@ -0,0 +1,275 @@ +using System.Net.Http; +using System.Net.Http.Headers; + +namespace SeedPublicObject.Core; + +/// +/// The request object to be sent for multipart form data. +/// +internal record MultipartFormRequest : BaseRequest +{ + private readonly List> _partAdders = []; + + internal void AddJsonPart(string name, object? value) => AddJsonPart(name, value, null); + + internal void AddJsonPart(string name, object? value, string? contentType) + { + if (value is null) + { + return; + } + + _partAdders.Add(form => + { + var (encoding, charset, mediaType) = ParseContentTypeOrDefault( + contentType, + Utf8NoBom, + "application/json" + ); + var content = new StringContent(JsonUtils.Serialize(value), encoding, mediaType); + if (string.IsNullOrEmpty(charset) && content.Headers.ContentType is not null) + { + content.Headers.ContentType.CharSet = ""; + } + + form.Add(content, name); + }); + } + + internal void AddJsonParts(string name, IEnumerable? value) => + AddJsonParts(name, value, null); + + internal void AddJsonParts(string name, IEnumerable? value, string? contentType) + { + if (value is null) + { + return; + } + + foreach (var item in value) + { + AddJsonPart(name, item, contentType); + } + } + + internal void AddStringPart(string name, object? value) => AddStringPart(name, value, null); + + internal void AddStringPart(string name, object? value, string? contentType) + { + if (value is null) + { + return; + } + + AddStringPart(name, ValueConvert.ToString(value), contentType); + } + + internal void AddStringPart(string name, string? value) => AddStringPart(name, value, null); + + internal void AddStringPart(string name, string? value, string? contentType) + { + if (value is null) + { + return; + } + + _partAdders.Add(form => + { + var (encoding, charset, mediaType) = ParseContentTypeOrDefault( + contentType, + Utf8NoBom, + "text/plain" + ); + var content = new StringContent(value, encoding, mediaType); + if (string.IsNullOrEmpty(charset) && content.Headers.ContentType is not null) + { + content.Headers.ContentType.CharSet = ""; + } + + form.Add(content, name); + }); + } + + internal void AddStringParts(string name, IEnumerable? value) => + AddStringParts(name, value, null); + + internal void AddStringParts(string name, IEnumerable? value, string? contentType) + { + if (value is null) + { + return; + } + + AddStringPart(name, ValueConvert.ToString(value), contentType); + } + + internal void AddStringParts(string name, IEnumerable? value) => + AddStringParts(name, value, null); + + internal void AddStringParts(string name, IEnumerable? value, string? contentType) + { + if (value is null) + { + return; + } + + foreach (var item in value) + { + AddStringPart(name, item, contentType); + } + } + + internal void AddStreamPart(string name, Stream? stream, string? fileName) => + AddStreamPart(name, stream, fileName, null); + + internal void AddStreamPart(string name, Stream? stream, string? fileName, string? contentType) + { + if (stream is null) + { + return; + } + + _partAdders.Add(form => + { + var content = new StreamContent(stream) + { + Headers = + { + ContentType = MediaTypeHeaderValue.Parse( + contentType ?? "application/octet-stream" + ), + }, + }; + + if (fileName is not null) + { + form.Add(content, name, fileName); + } + else + { + form.Add(content, name); + } + }); + } + + internal void AddFileParameterPart(string name, FileParameter? file) => + AddFileParameterPart(name, file, null); + + internal void AddFileParameterPart( + string name, + FileParameter? file, + string? fallbackContentType + ) => + AddStreamPart(name, file?.Stream, file?.FileName, file?.ContentType ?? fallbackContentType); + + internal void AddFileParameterParts(string name, IEnumerable? files) => + AddFileParameterParts(name, files, null); + + internal void AddFileParameterParts( + string name, + IEnumerable? files, + string? fallbackContentType + ) + { + if (files is null) + { + return; + } + + foreach (var file in files) + { + AddFileParameterPart(name, file, fallbackContentType); + } + } + + internal void AddFormEncodedPart(string name, object? value) => + AddFormEncodedPart(name, value, null); + + internal void AddFormEncodedPart(string name, object? value, string? contentType) + { + if (value is null) + { + return; + } + + _partAdders.Add(form => + { + var content = FormUrlEncoder.EncodeAsForm(value); + if (!string.IsNullOrEmpty(contentType)) + { + content.Headers.ContentType = MediaTypeHeaderValue.Parse(contentType); + } + + form.Add(content, name); + }); + } + + internal void AddFormEncodedParts(string name, IEnumerable? value) => + AddFormEncodedParts(name, value, null); + + internal void AddFormEncodedParts(string name, IEnumerable? value, string? contentType) + { + if (value is null) + { + return; + } + + foreach (var item in value) + { + AddFormEncodedPart(name, item, contentType); + } + } + + internal void AddExplodedFormEncodedPart(string name, object? value) => + AddExplodedFormEncodedPart(name, value, null); + + internal void AddExplodedFormEncodedPart(string name, object? value, string? contentType) + { + if (value is null) + { + return; + } + + _partAdders.Add(form => + { + var content = FormUrlEncoder.EncodeAsExplodedForm(value); + if (!string.IsNullOrEmpty(contentType)) + { + content.Headers.ContentType = MediaTypeHeaderValue.Parse(contentType); + } + + form.Add(content, name); + }); + } + + internal void AddExplodedFormEncodedParts(string name, IEnumerable? value) => + AddExplodedFormEncodedParts(name, value, null); + + internal void AddExplodedFormEncodedParts( + string name, + IEnumerable? value, + string? contentType + ) + { + if (value is null) + { + return; + } + + foreach (var item in value) + { + AddExplodedFormEncodedPart(name, item, contentType); + } + } + + internal override HttpContent CreateContent() + { + var form = new MultipartFormDataContent(); + foreach (var adder in _partAdders) + { + adder(form); + } + + return form; + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/OneOfSerializer.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/OneOfSerializer.cs new file mode 100644 index 00000000000..777826354b6 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/OneOfSerializer.cs @@ -0,0 +1,91 @@ +using System.Reflection; +using System.Text.Json; +using System.Text.Json.Serialization; +using OneOf; + +namespace SeedPublicObject.Core; + +internal class OneOfSerializer : JsonConverter +{ + public override IOneOf? Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType is JsonTokenType.Null) + return default; + + foreach (var (type, cast) in GetOneOfTypes(typeToConvert)) + { + try + { + var readerCopy = reader; + var result = JsonSerializer.Deserialize(ref readerCopy, type, options); + reader.Skip(); + return (IOneOf)cast.Invoke(null, [result])!; + } + catch (JsonException) { } + } + + throw new JsonException( + $"Cannot deserialize into one of the supported types for {typeToConvert}" + ); + } + + public override void Write(Utf8JsonWriter writer, IOneOf value, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, value.Value, options); + } + + private static (global::System.Type type, MethodInfo cast)[] GetOneOfTypes( + global::System.Type typeToConvert + ) + { + var type = typeToConvert; + if (Nullable.GetUnderlyingType(type) is { } underlyingType) + { + type = underlyingType; + } + + var casts = type.GetRuntimeMethods() + .Where(m => m.IsSpecialName && m.Name == "op_Implicit") + .ToArray(); + while (type != null) + { + if ( + type.IsGenericType + && (type.Name.StartsWith("OneOf`") || type.Name.StartsWith("OneOfBase`")) + ) + { + var genericArguments = type.GetGenericArguments(); + if (genericArguments.Length == 1) + { + return [(genericArguments[0], casts[0])]; + } + + // if object type is present, make sure it is last + var indexOfObjectType = Array.IndexOf(genericArguments, typeof(object)); + if (indexOfObjectType != -1 && genericArguments.Length - 1 != indexOfObjectType) + { + genericArguments = genericArguments + .OrderBy(t => t == typeof(object) ? 1 : 0) + .ToArray(); + } + + return genericArguments + .Select(t => (t, casts.First(c => c.GetParameters()[0].ParameterType == t))) + .ToArray(); + } + + type = type.BaseType; + } + + throw new InvalidOperationException($"{type} isn't OneOf or OneOfBase"); + } + + public override bool CanConvert(global::System.Type typeToConvert) + { + return typeof(IOneOf).IsAssignableFrom(typeToConvert); + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/ClientOptions.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/ClientOptions.cs new file mode 100644 index 00000000000..05d0ea9a545 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/ClientOptions.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Net.Http; +using SeedPublicObject.Core; + +namespace SeedPublicObject; + +public partial class ClientOptions +{ + /// + /// The http headers sent with the request. + /// + internal Headers Headers { get; init; } = new(); + + /// + /// The Base URL for the API. + /// + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; + + /// + /// The http client used to make requests. + /// + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); + + /// + /// Additional headers to be sent with HTTP requests. + /// Headers with matching keys will be overwritten by headers set on the request. + /// + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; + + /// + /// The http client used to make requests. + /// + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; + + /// + /// The timeout for the request. + /// + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); + + /// + /// Clones this and returns a new instance + /// + internal ClientOptions Clone() + { + return new ClientOptions + { + BaseUrl = BaseUrl, + HttpClient = HttpClient, + MaxRetries = MaxRetries, + Timeout = Timeout, + Headers = new Headers(new Dictionary(Headers)), + }; + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/FileParameter.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/FileParameter.cs new file mode 100644 index 00000000000..082a2849101 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/FileParameter.cs @@ -0,0 +1,63 @@ +namespace SeedPublicObject; + +/// +/// File parameter for uploading files. +/// +public record FileParameter : IDisposable +#if NET6_0_OR_GREATER + , IAsyncDisposable +#endif +{ + private bool _disposed; + + /// + /// The name of the file to be uploaded. + /// + public string? FileName { get; set; } + + /// + /// The content type of the file to be uploaded. + /// + public string? ContentType { get; set; } + + /// + /// The content of the file to be uploaded. + /// + public required Stream Stream { get; set; } + + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + protected virtual void Dispose(bool disposing) + { + if (_disposed) + return; + if (disposing) + { + Stream.Dispose(); + } + + _disposed = true; + } + +#if NET6_0_OR_GREATER + /// + public async ValueTask DisposeAsync() + { + if (!_disposed) + { + await Stream.DisposeAsync().ConfigureAwait(false); + _disposed = true; + } + + GC.SuppressFinalize(this); + } +#endif + + public static implicit operator FileParameter(Stream stream) => new() { Stream = stream }; +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/RequestOptions.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/RequestOptions.cs new file mode 100644 index 00000000000..1ff781ac5c0 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/RequestOptions.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using SeedPublicObject.Core; + +namespace SeedPublicObject; + +public partial class RequestOptions : IRequestOptions +{ + /// + /// The http headers sent with the request. + /// + Headers IRequestOptions.Headers { get; init; } = new(); + + /// + /// The Base URL for the API. + /// + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// The http client used to make requests. + /// + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// Additional headers to be sent with the request. + /// Headers previously set with matching keys will be overwritten. + /// + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; + + /// + /// The http client used to make requests. + /// + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// The timeout for the request. + /// + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } + + /// + /// Additional query parameters sent with the request. + /// + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); + + /// + /// Additional body properties sent with the request. + /// This is only applied to JSON requests. + /// + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/SeedPublicObjectApiException.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/SeedPublicObjectApiException.cs new file mode 100644 index 00000000000..690810af3b7 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/SeedPublicObjectApiException.cs @@ -0,0 +1,18 @@ +namespace SeedPublicObject; + +/// +/// This exception type will be thrown for any non-2XX API responses. +/// +public class SeedPublicObjectApiException(string message, int statusCode, object body) + : SeedPublicObjectException(message) +{ + /// + /// The error code of the response that triggered the exception. + /// + public int StatusCode => statusCode; + + /// + /// The body of the response that triggered the exception. + /// + public object Body => body; +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/SeedPublicObjectException.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/SeedPublicObjectException.cs new file mode 100644 index 00000000000..89ea23559ae --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/SeedPublicObjectException.cs @@ -0,0 +1,9 @@ +using System; + +namespace SeedPublicObject; + +/// +/// Base exception class for all exceptions thrown by the SDK. +/// +public class SeedPublicObjectException(string message, Exception? innerException = null) + : Exception(message, innerException); diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/Version.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/Version.cs new file mode 100644 index 00000000000..abdcbb0e811 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/Public/Version.cs @@ -0,0 +1,6 @@ +namespace SeedPublicObject; + +internal class Version +{ + public const string Current = "0.0.1"; +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/QueryStringConverter.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/QueryStringConverter.cs new file mode 100644 index 00000000000..473830eb25c --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/QueryStringConverter.cs @@ -0,0 +1,229 @@ +using global::System.Text.Json; + +namespace SeedPublicObject.Core; + +/// +/// Converts an object into a query string collection. +/// +internal static class QueryStringConverter +{ + /// + /// Converts an object into a query string collection using Deep Object notation. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + /// A collection of key value pairs. The keys and values are not URL encoded. + internal static IEnumerable> ToDeepObject(object value) + { + var queryCollection = new List>(); + var json = JsonUtils.SerializeToElement(value); + AssertRootJson(json); + JsonToDeepObject(json, "", queryCollection); + return queryCollection; + } + + /// + /// Converts an object into a query string collection using Exploded Form notation. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + /// A collection of key value pairs. The keys and values are not URL encoded. + internal static IEnumerable> ToExplodedForm(object value) + { + var queryCollection = new List>(); + var json = JsonUtils.SerializeToElement(value); + AssertRootJson(json); + JsonToFormExploded(json, "", queryCollection); + return queryCollection; + } + + /// + /// Converts an object into a query string collection using Form notation without exploding parameters. + /// + /// Object to form URL-encode. You can pass in an object or dictionary, but not lists, strings, or primitives. + /// Throws when passing in a list, a string, or a primitive value. + /// A collection of key value pairs. The keys and values are not URL encoded. + internal static IEnumerable> ToForm(object value) + { + var queryCollection = new List>(); + var json = JsonUtils.SerializeToElement(value); + AssertRootJson(json); + JsonToForm(json, "", queryCollection); + return queryCollection; + } + + private static void AssertRootJson(JsonElement json) + { + switch (json.ValueKind) + { + case JsonValueKind.Object: + break; + case JsonValueKind.Array: + case JsonValueKind.Undefined: + case JsonValueKind.String: + case JsonValueKind.Number: + case JsonValueKind.True: + case JsonValueKind.False: + case JsonValueKind.Null: + default: + throw new Exception( + $"Only objects can be converted to query string collections. Given type is {json.ValueKind}." + ); + } + } + + private static void JsonToForm( + JsonElement element, + string prefix, + List> parameters + ) + { + switch (element.ValueKind) + { + case JsonValueKind.Object: + foreach (var property in element.EnumerateObject()) + { + var newPrefix = string.IsNullOrEmpty(prefix) + ? property.Name + : $"{prefix}[{property.Name}]"; + + JsonToForm(property.Value, newPrefix, parameters); + } + break; + case JsonValueKind.Array: + var arrayValues = element.EnumerateArray().Select(ValueToString).ToArray(); + parameters.Add( + new KeyValuePair(prefix, string.Join(",", arrayValues)) + ); + break; + case JsonValueKind.Null: + break; + case JsonValueKind.Undefined: + case JsonValueKind.String: + case JsonValueKind.Number: + case JsonValueKind.True: + case JsonValueKind.False: + default: + parameters.Add(new KeyValuePair(prefix, ValueToString(element))); + break; + } + } + + private static void JsonToFormExploded( + JsonElement element, + string prefix, + List> parameters + ) + { + switch (element.ValueKind) + { + case JsonValueKind.Object: + foreach (var property in element.EnumerateObject()) + { + var newPrefix = string.IsNullOrEmpty(prefix) + ? property.Name + : $"{prefix}[{property.Name}]"; + + JsonToFormExploded(property.Value, newPrefix, parameters); + } + + break; + case JsonValueKind.Array: + foreach (var item in element.EnumerateArray()) + { + if ( + item.ValueKind != JsonValueKind.Object + && item.ValueKind != JsonValueKind.Array + ) + { + parameters.Add( + new KeyValuePair(prefix, ValueToString(item)) + ); + } + else + { + JsonToFormExploded(item, prefix, parameters); + } + } + + break; + case JsonValueKind.Null: + break; + case JsonValueKind.Undefined: + case JsonValueKind.String: + case JsonValueKind.Number: + case JsonValueKind.True: + case JsonValueKind.False: + default: + parameters.Add(new KeyValuePair(prefix, ValueToString(element))); + break; + } + } + + private static void JsonToDeepObject( + JsonElement element, + string prefix, + List> parameters + ) + { + switch (element.ValueKind) + { + case JsonValueKind.Object: + foreach (var property in element.EnumerateObject()) + { + var newPrefix = string.IsNullOrEmpty(prefix) + ? property.Name + : $"{prefix}[{property.Name}]"; + + JsonToDeepObject(property.Value, newPrefix, parameters); + } + + break; + case JsonValueKind.Array: + var index = 0; + foreach (var item in element.EnumerateArray()) + { + var newPrefix = $"{prefix}[{index++}]"; + + if ( + item.ValueKind != JsonValueKind.Object + && item.ValueKind != JsonValueKind.Array + ) + { + parameters.Add( + new KeyValuePair(newPrefix, ValueToString(item)) + ); + } + else + { + JsonToDeepObject(item, newPrefix, parameters); + } + } + + break; + case JsonValueKind.Null: + break; + case JsonValueKind.Undefined: + case JsonValueKind.String: + case JsonValueKind.Number: + case JsonValueKind.True: + case JsonValueKind.False: + default: + parameters.Add(new KeyValuePair(prefix, ValueToString(element))); + break; + } + } + + private static string ValueToString(JsonElement element) + { + return element.ValueKind switch + { + JsonValueKind.String => element.GetString() ?? "", + JsonValueKind.Number => element.GetRawText(), + JsonValueKind.True => "true", + JsonValueKind.False => "false", + JsonValueKind.Null => "", + _ => element.GetRawText(), + }; + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/RawClient.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/RawClient.cs new file mode 100644 index 00000000000..0e09e607d56 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/RawClient.cs @@ -0,0 +1,409 @@ +using global::System.Net.Http; +using global::System.Net.Http.Headers; +using global::System.Text; +using SystemTask = global::System.Threading.Tasks.Task; + +namespace SeedPublicObject.Core; + +/// +/// Utility class for making raw HTTP requests to the API. +/// +internal partial class RawClient(ClientOptions clientOptions) +{ + private const int MaxRetryDelayMs = 60000; + internal int BaseRetryDelay { get; set; } = 1000; + + /// + /// The client options applied on every request. + /// + internal readonly ClientOptions Options = clientOptions; + + [Obsolete("Use SendRequestAsync instead.")] + internal Task MakeRequestAsync( + SeedPublicObject.Core.BaseRequest request, + CancellationToken cancellationToken = default + ) + { + return SendRequestAsync(request, cancellationToken); + } + + internal async Task SendRequestAsync( + SeedPublicObject.Core.BaseRequest request, + CancellationToken cancellationToken = default + ) + { + // Apply the request timeout. + var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + var timeout = request.Options?.Timeout ?? Options.Timeout; + cts.CancelAfter(timeout); + + var httpRequest = CreateHttpRequest(request); + // Send the request. + return await SendWithRetriesAsync(httpRequest, request.Options, cts.Token) + .ConfigureAwait(false); + } + + internal async Task SendRequestAsync( + HttpRequestMessage request, + IRequestOptions? options, + CancellationToken cancellationToken = default + ) + { + // Apply the request timeout. + var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + var timeout = options?.Timeout ?? Options.Timeout; + cts.CancelAfter(timeout); + + // Send the request. + return await SendWithRetriesAsync(request, options, cts.Token).ConfigureAwait(false); + } + + private static async Task CloneRequestAsync(HttpRequestMessage request) + { + var clonedRequest = new HttpRequestMessage(request.Method, request.RequestUri); + clonedRequest.Version = request.Version; + switch (request.Content) + { + case MultipartContent oldMultipartFormContent: + var originalBoundary = + oldMultipartFormContent + .Headers.ContentType?.Parameters.First(p => + p.Name.Equals("boundary", StringComparison.OrdinalIgnoreCase) + ) + .Value?.Trim('"') ?? Guid.NewGuid().ToString(); + var newMultipartContent = oldMultipartFormContent switch + { + MultipartFormDataContent => new MultipartFormDataContent(originalBoundary), + _ => new MultipartContent(), + }; + foreach (var content in oldMultipartFormContent) + { + var ms = new MemoryStream(); + await content.CopyToAsync(ms).ConfigureAwait(false); + ms.Position = 0; + var newPart = new StreamContent(ms); + foreach (var header in oldMultipartFormContent.Headers) + { + newPart.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + + newMultipartContent.Add(newPart); + } + + clonedRequest.Content = newMultipartContent; + break; + default: + clonedRequest.Content = request.Content; + break; + } + + foreach (var header in request.Headers) + { + clonedRequest.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + + return clonedRequest; + } + + /// + /// Sends the request with retries, unless the request content is not retryable, + /// such as stream requests and multipart form data with stream content. + /// + private async Task SendWithRetriesAsync( + HttpRequestMessage request, + IRequestOptions? options, + CancellationToken cancellationToken + ) + { + var httpClient = options?.HttpClient ?? Options.HttpClient; + var maxRetries = options?.MaxRetries ?? Options.MaxRetries; + var response = await httpClient.SendAsync(request, cancellationToken).ConfigureAwait(false); + var isRetryableContent = IsRetryableContent(request); + + if (!isRetryableContent) + { + return new SeedPublicObject.Core.ApiResponse + { + StatusCode = (int)response.StatusCode, + Raw = response, + }; + } + + for (var i = 0; i < maxRetries; i++) + { + if (!ShouldRetry(response)) + { + break; + } + + var delayMs = Math.Min(BaseRetryDelay * (int)Math.Pow(2, i), MaxRetryDelayMs); + await SystemTask.Delay(delayMs, cancellationToken).ConfigureAwait(false); + using var retryRequest = await CloneRequestAsync(request).ConfigureAwait(false); + response = await httpClient + .SendAsync(retryRequest, cancellationToken) + .ConfigureAwait(false); + } + + return new SeedPublicObject.Core.ApiResponse + { + StatusCode = (int)response.StatusCode, + Raw = response, + }; + } + + private static bool ShouldRetry(HttpResponseMessage response) + { + var statusCode = (int)response.StatusCode; + return statusCode is 408 or 429 or >= 500; + } + + private static bool IsRetryableContent(HttpRequestMessage request) + { + return request.Content switch + { + IIsRetryableContent c => c.IsRetryable, + StreamContent => false, + MultipartContent content => !content.Any(c => c is StreamContent), + _ => true, + }; + } + + internal HttpRequestMessage CreateHttpRequest(SeedPublicObject.Core.BaseRequest request) + { + var url = BuildUrl(request); + var httpRequest = new HttpRequestMessage(request.Method, url); + httpRequest.Content = request.CreateContent(); + var mergedHeaders = new Dictionary>(); + MergeHeaders(mergedHeaders, Options.Headers); + MergeAdditionalHeaders(mergedHeaders, Options.AdditionalHeaders); + MergeHeaders(mergedHeaders, request.Headers); + MergeHeaders(mergedHeaders, request.Options?.Headers); + + MergeAdditionalHeaders(mergedHeaders, request.Options?.AdditionalHeaders ?? []); + SetHeaders(httpRequest, mergedHeaders); + return httpRequest; + } + + private static string BuildUrl(SeedPublicObject.Core.BaseRequest request) + { + var baseUrl = request.Options?.BaseUrl ?? request.BaseUrl; + var trimmedBaseUrl = baseUrl.TrimEnd('/'); + var trimmedBasePath = request.Path.TrimStart('/'); + var url = $"{trimmedBaseUrl}/{trimmedBasePath}"; + + var queryParameters = GetQueryParameters(request); + if (!queryParameters.Any()) + return url; + + url += "?"; + url = queryParameters.Aggregate( + url, + (current, queryItem) => + { + if ( + queryItem.Value + is global::System.Collections.IEnumerable collection + and not string + ) + { + var items = collection + .Cast() + .Select(value => $"{queryItem.Key}={value}") + .ToList(); + if (items.Any()) + { + current += string.Join("&", items) + "&"; + } + } + else + { + current += $"{queryItem.Key}={queryItem.Value}&"; + } + + return current; + } + ); + url = url[..^1]; + return url; + } + + private static List> GetQueryParameters( + SeedPublicObject.Core.BaseRequest request + ) + { + var result = TransformToKeyValuePairs(request.Query); + if ( + request.Options?.AdditionalQueryParameters is null + || !request.Options.AdditionalQueryParameters.Any() + ) + { + return result; + } + + var additionalKeys = request + .Options.AdditionalQueryParameters.Select(p => p.Key) + .Distinct(); + foreach (var key in additionalKeys) + { + result.RemoveAll(kv => kv.Key == key); + } + + result.AddRange(request.Options.AdditionalQueryParameters); + return result; + } + + private static List> TransformToKeyValuePairs( + Dictionary inputDict + ) + { + var result = new List>(); + foreach (var kvp in inputDict) + { + switch (kvp.Value) + { + case string str: + result.Add(new KeyValuePair(kvp.Key, str)); + break; + case IEnumerable strList: + { + foreach (var value in strList) + { + result.Add(new KeyValuePair(kvp.Key, value)); + } + + break; + } + } + } + + return result; + } + + private static void MergeHeaders( + Dictionary> mergedHeaders, + Headers? headers + ) + { + if (headers is null) + { + return; + } + + foreach (var header in headers) + { + var value = header.Value?.Match(str => str, func => func.Invoke()); + if (value != null) + { + mergedHeaders[header.Key] = [value]; + } + } + } + + private static void MergeAdditionalHeaders( + Dictionary> mergedHeaders, + IEnumerable>? headers + ) + { + if (headers is null) + { + return; + } + + var usedKeys = new HashSet(); + foreach (var header in headers) + { + if (header.Value is null) + { + mergedHeaders.Remove(header.Key); + usedKeys.Remove(header.Key); + continue; + } + + if (usedKeys.Contains(header.Key)) + { + mergedHeaders[header.Key].Add(header.Value); + } + else + { + mergedHeaders[header.Key] = [header.Value]; + usedKeys.Add(header.Key); + } + } + } + + private void SetHeaders( + HttpRequestMessage httpRequest, + Dictionary> mergedHeaders + ) + { + foreach (var kv in mergedHeaders) + { + foreach (var header in kv.Value) + { + if (header is null) + { + continue; + } + + httpRequest.Headers.TryAddWithoutValidation(kv.Key, header); + } + } + } + + private static (Encoding encoding, string? charset, string mediaType) ParseContentTypeOrDefault( + string? contentType, + Encoding encodingFallback, + string mediaTypeFallback + ) + { + var encoding = encodingFallback; + var mediaType = mediaTypeFallback; + string? charset = null; + if (string.IsNullOrEmpty(contentType)) + { + return (encoding, charset, mediaType); + } + + if (!MediaTypeHeaderValue.TryParse(contentType, out var mediaTypeHeaderValue)) + { + return (encoding, charset, mediaType); + } + + if (!string.IsNullOrEmpty(mediaTypeHeaderValue.CharSet)) + { + charset = mediaTypeHeaderValue.CharSet; + encoding = Encoding.GetEncoding(mediaTypeHeaderValue.CharSet); + } + + if (!string.IsNullOrEmpty(mediaTypeHeaderValue.MediaType)) + { + mediaType = mediaTypeHeaderValue.MediaType; + } + + return (encoding, charset, mediaType); + } + + /// + [Obsolete("Use SeedPublicObject.Core.ApiResponse instead.")] + internal record ApiResponse : SeedPublicObject.Core.ApiResponse; + + /// + [Obsolete("Use SeedPublicObject.Core.BaseRequest instead.")] + internal abstract record BaseApiRequest : SeedPublicObject.Core.BaseRequest; + + /// + [Obsolete("Use SeedPublicObject.Core.EmptyRequest instead.")] + internal abstract record EmptyApiRequest : SeedPublicObject.Core.EmptyRequest; + + /// + [Obsolete("Use SeedPublicObject.Core.JsonRequest instead.")] + internal abstract record JsonApiRequest : SeedPublicObject.Core.JsonRequest; + + /// + [Obsolete("Use SeedPublicObject.Core.MultipartFormRequest instead.")] + internal abstract record MultipartFormRequest : SeedPublicObject.Core.MultipartFormRequest; + + /// + [Obsolete("Use SeedPublicObject.Core.StreamRequest instead.")] + internal abstract record StreamApiRequest : SeedPublicObject.Core.StreamRequest; +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/StreamRequest.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/StreamRequest.cs new file mode 100644 index 00000000000..b62c2cd5f6c --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/StreamRequest.cs @@ -0,0 +1,29 @@ +using System.Net.Http; +using System.Net.Http.Headers; + +namespace SeedPublicObject.Core; + +/// +/// The request object to be sent for streaming uploads. +/// +internal record StreamRequest : BaseRequest +{ + internal Stream? Body { get; init; } + + internal override HttpContent? CreateContent() + { + if (Body is null) + { + return null; + } + + var content = new StreamContent(Body) + { + Headers = + { + ContentType = MediaTypeHeaderValue.Parse(ContentType ?? "application/octet-stream"), + }, + }; + return content; + } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/ValueConvert.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/ValueConvert.cs new file mode 100644 index 00000000000..0f532b6b187 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Core/ValueConvert.cs @@ -0,0 +1,109 @@ +using global::System.Globalization; + +namespace SeedPublicObject.Core; + +/// +/// Convert values to string for path and query parameters. +/// +public static class ValueConvert +{ + internal static string ToPathParameterString(T value) => ToString(value); + + internal static string ToPathParameterString(bool v) => ToString(v); + + internal static string ToPathParameterString(int v) => ToString(v); + + internal static string ToPathParameterString(long v) => ToString(v); + + internal static string ToPathParameterString(float v) => ToString(v); + + internal static string ToPathParameterString(double v) => ToString(v); + + internal static string ToPathParameterString(decimal v) => ToString(v); + + internal static string ToPathParameterString(short v) => ToString(v); + + internal static string ToPathParameterString(ushort v) => ToString(v); + + internal static string ToPathParameterString(uint v) => ToString(v); + + internal static string ToPathParameterString(ulong v) => ToString(v); + + internal static string ToPathParameterString(char v) => ToString(v); + + internal static string ToPathParameterString(Guid v) => ToString(v); + + internal static string ToQueryStringValue(T value) => value is null ? "" : ToString(value); + + internal static string ToQueryStringValue(bool v) => ToString(v); + + internal static string ToQueryStringValue(int v) => ToString(v); + + internal static string ToQueryStringValue(long v) => ToString(v); + + internal static string ToQueryStringValue(float v) => ToString(v); + + internal static string ToQueryStringValue(double v) => ToString(v); + + internal static string ToQueryStringValue(decimal v) => ToString(v); + + internal static string ToQueryStringValue(short v) => ToString(v); + + internal static string ToQueryStringValue(ushort v) => ToString(v); + + internal static string ToQueryStringValue(uint v) => ToString(v); + + internal static string ToQueryStringValue(ulong v) => ToString(v); + + internal static string ToQueryStringValue(char v) => ToString(v); + + internal static string ToQueryStringValue(Guid v) => ToString(v); + + internal static string ToString(T value) + { + return value switch + { + null => "null", + string str => str, + true => "true", + false => "false", + int i => ToString(i), + long l => ToString(l), + float f => ToString(f), + double d => ToString(d), + decimal dec => ToString(dec), + short s => ToString(s), + ushort u => ToString(u), + uint u => ToString(u), + ulong u => ToString(u), + char c => ToString(c), + Guid guid => ToString(guid), + Enum e => JsonUtils.Serialize(e).Trim('"'), + _ => JsonUtils.Serialize(value).Trim('"'), + }; + } + + internal static string ToString(bool v) => v ? "true" : "false"; + + internal static string ToString(int v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(long v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(float v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(double v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(decimal v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(short v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(ushort v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(uint v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(ulong v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(char v) => v.ToString(CultureInfo.InvariantCulture); + + internal static string ToString(Guid v) => v.ToString("D"); +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/SeedPublicObject.Custom.props b/seed/csharp-sdk/public-object/src/SeedPublicObject/SeedPublicObject.Custom.props new file mode 100644 index 00000000000..70df2849401 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/SeedPublicObject.Custom.props @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/SeedPublicObject.csproj b/seed/csharp-sdk/public-object/src/SeedPublicObject/SeedPublicObject.csproj new file mode 100644 index 00000000000..8fd4b115e19 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/SeedPublicObject.csproj @@ -0,0 +1,53 @@ + + + + net462;net8.0;net7.0;net6.0;netstandard2.0 + enable + 12 + enable + 0.0.1 + $(Version) + $(Version) + README.md + https://github.com/public-object/fern + true + + + + false + + + $(DefineConstants);USE_PORTABLE_DATE_ONLY + true + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + + + + <_Parameter1>SeedPublicObject.Test + + + + + diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/SeedPublicObjectClient.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/SeedPublicObjectClient.cs new file mode 100644 index 00000000000..397ee5ee4d5 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/SeedPublicObjectClient.cs @@ -0,0 +1,33 @@ +using SeedPublicObject.Core; + +namespace SeedPublicObject; + +public partial class SeedPublicObjectClient +{ + private readonly RawClient _client; + + public SeedPublicObjectClient(ClientOptions? clientOptions = null) + { + var defaultHeaders = new Headers( + new Dictionary() + { + { "X-Fern-Language", "C#" }, + { "X-Fern-SDK-Name", "SeedPublicObject" }, + { "X-Fern-SDK-Version", Version.Current }, + { "User-Agent", "Fernpublic-object/0.0.1" }, + } + ); + clientOptions ??= new ClientOptions(); + foreach (var header in defaultHeaders) + { + if (!clientOptions.Headers.ContainsKey(header.Key)) + { + clientOptions.Headers[header.Key] = header.Value; + } + } + _client = new RawClient(clientOptions); + Service = new ServiceClient(_client); + } + + public ServiceClient Service { get; } +} diff --git a/seed/csharp-sdk/public-object/src/SeedPublicObject/Service/ServiceClient.cs b/seed/csharp-sdk/public-object/src/SeedPublicObject/Service/ServiceClient.cs new file mode 100644 index 00000000000..4d92b2b5fd7 --- /dev/null +++ b/seed/csharp-sdk/public-object/src/SeedPublicObject/Service/ServiceClient.cs @@ -0,0 +1,43 @@ +using System.Net.Http; +using System.Threading; +using global::System.Threading.Tasks; +using SeedPublicObject.Core; + +namespace SeedPublicObject; + +public partial class ServiceClient +{ + private RawClient _client; + + internal ServiceClient(RawClient client) + { + _client = client; + } + + public async global::System.Threading.Tasks.Task GetAsync( + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .SendRequestAsync( + new JsonRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = "/helloworld.txt", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + { + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + throw new SeedPublicObjectApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + } +} diff --git a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/IRequestOptions.cs b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/IRequestOptions.cs index cb86fbb6c30..0ef8b57ed2b 100644 --- a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/Public/ClientOptions.cs b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/Public/ClientOptions.cs index 5bd9b1d2504..6a43718df1e 100644 --- a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/Public/FileParameter.cs b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/Public/FileParameter.cs index 9bb9723aaea..109389b082e 100644 --- a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/Public/RequestOptions.cs b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/Public/RequestOptions.cs index bf09b16a1c0..8c619780715 100644 --- a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/SeedQueryParametersClient.cs b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/SeedQueryParametersClient.cs index 27313343236..db7d6a528e4 100644 --- a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/SeedQueryParametersClient.cs +++ b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/SeedQueryParametersClient.cs @@ -29,5 +29,5 @@ public SeedQueryParametersClient(ClientOptions? clientOptions = null) User = new UserClient(_client); } - public UserClient User { get; init; } + public UserClient User { get; } } diff --git a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/IRequestOptions.cs b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/IRequestOptions.cs index 638432126a1..f0399f74e5f 100644 --- a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/Public/ClientOptions.cs index 3e7af18da9e..d59b3bf1aba 100644 --- a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/Public/FileParameter.cs index 562d0a282f9..accc7487f9d 100644 --- a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/Public/RequestOptions.cs index 24ef1da3530..52621a4781e 100644 --- a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/SeedNurseryApiClient.cs b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/SeedNurseryApiClient.cs index ab522671bdc..ffa9669a761 100644 --- a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/SeedNurseryApiClient.cs +++ b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/SeedNurseryApiClient.cs @@ -29,5 +29,5 @@ public SeedNurseryApiClient(ClientOptions? clientOptions = null) Package = new PackageClient(_client); } - public PackageClient Package { get; init; } + public PackageClient Package { get; } } diff --git a/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/IRequestOptions.cs b/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/IRequestOptions.cs index 0bd63b8533a..0e2cb229e08 100644 --- a/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/Public/ClientOptions.cs b/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/Public/ClientOptions.cs index b7a2082886b..366dd27c481 100644 --- a/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/Public/FileParameter.cs b/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/Public/FileParameter.cs index 229713c03c9..b1e9b19a792 100644 --- a/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/Public/RequestOptions.cs b/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/Public/RequestOptions.cs index 8be97396518..6a2e91a10bc 100644 --- a/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/response-property/src/SeedResponseProperty/SeedResponsePropertyClient.cs b/seed/csharp-sdk/response-property/src/SeedResponseProperty/SeedResponsePropertyClient.cs index e8b2c02e64d..2139e36553d 100644 --- a/seed/csharp-sdk/response-property/src/SeedResponseProperty/SeedResponsePropertyClient.cs +++ b/seed/csharp-sdk/response-property/src/SeedResponseProperty/SeedResponsePropertyClient.cs @@ -29,5 +29,5 @@ public SeedResponsePropertyClient(ClientOptions? clientOptions = null) Service = new ServiceClient(_client); } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } } diff --git a/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/IRequestOptions.cs b/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/IRequestOptions.cs index 8d9c4503904..d98137e7897 100644 --- a/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/ClientOptions.cs b/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/ClientOptions.cs index dfd354002a6..c6fa0096544 100644 --- a/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/FileParameter.cs b/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/FileParameter.cs index 4177a7d4af2..654512fbc37 100644 --- a/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/RequestOptions.cs b/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/RequestOptions.cs index e0cecc75c83..fa6e49c3749 100644 --- a/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/SeedServerSentEventsClient.cs b/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/SeedServerSentEventsClient.cs index d7722d72572..aea950d6a00 100644 --- a/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/SeedServerSentEventsClient.cs +++ b/seed/csharp-sdk/server-sent-event-examples/src/SeedServerSentEvents/SeedServerSentEventsClient.cs @@ -29,5 +29,5 @@ public SeedServerSentEventsClient(ClientOptions? clientOptions = null) Completions = new CompletionsClient(_client); } - public CompletionsClient Completions { get; init; } + public CompletionsClient Completions { get; } } diff --git a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/IRequestOptions.cs b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/IRequestOptions.cs index 8d9c4503904..d98137e7897 100644 --- a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/Public/ClientOptions.cs b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/Public/ClientOptions.cs index dfd354002a6..c6fa0096544 100644 --- a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/Public/FileParameter.cs b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/Public/FileParameter.cs index 4177a7d4af2..654512fbc37 100644 --- a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/Public/RequestOptions.cs b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/Public/RequestOptions.cs index e0cecc75c83..fa6e49c3749 100644 --- a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/SeedServerSentEventsClient.cs b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/SeedServerSentEventsClient.cs index 8591d33885f..46ff1baedff 100644 --- a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/SeedServerSentEventsClient.cs +++ b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/SeedServerSentEventsClient.cs @@ -29,5 +29,5 @@ public SeedServerSentEventsClient(ClientOptions? clientOptions = null) Completions = new CompletionsClient(_client); } - public CompletionsClient Completions { get; init; } + public CompletionsClient Completions { get; } } diff --git a/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/IRequestOptions.cs b/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/IRequestOptions.cs index ac60bfd5a10..aae1be9fa10 100644 --- a/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/Public/ClientOptions.cs b/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/Public/ClientOptions.cs index 7de8ff27f53..a5328968c05 100644 --- a/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/Public/FileParameter.cs b/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/Public/FileParameter.cs index 97e498c91c9..f33d4902888 100644 --- a/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/Public/RequestOptions.cs b/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/Public/RequestOptions.cs index 4780fbf549e..c43b906e7e3 100644 --- a/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/simple-fhir/src/SeedApi/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/IRequestOptions.cs b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/IRequestOptions.cs index 096020efb2f..7f78b653ac3 100644 --- a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/ClientOptions.cs b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/ClientOptions.cs index 3eabafb86cb..655afaa11c4 100644 --- a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = SeedSingleUrlEnvironmentDefaultEnvironment.Production; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = SeedSingleUrlEnvironmentDefaultEnvironment.Production; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/FileParameter.cs b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/FileParameter.cs index 034b2390f26..5b30c308735 100644 --- a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/RequestOptions.cs b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/RequestOptions.cs index 8087802cfb6..19f1dc86ebc 100644 --- a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/SeedSingleUrlEnvironmentDefaultClient.cs b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/SeedSingleUrlEnvironmentDefaultClient.cs index 1d8b728a9ff..cd177a64a42 100644 --- a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/SeedSingleUrlEnvironmentDefaultClient.cs +++ b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/SeedSingleUrlEnvironmentDefaultClient.cs @@ -33,5 +33,5 @@ public SeedSingleUrlEnvironmentDefaultClient( Dummy = new DummyClient(_client); } - public DummyClient Dummy { get; init; } + public DummyClient Dummy { get; } } diff --git a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/IRequestOptions.cs b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/IRequestOptions.cs index 87b84e8a6dc..f4f11a1599c 100644 --- a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/ClientOptions.cs b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/ClientOptions.cs index e7d78a09532..5edcd73d97b 100644 --- a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/FileParameter.cs b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/FileParameter.cs index e3d23ca026b..07f686d53a4 100644 --- a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/RequestOptions.cs b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/RequestOptions.cs index 1e7c55dd490..e2e4bdb542a 100644 --- a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/SeedSingleUrlEnvironmentNoDefaultClient.cs b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/SeedSingleUrlEnvironmentNoDefaultClient.cs index 10da9f71a74..962554426b8 100644 --- a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/SeedSingleUrlEnvironmentNoDefaultClient.cs +++ b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/SeedSingleUrlEnvironmentNoDefaultClient.cs @@ -33,5 +33,5 @@ public SeedSingleUrlEnvironmentNoDefaultClient( Dummy = new DummyClient(_client); } - public DummyClient Dummy { get; init; } + public DummyClient Dummy { get; } } diff --git a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/IRequestOptions.cs b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/IRequestOptions.cs index 9afa0e44597..56d3a061d15 100644 --- a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/Public/ClientOptions.cs b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/Public/ClientOptions.cs index 0ca1b4b1452..8ef1aa4fb1f 100644 --- a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/Public/FileParameter.cs b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/Public/FileParameter.cs index 74138df79bb..49bf6113e62 100644 --- a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/Public/RequestOptions.cs b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/Public/RequestOptions.cs index 4d7186f03ee..9dc5841ce1b 100644 --- a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/SeedStreamingClient.cs b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/SeedStreamingClient.cs index d3602a61960..bf6c0072192 100644 --- a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/SeedStreamingClient.cs +++ b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/SeedStreamingClient.cs @@ -29,5 +29,5 @@ public SeedStreamingClient(ClientOptions? clientOptions = null) Dummy = new DummyClient(_client); } - public DummyClient Dummy { get; init; } + public DummyClient Dummy { get; } } diff --git a/seed/csharp-sdk/streaming/src/SeedStreaming/Core/IRequestOptions.cs b/seed/csharp-sdk/streaming/src/SeedStreaming/Core/IRequestOptions.cs index 9afa0e44597..56d3a061d15 100644 --- a/seed/csharp-sdk/streaming/src/SeedStreaming/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/streaming/src/SeedStreaming/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/streaming/src/SeedStreaming/Core/Public/ClientOptions.cs b/seed/csharp-sdk/streaming/src/SeedStreaming/Core/Public/ClientOptions.cs index 0ca1b4b1452..8ef1aa4fb1f 100644 --- a/seed/csharp-sdk/streaming/src/SeedStreaming/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/streaming/src/SeedStreaming/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/streaming/src/SeedStreaming/Core/Public/FileParameter.cs b/seed/csharp-sdk/streaming/src/SeedStreaming/Core/Public/FileParameter.cs index 74138df79bb..49bf6113e62 100644 --- a/seed/csharp-sdk/streaming/src/SeedStreaming/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/streaming/src/SeedStreaming/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/streaming/src/SeedStreaming/Core/Public/RequestOptions.cs b/seed/csharp-sdk/streaming/src/SeedStreaming/Core/Public/RequestOptions.cs index 4d7186f03ee..9dc5841ce1b 100644 --- a/seed/csharp-sdk/streaming/src/SeedStreaming/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/streaming/src/SeedStreaming/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/streaming/src/SeedStreaming/SeedStreamingClient.cs b/seed/csharp-sdk/streaming/src/SeedStreaming/SeedStreamingClient.cs index 38d7d5eab67..03f267f3031 100644 --- a/seed/csharp-sdk/streaming/src/SeedStreaming/SeedStreamingClient.cs +++ b/seed/csharp-sdk/streaming/src/SeedStreaming/SeedStreamingClient.cs @@ -29,5 +29,5 @@ public SeedStreamingClient(ClientOptions? clientOptions = null) Dummy = new DummyClient(_client); } - public DummyClient Dummy { get; init; } + public DummyClient Dummy { get; } } diff --git a/seed/csharp-sdk/trace/src/SeedTrace/Core/IRequestOptions.cs b/seed/csharp-sdk/trace/src/SeedTrace/Core/IRequestOptions.cs index dc9386fc0de..1649aaaabcc 100644 --- a/seed/csharp-sdk/trace/src/SeedTrace/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/trace/src/SeedTrace/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -28,17 +40,35 @@ internal interface IRequestOptions public IEnumerable> AdditionalHeaders { get; init; } + >> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. @@ -46,11 +76,23 @@ public IEnumerable> AdditionalQueryParameters { get; init; } + >> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/trace/src/SeedTrace/Core/Public/ClientOptions.cs b/seed/csharp-sdk/trace/src/SeedTrace/Core/Public/ClientOptions.cs index 41feddb99cc..c24e2abeb8d 100644 --- a/seed/csharp-sdk/trace/src/SeedTrace/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/trace/src/SeedTrace/Core/Public/ClientOptions.cs @@ -15,12 +15,24 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = SeedTraceEnvironment.Prod; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = SeedTraceEnvironment.Prod; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. @@ -29,17 +41,35 @@ public partial class ClientOptions public IEnumerable> AdditionalHeaders { get; init; } = []; + >> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/trace/src/SeedTrace/Core/Public/FileParameter.cs b/seed/csharp-sdk/trace/src/SeedTrace/Core/Public/FileParameter.cs index 5adc1a40721..ec7bef1d2ff 100644 --- a/seed/csharp-sdk/trace/src/SeedTrace/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/trace/src/SeedTrace/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/trace/src/SeedTrace/Core/Public/RequestOptions.cs b/seed/csharp-sdk/trace/src/SeedTrace/Core/Public/RequestOptions.cs index bd22533dec6..51e0204df2b 100644 --- a/seed/csharp-sdk/trace/src/SeedTrace/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/trace/src/SeedTrace/Core/Public/RequestOptions.cs @@ -16,12 +16,24 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. @@ -30,17 +42,35 @@ public partial class RequestOptions : IRequestOptions public IEnumerable> AdditionalHeaders { get; init; } = []; + >> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. @@ -48,12 +78,23 @@ public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + >> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/trace/src/SeedTrace/SeedTraceClient.cs b/seed/csharp-sdk/trace/src/SeedTrace/SeedTraceClient.cs index 1a4a47db4c5..2e0ee16a8ae 100644 --- a/seed/csharp-sdk/trace/src/SeedTrace/SeedTraceClient.cs +++ b/seed/csharp-sdk/trace/src/SeedTrace/SeedTraceClient.cs @@ -45,23 +45,23 @@ public SeedTraceClient( Sysprop = new SyspropClient(_client); } - public V2Client V2 { get; init; } + public V2Client V2 { get; } - public AdminClient Admin { get; init; } + public AdminClient Admin { get; } - public CommonsClient Commons { get; init; } + public CommonsClient Commons { get; } - public HomepageClient Homepage { get; init; } + public HomepageClient Homepage { get; } - public LangServerClient LangServer { get; init; } + public LangServerClient LangServer { get; } - public MigrationClient Migration { get; init; } + public MigrationClient Migration { get; } - public PlaylistClient Playlist { get; init; } + public PlaylistClient Playlist { get; } - public ProblemClient Problem { get; init; } + public ProblemClient Problem { get; } - public SubmissionClient Submission { get; init; } + public SubmissionClient Submission { get; } - public SyspropClient Sysprop { get; init; } + public SyspropClient Sysprop { get; } } diff --git a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/IRequestOptions.cs b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/IRequestOptions.cs index 2e7c311a29e..3c9e7258c85 100644 --- a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/ClientOptions.cs b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/ClientOptions.cs index fdc9e328324..e564d881ed5 100644 --- a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/FileParameter.cs b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/FileParameter.cs index 84b272e7327..d0b0ee987f9 100644 --- a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/RequestOptions.cs b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/RequestOptions.cs index 7c12564c33e..8e2d2082b93 100644 --- a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/SeedUndiscriminatedUnionsClient.cs b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/SeedUndiscriminatedUnionsClient.cs index 7f0ce98e4b1..d41f7412d7f 100644 --- a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/SeedUndiscriminatedUnionsClient.cs +++ b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/SeedUndiscriminatedUnionsClient.cs @@ -29,5 +29,5 @@ public SeedUndiscriminatedUnionsClient(ClientOptions? clientOptions = null) Union = new UnionClient(_client); } - public UnionClient Union { get; init; } + public UnionClient Union { get; } } diff --git a/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/IRequestOptions.cs b/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/IRequestOptions.cs index a123349b68e..2b08c318311 100644 --- a/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/Public/ClientOptions.cs b/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/Public/ClientOptions.cs index 6cb6ac0ad23..ec5d5804267 100644 --- a/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/Public/FileParameter.cs b/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/Public/FileParameter.cs index 5dd91ab2030..c1346d1db89 100644 --- a/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/Public/RequestOptions.cs b/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/Public/RequestOptions.cs index 6218b50b7ee..ae023692283 100644 --- a/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/SeedUnionsClient.cs b/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/SeedUnionsClient.cs index 991aab010e2..fe479b58fd1 100644 --- a/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/SeedUnionsClient.cs +++ b/seed/csharp-sdk/unions/no-custom-config/src/SeedUnions/SeedUnionsClient.cs @@ -31,9 +31,9 @@ public SeedUnionsClient(ClientOptions? clientOptions = null) Union = new UnionClient(_client); } - public BigunionClient Bigunion { get; init; } + public BigunionClient Bigunion { get; } - public TypesClient Types { get; init; } + public TypesClient Types { get; } - public UnionClient Union { get; init; } + public UnionClient Union { get; } } diff --git a/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/IRequestOptions.cs b/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/IRequestOptions.cs index a123349b68e..2b08c318311 100644 --- a/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/Public/ClientOptions.cs b/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/Public/ClientOptions.cs index 6cb6ac0ad23..ec5d5804267 100644 --- a/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/Public/FileParameter.cs b/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/Public/FileParameter.cs index 5dd91ab2030..c1346d1db89 100644 --- a/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/Public/RequestOptions.cs b/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/Public/RequestOptions.cs index 6218b50b7ee..ae023692283 100644 --- a/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/SeedUnionsClient.cs b/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/SeedUnionsClient.cs index 991aab010e2..fe479b58fd1 100644 --- a/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/SeedUnionsClient.cs +++ b/seed/csharp-sdk/unions/use-discriminated-unions/src/SeedUnions/SeedUnionsClient.cs @@ -31,9 +31,9 @@ public SeedUnionsClient(ClientOptions? clientOptions = null) Union = new UnionClient(_client); } - public BigunionClient Bigunion { get; init; } + public BigunionClient Bigunion { get; } - public TypesClient Types { get; init; } + public TypesClient Types { get; } - public UnionClient Union { get; init; } + public UnionClient Union { get; } } diff --git a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/IRequestOptions.cs b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/IRequestOptions.cs index d748bc6c4c9..383d4f417ae 100644 --- a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/Public/ClientOptions.cs b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/Public/ClientOptions.cs index 5b14d0baaee..611fa85fb20 100644 --- a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/Public/FileParameter.cs b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/Public/FileParameter.cs index de16420e580..c69b07d6da0 100644 --- a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/Public/RequestOptions.cs b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/Public/RequestOptions.cs index a477e204678..ec97da47dbb 100644 --- a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/SeedUnknownAsAnyClient.cs b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/SeedUnknownAsAnyClient.cs index 43370189655..ab8ad1ae96f 100644 --- a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/SeedUnknownAsAnyClient.cs +++ b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/SeedUnknownAsAnyClient.cs @@ -29,5 +29,5 @@ public SeedUnknownAsAnyClient(ClientOptions? clientOptions = null) Unknown = new UnknownClient(_client); } - public UnknownClient Unknown { get; init; } + public UnknownClient Unknown { get; } } diff --git a/seed/csharp-sdk/validation/src/SeedValidation/Core/IRequestOptions.cs b/seed/csharp-sdk/validation/src/SeedValidation/Core/IRequestOptions.cs index c9c8ab7c410..dd4611d384c 100644 --- a/seed/csharp-sdk/validation/src/SeedValidation/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/validation/src/SeedValidation/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/validation/src/SeedValidation/Core/Public/ClientOptions.cs b/seed/csharp-sdk/validation/src/SeedValidation/Core/Public/ClientOptions.cs index 6b46b37dbb0..b25cfdf3fb3 100644 --- a/seed/csharp-sdk/validation/src/SeedValidation/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/validation/src/SeedValidation/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/validation/src/SeedValidation/Core/Public/FileParameter.cs b/seed/csharp-sdk/validation/src/SeedValidation/Core/Public/FileParameter.cs index 5c6a4009c81..f214f823728 100644 --- a/seed/csharp-sdk/validation/src/SeedValidation/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/validation/src/SeedValidation/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/validation/src/SeedValidation/Core/Public/RequestOptions.cs b/seed/csharp-sdk/validation/src/SeedValidation/Core/Public/RequestOptions.cs index 314b767e87a..ef54f73809f 100644 --- a/seed/csharp-sdk/validation/src/SeedValidation/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/validation/src/SeedValidation/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/variables/src/SeedVariables/Core/IRequestOptions.cs b/seed/csharp-sdk/variables/src/SeedVariables/Core/IRequestOptions.cs index 3b67bfaf710..8f4c2bc25b4 100644 --- a/seed/csharp-sdk/variables/src/SeedVariables/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/variables/src/SeedVariables/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/variables/src/SeedVariables/Core/Public/ClientOptions.cs b/seed/csharp-sdk/variables/src/SeedVariables/Core/Public/ClientOptions.cs index f6e22b4d6b6..61a5561d960 100644 --- a/seed/csharp-sdk/variables/src/SeedVariables/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/variables/src/SeedVariables/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/variables/src/SeedVariables/Core/Public/FileParameter.cs b/seed/csharp-sdk/variables/src/SeedVariables/Core/Public/FileParameter.cs index 361655b36a0..82c393de713 100644 --- a/seed/csharp-sdk/variables/src/SeedVariables/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/variables/src/SeedVariables/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/variables/src/SeedVariables/Core/Public/RequestOptions.cs b/seed/csharp-sdk/variables/src/SeedVariables/Core/Public/RequestOptions.cs index 29b49160c37..d5f309aae26 100644 --- a/seed/csharp-sdk/variables/src/SeedVariables/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/variables/src/SeedVariables/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/variables/src/SeedVariables/SeedVariablesClient.cs b/seed/csharp-sdk/variables/src/SeedVariables/SeedVariablesClient.cs index f677660dcc1..89118f8b7e0 100644 --- a/seed/csharp-sdk/variables/src/SeedVariables/SeedVariablesClient.cs +++ b/seed/csharp-sdk/variables/src/SeedVariables/SeedVariablesClient.cs @@ -29,5 +29,5 @@ public SeedVariablesClient(ClientOptions? clientOptions = null) Service = new ServiceClient(_client); } - public ServiceClient Service { get; init; } + public ServiceClient Service { get; } } diff --git a/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/IRequestOptions.cs b/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/IRequestOptions.cs index 2a1064b029b..b697e2add50 100644 --- a/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/Public/ClientOptions.cs b/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/Public/ClientOptions.cs index 0e06bd93f40..78e10d04257 100644 --- a/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/Public/FileParameter.cs b/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/Public/FileParameter.cs index 0f712ceacd5..6dc794aeac5 100644 --- a/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/Public/RequestOptions.cs b/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/Public/RequestOptions.cs index 46b12db6ee6..dd749a2dced 100644 --- a/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/version-no-default/src/SeedVersion/SeedVersionClient.cs b/seed/csharp-sdk/version-no-default/src/SeedVersion/SeedVersionClient.cs index feb6e9dd277..f9dbfbadec1 100644 --- a/seed/csharp-sdk/version-no-default/src/SeedVersion/SeedVersionClient.cs +++ b/seed/csharp-sdk/version-no-default/src/SeedVersion/SeedVersionClient.cs @@ -29,5 +29,5 @@ public SeedVersionClient(ClientOptions? clientOptions = null) User = new UserClient(_client); } - public UserClient User { get; init; } + public UserClient User { get; } } diff --git a/seed/csharp-sdk/version/src/SeedVersion/Core/IRequestOptions.cs b/seed/csharp-sdk/version/src/SeedVersion/Core/IRequestOptions.cs index 2a1064b029b..b697e2add50 100644 --- a/seed/csharp-sdk/version/src/SeedVersion/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/version/src/SeedVersion/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/version/src/SeedVersion/Core/Public/ClientOptions.cs b/seed/csharp-sdk/version/src/SeedVersion/Core/Public/ClientOptions.cs index 0e06bd93f40..78e10d04257 100644 --- a/seed/csharp-sdk/version/src/SeedVersion/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/version/src/SeedVersion/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/version/src/SeedVersion/Core/Public/FileParameter.cs b/seed/csharp-sdk/version/src/SeedVersion/Core/Public/FileParameter.cs index 0f712ceacd5..6dc794aeac5 100644 --- a/seed/csharp-sdk/version/src/SeedVersion/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/version/src/SeedVersion/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/version/src/SeedVersion/Core/Public/RequestOptions.cs b/seed/csharp-sdk/version/src/SeedVersion/Core/Public/RequestOptions.cs index 46b12db6ee6..dd749a2dced 100644 --- a/seed/csharp-sdk/version/src/SeedVersion/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/version/src/SeedVersion/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/version/src/SeedVersion/SeedVersionClient.cs b/seed/csharp-sdk/version/src/SeedVersion/SeedVersionClient.cs index 2e61a39773a..6ded9433e8f 100644 --- a/seed/csharp-sdk/version/src/SeedVersion/SeedVersionClient.cs +++ b/seed/csharp-sdk/version/src/SeedVersion/SeedVersionClient.cs @@ -29,5 +29,5 @@ public SeedVersionClient(ClientOptions? clientOptions = null) User = new UserClient(_client); } - public UserClient User { get; init; } + public UserClient User { get; } } diff --git a/seed/csharp-sdk/websocket/.mock/definition/realtime.yml b/seed/csharp-sdk/websocket/.mock/definition/realtime.yml index ddee9418b74..54f5e7b172f 100644 --- a/seed/csharp-sdk/websocket/.mock/definition/realtime.yml +++ b/seed/csharp-sdk/websocket/.mock/definition/realtime.yml @@ -6,31 +6,69 @@ channel: path-parameters: id: string query-parameters: - model: optional + model: optional temperature: optional messages: send: - display-name: "Send" + display-name: Send origin: client - body: string - + body: SendEvent + send2: + display-name: Send2 + origin: client + body: SendEvent2 receive: - display-name: "Receive" + display-name: Receive origin: server - body: - name: ReceiveEvent - properties: - text: string - + body: ReceiveEvent + receive2: + display-name: Receive2 + origin: server + body: ReceiveEvent2 + receive3: + display-name: Receive3 + origin: server + body: ReceiveEvent3 examples: - name: Default example path-parameters: id: doc_123 messages: - type: send - body: "uvxcdv12344412b" + body: + sendText: "uvxcdv12344412b" + sendParam: 123 - type: receive body: - text: "The weather for today..." - - type: send - body: "uvxcdv12344412b" + alpha: "The weather for today..." + beta: 123 + - type: send2 + body: + sendText2: "uvxcdv12344412b" + sendParam2: true + - type: receive2 + body: + gamma: "The weather for today..." + delta: 123 + epsilon: true +types: + SendEvent: + properties: + sendText: string + sendParam: integer + ReceiveEvent: + properties: + alpha: string + beta: integer + SendEvent2: + properties: + sendText2: string + sendParam2: boolean + ReceiveEvent2: + properties: + gamma: string + delta: integer + epsilon: boolean + ReceiveEvent3: + properties: + receiveText3: string diff --git a/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/IRequestOptions.cs b/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/IRequestOptions.cs index af5634c14e1..fe548f37368 100644 --- a/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/IRequestOptions.cs +++ b/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/IRequestOptions.cs @@ -9,12 +9,24 @@ internal interface IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http headers sent with the request. @@ -25,26 +37,56 @@ internal interface IRequestOptions /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/Public/ClientOptions.cs b/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/Public/ClientOptions.cs index 8c9ce8b9ef0..4337e04098f 100644 --- a/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/Public/ClientOptions.cs +++ b/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/Public/ClientOptions.cs @@ -15,28 +15,58 @@ public partial class ClientOptions /// /// The Base URL for the API. /// - public string BaseUrl { get; init; } = ""; + public string BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = ""; /// /// The http client used to make requests. /// - public HttpClient HttpClient { get; init; } = new HttpClient(); + public HttpClient HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = new HttpClient(); /// /// Additional headers to be sent with HTTP requests. /// Headers with matching keys will be overwritten by headers set on the request. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int MaxRetries { get; init; } = 2; + public int MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = 2; /// /// The timeout for the request. /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); + public TimeSpan Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = TimeSpan.FromSeconds(30); /// /// Clones this and returns a new instance diff --git a/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/Public/FileParameter.cs b/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/Public/FileParameter.cs index 80299a3bca4..37ed174f5fb 100644 --- a/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/Public/FileParameter.cs +++ b/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/Public/FileParameter.cs @@ -13,17 +13,17 @@ public record FileParameter : IDisposable /// /// The name of the file to be uploaded. /// - public string? FileName { get; init; } + public string? FileName { get; set; } /// /// The content type of the file to be uploaded. /// - public string? ContentType { get; init; } + public string? ContentType { get; set; } /// /// The content of the file to be uploaded. /// - public required Stream Stream { get; init; } + public required Stream Stream { get; set; } /// public void Dispose() diff --git a/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/Public/RequestOptions.cs b/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/Public/RequestOptions.cs index 2c29a3e0799..79183497566 100644 --- a/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/Public/RequestOptions.cs +++ b/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/Public/RequestOptions.cs @@ -16,38 +16,79 @@ public partial class RequestOptions : IRequestOptions /// /// The Base URL for the API. /// - public string? BaseUrl { get; init; } + public string? BaseUrl { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The http client used to make requests. /// - public HttpClient? HttpClient { get; init; } + public HttpClient? HttpClient { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional headers to be sent with the request. /// Headers previously set with matching keys will be overwritten. /// - public IEnumerable> AdditionalHeaders { get; init; } = []; + public IEnumerable> AdditionalHeaders { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = []; /// /// The http client used to make requests. /// - public int? MaxRetries { get; init; } + public int? MaxRetries { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// The timeout for the request. /// - public TimeSpan? Timeout { get; init; } + public TimeSpan? Timeout { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } /// /// Additional query parameters sent with the request. /// - public IEnumerable> AdditionalQueryParameters { get; init; } = - Enumerable.Empty>(); + public IEnumerable> AdditionalQueryParameters { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } = Enumerable.Empty>(); /// /// Additional body properties sent with the request. /// This is only applied to JSON requests. /// - public object? AdditionalBodyProperties { get; init; } + public object? AdditionalBodyProperties { get; +#if NET5_0_OR_GREATER + init; +#else + set; +#endif + } } diff --git a/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/ReceiveEvent.cs b/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/ReceiveEvent.cs new file mode 100644 index 00000000000..7a89cccb9e5 --- /dev/null +++ b/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/ReceiveEvent.cs @@ -0,0 +1,27 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using SeedWebsocket.Core; + +namespace SeedWebsocket; + +public record ReceiveEvent +{ + [JsonPropertyName("alpha")] + public required string Alpha { get; set; } + + [JsonPropertyName("beta")] + public required int Beta { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/ReceiveEvent2.cs b/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/ReceiveEvent2.cs new file mode 100644 index 00000000000..9564716b907 --- /dev/null +++ b/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/ReceiveEvent2.cs @@ -0,0 +1,30 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using SeedWebsocket.Core; + +namespace SeedWebsocket; + +public record ReceiveEvent2 +{ + [JsonPropertyName("gamma")] + public required string Gamma { get; set; } + + [JsonPropertyName("delta")] + public required int Delta { get; set; } + + [JsonPropertyName("epsilon")] + public required bool Epsilon { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/ReceiveEvent3.cs b/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/ReceiveEvent3.cs new file mode 100644 index 00000000000..ddb63c26d6f --- /dev/null +++ b/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/ReceiveEvent3.cs @@ -0,0 +1,24 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using SeedWebsocket.Core; + +namespace SeedWebsocket; + +public record ReceiveEvent3 +{ + [JsonPropertyName("receiveText3")] + public required string ReceiveText3 { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/SendEvent.cs b/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/SendEvent.cs new file mode 100644 index 00000000000..ca3f7b0e3fd --- /dev/null +++ b/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/SendEvent.cs @@ -0,0 +1,27 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using SeedWebsocket.Core; + +namespace SeedWebsocket; + +public record SendEvent +{ + [JsonPropertyName("sendText")] + public required string SendText { get; set; } + + [JsonPropertyName("sendParam")] + public required int SendParam { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/SendEvent2.cs b/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/SendEvent2.cs new file mode 100644 index 00000000000..392b9f5ab6c --- /dev/null +++ b/seed/csharp-sdk/websocket/src/SeedWebsocket/Realtime/Types/SendEvent2.cs @@ -0,0 +1,27 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using SeedWebsocket.Core; + +namespace SeedWebsocket; + +public record SendEvent2 +{ + [JsonPropertyName("sendText2")] + public required string SendText2 { get; set; } + + [JsonPropertyName("sendParam2")] + public required bool SendParam2 { get; set; } + + /// + /// Additional properties received from the response, if any. + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; internal set; } = + new Dictionary(); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/websocket/src/SeedWebsocket/SeedWebsocketClient.cs b/seed/csharp-sdk/websocket/src/SeedWebsocket/SeedWebsocketClient.cs index 90ec072cc93..292f086962c 100644 --- a/seed/csharp-sdk/websocket/src/SeedWebsocket/SeedWebsocketClient.cs +++ b/seed/csharp-sdk/websocket/src/SeedWebsocket/SeedWebsocketClient.cs @@ -29,5 +29,5 @@ public SeedWebsocketClient(ClientOptions? clientOptions = null) Realtime = new RealtimeClient(_client); } - public RealtimeClient Realtime { get; init; } + public RealtimeClient Realtime { get; } }