From 9c06e8e5c204006202badf9f877dd0e44a8fd787 Mon Sep 17 00:00:00 2001 From: Niels Swimberghe <3382717+Swimburger@users.noreply.github.com> Date: Thu, 12 Dec 2024 08:02:22 -0500 Subject: [PATCH 1/6] fix(seed): Make inline types and inline schemas test definition TypeScript exclusive (#5391) * Make inline types and inline schemas test definition TypeScript exclusive --- .../type__AliasOptionalInline.json | 28 - .../inline-types/type__InlineEnum.json | 10 - .../inline-types/type__InlineType1.json | 47 - .../inline-types/type__InlineType2.json | 13 - .../type__InlinedDiscriminatedUnion1.json | 80 - .../type__InlinedUndiscriminatedUnion1.json | 69 - .../inline-types/type__MixedInlineType1.json | 17 - .../inline-types/type__NestedInlineType1.json | 31 - .../inline-types/type__RootType2.json | 34 - .../type__AliasInlineValue.json | 0 .../type__AliasListInline.json | 0 .../type__AliasMapInline.json | 0 .../type__AliasSetInline.json | 0 .../type__DiscriminatedUnion1.json | 0 .../type__DiscriminatedUnion1InlineType1.json | 0 ...riminatedUnion1InlineType1InlineType1.json | 0 .../type__DiscriminatedUnion1InlineType2.json | 0 .../type__InlineEnum1.json | 0 .../type__ReferenceType.json | 0 .../type__RequestTypeInlineType1.json | 0 .../type__RootType1.json | 0 .../type__RootType1FooListItem.json | 0 .../type__RootType1FooMapValue.json | 0 .../type__RootType1FooSetItem.json | 0 .../type__RootType1InlineType1.json | 0 ...RootType1InlineType1NestedInlineType1.json | 0 .../type__UndiscriminatedUnion1.json | 0 ...iscriminatedUnion1DiscriminatedUnion1.json | 0 ...dUnion1DiscriminatedUnion1InlineType1.json | 0 ...riminatedUnion1InlineType1InlineType1.json | 0 ...dUnion1DiscriminatedUnion1InlineType2.json | 0 ...ype__UndiscriminatedUnion1InlineEnum1.json | 0 ..._UndiscriminatedUnion1InlineListItem1.json | 0 ...__UndiscriminatedUnion1InlineMapItem1.json | 0 ...__UndiscriminatedUnion1InlineSetItem1.json | 0 ...ype__UndiscriminatedUnion1InlineType1.json | 0 ...riminatedUnion1InlineType1InlineType1.json | 0 ...ype__UndiscriminatedUnion1InlineType2.json | 0 .../type__UserId.json | 0 ...inline-types.json => ts-inline-types.json} | 0 .../test-definitions/inline-types.json | 3316 ------------- ...inline-types.json => ts-inline-types.json} | 0 .../inline-types/.github/workflows/ci.yml | 69 - seed/csharp-model/inline-types/.gitignore | 484 -- .../.mock/definition/__package__.yml | 61 - .../inline-types/snippet-templates.json | 0 seed/csharp-model/inline-types/snippet.json | 0 .../Core/EnumSerializerTests.cs | 61 - .../SeedObject.Test.Custom.props | 7 - .../SeedObject.Test/SeedObject.Test.csproj | 33 - .../inline-types/src/SeedObject.sln | 28 - .../Core/CollectionItemSerializer.cs | 91 - .../src/SeedObject/Core/Constants.cs | 7 - .../src/SeedObject/Core/DateTimeSerializer.cs | 22 - .../src/SeedObject/Core/EnumSerializer.cs | 53 - .../src/SeedObject/Core/JsonConfiguration.cs | 36 - .../src/SeedObject/Core/OneOfSerializer.cs | 69 - .../src/SeedObject/Core/Public/Version.cs | 6 - .../inline-types/src/SeedObject/InlineEnum.cs | 23 - .../src/SeedObject/InlineType1.cs | 20 - .../src/SeedObject/InlineType2.cs | 17 - .../src/SeedObject/NestedInlineType1.cs | 23 - .../inline-types/src/SeedObject/RootType1.cs | 20 - .../src/SeedObject/SeedObject.Custom.props | 20 - .../src/SeedObject/SeedObject.csproj | 44 - .../inline-types/.github/workflows/ci.yml | 69 - seed/csharp-sdk/inline-types/.gitignore | 484 -- .../.mock/definition/__package__.yml | 61 - seed/csharp-sdk/inline-types/README.md | 102 - seed/csharp-sdk/inline-types/reference.md | 55 - .../inline-types/snippet-templates.json | 0 seed/csharp-sdk/inline-types/snippet.json | 17 - .../Core/EnumSerializerTests.cs | 61 - .../SeedObject.Test/Core/RawClientTests.cs | 113 - .../SeedObject.Test.Custom.props | 7 - .../SeedObject.Test/SeedObject.Test.csproj | 33 - .../src/SeedObject.Test/TestClient.cs | 8 - .../Unit/MockServer/BaseMockServerTest.cs | 40 - .../Unit/MockServer/GetRootTest.cs | 84 - .../inline-types/src/SeedObject.sln | 28 - .../Core/CollectionItemSerializer.cs | 91 - .../src/SeedObject/Core/Constants.cs | 7 - .../src/SeedObject/Core/DateTimeSerializer.cs | 22 - .../src/SeedObject/Core/EnumSerializer.cs | 53 - .../src/SeedObject/Core/Extensions.cs | 14 - .../src/SeedObject/Core/HeaderValue.cs | 17 - .../src/SeedObject/Core/Headers.cs | 17 - .../SeedObject/Core/HttpMethodExtensions.cs | 8 - .../src/SeedObject/Core/IRequestOptions.cs | 34 - .../src/SeedObject/Core/JsonConfiguration.cs | 36 - .../src/SeedObject/Core/OneOfSerializer.cs | 69 - .../SeedObject/Core/Public/ClientOptions.cs | 50 - .../SeedObject/Core/Public/RequestOptions.cs | 35 - .../Core/Public/SeedObjectApiException.cs | 18 - .../Core/Public/SeedObjectException.cs | 11 - .../src/SeedObject/Core/Public/Version.cs | 6 - .../src/SeedObject/Core/RawClient.cs | 189 - .../SeedObject/Requests/PostRootRequest.cs | 20 - .../src/SeedObject/SeedObject.Custom.props | 20 - .../src/SeedObject/SeedObject.csproj | 44 - .../src/SeedObject/SeedObjectClient.cs | 93 - .../src/SeedObject/Types/InlineEnum.cs | 23 - .../src/SeedObject/Types/InlineType1.cs | 20 - .../src/SeedObject/Types/InlineType2.cs | 17 - .../src/SeedObject/Types/NestedInlineType1.cs | 23 - .../src/SeedObject/Types/RootType1.cs | 20 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/fern.config.json | 1 - seed/fastapi/inline-types/__init__.py | 23 - seed/fastapi/inline-types/core/__init__.py | 42 - .../core/abstract_fern_service.py | 10 - .../inline-types/core/datetime_utils.py | 30 - .../inline-types/core/exceptions/__init__.py | 17 - .../core/exceptions/fern_http_exception.py | 24 - .../inline-types/core/exceptions/handlers.py | 50 - .../core/exceptions/unauthorized.py | 15 - .../inline-types/core/pydantic_utilities.py | 273 -- seed/fastapi/inline-types/core/route_args.py | 73 - .../inline-types/core/security/__init__.py | 5 - .../inline-types/core/security/bearer.py | 22 - .../inline-types/core/serialization.py | 276 -- seed/fastapi/inline-types/register.py | 48 - seed/fastapi/inline-types/service/__init__.py | 6 - .../inline-types/service/post_root_request.py | 21 - seed/fastapi/inline-types/service/service.py | 77 - .../inline-types/snippet-templates.json | 0 seed/fastapi/inline-types/snippet.json | 0 seed/fastapi/inline-types/types/__init__.py | 19 - .../fastapi/inline-types/types/inline_enum.py | 29 - .../inline-types/types/inline_type_1.py | 21 - .../inline-types/types/inline_type_2.py | 19 - .../types/inlined_discriminated_union_1.py | 108 - .../types/inlined_undiscriminated_union_1.py | 7 - .../types/nested_inline_type_1.py | 22 - .../fastapi/inline-types/types/root_type_1.py | 21 - .../inline-types/.github/workflows/ci.yml | 27 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../inline-types/.mock/generators.yml | 1 - seed/go-fiber/inline-types/go.mod | 8 - seed/go-fiber/inline-types/go.sum | 12 - .../inline-types/internal/extra_properties.go | 141 - .../internal/extra_properties_test.go | 228 - .../inline-types/internal/stringer.go | 13 - seed/go-fiber/inline-types/internal/time.go | 137 - .../inline-types/snippet-templates.json | 0 seed/go-fiber/inline-types/snippet.json | 0 seed/go-fiber/inline-types/types.go | 390 -- .../inline-types/.github/workflows/ci.yml | 27 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../inline-types/.mock/generators.yml | 1 - seed/go-model/inline-types/go.mod | 8 - seed/go-model/inline-types/go.sum | 12 - .../inline-types/internal/extra_properties.go | 141 - .../internal/extra_properties_test.go | 228 - .../inline-types/internal/stringer.go | 13 - seed/go-model/inline-types/internal/time.go | 137 - .../inline-types/snippet-templates.json | 0 seed/go-model/inline-types/snippet.json | 0 seed/go-model/inline-types/types.go | 385 -- .../inline-types/.github/workflows/ci.yml | 27 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - seed/go-sdk/inline-types/.mock/generators.yml | 1 - seed/go-sdk/inline-types/client/client.go | 70 - .../go-sdk/inline-types/client/client_test.go | 45 - seed/go-sdk/inline-types/core/api_error.go | 42 - seed/go-sdk/inline-types/core/http.go | 8 - .../inline-types/core/request_option.go | 108 - .../dynamic-snippets/example0/snippet.go | 25 - seed/go-sdk/inline-types/file_param.go | 41 - seed/go-sdk/inline-types/go.mod | 9 - seed/go-sdk/inline-types/go.sum | 14 - seed/go-sdk/inline-types/internal/caller.go | 238 - .../inline-types/internal/caller_test.go | 391 -- .../inline-types/internal/error_decoder.go | 45 - .../internal/error_decoder_test.go | 55 - .../inline-types/internal/extra_properties.go | 141 - .../internal/extra_properties_test.go | 228 - seed/go-sdk/inline-types/internal/http.go | 48 - seed/go-sdk/inline-types/internal/query.go | 231 - .../inline-types/internal/query_test.go | 187 - seed/go-sdk/inline-types/internal/retrier.go | 165 - .../inline-types/internal/retrier_test.go | 211 - seed/go-sdk/inline-types/internal/stringer.go | 13 - seed/go-sdk/inline-types/internal/time.go | 137 - .../inline-types/option/request_option.go | 64 - seed/go-sdk/inline-types/pointer.go | 132 - .../inline-types/snippet-templates.json | 0 seed/go-sdk/inline-types/snippet.json | 15 - seed/go-sdk/inline-types/types.go | 418 -- .../inline-types/.github/workflows/ci.yml | 61 - seed/java-model/inline-types/.gitignore | 24 - .../.gradle/8.5/checksums/checksums.lock | Bin 17 -> 0 bytes .../.gradle/8.5/checksums/md5-checksums.bin | Bin 20947 -> 0 bytes .../.gradle/8.5/checksums/sha1-checksums.bin | Bin 23627 -> 0 bytes .../dependencies-accessors.lock | Bin 17 -> 0 bytes .../8.5/dependencies-accessors/gc.properties | 0 .../8.5/executionHistory/executionHistory.bin | Bin 26343 -> 0 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 0 bytes .../.gradle/8.5/fileChanges/last-build.bin | Bin 1 -> 0 bytes .../.gradle/8.5/fileHashes/fileHashes.bin | Bin 19647 -> 0 bytes .../.gradle/8.5/fileHashes/fileHashes.lock | Bin 17 -> 0 bytes .../inline-types/.gradle/8.5/gc.properties | 0 .../buildOutputCleanup.lock | Bin 17 -> 0 bytes .../buildOutputCleanup/cache.properties | 2 - .../buildOutputCleanup/outputFiles.bin | Bin 18749 -> 0 bytes .../inline-types/.gradle/vcs-1/gc.properties | 0 .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../inline-types/.mock/generators.yml | 1 - seed/java-model/inline-types/build.gradle | 98 - .../object/core/DateTimeDeserializer.java | 55 - .../com/seed/object/core/ObjectMappers.java | 36 - .../com/seed/object/model/InlineEnum.java | 28 - .../com/seed/object/model/InlineType1.java | 108 - .../com/seed/object/model/InlineType2.java | 86 - .../model/InlinedDiscriminatedUnion1.java | 200 - .../model/InlinedUndiscriminatedUnion1.java | 94 - .../seed/object/model/NestedInlineType1.java | 130 - .../java/com/seed/object/model/RootType1.java | 108 - .../build/tmp/spotless-register-dependencies | 1 - seed/java-model/inline-types/settings.gradle | 2 - .../inline-types/snippet-templates.json | 0 seed/java-model/inline-types/snippet.json | 0 .../object/core/DateTimeDeserializer.java | 55 - .../com/seed/object/core/ObjectMappers.java | 36 - .../com/seed/object/model/InlineEnum.java | 28 - .../com/seed/object/model/InlineType1.java | 108 - .../com/seed/object/model/InlineType2.java | 86 - .../model/InlinedDiscriminatedUnion1.java | 200 - .../model/InlinedUndiscriminatedUnion1.java | 94 - .../seed/object/model/NestedInlineType1.java | 130 - .../java/com/seed/object/model/RootType1.java | 108 - .../inline-types/.github/workflows/ci.yml | 61 - seed/java-sdk/inline-types/.gitignore | 24 - .../.gradle/8.11.1/checksums/checksums.lock | Bin 17 -> 0 bytes .../8.11.1/checksums/md5-checksums.bin | Bin 20947 -> 0 bytes .../8.11.1/checksums/sha1-checksums.bin | Bin 23627 -> 0 bytes .../executionHistory/executionHistory.bin | Bin 29880 -> 0 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 0 bytes .../.gradle/8.11.1/fileChanges/last-build.bin | Bin 1 -> 0 bytes .../.gradle/8.11.1/fileHashes/fileHashes.bin | Bin 21347 -> 0 bytes .../.gradle/8.11.1/fileHashes/fileHashes.lock | Bin 17 -> 0 bytes .../inline-types/.gradle/8.11.1/gc.properties | 0 .../buildOutputCleanup.lock | Bin 17 -> 0 bytes .../buildOutputCleanup/cache.properties | 2 - .../buildOutputCleanup/outputFiles.bin | Bin 18749 -> 0 bytes .../inline-types/.gradle/vcs-1/gc.properties | 0 .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../inline-types/.mock/generators.yml | 1 - seed/java-sdk/inline-types/build.gradle | 101 - .../reports/problems/problems-report.html | 663 --- .../com/seed/object/SeedObjectClient.java | 76 - .../seed/object/SeedObjectClientBuilder.java | 23 - .../com/seed/object/core/ClientOptions.java | 103 - .../object/core/DateTimeDeserializer.java | 55 - .../com/seed/object/core/Environment.java | 20 - .../java/com/seed/object/core/FileStream.java | 60 - .../object/core/InputStreamRequestBody.java | 79 - .../java/com/seed/object/core/MediaTypes.java | 13 - .../com/seed/object/core/ObjectMappers.java | 36 - .../com/seed/object/core/RequestOptions.java | 58 - .../object/core/ResponseBodyInputStream.java | 45 - .../seed/object/core/ResponseBodyReader.java | 44 - .../seed/object/core/RetryInterceptor.java | 78 - .../object/core/SeedObjectApiException.java | 45 - .../seed/object/core/SeedObjectException.java | 17 - .../java/com/seed/object/core/Stream.java | 97 - .../java/com/seed/object/core/Suppliers.java | 23 - .../seed/object/requests/PostRootRequest.java | 125 - .../com/seed/object/types/InlineEnum.java | 28 - .../com/seed/object/types/InlineType1.java | 124 - .../com/seed/object/types/InlineType2.java | 102 - .../types/InlinedDiscriminatedUnion1.java | 200 - .../types/InlinedUndiscriminatedUnion1.java | 94 - .../seed/object/types/NestedInlineType1.java | 146 - .../java/com/seed/object/types/RootType1.java | 124 - .../test/java/com/seed/object/TestClient.java | 11 - .../build/tmp/spotless-register-dependencies | 1 - .../inline-types/sample-app/build.gradle | 19 - .../sample-app/src/main/java/sample/App.java | 13 - seed/java-sdk/inline-types/settings.gradle | 3 - .../inline-types/snippet-templates.json | 0 seed/java-sdk/inline-types/snippet.json | 0 .../com/seed/object/SeedObjectClient.java | 76 - .../seed/object/SeedObjectClientBuilder.java | 23 - .../com/seed/object/core/ClientOptions.java | 103 - .../object/core/DateTimeDeserializer.java | 55 - .../com/seed/object/core/Environment.java | 20 - .../java/com/seed/object/core/FileStream.java | 60 - .../object/core/InputStreamRequestBody.java | 79 - .../java/com/seed/object/core/MediaTypes.java | 13 - .../com/seed/object/core/ObjectMappers.java | 36 - .../com/seed/object/core/RequestOptions.java | 58 - .../object/core/ResponseBodyInputStream.java | 45 - .../seed/object/core/ResponseBodyReader.java | 44 - .../seed/object/core/RetryInterceptor.java | 78 - .../object/core/SeedObjectApiException.java | 45 - .../seed/object/core/SeedObjectException.java | 17 - .../java/com/seed/object/core/Stream.java | 97 - .../java/com/seed/object/core/Suppliers.java | 23 - .../seed/object/requests/PostRootRequest.java | 125 - .../com/seed/object/types/InlineEnum.java | 28 - .../com/seed/object/types/InlineType1.java | 124 - .../com/seed/object/types/InlineType2.java | 102 - .../types/InlinedDiscriminatedUnion1.java | 200 - .../types/InlinedUndiscriminatedUnion1.java | 94 - .../seed/object/types/NestedInlineType1.java | 146 - .../java/com/seed/object/types/RootType1.java | 124 - .../test/java/com/seed/object/TestClient.java | 11 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../inline-types/.mock/generators.yml | 1 - .../java-spring/inline-types/RootService.java | 21 - .../inline-types/core/APIException.java | 10 - .../core/DateTimeDeserializer.java | 56 - .../inline-types/core/ObjectMappers.java | 41 - .../requests/PostRootRequest.java | 118 - .../inline-types/snippet-templates.json | 0 seed/java-spring/inline-types/snippet.json | 0 .../inline-types/types/InlineEnum.java | 30 - .../inline-types/types/InlineType1.java | 117 - .../inline-types/types/InlineType2.java | 95 - .../types/InlinedDiscriminatedUnion1.java | 224 - .../types/InlinedUndiscriminatedUnion1.java | 102 - .../inline-types/types/NestedInlineType1.java | 139 - .../inline-types/types/RootType1.java | 117 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../openapi/inline-types/.mock/generators.yml | 1 - seed/openapi/inline-types/openapi.yml | 117 - .../inline-types/snippet-templates.json | 0 seed/openapi/inline-types/snippet.json | 0 .../inline-types/.github/workflows/ci.yml | 48 - seed/php-model/inline-types/.gitignore | 4 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../inline-types/.mock/generators.yml | 1 - seed/php-model/inline-types/composer.json | 40 - seed/php-model/inline-types/phpstan.neon | 5 - seed/php-model/inline-types/phpunit.xml | 7 - .../inline-types/snippet-templates.json | 0 seed/php-model/inline-types/snippet.json | 0 .../src/Core/Json/JsonDecoder.php | 161 - .../src/Core/Json/JsonDeserializer.php | 204 - .../src/Core/Json/JsonEncoder.php | 20 - .../src/Core/Json/JsonProperty.php | 13 - .../src/Core/Json/JsonSerializableType.php | 182 - .../src/Core/Json/JsonSerializer.php | 192 - .../inline-types/src/Core/Json/Utils.php | 61 - .../inline-types/src/Core/Types/ArrayType.php | 16 - .../inline-types/src/Core/Types/Constant.php | 12 - .../inline-types/src/Core/Types/Date.php | 16 - .../inline-types/src/Core/Types/Union.php | 62 - .../php-model/inline-types/src/InlineEnum.php | 11 - .../inline-types/src/InlineType1.php | 34 - .../inline-types/src/InlineType2.php | 26 - .../inline-types/src/NestedInlineType1.php | 42 - seed/php-model/inline-types/src/RootType1.php | 34 - .../tests/Seed/Core/Json/DateArrayTest.php | 54 - .../tests/Seed/Core/Json/EmptyArrayTest.php | 71 - .../tests/Seed/Core/Json/EnumTest.php | 76 - .../tests/Seed/Core/Json/ExhaustiveTest.php | 197 - .../tests/Seed/Core/Json/InvalidTest.php | 42 - .../Seed/Core/Json/NestedUnionArrayTest.php | 89 - .../tests/Seed/Core/Json/NullPropertyTest.php | 53 - .../Seed/Core/Json/NullableArrayTest.php | 49 - .../tests/Seed/Core/Json/ScalarTest.php | 116 - .../tests/Seed/Core/Json/TraitTest.php | 60 - .../tests/Seed/Core/Json/UnionArrayTest.php | 57 - .../Seed/Core/Json/UnionPropertyTest.php | 115 - .../inline-types/.github/workflows/ci.yml | 48 - seed/php-sdk/inline-types/.gitignore | 4 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../php-sdk/inline-types/.mock/generators.yml | 1 - seed/php-sdk/inline-types/composer.json | 40 - seed/php-sdk/inline-types/phpstan.neon | 5 - seed/php-sdk/inline-types/phpunit.xml | 7 - .../inline-types/snippet-templates.json | 0 seed/php-sdk/inline-types/snippet.json | 0 .../src/Core/Client/BaseApiRequest.php | 22 - .../src/Core/Client/HttpMethod.php | 12 - .../src/Core/Client/RawClient.php | 146 - .../src/Core/Json/JsonApiRequest.php | 28 - .../src/Core/Json/JsonDecoder.php | 161 - .../src/Core/Json/JsonDeserializer.php | 204 - .../src/Core/Json/JsonEncoder.php | 20 - .../src/Core/Json/JsonProperty.php | 13 - .../src/Core/Json/JsonSerializableType.php | 182 - .../src/Core/Json/JsonSerializer.php | 192 - .../inline-types/src/Core/Json/Utils.php | 61 - .../Core/Multipart/MultipartApiRequest.php | 28 - .../src/Core/Multipart/MultipartFormData.php | 61 - .../Core/Multipart/MultipartFormDataPart.php | 76 - .../inline-types/src/Core/Types/ArrayType.php | 16 - .../inline-types/src/Core/Types/Constant.php | 12 - .../inline-types/src/Core/Types/Date.php | 16 - .../inline-types/src/Core/Types/Union.php | 62 - .../src/Exceptions/SeedApiException.php | 53 - .../src/Exceptions/SeedException.php | 12 - .../src/Requests/PostRootRequest.php | 35 - seed/php-sdk/inline-types/src/SeedClient.php | 95 - .../inline-types/src/Types/InlineEnum.php | 11 - .../inline-types/src/Types/InlineType1.php | 34 - .../inline-types/src/Types/InlineType2.php | 26 - .../src/Types/NestedInlineType1.php | 42 - .../inline-types/src/Types/RootType1.php | 34 - seed/php-sdk/inline-types/src/Utils/File.php | 125 - .../tests/Seed/Core/Client/RawClientTest.php | 101 - .../tests/Seed/Core/Json/DateArrayTest.php | 54 - .../tests/Seed/Core/Json/EmptyArrayTest.php | 71 - .../tests/Seed/Core/Json/EnumTest.php | 76 - .../tests/Seed/Core/Json/ExhaustiveTest.php | 197 - .../tests/Seed/Core/Json/InvalidTest.php | 42 - .../Seed/Core/Json/NestedUnionArrayTest.php | 89 - .../tests/Seed/Core/Json/NullPropertyTest.php | 53 - .../Seed/Core/Json/NullableArrayTest.php | 49 - .../tests/Seed/Core/Json/ScalarTest.php | 116 - .../tests/Seed/Core/Json/TraitTest.php | 60 - .../tests/Seed/Core/Json/UnionArrayTest.php | 57 - .../Seed/Core/Json/UnionPropertyTest.php | 115 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../postman/inline-types/.mock/generators.yml | 1 - seed/postman/inline-types/collection.json | 97 - .../inline-types/snippet-templates.json | 0 seed/postman/inline-types/snippet.json | 0 .../inline-types/.github/workflows/ci.yml | 61 - seed/pydantic/inline-types/.gitignore | 5 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../inline-types/.mock/generators.yml | 1 - seed/pydantic/inline-types/README.md | 0 seed/pydantic/inline-types/pyproject.toml | 59 - .../inline-types/snippet-templates.json | 0 seed/pydantic/inline-types/snippet.json | 0 .../inline-types/src/seed/object/__init__.py | 25 - .../src/seed/object/core/__init__.py | 25 - .../src/seed/object/core/datetime_utils.py | 28 - .../seed/object/core/pydantic_utilities.py | 265 -- .../src/seed/object/core/serialization.py | 272 -- .../src/seed/object/inline_enum.py | 5 - .../src/seed/object/inline_type_1.py | 19 - .../src/seed/object/inline_type_2.py | 17 - .../object/inlined_discriminated_union_1.py | 36 - .../object/inlined_undiscriminated_union_1.py | 7 - .../src/seed/object/nested_inline_type_1.py | 20 - .../inline-types/src/seed/object/py.typed | 0 .../src/seed/object/root_type_1.py | 19 - .../inline-types/tests/custom/test_client.py | 7 - .../inline-types/.github/workflows/ci.yml | 63 - seed/python-sdk/inline-types/.gitignore | 5 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../inline-types/.mock/generators.yml | 1 - seed/python-sdk/inline-types/README.md | 154 - seed/python-sdk/inline-types/pyproject.toml | 61 - seed/python-sdk/inline-types/reference.md | 73 - .../resolved-snippet-templates.md | 18 - .../inline-types/snippet-templates.json | 282 -- seed/python-sdk/inline-types/snippet.json | 18 - .../inline-types/src/seed/__init__.py | 30 - .../inline-types/src/seed/client.py | 244 - .../inline-types/src/seed/core/__init__.py | 47 - .../inline-types/src/seed/core/api_error.py | 15 - .../src/seed/core/client_wrapper.py | 48 - .../src/seed/core/datetime_utils.py | 28 - .../inline-types/src/seed/core/file.py | 67 - .../inline-types/src/seed/core/http_client.py | 499 -- .../src/seed/core/jsonable_encoder.py | 101 - .../src/seed/core/pydantic_utilities.py | 296 -- .../src/seed/core/query_encoder.py | 58 - .../src/seed/core/remove_none_from_dict.py | 11 - .../src/seed/core/request_options.py | 35 - .../src/seed/core/serialization.py | 272 -- .../python-sdk/inline-types/src/seed/py.typed | 0 .../inline-types/src/seed/types/__init__.py | 25 - .../src/seed/types/inline_enum.py | 5 - .../src/seed/types/inline_type_1.py | 21 - .../src/seed/types/inline_type_2.py | 19 - .../types/inlined_discriminated_union_1.py | 40 - .../types/inlined_undiscriminated_union_1.py | 7 - .../src/seed/types/nested_inline_type_1.py | 24 - .../src/seed/types/root_type_1.py | 21 - .../inline-types/src/seed/version.py | 3 - .../python-sdk/inline-types/tests/__init__.py | 2 - .../python-sdk/inline-types/tests/conftest.py | 16 - .../inline-types/tests/custom/test_client.py | 7 - .../inline-types/tests/test_root.py | 25 - .../inline-types/tests/utilities.py | 162 - .../inline-types/tests/utils/__init__.py | 2 - .../tests/utils/assets/models/__init__.py | 21 - .../tests/utils/assets/models/circle.py | 11 - .../tests/utils/assets/models/color.py | 7 - .../assets/models/object_with_defaults.py | 16 - .../models/object_with_optional_field.py | 34 - .../tests/utils/assets/models/shape.py | 26 - .../tests/utils/assets/models/square.py | 11 - .../assets/models/undiscriminated_shape.py | 9 - .../tests/utils/test_http_client.py | 61 - .../tests/utils/test_query_encoding.py | 37 - .../tests/utils/test_serialization.py | 72 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../inline-types/.mock/generators.yml | 1 - seed/ruby-model/inline-types/.rubocop.yml | 36 - seed/ruby-model/inline-types/Gemfile | 9 - seed/ruby-model/inline-types/Rakefile | 12 - seed/ruby-model/inline-types/lib/gemconfig.rb | 14 - .../inline-types/lib/seed_object_client.rb | 9 - .../seed_object_client/types/inline_enum.rb | 10 - .../seed_object_client/types/inline_type_1.rb | 71 - .../seed_object_client/types/inline_type_2.rb | 55 - .../types/inlined_discriminated_union_1.rb | 94 - .../types/inlined_undiscriminated_union_1.rb | 54 - .../types/nested_inline_type_1.rb | 73 - .../seed_object_client/types/root_type_1.rb | 71 - .../inline-types/seed_object_client.gemspec | 21 - .../inline-types/snippet-templates.json | 0 seed/ruby-model/inline-types/snippet.json | 0 .../inline-types/test/test_helper.rb | 6 - .../test/test_seed_object_client.rb | 11 - .../.github/workflows/publish.yml | 26 - seed/ruby-sdk/inline-types/.gitignore | 10 - .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../inline-types/.mock/generators.yml | 1 - seed/ruby-sdk/inline-types/.rubocop.yml | 36 - seed/ruby-sdk/inline-types/Gemfile | 9 - seed/ruby-sdk/inline-types/README.md | 0 seed/ruby-sdk/inline-types/Rakefile | 12 - .../inline-types/fern_inline_types.gemspec | 25 - .../inline-types/lib/fern_inline_types.rb | 94 - .../fern_inline_types/types/inline_enum.rb | 10 - .../fern_inline_types/types/inline_type_1.rb | 71 - .../fern_inline_types/types/inline_type_2.rb | 55 - .../types/inlined_discriminated_union_1.rb | 94 - .../types/inlined_undiscriminated_union_1.rb | 54 - .../types/nested_inline_type_1.rb | 73 - .../fern_inline_types/types/root_type_1.rb | 71 - seed/ruby-sdk/inline-types/lib/gemconfig.rb | 14 - seed/ruby-sdk/inline-types/lib/requests.rb | 132 - .../ruby-sdk/inline-types/lib/types_export.rb | 9 - .../inline-types/snippet-templates.json | 0 seed/ruby-sdk/inline-types/snippet.json | 27 - .../test/test_fern_inline_types.rb | 11 - .../ruby-sdk/inline-types/test/test_helper.rb | 6 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - .../inline-types/.mock/generators.yml | 1 - seed/ts-express/inline-types/.mock/ir.json | 4159 ----------------- seed/ts-express/inline-types/api/index.ts | 2 - .../inline-types/api/service/RootService.ts | 179 - .../requests/GetDiscriminatedUnionRequest.ts | 10 - .../GetUndiscriminatedUnionRequest.ts | 10 - .../api/service/requests/PostRootRequest.ts | 10 - .../api/service/requests/index.ts | 3 - seed/ts-express/inline-types/core/index.ts | 1 - .../inline-types/core/schemas/Schema.ts | 99 - .../core/schemas/builders/bigint/bigint.ts | 50 - .../core/schemas/builders/bigint/index.ts | 1 - .../core/schemas/builders/date/date.ts | 65 - .../core/schemas/builders/date/index.ts | 1 - .../core/schemas/builders/enum/enum.ts | 43 - .../core/schemas/builders/enum/index.ts | 1 - .../core/schemas/builders/index.ts | 14 - .../core/schemas/builders/lazy/index.ts | 3 - .../core/schemas/builders/lazy/lazy.ts | 32 - .../core/schemas/builders/lazy/lazyObject.ts | 20 - .../core/schemas/builders/list/index.ts | 1 - .../core/schemas/builders/list/list.ts | 73 - .../builders/literals/booleanLiteral.ts | 29 - .../core/schemas/builders/literals/index.ts | 2 - .../builders/literals/stringLiteral.ts | 29 - .../object-like/getObjectLikeUtils.ts | 79 - .../schemas/builders/object-like/index.ts | 2 - .../schemas/builders/object-like/types.ts | 11 - .../core/schemas/builders/object/index.ts | 22 - .../core/schemas/builders/object/object.ts | 365 -- .../object/objectWithoutOptionalProperties.ts | 18 - .../core/schemas/builders/object/property.ts | 23 - .../core/schemas/builders/object/types.ts | 73 - .../core/schemas/builders/primitives/any.ts | 4 - .../schemas/builders/primitives/boolean.ts | 25 - .../core/schemas/builders/primitives/index.ts | 5 - .../schemas/builders/primitives/number.ts | 25 - .../schemas/builders/primitives/string.ts | 25 - .../schemas/builders/primitives/unknown.ts | 4 - .../core/schemas/builders/record/index.ts | 2 - .../core/schemas/builders/record/record.ts | 130 - .../core/schemas/builders/record/types.ts | 17 - .../builders/schema-utils/JsonError.ts | 9 - .../builders/schema-utils/ParseError.ts | 9 - .../builders/schema-utils/getSchemaUtils.ts | 105 - .../schemas/builders/schema-utils/index.ts | 4 - .../schema-utils/stringifyValidationErrors.ts | 8 - .../core/schemas/builders/set/index.ts | 1 - .../core/schemas/builders/set/set.ts | 43 - .../builders/undiscriminated-union/index.ts | 6 - .../builders/undiscriminated-union/types.ts | 10 - .../undiscriminatedUnion.ts | 60 - .../schemas/builders/union/discriminant.ts | 14 - .../core/schemas/builders/union/index.ts | 10 - .../core/schemas/builders/union/types.ts | 26 - .../core/schemas/builders/union/union.ts | 170 - .../inline-types/core/schemas/index.ts | 2 - .../core/schemas/utils/MaybePromise.ts | 1 - .../addQuestionMarksToNullableProperties.ts | 15 - .../utils/createIdentitySchemaCreator.ts | 21 - .../core/schemas/utils/entries.ts | 3 - .../core/schemas/utils/filterObject.ts | 10 - .../utils/getErrorMessageForIncorrectType.ts | 25 - .../core/schemas/utils/isPlainObject.ts | 17 - .../inline-types/core/schemas/utils/keys.ts | 3 - .../core/schemas/utils/maybeSkipValidation.ts | 38 - .../core/schemas/utils/partition.ts | 12 - .../inline-types/errors/SeedObjectError.ts | 14 - seed/ts-express/inline-types/errors/index.ts | 1 - seed/ts-express/inline-types/index.ts | 3 - seed/ts-express/inline-types/register.ts | 15 - .../inline-types/serialization/index.ts | 2 - .../requests/GetDiscriminatedUnionRequest.ts | 22 - .../GetUndiscriminatedUnionRequest.ts | 22 - .../service/requests/PostRootRequest.ts | 20 - .../serialization/service/requests/index.ts | 3 - .../serialization/types/AliasInlineValue.ts | 22 - .../serialization/types/AliasListInline.ts | 14 - .../serialization/types/AliasMapInline.ts | 17 - .../serialization/types/AliasSetInline.ts | 14 - .../types/DiscriminatedUnion1.ts | 37 - .../types/DiscriminatedUnion1InlineType1.ts | 24 - ...scriminatedUnion1InlineType1InlineType1.ts | 22 - .../types/DiscriminatedUnion1InlineType2.ts | 22 - .../serialization/types/InlineEnum1.ts | 14 - .../serialization/types/ReferenceType.ts | 18 - .../types/RequestTypeInlineType1.ts | 20 - .../serialization/types/RootType1.ts | 31 - .../types/RootType1FooListItem.ts | 22 - .../types/RootType1FooMapValue.ts | 22 - .../types/RootType1FooSetItem.ts | 22 - .../types/RootType1InlineType1.ts | 24 - .../RootType1InlineType1NestedInlineType1.ts | 26 - .../types/UndiscriminatedUnion1.ts | 40 - ...ndiscriminatedUnion1DiscriminatedUnion1.ts | 40 - ...tedUnion1DiscriminatedUnion1InlineType1.ts | 26 - ...scriminatedUnion1InlineType1InlineType1.ts | 22 - ...tedUnion1DiscriminatedUnion1InlineType2.ts | 22 - .../types/UndiscriminatedUnion1InlineEnum1.ts | 16 - .../UndiscriminatedUnion1InlineListItem1.ts | 22 - .../UndiscriminatedUnion1InlineMapItem1.ts | 22 - .../UndiscriminatedUnion1InlineSetItem1.ts | 22 - .../types/UndiscriminatedUnion1InlineType1.ts | 24 - ...scriminatedUnion1InlineType1InlineType1.ts | 22 - .../types/UndiscriminatedUnion1InlineType2.ts | 22 - .../serialization/types/UserId.ts | 13 - .../inline-types/serialization/types/index.ts | 30 - .../inline-types/snippet-templates.json | 0 seed/ts-express/inline-types/snippet.json | 0 .../.mock/definition/__package__.yml | 61 - .../inline-types/.mock/definition/api.yml | 1 - .../inline-types/.mock/fern.config.json | 1 - seed/ts-sdk/inline-types/.mock/generators.yml | 1 - seed/ts-sdk/inline-types/README.md | 161 - .../inline/.mock/definition/api.yml | 1 - .../inline/.mock/fern.config.json | 1 - .../inline-types/inline/.mock/generators.yml | 1 - seed/ts-sdk/inline-types/inline/.mock/ir.json | 4159 ----------------- seed/ts-sdk/inline-types/inline/package.json | 42 - .../inline/src/api/client/index.ts | 1 - .../no-inline/.github/workflows/ci.yml | 57 - seed/ts-sdk/inline-types/no-inline/.gitignore | 3 - .../no-inline/.mock/definition/api.yml | 1 - .../no-inline/.mock/fern.config.json | 1 - .../no-inline/.mock/generators.yml | 1 - .../inline-types/no-inline/.mock/ir.json | 4159 ----------------- seed/ts-sdk/inline-types/no-inline/.npmignore | 9 - .../inline-types/no-inline/.prettierrc.yml | 2 - .../inline-types/no-inline/jest.config.js | 5 - .../no-inline/src/api/client/index.ts | 1 - .../src/api/types/AliasInlineValue.ts | 8 - .../src/api/types/AliasListInline.ts | 7 - .../no-inline/src/api/types/AliasMapInline.ts | 7 - .../no-inline/src/api/types/AliasSetInline.ts | 7 - .../src/api/types/DiscriminatedUnion1.ts | 33 - .../types/DiscriminatedUnion1InlineType1.ts | 17 - ...scriminatedUnion1InlineType1InlineType1.ts | 15 - .../types/DiscriminatedUnion1InlineType2.ts | 15 - .../no-inline/src/api/types/InlineEnum1.ts | 14 - .../no-inline/src/api/types/ReferenceType.ts | 11 - .../src/api/types/RequestTypeInlineType1.ts | 11 - .../no-inline/src/api/types/RootType1.ts | 23 - .../src/api/types/RootType1FooListItem.ts | 15 - .../src/api/types/RootType1FooMapValue.ts | 15 - .../src/api/types/RootType1FooSetItem.ts | 15 - .../src/api/types/RootType1InlineType1.ts | 17 - .../RootType1InlineType1NestedInlineType1.ts | 19 - .../src/api/types/UndiscriminatedUnion1.ts | 40 - ...ndiscriminatedUnion1DiscriminatedUnion1.ts | 33 - ...tedUnion1DiscriminatedUnion1InlineType1.ts | 17 - ...scriminatedUnion1InlineType1InlineType1.ts | 15 - ...tedUnion1DiscriminatedUnion1InlineType2.ts | 15 - .../types/UndiscriminatedUnion1InlineEnum1.ts | 14 - .../UndiscriminatedUnion1InlineListItem1.ts | 15 - .../UndiscriminatedUnion1InlineMapItem1.ts | 15 - .../UndiscriminatedUnion1InlineSetItem1.ts | 15 - .../types/UndiscriminatedUnion1InlineType1.ts | 17 - ...scriminatedUnion1InlineType1InlineType1.ts | 15 - .../types/UndiscriminatedUnion1InlineType2.ts | 15 - .../no-inline/src/api/types/UserId.ts | 8 - .../no-inline/src/api/types/index.ts | 30 - seed/ts-sdk/inline-types/reference.md | 61 - .../resolved-snippet-templates.md | 18 - .../inline-types/snippet-templates.json | 178 - seed/ts-sdk/inline-types/snippet.json | 16 - seed/ts-sdk/inline-types/src/Client.ts | 101 - .../inline-types/src/api/client/index.ts | 1 - .../api/client/requests/PostRootRequest.ts | 24 - .../src/api/client/requests/index.ts | 1 - seed/ts-sdk/inline-types/src/api/index.ts | 2 - .../inline-types/src/api/types/InlineEnum.ts | 12 - .../inline-types/src/api/types/InlineType1.ts | 10 - .../inline-types/src/api/types/InlineType2.ts | 7 - .../api/types/InlinedDiscriminatedUnion1.ts | 19 - .../api/types/InlinedUndiscriminatedUnion1.ts | 7 - .../src/api/types/NestedInlineType1.ts | 11 - .../inline-types/src/api/types/RootType1.ts | 10 - .../inline-types/src/api/types/index.ts | 7 - .../src/core/fetcher/APIResponse.ts | 12 - .../inline-types/src/core/fetcher/Fetcher.ts | 143 - .../inline-types/src/core/fetcher/Supplier.ts | 11 - .../src/core/fetcher/createRequestUrl.ts | 10 - .../src/core/fetcher/getFetchFn.ts | 25 - .../src/core/fetcher/getHeader.ts | 8 - .../src/core/fetcher/getRequestBody.ts | 14 - .../src/core/fetcher/getResponseBody.ts | 34 - .../inline-types/src/core/fetcher/index.ts | 5 - .../src/core/fetcher/makeRequest.ts | 44 - .../src/core/fetcher/requestWithRetries.ts | 33 - .../inline-types/src/core/fetcher/signals.ts | 38 - .../Node18UniversalStreamWrapper.ts | 256 - .../stream-wrappers/NodePre18StreamWrapper.ts | 106 - .../stream-wrappers/UndiciStreamWrapper.ts | 243 - .../stream-wrappers/chooseStreamWrapper.ts | 33 - seed/ts-sdk/inline-types/src/core/index.ts | 3 - .../inline-types/src/core/runtime/index.ts | 1 - .../inline-types/src/core/runtime/runtime.ts | 126 - .../inline-types/src/core/schemas/Schema.ts | 99 - .../core/schemas/builders/bigint/bigint.ts | 50 - .../src/core/schemas/builders/bigint/index.ts | 1 - .../src/core/schemas/builders/date/date.ts | 65 - .../src/core/schemas/builders/date/index.ts | 1 - .../src/core/schemas/builders/enum/enum.ts | 43 - .../src/core/schemas/builders/enum/index.ts | 1 - .../src/core/schemas/builders/index.ts | 14 - .../src/core/schemas/builders/lazy/index.ts | 3 - .../src/core/schemas/builders/lazy/lazy.ts | 32 - .../core/schemas/builders/lazy/lazyObject.ts | 20 - .../src/core/schemas/builders/list/index.ts | 1 - .../src/core/schemas/builders/list/list.ts | 73 - .../builders/literals/booleanLiteral.ts | 29 - .../core/schemas/builders/literals/index.ts | 2 - .../builders/literals/stringLiteral.ts | 29 - .../object-like/getObjectLikeUtils.ts | 79 - .../schemas/builders/object-like/index.ts | 2 - .../schemas/builders/object-like/types.ts | 11 - .../src/core/schemas/builders/object/index.ts | 22 - .../core/schemas/builders/object/object.ts | 365 -- .../object/objectWithoutOptionalProperties.ts | 18 - .../core/schemas/builders/object/property.ts | 23 - .../src/core/schemas/builders/object/types.ts | 73 - .../core/schemas/builders/primitives/any.ts | 4 - .../schemas/builders/primitives/boolean.ts | 25 - .../core/schemas/builders/primitives/index.ts | 5 - .../schemas/builders/primitives/number.ts | 25 - .../schemas/builders/primitives/string.ts | 25 - .../schemas/builders/primitives/unknown.ts | 4 - .../src/core/schemas/builders/record/index.ts | 2 - .../core/schemas/builders/record/record.ts | 130 - .../src/core/schemas/builders/record/types.ts | 17 - .../builders/schema-utils/JsonError.ts | 9 - .../builders/schema-utils/ParseError.ts | 9 - .../builders/schema-utils/getSchemaUtils.ts | 105 - .../schemas/builders/schema-utils/index.ts | 4 - .../schema-utils/stringifyValidationErrors.ts | 8 - .../src/core/schemas/builders/set/index.ts | 1 - .../src/core/schemas/builders/set/set.ts | 43 - .../builders/undiscriminated-union/index.ts | 6 - .../builders/undiscriminated-union/types.ts | 10 - .../undiscriminatedUnion.ts | 60 - .../schemas/builders/union/discriminant.ts | 14 - .../src/core/schemas/builders/union/index.ts | 10 - .../src/core/schemas/builders/union/types.ts | 26 - .../src/core/schemas/builders/union/union.ts | 170 - .../inline-types/src/core/schemas/index.ts | 2 - .../src/core/schemas/utils/MaybePromise.ts | 1 - .../addQuestionMarksToNullableProperties.ts | 15 - .../utils/createIdentitySchemaCreator.ts | 21 - .../src/core/schemas/utils/entries.ts | 3 - .../src/core/schemas/utils/filterObject.ts | 10 - .../utils/getErrorMessageForIncorrectType.ts | 25 - .../src/core/schemas/utils/isPlainObject.ts | 17 - .../src/core/schemas/utils/keys.ts | 3 - .../core/schemas/utils/maybeSkipValidation.ts | 38 - .../src/core/schemas/utils/partition.ts | 12 - .../src/errors/SeedObjectError.ts | 45 - .../src/errors/SeedObjectTimeoutError.ts | 10 - seed/ts-sdk/inline-types/src/errors/index.ts | 2 - seed/ts-sdk/inline-types/src/index.ts | 3 - .../src/serialization/client/index.ts | 1 - .../client/requests/PostRootRequest.ts | 21 - .../serialization/client/requests/index.ts | 1 - .../inline-types/src/serialization/index.ts | 2 - .../src/serialization/types/InlineEnum.ts | 14 - .../src/serialization/types/InlineType1.ts | 21 - .../src/serialization/types/InlineType2.ts | 18 - .../types/InlinedDiscriminatedUnion1.ts | 34 - .../types/InlinedUndiscriminatedUnion1.ts | 18 - .../serialization/types/NestedInlineType1.ts | 25 - .../src/serialization/types/RootType1.ts | 21 - .../src/serialization/types/index.ts | 7 - seed/ts-sdk/inline-types/src/version.ts | 1 - seed/ts-sdk/inline-types/tests/custom.test.ts | 13 - .../tests/unit/fetcher/Fetcher.test.ts | 73 - .../unit/fetcher/createRequestUrl.test.ts | 51 - .../tests/unit/fetcher/getFetchFn.test.ts | 22 - .../tests/unit/fetcher/getRequestBody.test.ts | 77 - .../unit/fetcher/getResponseBody.test.ts | 64 - .../tests/unit/fetcher/makeRequest.test.ts | 54 - .../unit/fetcher/requestWithRetries.test.ts | 133 - .../tests/unit/fetcher/signals.test.ts | 69 - .../Node18UniversalStreamWrapper.test.ts | 178 - .../NodePre18StreamWrapper.test.ts | 124 - .../UndiciStreamWrapper.test.ts | 153 - .../chooseStreamWrapper.test.ts | 43 - .../fetcher/stream-wrappers/webpack.test.ts | 38 - .../tests/unit/fetcher/test-file.txt | 1 - .../tests/unit/zurg/bigint/bigint.test.ts | 24 - .../tests/unit/zurg/date/date.test.ts | 31 - .../tests/unit/zurg/enum/enum.test.ts | 30 - .../tests/unit/zurg/lazy/lazy.test.ts | 57 - .../tests/unit/zurg/lazy/lazyObject.test.ts | 18 - .../tests/unit/zurg/lazy/recursive/a.ts | 7 - .../tests/unit/zurg/lazy/recursive/b.ts | 8 - .../tests/unit/zurg/list/list.test.ts | 41 - .../unit/zurg/literals/stringLiteral.test.ts | 21 - .../object-like/withParsedProperties.test.ts | 57 - .../tests/unit/zurg/object/extend.test.ts | 89 - .../tests/unit/zurg/object/object.test.ts | 255 - .../objectWithoutOptionalProperties.test.ts | 21 - .../unit/zurg/object/passthrough.test.ts | 87 - .../tests/unit/zurg/primitives/any.test.ts | 6 - .../unit/zurg/primitives/boolean.test.ts | 14 - .../tests/unit/zurg/primitives/number.test.ts | 14 - .../tests/unit/zurg/primitives/string.test.ts | 14 - .../unit/zurg/primitives/unknown.test.ts | 6 - .../tests/unit/zurg/record/record.test.ts | 34 - .../zurg/schema-utils/getSchemaUtils.test.ts | 83 - .../tests/unit/zurg/schema.test.ts | 78 - .../tests/unit/zurg/set/set.test.ts | 48 - .../tests/unit/zurg/skipValidation.test.ts | 45 - .../undiscriminatedUnion.test.ts | 44 - .../tests/unit/zurg/union/union.test.ts | 113 - .../tests/unit/zurg/utils/itSchema.ts | 78 - .../tests/unit/zurg/utils/itValidate.ts | 56 - seed/ts-sdk/inline-types/tsconfig.json | 17 - seed/ts-sdk/seed.yml | 2 +- .../inline}/.github/workflows/ci.yml | 0 .../inline}/.gitignore | 0 .../inline}/.mock/definition/__package__.yml | 0 .../inline}/.mock/definition/api.yml | 0 .../inline}/.mock/fern.config.json | 0 .../inline}/.mock/generators.yml | 0 .../inline}/.npmignore | 0 .../inline}/.prettierrc.yml | 0 .../inline/README.md | 12 +- .../inline/jest.config.js | 0 .../inline}/package.json | 4 +- .../inline/reference.md | 0 .../inline/resolved-snippet-templates.md | 6 +- .../inline/snippet-templates.json | 12 +- .../inline}/snippet.json | 6 +- .../inline/src/Client.ts | 12 +- .../inline/src/api/client}/index.ts | 0 .../requests/GetDiscriminatedUnionRequest.ts | 0 .../GetUndiscriminatedUnionRequest.ts | 0 .../api/client/requests/PostRootRequest.ts | 0 .../inline/src/api/client/requests/index.ts | 0 .../inline/src/api/index.ts | 0 .../inline/src/api/types/AliasListInline.ts | 0 .../inline/src/api/types/AliasMapInline.ts | 0 .../inline/src/api/types/AliasSetInline.ts | 0 .../inline/src}/api/types/ReferenceType.ts | 0 .../inline/src/api/types/RootType1.ts | 0 .../inline/src}/api/types/UserId.ts | 0 .../inline/src/api/types/index.ts | 0 .../inline/src/core/fetcher/APIResponse.ts | 0 .../inline/src/core/fetcher/Fetcher.ts | 0 .../inline/src/core/fetcher/Supplier.ts | 0 .../src/core/fetcher/createRequestUrl.ts | 0 .../inline/src/core/fetcher/getFetchFn.ts | 0 .../inline/src/core/fetcher/getHeader.ts | 0 .../inline/src/core/fetcher/getRequestBody.ts | 0 .../src/core/fetcher/getResponseBody.ts | 0 .../inline/src/core/fetcher/index.ts | 0 .../inline/src/core/fetcher/makeRequest.ts | 0 .../src/core/fetcher/requestWithRetries.ts | 0 .../inline/src/core/fetcher/signals.ts | 0 .../Node18UniversalStreamWrapper.ts | 0 .../stream-wrappers/NodePre18StreamWrapper.ts | 0 .../stream-wrappers/UndiciStreamWrapper.ts | 0 .../stream-wrappers/chooseStreamWrapper.ts | 0 .../inline/src/core/index.ts | 0 .../inline/src/core/runtime/index.ts | 0 .../inline/src/core/runtime/runtime.ts | 0 .../inline/src/errors/SeedObjectError.ts | 0 .../src/errors/SeedObjectTimeoutError.ts | 0 .../inline/src/errors/index.ts | 0 .../inline/src/index.ts | 0 .../inline/src/version.ts | 0 .../inline/tests/custom.test.ts | 0 .../inline/tests/unit/fetcher/Fetcher.test.ts | 0 .../unit/fetcher/createRequestUrl.test.ts | 0 .../tests/unit/fetcher/getFetchFn.test.ts | 0 .../tests/unit/fetcher/getRequestBody.test.ts | 0 .../unit/fetcher/getResponseBody.test.ts | 0 .../tests/unit/fetcher/makeRequest.test.ts | 0 .../unit/fetcher/requestWithRetries.test.ts | 0 .../inline/tests/unit/fetcher/signals.test.ts | 0 .../Node18UniversalStreamWrapper.test.ts | 0 .../NodePre18StreamWrapper.test.ts | 0 .../UndiciStreamWrapper.test.ts | 0 .../chooseStreamWrapper.test.ts | 0 .../fetcher/stream-wrappers/webpack.test.ts | 0 .../inline/tests/unit/fetcher/test-file.txt | 0 .../inline/tsconfig.json | 0 .../no-inline}/.github/workflows/ci.yml | 0 .../no-inline}/.gitignore | 0 .../.mock/definition/__package__.yml | 0 .../no-inline}/.mock/definition/api.yml | 0 .../no-inline}/.mock/fern.config.json | 0 .../no-inline}/.mock/generators.yml | 0 .../no-inline}/.npmignore | 0 .../no-inline}/.prettierrc.yml | 0 .../no-inline/README.md | 12 +- .../no-inline}/jest.config.js | 0 .../no-inline/package.json | 4 +- .../no-inline/reference.md | 0 .../no-inline/resolved-snippet-templates.md | 6 +- .../no-inline/snippet-templates.json | 12 +- .../no-inline}/snippet.json | 6 +- .../no-inline/src/Client.ts | 12 +- .../no-inline/src/api/client}/index.ts | 0 .../requests/GetDiscriminatedUnionRequest.ts | 0 .../GetUndiscriminatedUnionRequest.ts | 0 .../api/client/requests/PostRootRequest.ts | 0 .../src/api/client/requests/index.ts | 0 .../no-inline/src/api/index.ts | 0 .../src}/api/types/AliasInlineValue.ts | 0 .../src}/api/types/AliasListInline.ts | 0 .../src}/api/types/AliasMapInline.ts | 0 .../src}/api/types/AliasSetInline.ts | 0 .../src}/api/types/DiscriminatedUnion1.ts | 0 .../types/DiscriminatedUnion1InlineType1.ts | 0 ...scriminatedUnion1InlineType1InlineType1.ts | 0 .../types/DiscriminatedUnion1InlineType2.ts | 0 .../no-inline/src}/api/types/InlineEnum1.ts | 0 .../no-inline}/src/api/types/ReferenceType.ts | 0 .../src}/api/types/RequestTypeInlineType1.ts | 0 .../no-inline/src}/api/types/RootType1.ts | 0 .../src}/api/types/RootType1FooListItem.ts | 0 .../src}/api/types/RootType1FooMapValue.ts | 0 .../src}/api/types/RootType1FooSetItem.ts | 0 .../src}/api/types/RootType1InlineType1.ts | 0 .../RootType1InlineType1NestedInlineType1.ts | 0 .../src}/api/types/UndiscriminatedUnion1.ts | 0 ...ndiscriminatedUnion1DiscriminatedUnion1.ts | 0 ...tedUnion1DiscriminatedUnion1InlineType1.ts | 0 ...scriminatedUnion1InlineType1InlineType1.ts | 0 ...tedUnion1DiscriminatedUnion1InlineType2.ts | 0 .../types/UndiscriminatedUnion1InlineEnum1.ts | 0 .../UndiscriminatedUnion1InlineListItem1.ts | 0 .../UndiscriminatedUnion1InlineMapItem1.ts | 0 .../UndiscriminatedUnion1InlineSetItem1.ts | 0 .../types/UndiscriminatedUnion1InlineType1.ts | 0 ...scriminatedUnion1InlineType1InlineType1.ts | 0 .../types/UndiscriminatedUnion1InlineType2.ts | 0 .../no-inline}/src/api/types/UserId.ts | 0 .../no-inline/src}/api/types/index.ts | 0 .../no-inline/src/core/fetcher/APIResponse.ts | 0 .../no-inline/src/core/fetcher/Fetcher.ts | 0 .../no-inline/src/core/fetcher/Supplier.ts | 0 .../src/core/fetcher/createRequestUrl.ts | 0 .../no-inline/src/core/fetcher/getFetchFn.ts | 0 .../no-inline/src/core/fetcher/getHeader.ts | 0 .../src/core/fetcher/getRequestBody.ts | 0 .../src/core/fetcher/getResponseBody.ts | 0 .../no-inline/src/core/fetcher/index.ts | 0 .../no-inline/src/core/fetcher/makeRequest.ts | 0 .../src/core/fetcher/requestWithRetries.ts | 0 .../no-inline/src/core/fetcher/signals.ts | 0 .../Node18UniversalStreamWrapper.ts | 0 .../stream-wrappers/NodePre18StreamWrapper.ts | 0 .../stream-wrappers/UndiciStreamWrapper.ts | 0 .../stream-wrappers/chooseStreamWrapper.ts | 0 .../no-inline/src/core/index.ts | 0 .../no-inline/src/core/runtime/index.ts | 0 .../no-inline/src/core/runtime/runtime.ts | 0 .../no-inline/src/errors/SeedObjectError.ts | 0 .../src/errors/SeedObjectTimeoutError.ts | 0 .../no-inline/src/errors/index.ts | 0 .../no-inline/src/index.ts | 0 .../no-inline/src/version.ts | 0 .../no-inline/tests/custom.test.ts | 0 .../tests/unit/fetcher/Fetcher.test.ts | 0 .../unit/fetcher/createRequestUrl.test.ts | 0 .../tests/unit/fetcher/getFetchFn.test.ts | 0 .../tests/unit/fetcher/getRequestBody.test.ts | 0 .../unit/fetcher/getResponseBody.test.ts | 0 .../tests/unit/fetcher/makeRequest.test.ts | 0 .../unit/fetcher/requestWithRetries.test.ts | 0 .../tests/unit/fetcher/signals.test.ts | 0 .../Node18UniversalStreamWrapper.test.ts | 0 .../NodePre18StreamWrapper.test.ts | 0 .../UndiciStreamWrapper.test.ts | 0 .../chooseStreamWrapper.test.ts | 0 .../fetcher/stream-wrappers/webpack.test.ts | 0 .../tests/unit/fetcher/test-file.txt | 0 .../no-inline/tsconfig.json | 0 .../generators.yml | 0 .../openapi.yml | 0 .../inline-types/definition/__package__.yml | 365 -- .../fern/apis/inline-types/definition/api.yml | 1 - .../fern/apis/inline-types/generators.yml | 1 - .../definition/__package__.yml | 0 .../apis/ts-inline-types}/definition/api.yml | 0 .../fern/apis/ts-inline-types}/generators.yml | 0 1054 files changed, 53 insertions(+), 55374 deletions(-) delete mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__AliasOptionalInline.json delete mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineEnum.json delete mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineType1.json delete mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineType2.json delete mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlinedDiscriminatedUnion1.json delete mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlinedUndiscriminatedUnion1.json delete mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__MixedInlineType1.json delete mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__NestedInlineType1.json delete mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType2.json rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__AliasInlineValue.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__AliasListInline.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__AliasMapInline.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__AliasSetInline.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__DiscriminatedUnion1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__DiscriminatedUnion1InlineType1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__DiscriminatedUnion1InlineType1InlineType1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__DiscriminatedUnion1InlineType2.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__InlineEnum1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__ReferenceType.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__RequestTypeInlineType1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__RootType1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__RootType1FooListItem.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__RootType1FooMapValue.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__RootType1FooSetItem.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__RootType1InlineType1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__RootType1InlineType1NestedInlineType1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UndiscriminatedUnion1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UndiscriminatedUnion1DiscriminatedUnion1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType2.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UndiscriminatedUnion1InlineEnum1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UndiscriminatedUnion1InlineListItem1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UndiscriminatedUnion1InlineMapItem1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UndiscriminatedUnion1InlineSetItem1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UndiscriminatedUnion1InlineType1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UndiscriminatedUnion1InlineType1InlineType1.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UndiscriminatedUnion1InlineType2.json (100%) rename packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/{inline-types => ts-inline-types}/type__UserId.json (100%) rename packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/{inline-types.json => ts-inline-types.json} (100%) delete mode 100644 packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/inline-types.json rename packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/{inline-types.json => ts-inline-types.json} (100%) delete mode 100644 seed/csharp-model/inline-types/.github/workflows/ci.yml delete mode 100644 seed/csharp-model/inline-types/.gitignore delete mode 100644 seed/csharp-model/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/csharp-model/inline-types/snippet-templates.json delete mode 100644 seed/csharp-model/inline-types/snippet.json delete mode 100644 seed/csharp-model/inline-types/src/SeedObject.Test/Core/EnumSerializerTests.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject.Test/SeedObject.Test.Custom.props delete mode 100644 seed/csharp-model/inline-types/src/SeedObject.Test/SeedObject.Test.csproj delete mode 100644 seed/csharp-model/inline-types/src/SeedObject.sln delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/Core/CollectionItemSerializer.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/Core/Constants.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/Core/DateTimeSerializer.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/Core/EnumSerializer.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/Core/JsonConfiguration.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/Core/OneOfSerializer.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/Core/Public/Version.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/InlineEnum.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/InlineType1.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/InlineType2.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/NestedInlineType1.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/RootType1.cs delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/SeedObject.Custom.props delete mode 100644 seed/csharp-model/inline-types/src/SeedObject/SeedObject.csproj delete mode 100644 seed/csharp-sdk/inline-types/.github/workflows/ci.yml delete mode 100644 seed/csharp-sdk/inline-types/.gitignore delete mode 100644 seed/csharp-sdk/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/csharp-sdk/inline-types/README.md delete mode 100644 seed/csharp-sdk/inline-types/reference.md delete mode 100644 seed/csharp-sdk/inline-types/snippet-templates.json delete mode 100644 seed/csharp-sdk/inline-types/snippet.json delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject.Test/Core/EnumSerializerTests.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject.Test/Core/RawClientTests.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject.Test/SeedObject.Test.Custom.props delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject.Test/SeedObject.Test.csproj delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject.Test/TestClient.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject.Test/Unit/MockServer/BaseMockServerTest.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject.Test/Unit/MockServer/GetRootTest.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject.sln delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/CollectionItemSerializer.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/Constants.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/DateTimeSerializer.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/EnumSerializer.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/Extensions.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/HeaderValue.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/Headers.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/HttpMethodExtensions.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/IRequestOptions.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/JsonConfiguration.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/OneOfSerializer.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/ClientOptions.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/RequestOptions.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/SeedObjectApiException.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/SeedObjectException.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/Version.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Core/RawClient.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Requests/PostRootRequest.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/SeedObject.Custom.props delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/SeedObject.csproj delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/SeedObjectClient.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Types/InlineEnum.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Types/InlineType1.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Types/InlineType2.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Types/NestedInlineType1.cs delete mode 100644 seed/csharp-sdk/inline-types/src/SeedObject/Types/RootType1.cs delete mode 100644 seed/fastapi/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/fastapi/inline-types/.mock/fern.config.json delete mode 100644 seed/fastapi/inline-types/__init__.py delete mode 100644 seed/fastapi/inline-types/core/__init__.py delete mode 100644 seed/fastapi/inline-types/core/abstract_fern_service.py delete mode 100644 seed/fastapi/inline-types/core/datetime_utils.py delete mode 100644 seed/fastapi/inline-types/core/exceptions/__init__.py delete mode 100644 seed/fastapi/inline-types/core/exceptions/fern_http_exception.py delete mode 100644 seed/fastapi/inline-types/core/exceptions/handlers.py delete mode 100644 seed/fastapi/inline-types/core/exceptions/unauthorized.py delete mode 100644 seed/fastapi/inline-types/core/pydantic_utilities.py delete mode 100644 seed/fastapi/inline-types/core/route_args.py delete mode 100644 seed/fastapi/inline-types/core/security/__init__.py delete mode 100644 seed/fastapi/inline-types/core/security/bearer.py delete mode 100644 seed/fastapi/inline-types/core/serialization.py delete mode 100644 seed/fastapi/inline-types/register.py delete mode 100644 seed/fastapi/inline-types/service/__init__.py delete mode 100644 seed/fastapi/inline-types/service/post_root_request.py delete mode 100644 seed/fastapi/inline-types/service/service.py delete mode 100644 seed/fastapi/inline-types/snippet-templates.json delete mode 100644 seed/fastapi/inline-types/snippet.json delete mode 100644 seed/fastapi/inline-types/types/__init__.py delete mode 100644 seed/fastapi/inline-types/types/inline_enum.py delete mode 100644 seed/fastapi/inline-types/types/inline_type_1.py delete mode 100644 seed/fastapi/inline-types/types/inline_type_2.py delete mode 100644 seed/fastapi/inline-types/types/inlined_discriminated_union_1.py delete mode 100644 seed/fastapi/inline-types/types/inlined_undiscriminated_union_1.py delete mode 100644 seed/fastapi/inline-types/types/nested_inline_type_1.py delete mode 100644 seed/fastapi/inline-types/types/root_type_1.py delete mode 100644 seed/go-fiber/inline-types/.github/workflows/ci.yml delete mode 100644 seed/go-fiber/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/go-fiber/inline-types/.mock/definition/api.yml delete mode 100644 seed/go-fiber/inline-types/.mock/fern.config.json delete mode 100644 seed/go-fiber/inline-types/.mock/generators.yml delete mode 100644 seed/go-fiber/inline-types/go.mod delete mode 100644 seed/go-fiber/inline-types/go.sum delete mode 100644 seed/go-fiber/inline-types/internal/extra_properties.go delete mode 100644 seed/go-fiber/inline-types/internal/extra_properties_test.go delete mode 100644 seed/go-fiber/inline-types/internal/stringer.go delete mode 100644 seed/go-fiber/inline-types/internal/time.go delete mode 100644 seed/go-fiber/inline-types/snippet-templates.json delete mode 100644 seed/go-fiber/inline-types/snippet.json delete mode 100644 seed/go-fiber/inline-types/types.go delete mode 100644 seed/go-model/inline-types/.github/workflows/ci.yml delete mode 100644 seed/go-model/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/go-model/inline-types/.mock/definition/api.yml delete mode 100644 seed/go-model/inline-types/.mock/fern.config.json delete mode 100644 seed/go-model/inline-types/.mock/generators.yml delete mode 100644 seed/go-model/inline-types/go.mod delete mode 100644 seed/go-model/inline-types/go.sum delete mode 100644 seed/go-model/inline-types/internal/extra_properties.go delete mode 100644 seed/go-model/inline-types/internal/extra_properties_test.go delete mode 100644 seed/go-model/inline-types/internal/stringer.go delete mode 100644 seed/go-model/inline-types/internal/time.go delete mode 100644 seed/go-model/inline-types/snippet-templates.json delete mode 100644 seed/go-model/inline-types/snippet.json delete mode 100644 seed/go-model/inline-types/types.go delete mode 100644 seed/go-sdk/inline-types/.github/workflows/ci.yml delete mode 100644 seed/go-sdk/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/go-sdk/inline-types/.mock/definition/api.yml delete mode 100644 seed/go-sdk/inline-types/.mock/fern.config.json delete mode 100644 seed/go-sdk/inline-types/.mock/generators.yml delete mode 100644 seed/go-sdk/inline-types/client/client.go delete mode 100644 seed/go-sdk/inline-types/client/client_test.go delete mode 100644 seed/go-sdk/inline-types/core/api_error.go delete mode 100644 seed/go-sdk/inline-types/core/http.go delete mode 100644 seed/go-sdk/inline-types/core/request_option.go delete mode 100644 seed/go-sdk/inline-types/dynamic-snippets/example0/snippet.go delete mode 100644 seed/go-sdk/inline-types/file_param.go delete mode 100644 seed/go-sdk/inline-types/go.mod delete mode 100644 seed/go-sdk/inline-types/go.sum delete mode 100644 seed/go-sdk/inline-types/internal/caller.go delete mode 100644 seed/go-sdk/inline-types/internal/caller_test.go delete mode 100644 seed/go-sdk/inline-types/internal/error_decoder.go delete mode 100644 seed/go-sdk/inline-types/internal/error_decoder_test.go delete mode 100644 seed/go-sdk/inline-types/internal/extra_properties.go delete mode 100644 seed/go-sdk/inline-types/internal/extra_properties_test.go delete mode 100644 seed/go-sdk/inline-types/internal/http.go delete mode 100644 seed/go-sdk/inline-types/internal/query.go delete mode 100644 seed/go-sdk/inline-types/internal/query_test.go delete mode 100644 seed/go-sdk/inline-types/internal/retrier.go delete mode 100644 seed/go-sdk/inline-types/internal/retrier_test.go delete mode 100644 seed/go-sdk/inline-types/internal/stringer.go delete mode 100644 seed/go-sdk/inline-types/internal/time.go delete mode 100644 seed/go-sdk/inline-types/option/request_option.go delete mode 100644 seed/go-sdk/inline-types/pointer.go delete mode 100644 seed/go-sdk/inline-types/snippet-templates.json delete mode 100644 seed/go-sdk/inline-types/snippet.json delete mode 100644 seed/go-sdk/inline-types/types.go delete mode 100644 seed/java-model/inline-types/.github/workflows/ci.yml delete mode 100644 seed/java-model/inline-types/.gitignore delete mode 100644 seed/java-model/inline-types/.gradle/8.5/checksums/checksums.lock delete mode 100644 seed/java-model/inline-types/.gradle/8.5/checksums/md5-checksums.bin delete mode 100644 seed/java-model/inline-types/.gradle/8.5/checksums/sha1-checksums.bin delete mode 100644 seed/java-model/inline-types/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock delete mode 100644 seed/java-model/inline-types/.gradle/8.5/dependencies-accessors/gc.properties delete mode 100644 seed/java-model/inline-types/.gradle/8.5/executionHistory/executionHistory.bin delete mode 100644 seed/java-model/inline-types/.gradle/8.5/executionHistory/executionHistory.lock delete mode 100644 seed/java-model/inline-types/.gradle/8.5/fileChanges/last-build.bin delete mode 100644 seed/java-model/inline-types/.gradle/8.5/fileHashes/fileHashes.bin delete mode 100644 seed/java-model/inline-types/.gradle/8.5/fileHashes/fileHashes.lock delete mode 100644 seed/java-model/inline-types/.gradle/8.5/gc.properties delete mode 100644 seed/java-model/inline-types/.gradle/buildOutputCleanup/buildOutputCleanup.lock delete mode 100644 seed/java-model/inline-types/.gradle/buildOutputCleanup/cache.properties delete mode 100644 seed/java-model/inline-types/.gradle/buildOutputCleanup/outputFiles.bin delete mode 100644 seed/java-model/inline-types/.gradle/vcs-1/gc.properties delete mode 100644 seed/java-model/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/java-model/inline-types/.mock/definition/api.yml delete mode 100644 seed/java-model/inline-types/.mock/fern.config.json delete mode 100644 seed/java-model/inline-types/.mock/generators.yml delete mode 100644 seed/java-model/inline-types/build.gradle delete mode 100644 seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/DateTimeDeserializer.java delete mode 100644 seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ObjectMappers.java delete mode 100644 seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlineEnum.java delete mode 100644 seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlineType1.java delete mode 100644 seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlineType2.java delete mode 100644 seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlinedDiscriminatedUnion1.java delete mode 100644 seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlinedUndiscriminatedUnion1.java delete mode 100644 seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/NestedInlineType1.java delete mode 100644 seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/RootType1.java delete mode 100644 seed/java-model/inline-types/build/tmp/spotless-register-dependencies delete mode 100644 seed/java-model/inline-types/settings.gradle delete mode 100644 seed/java-model/inline-types/snippet-templates.json delete mode 100644 seed/java-model/inline-types/snippet.json delete mode 100644 seed/java-model/inline-types/src/main/java/com/seed/object/core/DateTimeDeserializer.java delete mode 100644 seed/java-model/inline-types/src/main/java/com/seed/object/core/ObjectMappers.java delete mode 100644 seed/java-model/inline-types/src/main/java/com/seed/object/model/InlineEnum.java delete mode 100644 seed/java-model/inline-types/src/main/java/com/seed/object/model/InlineType1.java delete mode 100644 seed/java-model/inline-types/src/main/java/com/seed/object/model/InlineType2.java delete mode 100644 seed/java-model/inline-types/src/main/java/com/seed/object/model/InlinedDiscriminatedUnion1.java delete mode 100644 seed/java-model/inline-types/src/main/java/com/seed/object/model/InlinedUndiscriminatedUnion1.java delete mode 100644 seed/java-model/inline-types/src/main/java/com/seed/object/model/NestedInlineType1.java delete mode 100644 seed/java-model/inline-types/src/main/java/com/seed/object/model/RootType1.java delete mode 100644 seed/java-sdk/inline-types/.github/workflows/ci.yml delete mode 100644 seed/java-sdk/inline-types/.gitignore delete mode 100644 seed/java-sdk/inline-types/.gradle/8.11.1/checksums/checksums.lock delete mode 100644 seed/java-sdk/inline-types/.gradle/8.11.1/checksums/md5-checksums.bin delete mode 100644 seed/java-sdk/inline-types/.gradle/8.11.1/checksums/sha1-checksums.bin delete mode 100644 seed/java-sdk/inline-types/.gradle/8.11.1/executionHistory/executionHistory.bin delete mode 100644 seed/java-sdk/inline-types/.gradle/8.11.1/executionHistory/executionHistory.lock delete mode 100644 seed/java-sdk/inline-types/.gradle/8.11.1/fileChanges/last-build.bin delete mode 100644 seed/java-sdk/inline-types/.gradle/8.11.1/fileHashes/fileHashes.bin delete mode 100644 seed/java-sdk/inline-types/.gradle/8.11.1/fileHashes/fileHashes.lock delete mode 100644 seed/java-sdk/inline-types/.gradle/8.11.1/gc.properties delete mode 100644 seed/java-sdk/inline-types/.gradle/buildOutputCleanup/buildOutputCleanup.lock delete mode 100644 seed/java-sdk/inline-types/.gradle/buildOutputCleanup/cache.properties delete mode 100644 seed/java-sdk/inline-types/.gradle/buildOutputCleanup/outputFiles.bin delete mode 100644 seed/java-sdk/inline-types/.gradle/vcs-1/gc.properties delete mode 100644 seed/java-sdk/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/java-sdk/inline-types/.mock/definition/api.yml delete mode 100644 seed/java-sdk/inline-types/.mock/fern.config.json delete mode 100644 seed/java-sdk/inline-types/.mock/generators.yml delete mode 100644 seed/java-sdk/inline-types/build.gradle delete mode 100644 seed/java-sdk/inline-types/build/reports/problems/problems-report.html delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/SeedObjectClient.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/SeedObjectClientBuilder.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ClientOptions.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/DateTimeDeserializer.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/Environment.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/FileStream.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/InputStreamRequestBody.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/MediaTypes.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ObjectMappers.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/RequestOptions.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ResponseBodyInputStream.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ResponseBodyReader.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/RetryInterceptor.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/SeedObjectApiException.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/SeedObjectException.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/Stream.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/Suppliers.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/requests/PostRootRequest.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlineEnum.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlineType1.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlineType2.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlinedDiscriminatedUnion1.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlinedUndiscriminatedUnion1.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/NestedInlineType1.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/RootType1.java delete mode 100644 seed/java-sdk/inline-types/build/spotless/spotlessJava/src/test/java/com/seed/object/TestClient.java delete mode 100644 seed/java-sdk/inline-types/build/tmp/spotless-register-dependencies delete mode 100644 seed/java-sdk/inline-types/sample-app/build.gradle delete mode 100644 seed/java-sdk/inline-types/sample-app/src/main/java/sample/App.java delete mode 100644 seed/java-sdk/inline-types/settings.gradle delete mode 100644 seed/java-sdk/inline-types/snippet-templates.json delete mode 100644 seed/java-sdk/inline-types/snippet.json delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/SeedObjectClient.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/SeedObjectClientBuilder.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ClientOptions.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/DateTimeDeserializer.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/Environment.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/FileStream.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/InputStreamRequestBody.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/MediaTypes.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ObjectMappers.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/RequestOptions.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ResponseBodyInputStream.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ResponseBodyReader.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/RetryInterceptor.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/SeedObjectApiException.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/SeedObjectException.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/Stream.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/core/Suppliers.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/requests/PostRootRequest.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlineEnum.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlineType1.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlineType2.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlinedDiscriminatedUnion1.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlinedUndiscriminatedUnion1.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/types/NestedInlineType1.java delete mode 100644 seed/java-sdk/inline-types/src/main/java/com/seed/object/types/RootType1.java delete mode 100644 seed/java-sdk/inline-types/src/test/java/com/seed/object/TestClient.java delete mode 100644 seed/java-spring/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/java-spring/inline-types/.mock/definition/api.yml delete mode 100644 seed/java-spring/inline-types/.mock/fern.config.json delete mode 100644 seed/java-spring/inline-types/.mock/generators.yml delete mode 100644 seed/java-spring/inline-types/RootService.java delete mode 100644 seed/java-spring/inline-types/core/APIException.java delete mode 100644 seed/java-spring/inline-types/core/DateTimeDeserializer.java delete mode 100644 seed/java-spring/inline-types/core/ObjectMappers.java delete mode 100644 seed/java-spring/inline-types/requests/PostRootRequest.java delete mode 100644 seed/java-spring/inline-types/snippet-templates.json delete mode 100644 seed/java-spring/inline-types/snippet.json delete mode 100644 seed/java-spring/inline-types/types/InlineEnum.java delete mode 100644 seed/java-spring/inline-types/types/InlineType1.java delete mode 100644 seed/java-spring/inline-types/types/InlineType2.java delete mode 100644 seed/java-spring/inline-types/types/InlinedDiscriminatedUnion1.java delete mode 100644 seed/java-spring/inline-types/types/InlinedUndiscriminatedUnion1.java delete mode 100644 seed/java-spring/inline-types/types/NestedInlineType1.java delete mode 100644 seed/java-spring/inline-types/types/RootType1.java delete mode 100644 seed/openapi/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/openapi/inline-types/.mock/definition/api.yml delete mode 100644 seed/openapi/inline-types/.mock/fern.config.json delete mode 100644 seed/openapi/inline-types/.mock/generators.yml delete mode 100644 seed/openapi/inline-types/openapi.yml delete mode 100644 seed/openapi/inline-types/snippet-templates.json delete mode 100644 seed/openapi/inline-types/snippet.json delete mode 100644 seed/php-model/inline-types/.github/workflows/ci.yml delete mode 100644 seed/php-model/inline-types/.gitignore delete mode 100644 seed/php-model/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/php-model/inline-types/.mock/definition/api.yml delete mode 100644 seed/php-model/inline-types/.mock/fern.config.json delete mode 100644 seed/php-model/inline-types/.mock/generators.yml delete mode 100644 seed/php-model/inline-types/composer.json delete mode 100644 seed/php-model/inline-types/phpstan.neon delete mode 100644 seed/php-model/inline-types/phpunit.xml delete mode 100644 seed/php-model/inline-types/snippet-templates.json delete mode 100644 seed/php-model/inline-types/snippet.json delete mode 100644 seed/php-model/inline-types/src/Core/Json/JsonDecoder.php delete mode 100644 seed/php-model/inline-types/src/Core/Json/JsonDeserializer.php delete mode 100644 seed/php-model/inline-types/src/Core/Json/JsonEncoder.php delete mode 100644 seed/php-model/inline-types/src/Core/Json/JsonProperty.php delete mode 100644 seed/php-model/inline-types/src/Core/Json/JsonSerializableType.php delete mode 100644 seed/php-model/inline-types/src/Core/Json/JsonSerializer.php delete mode 100644 seed/php-model/inline-types/src/Core/Json/Utils.php delete mode 100644 seed/php-model/inline-types/src/Core/Types/ArrayType.php delete mode 100644 seed/php-model/inline-types/src/Core/Types/Constant.php delete mode 100644 seed/php-model/inline-types/src/Core/Types/Date.php delete mode 100644 seed/php-model/inline-types/src/Core/Types/Union.php delete mode 100644 seed/php-model/inline-types/src/InlineEnum.php delete mode 100644 seed/php-model/inline-types/src/InlineType1.php delete mode 100644 seed/php-model/inline-types/src/InlineType2.php delete mode 100644 seed/php-model/inline-types/src/NestedInlineType1.php delete mode 100644 seed/php-model/inline-types/src/RootType1.php delete mode 100644 seed/php-model/inline-types/tests/Seed/Core/Json/DateArrayTest.php delete mode 100644 seed/php-model/inline-types/tests/Seed/Core/Json/EmptyArrayTest.php delete mode 100644 seed/php-model/inline-types/tests/Seed/Core/Json/EnumTest.php delete mode 100644 seed/php-model/inline-types/tests/Seed/Core/Json/ExhaustiveTest.php delete mode 100644 seed/php-model/inline-types/tests/Seed/Core/Json/InvalidTest.php delete mode 100644 seed/php-model/inline-types/tests/Seed/Core/Json/NestedUnionArrayTest.php delete mode 100644 seed/php-model/inline-types/tests/Seed/Core/Json/NullPropertyTest.php delete mode 100644 seed/php-model/inline-types/tests/Seed/Core/Json/NullableArrayTest.php delete mode 100644 seed/php-model/inline-types/tests/Seed/Core/Json/ScalarTest.php delete mode 100644 seed/php-model/inline-types/tests/Seed/Core/Json/TraitTest.php delete mode 100644 seed/php-model/inline-types/tests/Seed/Core/Json/UnionArrayTest.php delete mode 100644 seed/php-model/inline-types/tests/Seed/Core/Json/UnionPropertyTest.php delete mode 100644 seed/php-sdk/inline-types/.github/workflows/ci.yml delete mode 100644 seed/php-sdk/inline-types/.gitignore delete mode 100644 seed/php-sdk/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/php-sdk/inline-types/.mock/definition/api.yml delete mode 100644 seed/php-sdk/inline-types/.mock/fern.config.json delete mode 100644 seed/php-sdk/inline-types/.mock/generators.yml delete mode 100644 seed/php-sdk/inline-types/composer.json delete mode 100644 seed/php-sdk/inline-types/phpstan.neon delete mode 100644 seed/php-sdk/inline-types/phpunit.xml delete mode 100644 seed/php-sdk/inline-types/snippet-templates.json delete mode 100644 seed/php-sdk/inline-types/snippet.json delete mode 100644 seed/php-sdk/inline-types/src/Core/Client/BaseApiRequest.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Client/HttpMethod.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Client/RawClient.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Json/JsonApiRequest.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Json/JsonDecoder.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Json/JsonDeserializer.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Json/JsonEncoder.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Json/JsonProperty.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Json/JsonSerializableType.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Json/JsonSerializer.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Json/Utils.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Multipart/MultipartApiRequest.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Multipart/MultipartFormData.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Multipart/MultipartFormDataPart.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Types/ArrayType.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Types/Constant.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Types/Date.php delete mode 100644 seed/php-sdk/inline-types/src/Core/Types/Union.php delete mode 100644 seed/php-sdk/inline-types/src/Exceptions/SeedApiException.php delete mode 100644 seed/php-sdk/inline-types/src/Exceptions/SeedException.php delete mode 100644 seed/php-sdk/inline-types/src/Requests/PostRootRequest.php delete mode 100644 seed/php-sdk/inline-types/src/SeedClient.php delete mode 100644 seed/php-sdk/inline-types/src/Types/InlineEnum.php delete mode 100644 seed/php-sdk/inline-types/src/Types/InlineType1.php delete mode 100644 seed/php-sdk/inline-types/src/Types/InlineType2.php delete mode 100644 seed/php-sdk/inline-types/src/Types/NestedInlineType1.php delete mode 100644 seed/php-sdk/inline-types/src/Types/RootType1.php delete mode 100644 seed/php-sdk/inline-types/src/Utils/File.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Client/RawClientTest.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Json/DateArrayTest.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Json/EmptyArrayTest.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Json/EnumTest.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Json/ExhaustiveTest.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Json/InvalidTest.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Json/NestedUnionArrayTest.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Json/NullPropertyTest.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Json/NullableArrayTest.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Json/ScalarTest.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Json/TraitTest.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Json/UnionArrayTest.php delete mode 100644 seed/php-sdk/inline-types/tests/Seed/Core/Json/UnionPropertyTest.php delete mode 100644 seed/postman/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/postman/inline-types/.mock/definition/api.yml delete mode 100644 seed/postman/inline-types/.mock/fern.config.json delete mode 100644 seed/postman/inline-types/.mock/generators.yml delete mode 100644 seed/postman/inline-types/collection.json delete mode 100644 seed/postman/inline-types/snippet-templates.json delete mode 100644 seed/postman/inline-types/snippet.json delete mode 100644 seed/pydantic/inline-types/.github/workflows/ci.yml delete mode 100644 seed/pydantic/inline-types/.gitignore delete mode 100644 seed/pydantic/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/pydantic/inline-types/.mock/definition/api.yml delete mode 100644 seed/pydantic/inline-types/.mock/fern.config.json delete mode 100644 seed/pydantic/inline-types/.mock/generators.yml delete mode 100644 seed/pydantic/inline-types/README.md delete mode 100644 seed/pydantic/inline-types/pyproject.toml delete mode 100644 seed/pydantic/inline-types/snippet-templates.json delete mode 100644 seed/pydantic/inline-types/snippet.json delete mode 100644 seed/pydantic/inline-types/src/seed/object/__init__.py delete mode 100644 seed/pydantic/inline-types/src/seed/object/core/__init__.py delete mode 100644 seed/pydantic/inline-types/src/seed/object/core/datetime_utils.py delete mode 100644 seed/pydantic/inline-types/src/seed/object/core/pydantic_utilities.py delete mode 100644 seed/pydantic/inline-types/src/seed/object/core/serialization.py delete mode 100644 seed/pydantic/inline-types/src/seed/object/inline_enum.py delete mode 100644 seed/pydantic/inline-types/src/seed/object/inline_type_1.py delete mode 100644 seed/pydantic/inline-types/src/seed/object/inline_type_2.py delete mode 100644 seed/pydantic/inline-types/src/seed/object/inlined_discriminated_union_1.py delete mode 100644 seed/pydantic/inline-types/src/seed/object/inlined_undiscriminated_union_1.py delete mode 100644 seed/pydantic/inline-types/src/seed/object/nested_inline_type_1.py delete mode 100644 seed/pydantic/inline-types/src/seed/object/py.typed delete mode 100644 seed/pydantic/inline-types/src/seed/object/root_type_1.py delete mode 100644 seed/pydantic/inline-types/tests/custom/test_client.py delete mode 100644 seed/python-sdk/inline-types/.github/workflows/ci.yml delete mode 100644 seed/python-sdk/inline-types/.gitignore delete mode 100644 seed/python-sdk/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/python-sdk/inline-types/.mock/definition/api.yml delete mode 100644 seed/python-sdk/inline-types/.mock/fern.config.json delete mode 100644 seed/python-sdk/inline-types/.mock/generators.yml delete mode 100644 seed/python-sdk/inline-types/README.md delete mode 100644 seed/python-sdk/inline-types/pyproject.toml delete mode 100644 seed/python-sdk/inline-types/reference.md delete mode 100644 seed/python-sdk/inline-types/resolved-snippet-templates.md delete mode 100644 seed/python-sdk/inline-types/snippet-templates.json delete mode 100644 seed/python-sdk/inline-types/snippet.json delete mode 100644 seed/python-sdk/inline-types/src/seed/__init__.py delete mode 100644 seed/python-sdk/inline-types/src/seed/client.py delete mode 100644 seed/python-sdk/inline-types/src/seed/core/__init__.py delete mode 100644 seed/python-sdk/inline-types/src/seed/core/api_error.py delete mode 100644 seed/python-sdk/inline-types/src/seed/core/client_wrapper.py delete mode 100644 seed/python-sdk/inline-types/src/seed/core/datetime_utils.py delete mode 100644 seed/python-sdk/inline-types/src/seed/core/file.py delete mode 100644 seed/python-sdk/inline-types/src/seed/core/http_client.py delete mode 100644 seed/python-sdk/inline-types/src/seed/core/jsonable_encoder.py delete mode 100644 seed/python-sdk/inline-types/src/seed/core/pydantic_utilities.py delete mode 100644 seed/python-sdk/inline-types/src/seed/core/query_encoder.py delete mode 100644 seed/python-sdk/inline-types/src/seed/core/remove_none_from_dict.py delete mode 100644 seed/python-sdk/inline-types/src/seed/core/request_options.py delete mode 100644 seed/python-sdk/inline-types/src/seed/core/serialization.py delete mode 100644 seed/python-sdk/inline-types/src/seed/py.typed delete mode 100644 seed/python-sdk/inline-types/src/seed/types/__init__.py delete mode 100644 seed/python-sdk/inline-types/src/seed/types/inline_enum.py delete mode 100644 seed/python-sdk/inline-types/src/seed/types/inline_type_1.py delete mode 100644 seed/python-sdk/inline-types/src/seed/types/inline_type_2.py delete mode 100644 seed/python-sdk/inline-types/src/seed/types/inlined_discriminated_union_1.py delete mode 100644 seed/python-sdk/inline-types/src/seed/types/inlined_undiscriminated_union_1.py delete mode 100644 seed/python-sdk/inline-types/src/seed/types/nested_inline_type_1.py delete mode 100644 seed/python-sdk/inline-types/src/seed/types/root_type_1.py delete mode 100644 seed/python-sdk/inline-types/src/seed/version.py delete mode 100644 seed/python-sdk/inline-types/tests/__init__.py delete mode 100644 seed/python-sdk/inline-types/tests/conftest.py delete mode 100644 seed/python-sdk/inline-types/tests/custom/test_client.py delete mode 100644 seed/python-sdk/inline-types/tests/test_root.py delete mode 100644 seed/python-sdk/inline-types/tests/utilities.py delete mode 100644 seed/python-sdk/inline-types/tests/utils/__init__.py delete mode 100644 seed/python-sdk/inline-types/tests/utils/assets/models/__init__.py delete mode 100644 seed/python-sdk/inline-types/tests/utils/assets/models/circle.py delete mode 100644 seed/python-sdk/inline-types/tests/utils/assets/models/color.py delete mode 100644 seed/python-sdk/inline-types/tests/utils/assets/models/object_with_defaults.py delete mode 100644 seed/python-sdk/inline-types/tests/utils/assets/models/object_with_optional_field.py delete mode 100644 seed/python-sdk/inline-types/tests/utils/assets/models/shape.py delete mode 100644 seed/python-sdk/inline-types/tests/utils/assets/models/square.py delete mode 100644 seed/python-sdk/inline-types/tests/utils/assets/models/undiscriminated_shape.py delete mode 100644 seed/python-sdk/inline-types/tests/utils/test_http_client.py delete mode 100644 seed/python-sdk/inline-types/tests/utils/test_query_encoding.py delete mode 100644 seed/python-sdk/inline-types/tests/utils/test_serialization.py delete mode 100644 seed/ruby-model/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/ruby-model/inline-types/.mock/definition/api.yml delete mode 100644 seed/ruby-model/inline-types/.mock/fern.config.json delete mode 100644 seed/ruby-model/inline-types/.mock/generators.yml delete mode 100644 seed/ruby-model/inline-types/.rubocop.yml delete mode 100644 seed/ruby-model/inline-types/Gemfile delete mode 100644 seed/ruby-model/inline-types/Rakefile delete mode 100644 seed/ruby-model/inline-types/lib/gemconfig.rb delete mode 100644 seed/ruby-model/inline-types/lib/seed_object_client.rb delete mode 100644 seed/ruby-model/inline-types/lib/seed_object_client/types/inline_enum.rb delete mode 100644 seed/ruby-model/inline-types/lib/seed_object_client/types/inline_type_1.rb delete mode 100644 seed/ruby-model/inline-types/lib/seed_object_client/types/inline_type_2.rb delete mode 100644 seed/ruby-model/inline-types/lib/seed_object_client/types/inlined_discriminated_union_1.rb delete mode 100644 seed/ruby-model/inline-types/lib/seed_object_client/types/inlined_undiscriminated_union_1.rb delete mode 100644 seed/ruby-model/inline-types/lib/seed_object_client/types/nested_inline_type_1.rb delete mode 100644 seed/ruby-model/inline-types/lib/seed_object_client/types/root_type_1.rb delete mode 100644 seed/ruby-model/inline-types/seed_object_client.gemspec delete mode 100644 seed/ruby-model/inline-types/snippet-templates.json delete mode 100644 seed/ruby-model/inline-types/snippet.json delete mode 100644 seed/ruby-model/inline-types/test/test_helper.rb delete mode 100644 seed/ruby-model/inline-types/test/test_seed_object_client.rb delete mode 100644 seed/ruby-sdk/inline-types/.github/workflows/publish.yml delete mode 100644 seed/ruby-sdk/inline-types/.gitignore delete mode 100644 seed/ruby-sdk/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/ruby-sdk/inline-types/.mock/definition/api.yml delete mode 100644 seed/ruby-sdk/inline-types/.mock/fern.config.json delete mode 100644 seed/ruby-sdk/inline-types/.mock/generators.yml delete mode 100644 seed/ruby-sdk/inline-types/.rubocop.yml delete mode 100644 seed/ruby-sdk/inline-types/Gemfile delete mode 100644 seed/ruby-sdk/inline-types/README.md delete mode 100644 seed/ruby-sdk/inline-types/Rakefile delete mode 100644 seed/ruby-sdk/inline-types/fern_inline_types.gemspec delete mode 100644 seed/ruby-sdk/inline-types/lib/fern_inline_types.rb delete mode 100644 seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inline_enum.rb delete mode 100644 seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inline_type_1.rb delete mode 100644 seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inline_type_2.rb delete mode 100644 seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inlined_discriminated_union_1.rb delete mode 100644 seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inlined_undiscriminated_union_1.rb delete mode 100644 seed/ruby-sdk/inline-types/lib/fern_inline_types/types/nested_inline_type_1.rb delete mode 100644 seed/ruby-sdk/inline-types/lib/fern_inline_types/types/root_type_1.rb delete mode 100644 seed/ruby-sdk/inline-types/lib/gemconfig.rb delete mode 100644 seed/ruby-sdk/inline-types/lib/requests.rb delete mode 100644 seed/ruby-sdk/inline-types/lib/types_export.rb delete mode 100644 seed/ruby-sdk/inline-types/snippet-templates.json delete mode 100644 seed/ruby-sdk/inline-types/snippet.json delete mode 100644 seed/ruby-sdk/inline-types/test/test_fern_inline_types.rb delete mode 100644 seed/ruby-sdk/inline-types/test/test_helper.rb delete mode 100644 seed/ts-express/inline-types/.mock/definition/api.yml delete mode 100644 seed/ts-express/inline-types/.mock/fern.config.json delete mode 100644 seed/ts-express/inline-types/.mock/generators.yml delete mode 100644 seed/ts-express/inline-types/.mock/ir.json delete mode 100644 seed/ts-express/inline-types/api/index.ts delete mode 100644 seed/ts-express/inline-types/api/service/RootService.ts delete mode 100644 seed/ts-express/inline-types/api/service/requests/GetDiscriminatedUnionRequest.ts delete mode 100644 seed/ts-express/inline-types/api/service/requests/GetUndiscriminatedUnionRequest.ts delete mode 100644 seed/ts-express/inline-types/api/service/requests/PostRootRequest.ts delete mode 100644 seed/ts-express/inline-types/api/service/requests/index.ts delete mode 100644 seed/ts-express/inline-types/core/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/Schema.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/bigint/bigint.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/bigint/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/date/date.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/date/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/enum/enum.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/enum/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/lazy/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/lazy/lazy.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/lazy/lazyObject.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/list/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/list/list.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/literals/booleanLiteral.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/literals/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/literals/stringLiteral.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/object-like/getObjectLikeUtils.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/object-like/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/object-like/types.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/object/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/object/object.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/object/objectWithoutOptionalProperties.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/object/property.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/object/types.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/primitives/any.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/primitives/boolean.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/primitives/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/primitives/number.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/primitives/string.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/primitives/unknown.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/record/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/record/record.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/record/types.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/schema-utils/JsonError.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/schema-utils/ParseError.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/schema-utils/getSchemaUtils.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/schema-utils/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/schema-utils/stringifyValidationErrors.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/set/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/set/set.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/undiscriminated-union/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/undiscriminated-union/types.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/union/discriminant.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/union/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/union/types.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/builders/union/union.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/index.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/utils/MaybePromise.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/utils/addQuestionMarksToNullableProperties.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/utils/createIdentitySchemaCreator.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/utils/entries.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/utils/filterObject.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/utils/getErrorMessageForIncorrectType.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/utils/isPlainObject.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/utils/keys.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/utils/maybeSkipValidation.ts delete mode 100644 seed/ts-express/inline-types/core/schemas/utils/partition.ts delete mode 100644 seed/ts-express/inline-types/errors/SeedObjectError.ts delete mode 100644 seed/ts-express/inline-types/errors/index.ts delete mode 100644 seed/ts-express/inline-types/index.ts delete mode 100644 seed/ts-express/inline-types/register.ts delete mode 100644 seed/ts-express/inline-types/serialization/index.ts delete mode 100644 seed/ts-express/inline-types/serialization/service/requests/GetDiscriminatedUnionRequest.ts delete mode 100644 seed/ts-express/inline-types/serialization/service/requests/GetUndiscriminatedUnionRequest.ts delete mode 100644 seed/ts-express/inline-types/serialization/service/requests/PostRootRequest.ts delete mode 100644 seed/ts-express/inline-types/serialization/service/requests/index.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/AliasInlineValue.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/AliasListInline.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/AliasMapInline.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/AliasSetInline.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1InlineType1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1InlineType1InlineType1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1InlineType2.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/InlineEnum1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/ReferenceType.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/RequestTypeInlineType1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/RootType1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/RootType1FooListItem.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/RootType1FooMapValue.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/RootType1FooSetItem.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/RootType1InlineType1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/RootType1InlineType1NestedInlineType1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineEnum1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineListItem1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineMapItem1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineSetItem1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineType1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineType1InlineType1.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineType2.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/UserId.ts delete mode 100644 seed/ts-express/inline-types/serialization/types/index.ts delete mode 100644 seed/ts-express/inline-types/snippet-templates.json delete mode 100644 seed/ts-express/inline-types/snippet.json delete mode 100644 seed/ts-sdk/inline-types/.mock/definition/__package__.yml delete mode 100644 seed/ts-sdk/inline-types/.mock/definition/api.yml delete mode 100644 seed/ts-sdk/inline-types/.mock/fern.config.json delete mode 100644 seed/ts-sdk/inline-types/.mock/generators.yml delete mode 100644 seed/ts-sdk/inline-types/README.md delete mode 100644 seed/ts-sdk/inline-types/inline/.mock/definition/api.yml delete mode 100644 seed/ts-sdk/inline-types/inline/.mock/fern.config.json delete mode 100644 seed/ts-sdk/inline-types/inline/.mock/generators.yml delete mode 100644 seed/ts-sdk/inline-types/inline/.mock/ir.json delete mode 100644 seed/ts-sdk/inline-types/inline/package.json delete mode 100644 seed/ts-sdk/inline-types/inline/src/api/client/index.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/.github/workflows/ci.yml delete mode 100644 seed/ts-sdk/inline-types/no-inline/.gitignore delete mode 100644 seed/ts-sdk/inline-types/no-inline/.mock/definition/api.yml delete mode 100644 seed/ts-sdk/inline-types/no-inline/.mock/fern.config.json delete mode 100644 seed/ts-sdk/inline-types/no-inline/.mock/generators.yml delete mode 100644 seed/ts-sdk/inline-types/no-inline/.mock/ir.json delete mode 100644 seed/ts-sdk/inline-types/no-inline/.npmignore delete mode 100644 seed/ts-sdk/inline-types/no-inline/.prettierrc.yml delete mode 100644 seed/ts-sdk/inline-types/no-inline/jest.config.js delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/client/index.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/AliasInlineValue.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/AliasListInline.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/AliasMapInline.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/AliasSetInline.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType1InlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType2.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/InlineEnum1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/ReferenceType.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/RequestTypeInlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1FooListItem.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1FooMapValue.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1FooSetItem.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1InlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1InlineType1NestedInlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineEnum1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineListItem1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineMapItem1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineSetItem1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType1InlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType2.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/UserId.ts delete mode 100644 seed/ts-sdk/inline-types/no-inline/src/api/types/index.ts delete mode 100644 seed/ts-sdk/inline-types/reference.md delete mode 100644 seed/ts-sdk/inline-types/resolved-snippet-templates.md delete mode 100644 seed/ts-sdk/inline-types/snippet-templates.json delete mode 100644 seed/ts-sdk/inline-types/snippet.json delete mode 100644 seed/ts-sdk/inline-types/src/Client.ts delete mode 100644 seed/ts-sdk/inline-types/src/api/client/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/api/client/requests/PostRootRequest.ts delete mode 100644 seed/ts-sdk/inline-types/src/api/client/requests/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/api/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/api/types/InlineEnum.ts delete mode 100644 seed/ts-sdk/inline-types/src/api/types/InlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/src/api/types/InlineType2.ts delete mode 100644 seed/ts-sdk/inline-types/src/api/types/InlinedDiscriminatedUnion1.ts delete mode 100644 seed/ts-sdk/inline-types/src/api/types/InlinedUndiscriminatedUnion1.ts delete mode 100644 seed/ts-sdk/inline-types/src/api/types/NestedInlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/src/api/types/RootType1.ts delete mode 100644 seed/ts-sdk/inline-types/src/api/types/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/APIResponse.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/Fetcher.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/Supplier.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/createRequestUrl.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/getFetchFn.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/getHeader.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/getRequestBody.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/getResponseBody.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/makeRequest.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/requestWithRetries.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/signals.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/runtime/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/runtime/runtime.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/Schema.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/bigint/bigint.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/bigint/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/date/date.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/date/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/enum/enum.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/enum/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/lazy/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/lazy/lazy.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/lazy/lazyObject.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/list/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/list/list.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/literals/booleanLiteral.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/literals/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/literals/stringLiteral.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/object-like/getObjectLikeUtils.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/object-like/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/object-like/types.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/object/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/object/object.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/object/property.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/object/types.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/any.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/boolean.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/number.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/string.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/unknown.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/record/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/record/record.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/record/types.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/JsonError.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/ParseError.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/getSchemaUtils.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/set/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/set/set.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/undiscriminated-union/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/undiscriminated-union/types.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/union/discriminant.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/union/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/union/types.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/builders/union/union.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/utils/MaybePromise.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/utils/addQuestionMarksToNullableProperties.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/utils/createIdentitySchemaCreator.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/utils/entries.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/utils/filterObject.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/utils/getErrorMessageForIncorrectType.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/utils/isPlainObject.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/utils/keys.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/utils/maybeSkipValidation.ts delete mode 100644 seed/ts-sdk/inline-types/src/core/schemas/utils/partition.ts delete mode 100644 seed/ts-sdk/inline-types/src/errors/SeedObjectError.ts delete mode 100644 seed/ts-sdk/inline-types/src/errors/SeedObjectTimeoutError.ts delete mode 100644 seed/ts-sdk/inline-types/src/errors/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/serialization/client/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/serialization/client/requests/PostRootRequest.ts delete mode 100644 seed/ts-sdk/inline-types/src/serialization/client/requests/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/serialization/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/serialization/types/InlineEnum.ts delete mode 100644 seed/ts-sdk/inline-types/src/serialization/types/InlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/src/serialization/types/InlineType2.ts delete mode 100644 seed/ts-sdk/inline-types/src/serialization/types/InlinedDiscriminatedUnion1.ts delete mode 100644 seed/ts-sdk/inline-types/src/serialization/types/InlinedUndiscriminatedUnion1.ts delete mode 100644 seed/ts-sdk/inline-types/src/serialization/types/NestedInlineType1.ts delete mode 100644 seed/ts-sdk/inline-types/src/serialization/types/RootType1.ts delete mode 100644 seed/ts-sdk/inline-types/src/serialization/types/index.ts delete mode 100644 seed/ts-sdk/inline-types/src/version.ts delete mode 100644 seed/ts-sdk/inline-types/tests/custom.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/Fetcher.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/createRequestUrl.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/getFetchFn.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/getRequestBody.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/getResponseBody.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/makeRequest.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/requestWithRetries.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/signals.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/webpack.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/fetcher/test-file.txt delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/bigint/bigint.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/date/date.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/enum/enum.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/lazy/lazy.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/lazy/lazyObject.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/lazy/recursive/a.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/lazy/recursive/b.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/list/list.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/literals/stringLiteral.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/object-like/withParsedProperties.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/object/extend.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/object/object.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/object/objectWithoutOptionalProperties.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/object/passthrough.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/primitives/any.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/primitives/boolean.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/primitives/number.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/primitives/string.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/primitives/unknown.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/record/record.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/schema-utils/getSchemaUtils.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/schema.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/set/set.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/skipValidation.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/undiscriminated-union/undiscriminatedUnion.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/union/union.test.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/utils/itSchema.ts delete mode 100644 seed/ts-sdk/inline-types/tests/unit/zurg/utils/itValidate.ts delete mode 100644 seed/ts-sdk/inline-types/tsconfig.json rename seed/ts-sdk/{inline-types => ts-inline-types/inline}/.github/workflows/ci.yml (100%) rename seed/ts-sdk/{inline-types => ts-inline-types/inline}/.gitignore (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/inline}/.mock/definition/__package__.yml (100%) rename seed/{csharp-model/inline-types => ts-sdk/ts-inline-types/inline}/.mock/definition/api.yml (100%) rename seed/{csharp-model/inline-types => ts-sdk/ts-inline-types/inline}/.mock/fern.config.json (100%) rename seed/{csharp-model/inline-types => ts-sdk/ts-inline-types/inline}/.mock/generators.yml (100%) rename seed/ts-sdk/{inline-types => ts-inline-types/inline}/.npmignore (100%) rename seed/ts-sdk/{inline-types => ts-inline-types/inline}/.prettierrc.yml (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/README.md (91%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/jest.config.js (100%) rename seed/ts-sdk/{inline-types => ts-inline-types/inline}/package.json (91%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/reference.md (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/resolved-snippet-templates.md (80%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/snippet-templates.json (99%) rename seed/ts-sdk/{inline-types/no-inline => ts-inline-types/inline}/snippet.json (52%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/Client.ts (95%) rename seed/{ts-express/inline-types/api/service => ts-sdk/ts-inline-types/inline/src/api/client}/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/api/client/requests/GetDiscriminatedUnionRequest.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/api/client/requests/GetUndiscriminatedUnionRequest.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/api/client/requests/PostRootRequest.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/api/client/requests/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/api/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/api/types/AliasListInline.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/api/types/AliasMapInline.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/api/types/AliasSetInline.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/inline/src}/api/types/ReferenceType.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/api/types/RootType1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/inline/src}/api/types/UserId.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/api/types/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/APIResponse.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/Fetcher.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/Supplier.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/createRequestUrl.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/getFetchFn.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/getHeader.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/getRequestBody.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/getResponseBody.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/makeRequest.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/requestWithRetries.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/signals.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/runtime/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/core/runtime/runtime.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/errors/SeedObjectError.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/errors/SeedObjectTimeoutError.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/errors/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/src/version.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/custom.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/Fetcher.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/createRequestUrl.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/getFetchFn.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/getRequestBody.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/getResponseBody.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/makeRequest.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/requestWithRetries.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/signals.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/stream-wrappers/webpack.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tests/unit/fetcher/test-file.txt (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/inline/tsconfig.json (100%) rename seed/ts-sdk/{inline-types/inline => ts-inline-types/no-inline}/.github/workflows/ci.yml (100%) rename seed/ts-sdk/{inline-types/inline => ts-inline-types/no-inline}/.gitignore (100%) rename seed/ts-sdk/{inline-types/inline => ts-inline-types/no-inline}/.mock/definition/__package__.yml (100%) rename seed/{csharp-sdk/inline-types => ts-sdk/ts-inline-types/no-inline}/.mock/definition/api.yml (100%) rename seed/{csharp-sdk/inline-types => ts-sdk/ts-inline-types/no-inline}/.mock/fern.config.json (100%) rename seed/{csharp-sdk/inline-types => ts-sdk/ts-inline-types/no-inline}/.mock/generators.yml (100%) rename seed/ts-sdk/{inline-types/inline => ts-inline-types/no-inline}/.npmignore (100%) rename seed/ts-sdk/{inline-types/inline => ts-inline-types/no-inline}/.prettierrc.yml (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/README.md (91%) rename seed/ts-sdk/{inline-types => ts-inline-types/no-inline}/jest.config.js (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/package.json (91%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/reference.md (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/resolved-snippet-templates.md (80%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/snippet-templates.json (99%) rename seed/ts-sdk/{inline-types/inline => ts-inline-types/no-inline}/snippet.json (52%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/Client.ts (95%) rename seed/{ts-express/inline-types/serialization/service => ts-sdk/ts-inline-types/no-inline/src/api/client}/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/api/client/requests/GetDiscriminatedUnionRequest.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/api/client/requests/GetUndiscriminatedUnionRequest.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/api/client/requests/PostRootRequest.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/api/client/requests/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/api/index.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/AliasInlineValue.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/AliasListInline.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/AliasMapInline.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/AliasSetInline.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/DiscriminatedUnion1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/DiscriminatedUnion1InlineType1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/DiscriminatedUnion1InlineType1InlineType1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/DiscriminatedUnion1InlineType2.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/InlineEnum1.ts (100%) rename seed/ts-sdk/{inline-types/inline => ts-inline-types/no-inline}/src/api/types/ReferenceType.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/RequestTypeInlineType1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/RootType1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/RootType1FooListItem.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/RootType1FooMapValue.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/RootType1FooSetItem.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/RootType1InlineType1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/RootType1InlineType1NestedInlineType1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/UndiscriminatedUnion1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/UndiscriminatedUnion1DiscriminatedUnion1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/UndiscriminatedUnion1InlineEnum1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/UndiscriminatedUnion1InlineListItem1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/UndiscriminatedUnion1InlineMapItem1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/UndiscriminatedUnion1InlineSetItem1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/UndiscriminatedUnion1InlineType1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/UndiscriminatedUnion1InlineType1InlineType1.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/UndiscriminatedUnion1InlineType2.ts (100%) rename seed/ts-sdk/{inline-types/inline => ts-inline-types/no-inline}/src/api/types/UserId.ts (100%) rename seed/{ts-express/inline-types => ts-sdk/ts-inline-types/no-inline/src}/api/types/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/APIResponse.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/Fetcher.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/Supplier.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/createRequestUrl.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/getFetchFn.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/getHeader.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/getRequestBody.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/getResponseBody.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/makeRequest.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/requestWithRetries.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/signals.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/runtime/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/core/runtime/runtime.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/errors/SeedObjectError.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/errors/SeedObjectTimeoutError.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/errors/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/index.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/src/version.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/custom.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/Fetcher.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/createRequestUrl.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/getFetchFn.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/getRequestBody.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/getResponseBody.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/makeRequest.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/requestWithRetries.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/signals.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/stream-wrappers/webpack.test.ts (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tests/unit/fetcher/test-file.txt (100%) rename seed/ts-sdk/{inline-types => ts-inline-types}/no-inline/tsconfig.json (100%) rename test-definitions-openapi/fern/apis/{inline-schema-reference => ts-inline-schema-reference}/generators.yml (100%) rename test-definitions-openapi/fern/apis/{inline-schema-reference => ts-inline-schema-reference}/openapi.yml (100%) delete mode 100644 test-definitions/fern/apis/inline-types/definition/__package__.yml delete mode 100644 test-definitions/fern/apis/inline-types/definition/api.yml delete mode 100644 test-definitions/fern/apis/inline-types/generators.yml rename {seed/ts-sdk/inline-types/no-inline/.mock => test-definitions/fern/apis/ts-inline-types}/definition/__package__.yml (100%) rename {seed/fastapi/inline-types/.mock => test-definitions/fern/apis/ts-inline-types}/definition/api.yml (100%) rename {seed/fastapi/inline-types/.mock => test-definitions/fern/apis/ts-inline-types}/generators.yml (100%) diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__AliasOptionalInline.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__AliasOptionalInline.json deleted file mode 100644 index 2be7e4cf223..00000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__AliasOptionalInline.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "oneOf": [ - { - "$ref": "#/definitions/AliasInlineValue" - }, - { - "type": "null" - } - ], - "definitions": { - "AliasInlineValue": { - "type": "object", - "properties": { - "foo": { - "type": "string" - }, - "bar": { - "type": "string" - } - }, - "required": [ - "foo", - "bar" - ], - "additionalProperties": false - } - } -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineEnum.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineEnum.json deleted file mode 100644 index 247b41d0eb2..00000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineEnum.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "string", - "enum": [ - "SUNNY", - "CLOUDY", - "RAINING", - "SNOWING" - ], - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineType1.json deleted file mode 100644 index 5204fe27698..00000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineType1.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "type": "object", - "properties": { - "foo": { - "type": "string" - }, - "bar": { - "$ref": "#/definitions/NestedInlineType1" - } - }, - "required": [ - "foo", - "bar" - ], - "additionalProperties": false, - "definitions": { - "InlineEnum": { - "type": "string", - "enum": [ - "SUNNY", - "CLOUDY", - "RAINING", - "SNOWING" - ] - }, - "NestedInlineType1": { - "type": "object", - "properties": { - "foo": { - "type": "string" - }, - "bar": { - "type": "string" - }, - "myEnum": { - "$ref": "#/definitions/InlineEnum" - } - }, - "required": [ - "foo", - "bar", - "myEnum" - ], - "additionalProperties": false - } - } -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineType2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineType2.json deleted file mode 100644 index 801c382f354..00000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineType2.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "object", - "properties": { - "baz": { - "type": "string" - } - }, - "required": [ - "baz" - ], - "additionalProperties": false, - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlinedDiscriminatedUnion1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlinedDiscriminatedUnion1.json deleted file mode 100644 index 8b87c341009..00000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlinedDiscriminatedUnion1.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "type1", - "type2" - ] - } - }, - "required": [ - "type" - ], - "oneOf": [ - { - "properties": { - "type": { - "const": "type1" - }, - "foo": { - "type": "string" - }, - "bar": { - "$ref": "#/definitions/NestedInlineType1" - } - }, - "required": [ - "type", - "foo", - "bar" - ] - }, - { - "properties": { - "type": { - "const": "type2" - }, - "baz": { - "type": "string" - } - }, - "required": [ - "type", - "baz" - ] - } - ], - "definitions": { - "InlineEnum": { - "type": "string", - "enum": [ - "SUNNY", - "CLOUDY", - "RAINING", - "SNOWING" - ] - }, - "NestedInlineType1": { - "type": "object", - "properties": { - "foo": { - "type": "string" - }, - "bar": { - "type": "string" - }, - "myEnum": { - "$ref": "#/definitions/InlineEnum" - } - }, - "required": [ - "foo", - "bar", - "myEnum" - ], - "additionalProperties": false - } - } -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlinedUndiscriminatedUnion1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlinedUndiscriminatedUnion1.json deleted file mode 100644 index 6cd71fc31ed..00000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlinedUndiscriminatedUnion1.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "anyOf": [ - { - "$ref": "#/definitions/InlineType1" - }, - { - "$ref": "#/definitions/InlineType2" - } - ], - "definitions": { - "InlineEnum": { - "type": "string", - "enum": [ - "SUNNY", - "CLOUDY", - "RAINING", - "SNOWING" - ] - }, - "NestedInlineType1": { - "type": "object", - "properties": { - "foo": { - "type": "string" - }, - "bar": { - "type": "string" - }, - "myEnum": { - "$ref": "#/definitions/InlineEnum" - } - }, - "required": [ - "foo", - "bar", - "myEnum" - ], - "additionalProperties": false - }, - "InlineType1": { - "type": "object", - "properties": { - "foo": { - "type": "string" - }, - "bar": { - "$ref": "#/definitions/NestedInlineType1" - } - }, - "required": [ - "foo", - "bar" - ], - "additionalProperties": false - }, - "InlineType2": { - "type": "object", - "properties": { - "baz": { - "type": "string" - } - }, - "required": [ - "baz" - ], - "additionalProperties": false - } - } -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__MixedInlineType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__MixedInlineType1.json deleted file mode 100644 index a86a97251cf..00000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__MixedInlineType1.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "type": "object", - "properties": { - "foo": { - "type": "string" - }, - "bar": { - "type": "string" - } - }, - "required": [ - "foo", - "bar" - ], - "additionalProperties": false, - "definitions": {} -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__NestedInlineType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__NestedInlineType1.json deleted file mode 100644 index 45e73a2f960..00000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__NestedInlineType1.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "type": "object", - "properties": { - "foo": { - "type": "string" - }, - "bar": { - "type": "string" - }, - "myEnum": { - "$ref": "#/definitions/InlineEnum" - } - }, - "required": [ - "foo", - "bar", - "myEnum" - ], - "additionalProperties": false, - "definitions": { - "InlineEnum": { - "type": "string", - "enum": [ - "SUNNY", - "CLOUDY", - "RAINING", - "SNOWING" - ] - } - } -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType2.json deleted file mode 100644 index 326461285ac..00000000000 --- a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType2.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "type": "object", - "properties": { - "one": { - "type": "integer" - }, - "two": { - "$ref": "#/definitions/MixedInlineType1" - } - }, - "required": [ - "one", - "two" - ], - "additionalProperties": false, - "definitions": { - "MixedInlineType1": { - "type": "object", - "properties": { - "foo": { - "type": "string" - }, - "bar": { - "type": "string" - } - }, - "required": [ - "foo", - "bar" - ], - "additionalProperties": false - } - } -} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__AliasInlineValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__AliasInlineValue.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__AliasInlineValue.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__AliasInlineValue.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__AliasListInline.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__AliasListInline.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__AliasListInline.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__AliasListInline.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__AliasMapInline.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__AliasMapInline.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__AliasMapInline.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__AliasMapInline.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__AliasSetInline.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__AliasSetInline.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__AliasSetInline.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__AliasSetInline.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__DiscriminatedUnion1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__DiscriminatedUnion1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__DiscriminatedUnion1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__DiscriminatedUnion1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__DiscriminatedUnion1InlineType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__DiscriminatedUnion1InlineType1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__DiscriminatedUnion1InlineType1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__DiscriminatedUnion1InlineType1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__DiscriminatedUnion1InlineType1InlineType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__DiscriminatedUnion1InlineType1InlineType1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__DiscriminatedUnion1InlineType1InlineType1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__DiscriminatedUnion1InlineType1InlineType1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__DiscriminatedUnion1InlineType2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__DiscriminatedUnion1InlineType2.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__DiscriminatedUnion1InlineType2.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__DiscriminatedUnion1InlineType2.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineEnum1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__InlineEnum1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__InlineEnum1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__InlineEnum1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__ReferenceType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__ReferenceType.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__ReferenceType.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__ReferenceType.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RequestTypeInlineType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RequestTypeInlineType1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RequestTypeInlineType1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RequestTypeInlineType1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RootType1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RootType1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType1FooListItem.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RootType1FooListItem.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType1FooListItem.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RootType1FooListItem.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType1FooMapValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RootType1FooMapValue.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType1FooMapValue.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RootType1FooMapValue.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType1FooSetItem.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RootType1FooSetItem.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType1FooSetItem.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RootType1FooSetItem.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType1InlineType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RootType1InlineType1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType1InlineType1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RootType1InlineType1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType1InlineType1NestedInlineType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RootType1InlineType1NestedInlineType1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__RootType1InlineType1NestedInlineType1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__RootType1InlineType1NestedInlineType1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType2.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType2.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1DiscriminatedUnion1InlineType2.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineEnum1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineEnum1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineEnum1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineEnum1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineListItem1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineListItem1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineListItem1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineListItem1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineMapItem1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineMapItem1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineMapItem1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineMapItem1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineSetItem1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineSetItem1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineSetItem1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineSetItem1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineType1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineType1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineType1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineType1InlineType1.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineType1InlineType1.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineType1InlineType1.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineType1InlineType1.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineType2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineType2.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UndiscriminatedUnion1InlineType2.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UndiscriminatedUnion1InlineType2.json diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UserId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UserId.json similarity index 100% rename from packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/inline-types/type__UserId.json rename to packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-inline-types/type__UserId.json diff --git a/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/inline-types.json b/packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/ts-inline-types.json similarity index 100% rename from packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/inline-types.json rename to packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/test-definitions/ts-inline-types.json diff --git a/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/inline-types.json b/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/inline-types.json deleted file mode 100644 index 47a24189178..00000000000 --- a/packages/cli/generation/ir-generator-tests/src/ir/__test__/test-definitions/inline-types.json +++ /dev/null @@ -1,3316 +0,0 @@ -{ - "fdrApiDefinitionId": null, - "apiVersion": null, - "apiName": { - "originalName": "object", - "camelCase": { - "unsafeName": "object", - "safeName": "object" - }, - "snakeCase": { - "unsafeName": "object", - "safeName": "object" - }, - "screamingSnakeCase": { - "unsafeName": "OBJECT", - "safeName": "OBJECT" - }, - "pascalCase": { - "unsafeName": "Object", - "safeName": "Object" - } - }, - "apiDisplayName": null, - "apiDocs": null, - "auth": { - "requirement": "ALL", - "schemes": [], - "docs": null - }, - "headers": [], - "idempotencyHeaders": [], - "types": { - "type_:RootType1": { - "inline": null, - "name": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type1", - "safeName": "root_type1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE1", - "safeName": "ROOT_TYPE1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - }, - "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 - }, - { - "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": "InlineType1", - "camelCase": { - "unsafeName": "inlineType1", - "safeName": "inlineType1" - }, - "snakeCase": { - "unsafeName": "inline_type1", - "safeName": "inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE1", - "safeName": "INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "InlineType1", - "safeName": "InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType1", - "default": null, - "inline": null - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:InlineType1", - "type_:NestedInlineType1", - "type_:InlineEnum" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:InlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "InlineType1", - "camelCase": { - "unsafeName": "inlineType1", - "safeName": "inlineType1" - }, - "snakeCase": { - "unsafeName": "inline_type1", - "safeName": "inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE1", - "safeName": "INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "InlineType1", - "safeName": "InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType1" - }, - "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 - }, - { - "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": "NestedInlineType1", - "camelCase": { - "unsafeName": "nestedInlineType1", - "safeName": "nestedInlineType1" - }, - "snakeCase": { - "unsafeName": "nested_inline_type1", - "safeName": "nested_inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "NESTED_INLINE_TYPE1", - "safeName": "NESTED_INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "NestedInlineType1", - "safeName": "NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:NestedInlineType1", - "default": null, - "inline": null - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:NestedInlineType1", - "type_:InlineEnum" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:InlineType2": { - "inline": true, - "name": { - "name": { - "originalName": "InlineType2", - "camelCase": { - "unsafeName": "inlineType2", - "safeName": "inlineType2" - }, - "snakeCase": { - "unsafeName": "inline_type2", - "safeName": "inline_type2" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE2", - "safeName": "INLINE_TYPE2" - }, - "pascalCase": { - "unsafeName": "InlineType2", - "safeName": "InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType2" - }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "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_:NestedInlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "NestedInlineType1", - "camelCase": { - "unsafeName": "nestedInlineType1", - "safeName": "nestedInlineType1" - }, - "snakeCase": { - "unsafeName": "nested_inline_type1", - "safeName": "nested_inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "NESTED_INLINE_TYPE1", - "safeName": "NESTED_INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "NestedInlineType1", - "safeName": "NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:NestedInlineType1" - }, - "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 - }, - { - "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": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "valueType": { - "_type": "named", - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum", - "default": null, - "inline": null - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:InlineEnum" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:InlinedDiscriminatedUnion1": { - "inline": true, - "name": { - "name": { - "originalName": "InlinedDiscriminatedUnion1", - "camelCase": { - "unsafeName": "inlinedDiscriminatedUnion1", - "safeName": "inlinedDiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "inlined_discriminated_union1", - "safeName": "inlined_discriminated_union1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINED_DISCRIMINATED_UNION1", - "safeName": "INLINED_DISCRIMINATED_UNION1" - }, - "pascalCase": { - "unsafeName": "InlinedDiscriminatedUnion1", - "safeName": "InlinedDiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlinedDiscriminatedUnion1" - }, - "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": "type1", - "camelCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "snakeCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE1", - "safeName": "TYPE1" - }, - "pascalCase": { - "unsafeName": "Type1", - "safeName": "Type1" - } - }, - "wireValue": "type1" - }, - "shape": { - "_type": "samePropertiesAsObject", - "name": { - "originalName": "InlineType1", - "camelCase": { - "unsafeName": "inlineType1", - "safeName": "inlineType1" - }, - "snakeCase": { - "unsafeName": "inline_type1", - "safeName": "inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE1", - "safeName": "INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "InlineType1", - "safeName": "InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType1" - }, - "displayName": null, - "availability": null, - "docs": null - }, - { - "discriminantValue": { - "name": { - "originalName": "type2", - "camelCase": { - "unsafeName": "type2", - "safeName": "type2" - }, - "snakeCase": { - "unsafeName": "type2", - "safeName": "type2" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE2", - "safeName": "TYPE2" - }, - "pascalCase": { - "unsafeName": "Type2", - "safeName": "Type2" - } - }, - "wireValue": "type2" - }, - "shape": { - "_type": "samePropertiesAsObject", - "name": { - "originalName": "InlineType2", - "camelCase": { - "unsafeName": "inlineType2", - "safeName": "inlineType2" - }, - "snakeCase": { - "unsafeName": "inline_type2", - "safeName": "inline_type2" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE2", - "safeName": "INLINE_TYPE2" - }, - "pascalCase": { - "unsafeName": "InlineType2", - "safeName": "InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType2" - }, - "displayName": null, - "availability": null, - "docs": null - } - ] - }, - "referencedTypes": [ - "type_:InlineType1", - "type_:NestedInlineType1", - "type_:InlineEnum", - "type_:InlineType2" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:InlinedUndiscriminatedUnion1": { - "inline": true, - "name": { - "name": { - "originalName": "InlinedUndiscriminatedUnion1", - "camelCase": { - "unsafeName": "inlinedUndiscriminatedUnion1", - "safeName": "inlinedUndiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "inlined_undiscriminated_union1", - "safeName": "inlined_undiscriminated_union1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINED_UNDISCRIMINATED_UNION1", - "safeName": "INLINED_UNDISCRIMINATED_UNION1" - }, - "pascalCase": { - "unsafeName": "InlinedUndiscriminatedUnion1", - "safeName": "InlinedUndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlinedUndiscriminatedUnion1" - }, - "shape": { - "_type": "undiscriminatedUnion", - "members": [ - { - "type": { - "_type": "named", - "name": { - "originalName": "InlineType1", - "camelCase": { - "unsafeName": "inlineType1", - "safeName": "inlineType1" - }, - "snakeCase": { - "unsafeName": "inline_type1", - "safeName": "inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE1", - "safeName": "INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "InlineType1", - "safeName": "InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType1", - "default": null, - "inline": null - }, - "docs": null - }, - { - "type": { - "_type": "named", - "name": { - "originalName": "InlineType2", - "camelCase": { - "unsafeName": "inlineType2", - "safeName": "inlineType2" - }, - "snakeCase": { - "unsafeName": "inline_type2", - "safeName": "inline_type2" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE2", - "safeName": "INLINE_TYPE2" - }, - "pascalCase": { - "unsafeName": "InlineType2", - "safeName": "InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType2", - "default": null, - "inline": null - }, - "docs": null - } - ] - }, - "referencedTypes": [ - "type_:InlineType1", - "type_:NestedInlineType1", - "type_:InlineEnum", - "type_:InlineType2" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:InlineEnum": { - "inline": true, - "name": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum" - }, - "shape": { - "_type": "enum", - "default": null, - "values": [ - { - "name": { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "CLOUDY", - "camelCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "snakeCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "screamingSnakeCase": { - "unsafeName": "CLOUDY", - "safeName": "CLOUDY" - }, - "pascalCase": { - "unsafeName": "Cloudy", - "safeName": "Cloudy" - } - }, - "wireValue": "CLOUDY" - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "RAINING", - "camelCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "snakeCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "screamingSnakeCase": { - "unsafeName": "RAINING", - "safeName": "RAINING" - }, - "pascalCase": { - "unsafeName": "Raining", - "safeName": "Raining" - } - }, - "wireValue": "RAINING" - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "SNOWING", - "camelCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "snakeCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "screamingSnakeCase": { - "unsafeName": "SNOWING", - "safeName": "SNOWING" - }, - "pascalCase": { - "unsafeName": "Snowing", - "safeName": "Snowing" - } - }, - "wireValue": "SNOWING" - }, - "availability": null, - "docs": null - } - ] - }, - "referencedTypes": [], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - } - }, - "errors": {}, - "services": { - "service_": { - "availability": null, - "name": { - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "displayName": null, - "basePath": { - "head": "/root", - "parts": [] - }, - "headers": [], - "pathParameters": [], - "encoding": { - "json": {}, - "proto": null - }, - "transport": { - "type": "http" - }, - "endpoints": [ - { - "id": "endpoint_.getRoot", - "name": { - "originalName": "getRoot", - "camelCase": { - "unsafeName": "getRoot", - "safeName": "getRoot" - }, - "snakeCase": { - "unsafeName": "get_root", - "safeName": "get_root" - }, - "screamingSnakeCase": { - "unsafeName": "GET_ROOT", - "safeName": "GET_ROOT" - }, - "pascalCase": { - "unsafeName": "GetRoot", - "safeName": "GetRoot" - } - }, - "displayName": null, - "auth": false, - "idempotent": false, - "baseUrl": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/root", - "parts": [] - }, - "fullPath": { - "head": "/root/root", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "inlinedRequestBody", - "name": { - "originalName": "PostRootRequest", - "camelCase": { - "unsafeName": "postRootRequest", - "safeName": "postRootRequest" - }, - "snakeCase": { - "unsafeName": "post_root_request", - "safeName": "post_root_request" - }, - "screamingSnakeCase": { - "unsafeName": "POST_ROOT_REQUEST", - "safeName": "POST_ROOT_REQUEST" - }, - "pascalCase": { - "unsafeName": "PostRootRequest", - "safeName": "PostRootRequest" - } - }, - "extends": [], - "contentType": "application/json", - "properties": [ - { - "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": "InlineType1", - "camelCase": { - "unsafeName": "inlineType1", - "safeName": "inlineType1" - }, - "snakeCase": { - "unsafeName": "inline_type1", - "safeName": "inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE1", - "safeName": "INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "InlineType1", - "safeName": "InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType1", - "default": null, - "inline": null - }, - "availability": null, - "docs": 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 - } - ], - "extra-properties": false, - "extendedProperties": [], - "docs": null - }, - "sdkRequest": { - "shape": { - "type": "wrapper", - "wrapperName": { - "originalName": "PostRootRequest", - "camelCase": { - "unsafeName": "postRootRequest", - "safeName": "postRootRequest" - }, - "snakeCase": { - "unsafeName": "post_root_request", - "safeName": "post_root_request" - }, - "screamingSnakeCase": { - "unsafeName": "POST_ROOT_REQUEST", - "safeName": "POST_ROOT_REQUEST" - }, - "pascalCase": { - "unsafeName": "PostRootRequest", - "safeName": "PostRootRequest" - } - }, - "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": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type1", - "safeName": "root_type1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE1", - "safeName": "ROOT_TYPE1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1", - "default": null, - "inline": null - }, - "docs": null - } - }, - "status-code": null - }, - "errors": [], - "userSpecifiedExamples": [], - "autogeneratedExamples": [ - { - "example": { - "id": "9cd41e603ec7775a338b95cab82902d42d7df333", - "url": "/root/root", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "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" - }, - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "InlineType1", - "camelCase": { - "unsafeName": "inlineType1", - "safeName": "inlineType1" - }, - "snakeCase": { - "unsafeName": "inline_type1", - "safeName": "inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE1", - "safeName": "INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "InlineType1", - "safeName": "InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "InlineType1", - "camelCase": { - "unsafeName": "inlineType1", - "safeName": "inlineType1" - }, - "snakeCase": { - "unsafeName": "inline_type1", - "safeName": "inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE1", - "safeName": "INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "InlineType1", - "safeName": "InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "NestedInlineType1", - "camelCase": { - "unsafeName": "nestedInlineType1", - "safeName": "nestedInlineType1" - }, - "snakeCase": { - "unsafeName": "nested_inline_type1", - "safeName": "nested_inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "NESTED_INLINE_TYPE1", - "safeName": "NESTED_INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "NestedInlineType1", - "safeName": "NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:NestedInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "NestedInlineType1", - "camelCase": { - "unsafeName": "nestedInlineType1", - "safeName": "nestedInlineType1" - }, - "snakeCase": { - "unsafeName": "nested_inline_type1", - "safeName": "nested_inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "NESTED_INLINE_TYPE1", - "safeName": "NESTED_INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "NestedInlineType1", - "safeName": "NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:NestedInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "bar" - } - } - }, - "jsonExample": "bar" - } - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "NestedInlineType1", - "camelCase": { - "unsafeName": "nestedInlineType1", - "safeName": "nestedInlineType1" - }, - "snakeCase": { - "unsafeName": "nested_inline_type1", - "safeName": "nested_inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "NESTED_INLINE_TYPE1", - "safeName": "NESTED_INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "NestedInlineType1", - "safeName": "NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:NestedInlineType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "enum", - "value": { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - } - }, - "typeName": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum" - } - }, - "jsonExample": "SUNNY" - } - } - ] - }, - "typeName": { - "name": { - "originalName": "NestedInlineType1", - "camelCase": { - "unsafeName": "nestedInlineType1", - "safeName": "nestedInlineType1" - }, - "snakeCase": { - "unsafeName": "nested_inline_type1", - "safeName": "nested_inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "NESTED_INLINE_TYPE1", - "safeName": "NESTED_INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "NestedInlineType1", - "safeName": "NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:NestedInlineType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - ] - }, - "typeName": { - "name": { - "originalName": "InlineType1", - "camelCase": { - "unsafeName": "inlineType1", - "safeName": "inlineType1" - }, - "snakeCase": { - "unsafeName": "inline_type1", - "safeName": "inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE1", - "safeName": "INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "InlineType1", - "safeName": "InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - }, - { - "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" - }, - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ], - "jsonExample": { - "bar": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - }, - "foo": "foo" - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type1", - "safeName": "root_type1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE1", - "safeName": "ROOT_TYPE1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type1", - "safeName": "root_type1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE1", - "safeName": "ROOT_TYPE1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "InlineType1", - "camelCase": { - "unsafeName": "inlineType1", - "safeName": "inlineType1" - }, - "snakeCase": { - "unsafeName": "inline_type1", - "safeName": "inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE1", - "safeName": "INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "InlineType1", - "safeName": "InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "InlineType1", - "camelCase": { - "unsafeName": "inlineType1", - "safeName": "inlineType1" - }, - "snakeCase": { - "unsafeName": "inline_type1", - "safeName": "inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE1", - "safeName": "INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "InlineType1", - "safeName": "InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "NestedInlineType1", - "camelCase": { - "unsafeName": "nestedInlineType1", - "safeName": "nestedInlineType1" - }, - "snakeCase": { - "unsafeName": "nested_inline_type1", - "safeName": "nested_inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "NESTED_INLINE_TYPE1", - "safeName": "NESTED_INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "NestedInlineType1", - "safeName": "NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:NestedInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "NestedInlineType1", - "camelCase": { - "unsafeName": "nestedInlineType1", - "safeName": "nestedInlineType1" - }, - "snakeCase": { - "unsafeName": "nested_inline_type1", - "safeName": "nested_inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "NESTED_INLINE_TYPE1", - "safeName": "NESTED_INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "NestedInlineType1", - "safeName": "NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:NestedInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "bar" - } - } - }, - "jsonExample": "bar" - } - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "NestedInlineType1", - "camelCase": { - "unsafeName": "nestedInlineType1", - "safeName": "nestedInlineType1" - }, - "snakeCase": { - "unsafeName": "nested_inline_type1", - "safeName": "nested_inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "NESTED_INLINE_TYPE1", - "safeName": "NESTED_INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "NestedInlineType1", - "safeName": "NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:NestedInlineType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "enum", - "value": { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - } - }, - "typeName": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum" - } - }, - "jsonExample": "SUNNY" - } - } - ] - }, - "typeName": { - "name": { - "originalName": "NestedInlineType1", - "camelCase": { - "unsafeName": "nestedInlineType1", - "safeName": "nestedInlineType1" - }, - "snakeCase": { - "unsafeName": "nested_inline_type1", - "safeName": "nested_inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "NESTED_INLINE_TYPE1", - "safeName": "NESTED_INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "NestedInlineType1", - "safeName": "NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:NestedInlineType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - ] - }, - "typeName": { - "name": { - "originalName": "InlineType1", - "camelCase": { - "unsafeName": "inlineType1", - "safeName": "inlineType1" - }, - "snakeCase": { - "unsafeName": "inline_type1", - "safeName": "inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE1", - "safeName": "INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "InlineType1", - "safeName": "InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type1", - "safeName": "root_type1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE1", - "safeName": "ROOT_TYPE1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - } - } - }, - "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_": [ - "type_:RootType1", - "type_:InlineType1", - "type_:NestedInlineType1", - "type_:InlineEnum" - ] - }, - "sharedTypes": [ - "type_:InlineType2", - "type_:InlinedDiscriminatedUnion1", - "type_:InlinedUndiscriminatedUnion1" - ] - }, - "webhookGroups": {}, - "websocketChannels": {}, - "readmeConfig": null, - "sourceConfig": null, - "publishConfig": null, - "dynamic": { - "version": "1.0.0", - "types": { - "type_:RootType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type1", - "safeName": "root_type1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE1", - "safeName": "ROOT_TYPE1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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" - } - }, - { - "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_:InlineType1" - } - } - ] - }, - "type_:InlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "InlineType1", - "camelCase": { - "unsafeName": "inlineType1", - "safeName": "inlineType1" - }, - "snakeCase": { - "unsafeName": "inline_type1", - "safeName": "inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE1", - "safeName": "INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "InlineType1", - "safeName": "InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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" - } - }, - { - "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_:NestedInlineType1" - } - } - ] - }, - "type_:InlineType2": { - "type": "object", - "declaration": { - "name": { - "originalName": "InlineType2", - "camelCase": { - "unsafeName": "inlineType2", - "safeName": "inlineType2" - }, - "snakeCase": { - "unsafeName": "inline_type2", - "safeName": "inline_type2" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_TYPE2", - "safeName": "INLINE_TYPE2" - }, - "pascalCase": { - "unsafeName": "InlineType2", - "safeName": "InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "typeReference": { - "_type": "primitive", - "value": "STRING" - } - } - ] - }, - "type_:NestedInlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "NestedInlineType1", - "camelCase": { - "unsafeName": "nestedInlineType1", - "safeName": "nestedInlineType1" - }, - "snakeCase": { - "unsafeName": "nested_inline_type1", - "safeName": "nested_inline_type1" - }, - "screamingSnakeCase": { - "unsafeName": "NESTED_INLINE_TYPE1", - "safeName": "NESTED_INLINE_TYPE1" - }, - "pascalCase": { - "unsafeName": "NestedInlineType1", - "safeName": "NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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" - } - }, - { - "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": "primitive", - "value": "STRING" - } - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "typeReference": { - "_type": "named", - "value": "type_:InlineEnum" - } - } - ] - }, - "type_:InlinedDiscriminatedUnion1": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "InlinedDiscriminatedUnion1", - "camelCase": { - "unsafeName": "inlinedDiscriminatedUnion1", - "safeName": "inlinedDiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "inlined_discriminated_union1", - "safeName": "inlined_discriminated_union1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINED_DISCRIMINATED_UNION1", - "safeName": "INLINED_DISCRIMINATED_UNION1" - }, - "pascalCase": { - "unsafeName": "InlinedDiscriminatedUnion1", - "safeName": "InlinedDiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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": { - "type1": { - "type": "samePropertiesAsObject", - "typeId": "type_:InlineType1", - "discriminantValue": { - "name": { - "originalName": "type1", - "camelCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "snakeCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE1", - "safeName": "TYPE1" - }, - "pascalCase": { - "unsafeName": "Type1", - "safeName": "Type1" - } - }, - "wireValue": "type1" - }, - "properties": [] - }, - "type2": { - "type": "samePropertiesAsObject", - "typeId": "type_:InlineType2", - "discriminantValue": { - "name": { - "originalName": "type2", - "camelCase": { - "unsafeName": "type2", - "safeName": "type2" - }, - "snakeCase": { - "unsafeName": "type2", - "safeName": "type2" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE2", - "safeName": "TYPE2" - }, - "pascalCase": { - "unsafeName": "Type2", - "safeName": "Type2" - } - }, - "wireValue": "type2" - }, - "properties": [] - } - } - }, - "type_:InlinedUndiscriminatedUnion1": { - "type": "undiscriminatedUnion", - "declaration": { - "name": { - "originalName": "InlinedUndiscriminatedUnion1", - "camelCase": { - "unsafeName": "inlinedUndiscriminatedUnion1", - "safeName": "inlinedUndiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "inlined_undiscriminated_union1", - "safeName": "inlined_undiscriminated_union1" - }, - "screamingSnakeCase": { - "unsafeName": "INLINED_UNDISCRIMINATED_UNION1", - "safeName": "INLINED_UNDISCRIMINATED_UNION1" - }, - "pascalCase": { - "unsafeName": "InlinedUndiscriminatedUnion1", - "safeName": "InlinedUndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "types": [ - { - "_type": "named", - "value": "type_:InlineType1" - }, - { - "_type": "named", - "value": "type_:InlineType2" - } - ] - }, - "type_:InlineEnum": { - "type": "enum", - "declaration": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "values": [ - { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - }, - { - "name": { - "originalName": "CLOUDY", - "camelCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "snakeCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "screamingSnakeCase": { - "unsafeName": "CLOUDY", - "safeName": "CLOUDY" - }, - "pascalCase": { - "unsafeName": "Cloudy", - "safeName": "Cloudy" - } - }, - "wireValue": "CLOUDY" - }, - { - "name": { - "originalName": "RAINING", - "camelCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "snakeCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "screamingSnakeCase": { - "unsafeName": "RAINING", - "safeName": "RAINING" - }, - "pascalCase": { - "unsafeName": "Raining", - "safeName": "Raining" - } - }, - "wireValue": "RAINING" - }, - { - "name": { - "originalName": "SNOWING", - "camelCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "snakeCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "screamingSnakeCase": { - "unsafeName": "SNOWING", - "safeName": "SNOWING" - }, - "pascalCase": { - "unsafeName": "Snowing", - "safeName": "Snowing" - } - }, - "wireValue": "SNOWING" - } - ] - } - }, - "headers": [], - "endpoints": { - "endpoint_.getRoot": { - "auth": null, - "declaration": { - "name": { - "originalName": "getRoot", - "camelCase": { - "unsafeName": "getRoot", - "safeName": "getRoot" - }, - "snakeCase": { - "unsafeName": "get_root", - "safeName": "get_root" - }, - "screamingSnakeCase": { - "unsafeName": "GET_ROOT", - "safeName": "GET_ROOT" - }, - "pascalCase": { - "unsafeName": "GetRoot", - "safeName": "GetRoot" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/root/root" - }, - "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "PostRootRequest", - "camelCase": { - "unsafeName": "postRootRequest", - "safeName": "postRootRequest" - }, - "snakeCase": { - "unsafeName": "post_root_request", - "safeName": "post_root_request" - }, - "screamingSnakeCase": { - "unsafeName": "POST_ROOT_REQUEST", - "safeName": "POST_ROOT_REQUEST" - }, - "pascalCase": { - "unsafeName": "PostRootRequest", - "safeName": "PostRootRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "pathParameters": [], - "queryParameters": [], - "headers": [], - "body": { - "type": "properties", - "value": [ - { - "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_:InlineType1" - } - }, - { - "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" - } - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false - } - }, - "response": { - "type": "json" - } - } - } - }, - "subpackages": {}, - "rootPackage": { - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "websocket": null, - "service": "service_", - "types": [ - "type_:RootType1", - "type_:InlineType1", - "type_:InlineType2", - "type_:NestedInlineType1", - "type_:InlinedDiscriminatedUnion1", - "type_:InlinedUndiscriminatedUnion1", - "type_:InlineEnum" - ], - "errors": [], - "subpackages": [], - "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/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/inline-types.json b/packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/ts-inline-types.json similarity index 100% rename from packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/inline-types.json rename to packages/cli/register/src/ir-to-fdr-converter/__test__/__snapshots__/ts-inline-types.json diff --git a/seed/csharp-model/inline-types/.github/workflows/ci.yml b/seed/csharp-model/inline-types/.github/workflows/ci.yml deleted file mode 100644 index 304921ae0cf..00000000000 --- a/seed/csharp-model/inline-types/.github/workflows/ci.yml +++ /dev/null @@ -1,69 +0,0 @@ -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/SeedObject/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source "nuget.org" diff --git a/seed/csharp-model/inline-types/.gitignore b/seed/csharp-model/inline-types/.gitignore deleted file mode 100644 index 11014f2b33d..00000000000 --- a/seed/csharp-model/inline-types/.gitignore +++ /dev/null @@ -1,484 +0,0 @@ -## 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/inline-types/.mock/definition/__package__.yml b/seed/csharp-model/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/csharp-model/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/csharp-model/inline-types/snippet-templates.json b/seed/csharp-model/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-model/inline-types/snippet.json b/seed/csharp-model/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-model/inline-types/src/SeedObject.Test/Core/EnumSerializerTests.cs b/seed/csharp-model/inline-types/src/SeedObject.Test/Core/EnumSerializerTests.cs deleted file mode 100644 index 8abc0743d8c..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject.Test/Core/EnumSerializerTests.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Runtime.Serialization; -using System.Text.Json; -using System.Text.Json.Serialization; -using NUnit.Framework; -using SeedObject.Core; - -namespace SeedObject.Test.Core -{ - [TestFixture] - public class StringEnumSerializerTests - { - private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true }; - - private const DummyEnum KnownEnumValue2 = DummyEnum.KnownValue2; - private const string KnownEnumValue2String = "known_value2"; - - private static readonly 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/inline-types/src/SeedObject.Test/SeedObject.Test.Custom.props b/seed/csharp-model/inline-types/src/SeedObject.Test/SeedObject.Test.Custom.props deleted file mode 100644 index 55e683b0772..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject.Test/SeedObject.Test.Custom.props +++ /dev/null @@ -1,7 +0,0 @@ - - - \ No newline at end of file diff --git a/seed/csharp-model/inline-types/src/SeedObject.Test/SeedObject.Test.csproj b/seed/csharp-model/inline-types/src/SeedObject.Test/SeedObject.Test.csproj deleted file mode 100644 index be19774f42e..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject.Test/SeedObject.Test.csproj +++ /dev/null @@ -1,33 +0,0 @@ - - - - net8.0 - enable - enable - - false - true - - - - - - - - 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/inline-types/src/SeedObject.sln b/seed/csharp-model/inline-types/src/SeedObject.sln deleted file mode 100644 index b97dbe09dea..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject.sln +++ /dev/null @@ -1,28 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeedObject", "SeedObject\SeedObject.csproj", "{AD1F9DE6-0EEA-4C0F-A203-D87741677FCA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeedObject.Test", "SeedObject.Test\SeedObject.Test.csproj", "{ADFBEAB6-3110-4762-9E42-1C3308776ED7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AD1F9DE6-0EEA-4C0F-A203-D87741677FCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AD1F9DE6-0EEA-4C0F-A203-D87741677FCA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AD1F9DE6-0EEA-4C0F-A203-D87741677FCA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AD1F9DE6-0EEA-4C0F-A203-D87741677FCA}.Release|Any CPU.Build.0 = Release|Any CPU - {ADFBEAB6-3110-4762-9E42-1C3308776ED7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ADFBEAB6-3110-4762-9E42-1C3308776ED7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ADFBEAB6-3110-4762-9E42-1C3308776ED7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ADFBEAB6-3110-4762-9E42-1C3308776ED7}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/seed/csharp-model/inline-types/src/SeedObject/Core/CollectionItemSerializer.cs b/seed/csharp-model/inline-types/src/SeedObject/Core/CollectionItemSerializer.cs deleted file mode 100644 index b3b87d895b3..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/Core/CollectionItemSerializer.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace SeedObject.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, - 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; - } - - JsonSerializerOptions 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/inline-types/src/SeedObject/Core/Constants.cs b/seed/csharp-model/inline-types/src/SeedObject/Core/Constants.cs deleted file mode 100644 index f1291efd432..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/Core/Constants.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace SeedObject.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/inline-types/src/SeedObject/Core/DateTimeSerializer.cs b/seed/csharp-model/inline-types/src/SeedObject/Core/DateTimeSerializer.cs deleted file mode 100644 index 76290bfd825..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/Core/DateTimeSerializer.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Globalization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace SeedObject.Core; - -internal class DateTimeSerializer : JsonConverter -{ - public override DateTime Read( - ref Utf8JsonReader reader, - 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/inline-types/src/SeedObject/Core/EnumSerializer.cs b/seed/csharp-model/inline-types/src/SeedObject/Core/EnumSerializer.cs deleted file mode 100644 index 6eda795120b..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/Core/EnumSerializer.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace SeedObject.Core; - -internal class EnumSerializer : JsonConverter - where TEnum : struct, System.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.GetMember(enumValue.ToString())[0]; - 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, - 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/inline-types/src/SeedObject/Core/JsonConfiguration.cs b/seed/csharp-model/inline-types/src/SeedObject/Core/JsonConfiguration.cs deleted file mode 100644 index 5a726af685a..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/Core/JsonConfiguration.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace SeedObject.Core; - -internal static partial class JsonOptions -{ - public static readonly JsonSerializerOptions JsonSerializerOptions; - - static JsonOptions() - { - var options = new JsonSerializerOptions - { - Converters = { new DateTimeSerializer(), new OneOfSerializer() }, - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - }; - ConfigureJsonSerializerOptions(options); - JsonSerializerOptions = options; - } - - static partial void ConfigureJsonSerializerOptions(JsonSerializerOptions defaultOptions); -} - -internal static class JsonUtils -{ - public static string Serialize(T obj) - { - return JsonSerializer.Serialize(obj, JsonOptions.JsonSerializerOptions); - } - - public static T Deserialize(string json) - { - return JsonSerializer.Deserialize(json, JsonOptions.JsonSerializerOptions)!; - } -} diff --git a/seed/csharp-model/inline-types/src/SeedObject/Core/OneOfSerializer.cs b/seed/csharp-model/inline-types/src/SeedObject/Core/OneOfSerializer.cs deleted file mode 100644 index c6bd432c117..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/Core/OneOfSerializer.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.Reflection; -using System.Text.Json; -using System.Text.Json.Serialization; -using OneOf; - -namespace SeedObject.Core; - -internal class OneOfSerializer : JsonConverter -{ - public override IOneOf? Read( - ref Utf8JsonReader reader, - 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 (System.Type type, MethodInfo cast)[] GetOneOfTypes(System.Type typeToConvert) - { - var casts = typeToConvert - .GetRuntimeMethods() - .Where(m => m.IsSpecialName && m.Name == "op_Implicit") - .ToArray(); - var type = typeToConvert; - while (type != null) - { - if ( - type.IsGenericType - && (type.Name.StartsWith("OneOf`") || type.Name.StartsWith("OneOfBase`")) - ) - { - return type.GetGenericArguments() - .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(System.Type typeToConvert) - { - return typeof(IOneOf).IsAssignableFrom(typeToConvert); - } -} diff --git a/seed/csharp-model/inline-types/src/SeedObject/Core/Public/Version.cs b/seed/csharp-model/inline-types/src/SeedObject/Core/Public/Version.cs deleted file mode 100644 index 4c5cb2f299b..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/Core/Public/Version.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SeedObject; - -internal class Version -{ - public const string Current = "0.0.1"; -} diff --git a/seed/csharp-model/inline-types/src/SeedObject/InlineEnum.cs b/seed/csharp-model/inline-types/src/SeedObject/InlineEnum.cs deleted file mode 100644 index 6eb215679c4..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/InlineEnum.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -[JsonConverter(typeof(EnumSerializer))] -public enum InlineEnum -{ - [EnumMember(Value = "SUNNY")] - Sunny, - - [EnumMember(Value = "CLOUDY")] - Cloudy, - - [EnumMember(Value = "RAINING")] - Raining, - - [EnumMember(Value = "SNOWING")] - Snowing, -} diff --git a/seed/csharp-model/inline-types/src/SeedObject/InlineType1.cs b/seed/csharp-model/inline-types/src/SeedObject/InlineType1.cs deleted file mode 100644 index aa5df854386..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/InlineType1.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Text.Json.Serialization; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -public record InlineType1 -{ - [JsonPropertyName("foo")] - public required string Foo { get; set; } - - [JsonPropertyName("bar")] - public required NestedInlineType1 Bar { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/seed/csharp-model/inline-types/src/SeedObject/InlineType2.cs b/seed/csharp-model/inline-types/src/SeedObject/InlineType2.cs deleted file mode 100644 index ff1449e5d73..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/InlineType2.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Text.Json.Serialization; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -public record InlineType2 -{ - [JsonPropertyName("baz")] - public required string Baz { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/seed/csharp-model/inline-types/src/SeedObject/NestedInlineType1.cs b/seed/csharp-model/inline-types/src/SeedObject/NestedInlineType1.cs deleted file mode 100644 index 19ab70d0370..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/NestedInlineType1.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Text.Json.Serialization; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -public record NestedInlineType1 -{ - [JsonPropertyName("foo")] - public required string Foo { get; set; } - - [JsonPropertyName("bar")] - public required string Bar { get; set; } - - [JsonPropertyName("myEnum")] - public required InlineEnum MyEnum { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/seed/csharp-model/inline-types/src/SeedObject/RootType1.cs b/seed/csharp-model/inline-types/src/SeedObject/RootType1.cs deleted file mode 100644 index 72cfd860d48..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/RootType1.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Text.Json.Serialization; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -public record RootType1 -{ - [JsonPropertyName("foo")] - public required string Foo { get; set; } - - [JsonPropertyName("bar")] - public required InlineType1 Bar { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/seed/csharp-model/inline-types/src/SeedObject/SeedObject.Custom.props b/seed/csharp-model/inline-types/src/SeedObject/SeedObject.Custom.props deleted file mode 100644 index 70df2849401..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/SeedObject.Custom.props +++ /dev/null @@ -1,20 +0,0 @@ - - - - \ No newline at end of file diff --git a/seed/csharp-model/inline-types/src/SeedObject/SeedObject.csproj b/seed/csharp-model/inline-types/src/SeedObject/SeedObject.csproj deleted file mode 100644 index ceed24758f1..00000000000 --- a/seed/csharp-model/inline-types/src/SeedObject/SeedObject.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - - net462;net8.0;net7.0;net6.0;netstandard2.0 - enable - 12 - enable - 0.0.1 - $(Version) - $(Version) - README.md - https://github.com/inline-types/fern - true - - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - - - - - - - - <_Parameter1>SeedObject.Test - - - - - diff --git a/seed/csharp-sdk/inline-types/.github/workflows/ci.yml b/seed/csharp-sdk/inline-types/.github/workflows/ci.yml deleted file mode 100644 index 304921ae0cf..00000000000 --- a/seed/csharp-sdk/inline-types/.github/workflows/ci.yml +++ /dev/null @@ -1,69 +0,0 @@ -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/SeedObject/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source "nuget.org" diff --git a/seed/csharp-sdk/inline-types/.gitignore b/seed/csharp-sdk/inline-types/.gitignore deleted file mode 100644 index 11014f2b33d..00000000000 --- a/seed/csharp-sdk/inline-types/.gitignore +++ /dev/null @@ -1,484 +0,0 @@ -## 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/inline-types/.mock/definition/__package__.yml b/seed/csharp-sdk/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/csharp-sdk/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/csharp-sdk/inline-types/README.md b/seed/csharp-sdk/inline-types/README.md deleted file mode 100644 index 926c91c7595..00000000000 --- a/seed/csharp-sdk/inline-types/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# 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/SeedObject)](https://nuget.org/packages/SeedObject) - -The Seed C# library provides convenient access to the Seed API from C#. - -## Installation - -```sh -nuget install SeedObject -``` - -## Usage - -Instantiate and use the client with the following: - -```csharp -using SeedObject; - -var client = new SeedObjectClient(); -await client.GetRootAsync( - new PostRootRequest - { - Bar = new InlineType1 - { - Foo = "foo", - Bar = new NestedInlineType1 - { - Foo = "foo", - Bar = "bar", - MyEnum = InlineEnum.Sunny, - }, - }, - Foo = "foo", - } -); -``` - -## 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 SeedObject; - -try { - var response = await client.GetRootAsync(...); -} catch (SeedObjectApiException 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 retriable and the number of retry attempts has not grown larger than the configured -retry limit (default: 2). - -A request is deemed retriable 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.GetRootAsync( - ..., - 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.GetRootAsync( - ..., - 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/inline-types/reference.md b/seed/csharp-sdk/inline-types/reference.md deleted file mode 100644 index df8466b60cb..00000000000 --- a/seed/csharp-sdk/inline-types/reference.md +++ /dev/null @@ -1,55 +0,0 @@ -# Reference -
client.GetRootAsync(PostRootRequest { ... }) -> RootType1 -
-
- -#### 🔌 Usage - -
-
- -
-
- -```csharp -await client.GetRootAsync( - new PostRootRequest - { - Bar = new InlineType1 - { - Foo = "foo", - Bar = new NestedInlineType1 - { - Foo = "foo", - Bar = "bar", - MyEnum = InlineEnum.Sunny, - }, - }, - Foo = "foo", - } -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `PostRootRequest` - -
-
-
-
- - -
-
-
diff --git a/seed/csharp-sdk/inline-types/snippet-templates.json b/seed/csharp-sdk/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/inline-types/snippet.json b/seed/csharp-sdk/inline-types/snippet.json deleted file mode 100644 index 2799cc5a2ac..00000000000 --- a/seed/csharp-sdk/inline-types/snippet.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "types": {}, - "endpoints": [ - { - "example_identifier": null, - "id": { - "path": "/root/root", - "method": "POST", - "identifier_override": "endpoint_.getRoot" - }, - "snippet": { - "type": "typescript", - "client": "using SeedObject;\n\nvar client = new SeedObjectClient();\nawait client.GetRootAsync(\n new PostRootRequest\n {\n Bar = new InlineType1\n {\n Foo = \"foo\",\n Bar = new NestedInlineType1\n {\n Foo = \"foo\",\n Bar = \"bar\",\n MyEnum = InlineEnum.Sunny,\n },\n },\n Foo = \"foo\",\n }\n);\n" - } - } - ] -} \ No newline at end of file diff --git a/seed/csharp-sdk/inline-types/src/SeedObject.Test/Core/EnumSerializerTests.cs b/seed/csharp-sdk/inline-types/src/SeedObject.Test/Core/EnumSerializerTests.cs deleted file mode 100644 index 8abc0743d8c..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject.Test/Core/EnumSerializerTests.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Runtime.Serialization; -using System.Text.Json; -using System.Text.Json.Serialization; -using NUnit.Framework; -using SeedObject.Core; - -namespace SeedObject.Test.Core -{ - [TestFixture] - public class StringEnumSerializerTests - { - private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true }; - - private const DummyEnum KnownEnumValue2 = DummyEnum.KnownValue2; - private const string KnownEnumValue2String = "known_value2"; - - private static readonly 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/inline-types/src/SeedObject.Test/Core/RawClientTests.cs b/seed/csharp-sdk/inline-types/src/SeedObject.Test/Core/RawClientTests.cs deleted file mode 100644 index 4dd06c7b4b5..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject.Test/Core/RawClientTests.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using System.Net.Http; -using FluentAssertions; -using NUnit.Framework; -using SeedObject.Core; -using WireMock.Server; -using SystemTask = System.Threading.Tasks.Task; -using WireMockRequest = WireMock.RequestBuilders.Request; -using WireMockResponse = WireMock.ResponseBuilders.Response; - -namespace SeedObject.Test.Core -{ - [TestFixture] - public class RawClientTests - { - private WireMockServer _server; - private HttpClient _httpClient; - private RawClient _rawClient; - private string _baseUrl; - private const int _maxRetries = 3; - - [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 } - ); - } - - [Test] - [TestCase(408)] - [TestCase(429)] - [TestCase(500)] - [TestCase(504)] - public async SystemTask MakeRequestAsync_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 RawClient.BaseApiRequest - { - BaseUrl = _baseUrl, - Method = HttpMethod.Get, - Path = "/test", - }; - - var response = await _rawClient.MakeRequestAsync(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(_maxRetries)); - } - - [Test] - [TestCase(400)] - [TestCase(409)] - public async SystemTask MakeRequestAsync_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 RawClient.BaseApiRequest - { - BaseUrl = _baseUrl, - Method = HttpMethod.Get, - Path = "/test", - }; - - var response = await _rawClient.MakeRequestAsync(request); - Assert.That(response.StatusCode, Is.EqualTo(statusCode)); - - var content = await response.Raw.Content.ReadAsStringAsync(); - Assert.That(content, Is.EqualTo("Failure")); - - Assert.That(_server.LogEntries.Count, Is.EqualTo(1)); - } - - [TearDown] - public void TearDown() - { - _server.Dispose(); - _httpClient.Dispose(); - } - } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject.Test/SeedObject.Test.Custom.props b/seed/csharp-sdk/inline-types/src/SeedObject.Test/SeedObject.Test.Custom.props deleted file mode 100644 index 55e683b0772..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject.Test/SeedObject.Test.Custom.props +++ /dev/null @@ -1,7 +0,0 @@ - - - \ No newline at end of file diff --git a/seed/csharp-sdk/inline-types/src/SeedObject.Test/SeedObject.Test.csproj b/seed/csharp-sdk/inline-types/src/SeedObject.Test/SeedObject.Test.csproj deleted file mode 100644 index be19774f42e..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject.Test/SeedObject.Test.csproj +++ /dev/null @@ -1,33 +0,0 @@ - - - - net8.0 - enable - enable - - false - true - - - - - - - - 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/inline-types/src/SeedObject.Test/TestClient.cs b/seed/csharp-sdk/inline-types/src/SeedObject.Test/TestClient.cs deleted file mode 100644 index 307591f8be5..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject.Test/TestClient.cs +++ /dev/null @@ -1,8 +0,0 @@ -using NUnit.Framework; - -#nullable enable - -namespace SeedObject.Test; - -[TestFixture] -public class TestClient { } diff --git a/seed/csharp-sdk/inline-types/src/SeedObject.Test/Unit/MockServer/BaseMockServerTest.cs b/seed/csharp-sdk/inline-types/src/SeedObject.Test/Unit/MockServer/BaseMockServerTest.cs deleted file mode 100644 index 4e753d16f01..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject.Test/Unit/MockServer/BaseMockServerTest.cs +++ /dev/null @@ -1,40 +0,0 @@ -using NUnit.Framework; -using SeedObject; -using WireMock.Logging; -using WireMock.Server; -using WireMock.Settings; - -#nullable enable - -namespace SeedObject.Test.Unit.MockServer; - -[SetUpFixture] -public class BaseMockServerTest -{ - protected static WireMockServer Server { get; set; } = null!; - - protected static SeedObjectClient Client { get; set; } = null!; - - protected static RequestOptions RequestOptions { get; set; } = null!; - - [OneTimeSetUp] - public void GlobalSetup() - { - // Start the WireMock server - Server = WireMockServer.Start( - new WireMockServerSettings { Logger = new WireMockConsoleLogger() } - ); - - // Initialize the Client - Client = new SeedObjectClient(); - - RequestOptions = new RequestOptions { BaseUrl = Server.Urls[0] }; - } - - [OneTimeTearDown] - public void GlobalTeardown() - { - Server.Stop(); - Server.Dispose(); - } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject.Test/Unit/MockServer/GetRootTest.cs b/seed/csharp-sdk/inline-types/src/SeedObject.Test/Unit/MockServer/GetRootTest.cs deleted file mode 100644 index 392c7599eed..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject.Test/Unit/MockServer/GetRootTest.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.Threading.Tasks; -using FluentAssertions.Json; -using Newtonsoft.Json.Linq; -using NUnit.Framework; -using SeedObject; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject.Test.Unit.MockServer; - -[TestFixture] -public class GetRootTest : BaseMockServerTest -{ - [Test] - public async Task MockServerTest() - { - const string requestJson = """ - { - "bar": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - }, - "foo": "foo" - } - """; - - const string mockResponse = """ - { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - """; - - Server - .Given( - WireMock - .RequestBuilders.Request.Create() - .WithPath("/root/root") - .WithHeader("Content-Type", "application/json") - .UsingPost() - .WithBodyAsJson(requestJson) - ) - .RespondWith( - WireMock - .ResponseBuilders.Response.Create() - .WithStatusCode(200) - .WithBody(mockResponse) - ); - - var response = await Client.GetRootAsync( - new PostRootRequest - { - Bar = new InlineType1 - { - Foo = "foo", - Bar = new NestedInlineType1 - { - Foo = "foo", - Bar = "bar", - MyEnum = InlineEnum.Sunny, - }, - }, - Foo = "foo", - }, - RequestOptions - ); - JToken - .Parse(mockResponse) - .Should() - .BeEquivalentTo(JToken.Parse(JsonUtils.Serialize(response))); - } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject.sln b/seed/csharp-sdk/inline-types/src/SeedObject.sln deleted file mode 100644 index 04f8293ffea..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject.sln +++ /dev/null @@ -1,28 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeedObject", "SeedObject\SeedObject.csproj", "{5F954A6C-8849-40D3-8109-615573D3A579}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeedObject.Test", "SeedObject.Test\SeedObject.Test.csproj", "{3D1EA2A5-21F8-41B3-8AFA-F4C664F4CEC8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5F954A6C-8849-40D3-8109-615573D3A579}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5F954A6C-8849-40D3-8109-615573D3A579}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5F954A6C-8849-40D3-8109-615573D3A579}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5F954A6C-8849-40D3-8109-615573D3A579}.Release|Any CPU.Build.0 = Release|Any CPU - {3D1EA2A5-21F8-41B3-8AFA-F4C664F4CEC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3D1EA2A5-21F8-41B3-8AFA-F4C664F4CEC8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3D1EA2A5-21F8-41B3-8AFA-F4C664F4CEC8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3D1EA2A5-21F8-41B3-8AFA-F4C664F4CEC8}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Core/CollectionItemSerializer.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/CollectionItemSerializer.cs deleted file mode 100644 index b3b87d895b3..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/CollectionItemSerializer.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace SeedObject.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, - 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; - } - - JsonSerializerOptions 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/inline-types/src/SeedObject/Core/Constants.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/Constants.cs deleted file mode 100644 index f1291efd432..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/Constants.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace SeedObject.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/inline-types/src/SeedObject/Core/DateTimeSerializer.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/DateTimeSerializer.cs deleted file mode 100644 index 76290bfd825..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/DateTimeSerializer.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Globalization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace SeedObject.Core; - -internal class DateTimeSerializer : JsonConverter -{ - public override DateTime Read( - ref Utf8JsonReader reader, - 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/inline-types/src/SeedObject/Core/EnumSerializer.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/EnumSerializer.cs deleted file mode 100644 index 6eda795120b..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/EnumSerializer.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace SeedObject.Core; - -internal class EnumSerializer : JsonConverter - where TEnum : struct, System.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.GetMember(enumValue.ToString())[0]; - 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, - 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/inline-types/src/SeedObject/Core/Extensions.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/Extensions.cs deleted file mode 100644 index 2539faa7cde..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/Extensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Runtime.Serialization; - -namespace SeedObject.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/inline-types/src/SeedObject/Core/HeaderValue.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/HeaderValue.cs deleted file mode 100644 index 9fd0a6854cf..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/HeaderValue.cs +++ /dev/null @@ -1,17 +0,0 @@ -using OneOf; - -namespace SeedObject.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/inline-types/src/SeedObject/Core/Headers.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/Headers.cs deleted file mode 100644 index 3015ade82a5..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/Headers.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace SeedObject.Core; - -internal sealed class Headers : Dictionary -{ - public Headers() { } - - public Headers(Dictionary value) - { - foreach (var kvp in value) - { - this[kvp.Key] = new HeaderValue(kvp.Value); - } - } - - public Headers(IEnumerable> value) - : base(value.ToDictionary(e => e.Key, e => e.Value)) { } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Core/HttpMethodExtensions.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/HttpMethodExtensions.cs deleted file mode 100644 index 01e205d219d..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/HttpMethodExtensions.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Net.Http; - -namespace SeedObject.Core; - -internal static class HttpMethodExtensions -{ - public static readonly HttpMethod Patch = new("PATCH"); -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Core/IRequestOptions.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/IRequestOptions.cs deleted file mode 100644 index eefa20f04bb..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/IRequestOptions.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Net.Http; - -#nullable enable - -namespace SeedObject.Core; - -internal interface IRequestOptions -{ - /// - /// The Base URL for the API. - /// - public string? BaseUrl { get; init; } - - /// - /// The http client used to make requests. - /// - public HttpClient? HttpClient { get; init; } - - /// - /// The http headers sent with the request. - /// - internal Headers Headers { get; init; } - - /// - /// The http client used to make requests. - /// - public int? MaxRetries { get; init; } - - /// - /// The timeout for the request. - /// - public TimeSpan? Timeout { get; init; } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Core/JsonConfiguration.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/JsonConfiguration.cs deleted file mode 100644 index 5a726af685a..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/JsonConfiguration.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Text.Json; -using System.Text.Json.Serialization; - -namespace SeedObject.Core; - -internal static partial class JsonOptions -{ - public static readonly JsonSerializerOptions JsonSerializerOptions; - - static JsonOptions() - { - var options = new JsonSerializerOptions - { - Converters = { new DateTimeSerializer(), new OneOfSerializer() }, - WriteIndented = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - }; - ConfigureJsonSerializerOptions(options); - JsonSerializerOptions = options; - } - - static partial void ConfigureJsonSerializerOptions(JsonSerializerOptions defaultOptions); -} - -internal static class JsonUtils -{ - public static string Serialize(T obj) - { - return JsonSerializer.Serialize(obj, JsonOptions.JsonSerializerOptions); - } - - public static T Deserialize(string json) - { - return JsonSerializer.Deserialize(json, JsonOptions.JsonSerializerOptions)!; - } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Core/OneOfSerializer.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/OneOfSerializer.cs deleted file mode 100644 index c6bd432c117..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/OneOfSerializer.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.Reflection; -using System.Text.Json; -using System.Text.Json.Serialization; -using OneOf; - -namespace SeedObject.Core; - -internal class OneOfSerializer : JsonConverter -{ - public override IOneOf? Read( - ref Utf8JsonReader reader, - 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 (System.Type type, MethodInfo cast)[] GetOneOfTypes(System.Type typeToConvert) - { - var casts = typeToConvert - .GetRuntimeMethods() - .Where(m => m.IsSpecialName && m.Name == "op_Implicit") - .ToArray(); - var type = typeToConvert; - while (type != null) - { - if ( - type.IsGenericType - && (type.Name.StartsWith("OneOf`") || type.Name.StartsWith("OneOfBase`")) - ) - { - return type.GetGenericArguments() - .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(System.Type typeToConvert) - { - return typeof(IOneOf).IsAssignableFrom(typeToConvert); - } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/ClientOptions.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/ClientOptions.cs deleted file mode 100644 index 31bcb5fab70..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/ClientOptions.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Net.Http; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -public partial class ClientOptions -{ - /// - /// The Base URL for the API. - /// - public string BaseUrl { get; init; } = ""; - - /// - /// The http client used to make requests. - /// - public HttpClient HttpClient { get; init; } = new HttpClient(); - - /// - /// The http client used to make requests. - /// - public int MaxRetries { get; init; } = 2; - - /// - /// The timeout for the request. - /// - public TimeSpan Timeout { get; init; } = TimeSpan.FromSeconds(30); - - /// - /// The http headers sent with the request. - /// - internal Headers Headers { get; init; } = new(); - - /// - /// 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/inline-types/src/SeedObject/Core/Public/RequestOptions.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/RequestOptions.cs deleted file mode 100644 index b3488378918..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/RequestOptions.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Net.Http; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -public partial class RequestOptions : IRequestOptions -{ - /// - /// The Base URL for the API. - /// - public string? BaseUrl { get; init; } - - /// - /// The http client used to make requests. - /// - public HttpClient? HttpClient { get; init; } - - /// - /// The http client used to make requests. - /// - public int? MaxRetries { get; init; } - - /// - /// The timeout for the request. - /// - public TimeSpan? Timeout { get; init; } - - /// - /// The http headers sent with the request. - /// - Headers IRequestOptions.Headers { get; init; } = new(); -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/SeedObjectApiException.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/SeedObjectApiException.cs deleted file mode 100644 index 006a14f0735..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/SeedObjectApiException.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace SeedObject; - -/// -/// This exception type will be thrown for any non-2XX API responses. -/// -public class SeedObjectApiException(string message, int statusCode, object body) - : SeedObjectException(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/inline-types/src/SeedObject/Core/Public/SeedObjectException.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/SeedObjectException.cs deleted file mode 100644 index 640dccfd79a..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/SeedObjectException.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -#nullable enable - -namespace SeedObject; - -/// -/// Base exception class for all exceptions thrown by the SDK. -/// -public class SeedObjectException(string message, Exception? innerException = null) - : Exception(message, innerException) { } diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/Version.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/Version.cs deleted file mode 100644 index 4c5cb2f299b..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/Public/Version.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace SeedObject; - -internal class Version -{ - public const string Current = "0.0.1"; -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Core/RawClient.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Core/RawClient.cs deleted file mode 100644 index 2e42938980f..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Core/RawClient.cs +++ /dev/null @@ -1,189 +0,0 @@ -using System.Net.Http; -using System.Net.Http.Headers; -using System.Text; -using System.Threading; - -namespace SeedObject.Core; - -#nullable enable - -/// -/// Utility class for making raw HTTP requests to the API. -/// -internal class RawClient(ClientOptions clientOptions) -{ - private const int InitialRetryDelayMs = 1000; - private const int MaxRetryDelayMs = 60000; - - /// - /// The client options applied on every request. - /// - public readonly ClientOptions Options = clientOptions; - - public async Task MakeRequestAsync( - BaseApiRequest request, - CancellationToken cancellationToken = default - ) - { - // Apply the request timeout. - var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); - var timeout = request.Options?.Timeout ?? Options.Timeout; - cts.CancelAfter(timeout); - - // Send the request. - return await SendWithRetriesAsync(request, cts.Token); - } - - public record BaseApiRequest - { - public required string BaseUrl { get; init; } - - public required HttpMethod Method { get; init; } - - public required string Path { get; init; } - - public string? ContentType { get; init; } - - public Dictionary Query { get; init; } = new(); - - public Headers Headers { get; init; } = new(); - - public IRequestOptions? Options { get; init; } - } - - /// - /// The request object to be sent for streaming uploads. - /// - public record StreamApiRequest : BaseApiRequest - { - public Stream? Body { get; init; } - } - - /// - /// The request object to be sent for JSON APIs. - /// - public record JsonApiRequest : BaseApiRequest - { - public object? Body { get; init; } - } - - /// - /// The response object returned from the API. - /// - public record ApiResponse - { - public required int StatusCode { get; init; } - - public required HttpResponseMessage Raw { get; init; } - } - - private async Task SendWithRetriesAsync( - BaseApiRequest request, - CancellationToken cancellationToken - ) - { - var httpClient = request.Options?.HttpClient ?? Options.HttpClient; - var maxRetries = request.Options?.MaxRetries ?? Options.MaxRetries; - var response = await httpClient.SendAsync(BuildHttpRequest(request), cancellationToken); - for (var i = 0; i < maxRetries; i++) - { - if (!ShouldRetry(response)) - { - break; - } - var delayMs = Math.Min(InitialRetryDelayMs * (int)Math.Pow(2, i), MaxRetryDelayMs); - await System.Threading.Tasks.Task.Delay(delayMs, cancellationToken); - response = await httpClient.SendAsync(BuildHttpRequest(request), cancellationToken); - } - return new 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 HttpRequestMessage BuildHttpRequest(BaseApiRequest request) - { - var url = BuildUrl(request); - var httpRequest = new HttpRequestMessage(request.Method, url); - switch (request) - { - // Add the request body to the request. - case JsonApiRequest jsonRequest: - { - if (jsonRequest.Body != null) - { - httpRequest.Content = new StringContent( - JsonUtils.Serialize(jsonRequest.Body), - Encoding.UTF8, - "application/json" - ); - } - break; - } - case StreamApiRequest { Body: not null } streamRequest: - httpRequest.Content = new StreamContent(streamRequest.Body); - break; - } - if (request.ContentType != null) - { - httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse( - request.ContentType - ); - } - SetHeaders(httpRequest, Options.Headers); - SetHeaders(httpRequest, request.Headers); - SetHeaders(httpRequest, request.Options?.Headers ?? new Headers()); - - return httpRequest; - } - - private static string BuildUrl(BaseApiRequest request) - { - var baseUrl = request.Options?.BaseUrl ?? request.BaseUrl; - var trimmedBaseUrl = baseUrl.TrimEnd('/'); - var trimmedBasePath = request.Path.TrimStart('/'); - var url = $"{trimmedBaseUrl}/{trimmedBasePath}"; - if (request.Query.Count <= 0) - return url; - url += "?"; - url = request.Query.Aggregate( - url, - (current, queryItem) => - { - if (queryItem.Value is 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 void SetHeaders(HttpRequestMessage httpRequest, Headers headers) - { - foreach (var header in headers) - { - var value = header.Value?.Match(str => str, func => func.Invoke()); - if (value != null) - { - httpRequest.Headers.TryAddWithoutValidation(header.Key, value); - } - } - } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Requests/PostRootRequest.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Requests/PostRootRequest.cs deleted file mode 100644 index f7f4de3b2b3..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Requests/PostRootRequest.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Text.Json.Serialization; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -public record PostRootRequest -{ - [JsonPropertyName("bar")] - public required InlineType1 Bar { get; set; } - - [JsonPropertyName("foo")] - public required string Foo { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/SeedObject.Custom.props b/seed/csharp-sdk/inline-types/src/SeedObject/SeedObject.Custom.props deleted file mode 100644 index 70df2849401..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/SeedObject.Custom.props +++ /dev/null @@ -1,20 +0,0 @@ - - - - \ No newline at end of file diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/SeedObject.csproj b/seed/csharp-sdk/inline-types/src/SeedObject/SeedObject.csproj deleted file mode 100644 index ceed24758f1..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/SeedObject.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - - net462;net8.0;net7.0;net6.0;netstandard2.0 - enable - 12 - enable - 0.0.1 - $(Version) - $(Version) - README.md - https://github.com/inline-types/fern - true - - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - - - - - - - - - - - - <_Parameter1>SeedObject.Test - - - - - diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/SeedObjectClient.cs b/seed/csharp-sdk/inline-types/src/SeedObject/SeedObjectClient.cs deleted file mode 100644 index a4d257e2d62..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/SeedObjectClient.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System.Net.Http; -using System.Text.Json; -using System.Threading; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -public partial class SeedObjectClient -{ - private RawClient _client; - - public SeedObjectClient(ClientOptions? clientOptions = null) - { - var defaultHeaders = new Headers( - new Dictionary() - { - { "X-Fern-Language", "C#" }, - { "X-Fern-SDK-Name", "SeedObject" }, - { "X-Fern-SDK-Version", Version.Current }, - { "User-Agent", "Ferninline-types/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); - } - - /// - /// - /// await client.GetRootAsync( - /// new PostRootRequest - /// { - /// Bar = new InlineType1 - /// { - /// Foo = "foo", - /// Bar = new NestedInlineType1 - /// { - /// Foo = "foo", - /// Bar = "bar", - /// MyEnum = InlineEnum.Sunny, - /// }, - /// }, - /// Foo = "foo", - /// } - /// ); - /// - /// - public async Task GetRootAsync( - PostRootRequest request, - RequestOptions? options = null, - CancellationToken cancellationToken = default - ) - { - var response = await _client.MakeRequestAsync( - new RawClient.JsonApiRequest - { - BaseUrl = _client.Options.BaseUrl, - Method = HttpMethod.Post, - Path = "/root/root", - Body = request, - ContentType = "application/json", - Options = options, - }, - cancellationToken - ); - var responseBody = await response.Raw.Content.ReadAsStringAsync(); - if (response.StatusCode is >= 200 and < 400) - { - try - { - return JsonUtils.Deserialize(responseBody)!; - } - catch (JsonException e) - { - throw new SeedObjectException("Failed to deserialize response", e); - } - } - - throw new SeedObjectApiException( - $"Error with status code {response.StatusCode}", - response.StatusCode, - responseBody - ); - } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Types/InlineEnum.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Types/InlineEnum.cs deleted file mode 100644 index 6eb215679c4..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Types/InlineEnum.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Runtime.Serialization; -using System.Text.Json.Serialization; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -[JsonConverter(typeof(EnumSerializer))] -public enum InlineEnum -{ - [EnumMember(Value = "SUNNY")] - Sunny, - - [EnumMember(Value = "CLOUDY")] - Cloudy, - - [EnumMember(Value = "RAINING")] - Raining, - - [EnumMember(Value = "SNOWING")] - Snowing, -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Types/InlineType1.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Types/InlineType1.cs deleted file mode 100644 index aa5df854386..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Types/InlineType1.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Text.Json.Serialization; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -public record InlineType1 -{ - [JsonPropertyName("foo")] - public required string Foo { get; set; } - - [JsonPropertyName("bar")] - public required NestedInlineType1 Bar { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Types/InlineType2.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Types/InlineType2.cs deleted file mode 100644 index ff1449e5d73..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Types/InlineType2.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Text.Json.Serialization; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -public record InlineType2 -{ - [JsonPropertyName("baz")] - public required string Baz { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Types/NestedInlineType1.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Types/NestedInlineType1.cs deleted file mode 100644 index 19ab70d0370..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Types/NestedInlineType1.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Text.Json.Serialization; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -public record NestedInlineType1 -{ - [JsonPropertyName("foo")] - public required string Foo { get; set; } - - [JsonPropertyName("bar")] - public required string Bar { get; set; } - - [JsonPropertyName("myEnum")] - public required InlineEnum MyEnum { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/seed/csharp-sdk/inline-types/src/SeedObject/Types/RootType1.cs b/seed/csharp-sdk/inline-types/src/SeedObject/Types/RootType1.cs deleted file mode 100644 index 72cfd860d48..00000000000 --- a/seed/csharp-sdk/inline-types/src/SeedObject/Types/RootType1.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Text.Json.Serialization; -using SeedObject.Core; - -#nullable enable - -namespace SeedObject; - -public record RootType1 -{ - [JsonPropertyName("foo")] - public required string Foo { get; set; } - - [JsonPropertyName("bar")] - public required InlineType1 Bar { get; set; } - - public override string ToString() - { - return JsonUtils.Serialize(this); - } -} diff --git a/seed/fastapi/inline-types/.mock/definition/__package__.yml b/seed/fastapi/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/fastapi/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/fastapi/inline-types/.mock/fern.config.json b/seed/fastapi/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/fastapi/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/fastapi/inline-types/__init__.py b/seed/fastapi/inline-types/__init__.py deleted file mode 100644 index 559e53306bb..00000000000 --- a/seed/fastapi/inline-types/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .service import PostRootRequest -from .types import ( - InlineEnum, - InlineType1, - InlineType2, - InlinedDiscriminatedUnion1, - InlinedUndiscriminatedUnion1, - NestedInlineType1, - RootType1, -) - -__all__ = [ - "InlineEnum", - "InlineType1", - "InlineType2", - "InlinedDiscriminatedUnion1", - "InlinedUndiscriminatedUnion1", - "NestedInlineType1", - "PostRootRequest", - "RootType1", -] diff --git a/seed/fastapi/inline-types/core/__init__.py b/seed/fastapi/inline-types/core/__init__.py deleted file mode 100644 index f9c8e44aea0..00000000000 --- a/seed/fastapi/inline-types/core/__init__.py +++ /dev/null @@ -1,42 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .datetime_utils import serialize_datetime -from .exceptions import ( - FernHTTPException, - UnauthorizedException, - default_exception_handler, - fern_http_exception_handler, - http_exception_handler, -) -from .pydantic_utilities import ( - IS_PYDANTIC_V2, - UniversalBaseModel, - UniversalRootModel, - parse_obj_as, - universal_field_validator, - universal_root_validator, - update_forward_refs, -) -from .route_args import route_args -from .security import BearerToken -from .serialization import FieldMetadata, convert_and_respect_annotation_metadata - -__all__ = [ - "BearerToken", - "FernHTTPException", - "FieldMetadata", - "IS_PYDANTIC_V2", - "UnauthorizedException", - "UniversalBaseModel", - "UniversalRootModel", - "convert_and_respect_annotation_metadata", - "default_exception_handler", - "fern_http_exception_handler", - "http_exception_handler", - "parse_obj_as", - "route_args", - "serialize_datetime", - "universal_field_validator", - "universal_root_validator", - "update_forward_refs", -] diff --git a/seed/fastapi/inline-types/core/abstract_fern_service.py b/seed/fastapi/inline-types/core/abstract_fern_service.py deleted file mode 100644 index 9966b4876da..00000000000 --- a/seed/fastapi/inline-types/core/abstract_fern_service.py +++ /dev/null @@ -1,10 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import abc - -import fastapi - - -class AbstractFernService(abc.ABC): - @classmethod - def _init_fern(cls, router: fastapi.APIRouter) -> None: ... diff --git a/seed/fastapi/inline-types/core/datetime_utils.py b/seed/fastapi/inline-types/core/datetime_utils.py deleted file mode 100644 index 47344e9d9cc..00000000000 --- a/seed/fastapi/inline-types/core/datetime_utils.py +++ /dev/null @@ -1,30 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt - - -def serialize_datetime(v: dt.datetime) -> str: - """ - Serialize a datetime including timezone info. - - Uses the timezone info provided if present, otherwise uses the current runtime's timezone info. - - UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00. - """ - - def _serialize_zoned_datetime(v: dt.datetime) -> str: - if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname( - None - ): - # UTC is a special case where we use "Z" at the end instead of "+00:00" - return v.isoformat().replace("+00:00", "Z") - else: - # Delegate to the typical +/- offset format - return v.isoformat() - - if v.tzinfo is not None: - return _serialize_zoned_datetime(v) - else: - local_tz = dt.datetime.now().astimezone().tzinfo - localized_dt = v.replace(tzinfo=local_tz) - return _serialize_zoned_datetime(localized_dt) diff --git a/seed/fastapi/inline-types/core/exceptions/__init__.py b/seed/fastapi/inline-types/core/exceptions/__init__.py deleted file mode 100644 index dae4b8980c1..00000000000 --- a/seed/fastapi/inline-types/core/exceptions/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .fern_http_exception import FernHTTPException -from .handlers import ( - default_exception_handler, - fern_http_exception_handler, - http_exception_handler, -) -from .unauthorized import UnauthorizedException - -__all__ = [ - "FernHTTPException", - "UnauthorizedException", - "default_exception_handler", - "fern_http_exception_handler", - "http_exception_handler", -] diff --git a/seed/fastapi/inline-types/core/exceptions/fern_http_exception.py b/seed/fastapi/inline-types/core/exceptions/fern_http_exception.py deleted file mode 100644 index 81610359a7f..00000000000 --- a/seed/fastapi/inline-types/core/exceptions/fern_http_exception.py +++ /dev/null @@ -1,24 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import abc -import fastapi -import typing - - -class FernHTTPException(abc.ABC, fastapi.HTTPException): - def __init__( - self, - status_code: int, - name: typing.Optional[str] = None, - content: typing.Optional[typing.Any] = None, - ): - super().__init__(status_code=status_code) - self.name = name - self.status_code = status_code - self.content = content - - def to_json_response(self) -> fastapi.responses.JSONResponse: - content = fastapi.encoders.jsonable_encoder(self.content, exclude_none=True) - return fastapi.responses.JSONResponse( - content=content, status_code=self.status_code - ) diff --git a/seed/fastapi/inline-types/core/exceptions/handlers.py b/seed/fastapi/inline-types/core/exceptions/handlers.py deleted file mode 100644 index ae1c2741f06..00000000000 --- a/seed/fastapi/inline-types/core/exceptions/handlers.py +++ /dev/null @@ -1,50 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import logging - -import starlette -import starlette.exceptions - -import fastapi - -from .fern_http_exception import FernHTTPException - - -def fern_http_exception_handler( - request: fastapi.requests.Request, - exc: FernHTTPException, - skip_log: bool = False, -) -> fastapi.responses.JSONResponse: - if not skip_log: - logging.getLogger(__name__).error( - f"{exc.__class__.__name__} in {request.url.path}", exc_info=exc - ) - return exc.to_json_response() - - -def http_exception_handler( - request: fastapi.requests.Request, - exc: starlette.exceptions.HTTPException, - skip_log: bool = False, -) -> fastapi.responses.JSONResponse: - if not skip_log: - logging.getLogger(__name__).error( - f"{exc.__class__.__name__} in {request.url.path}", exc_info=exc - ) - return FernHTTPException( - status_code=exc.status_code, content=exc.detail - ).to_json_response() - - -def default_exception_handler( - request: fastapi.requests.Request, - exc: Exception, - skip_log: bool = False, -) -> fastapi.responses.JSONResponse: - if not skip_log: - logging.getLogger(__name__).error( - f"{exc.__class__.__name__} in {request.url.path}", exc_info=exc - ) - return FernHTTPException( - status_code=500, content="Internal Server Error" - ).to_json_response() diff --git a/seed/fastapi/inline-types/core/exceptions/unauthorized.py b/seed/fastapi/inline-types/core/exceptions/unauthorized.py deleted file mode 100644 index 32d532e5ef2..00000000000 --- a/seed/fastapi/inline-types/core/exceptions/unauthorized.py +++ /dev/null @@ -1,15 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .fern_http_exception import FernHTTPException - - -class UnauthorizedException(FernHTTPException): - """ - This is the exception that is thrown by Fern when auth is not present on a - request. - """ - - def __init__(self, content: typing.Optional[str] = None) -> None: - super().__init__(status_code=401, content=content) diff --git a/seed/fastapi/inline-types/core/pydantic_utilities.py b/seed/fastapi/inline-types/core/pydantic_utilities.py deleted file mode 100644 index fe6359cf503..00000000000 --- a/seed/fastapi/inline-types/core/pydantic_utilities.py +++ /dev/null @@ -1,273 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# nopycln: file -import datetime as dt -import typing -from collections import defaultdict - -import typing_extensions - -import pydantic - -from .datetime_utils import serialize_datetime - -IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") - -if IS_PYDANTIC_V2: - # isort will try to reformat the comments on these imports, which breaks mypy - # isort: off - from pydantic.v1.datetime_parse import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 - parse_date as parse_date, - ) - from pydantic.v1.datetime_parse import ( # pyright: ignore[reportMissingImports] # Pydantic v2 - parse_datetime as parse_datetime, - ) - from pydantic.v1.json import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 - ENCODERS_BY_TYPE as encoders_by_type, - ) - from pydantic.v1.typing import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 - get_args as get_args, - ) - from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 - get_origin as get_origin, - ) - from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 - is_literal_type as is_literal_type, - ) - from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 - is_union as is_union, - ) - from pydantic.v1.fields import ModelField as ModelField # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 -else: - from pydantic.datetime_parse import parse_date as parse_date # type: ignore # Pydantic v1 - from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore # Pydantic v1 - from pydantic.fields import ModelField as ModelField # type: ignore # Pydantic v1 - from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore # Pydantic v1 - from pydantic.typing import get_args as get_args # type: ignore # Pydantic v1 - from pydantic.typing import get_origin as get_origin # type: ignore # Pydantic v1 - from pydantic.typing import is_literal_type as is_literal_type # type: ignore # Pydantic v1 - from pydantic.typing import is_union as is_union # type: ignore # Pydantic v1 - - # isort: on - - -T = typing.TypeVar("T") -Model = typing.TypeVar("Model", bound=pydantic.BaseModel) - - -def parse_obj_as(type_: typing.Type[T], object_: typing.Any) -> T: - if IS_PYDANTIC_V2: - adapter = pydantic.TypeAdapter(type_) # type: ignore # Pydantic v2 - return adapter.validate_python(object_) - else: - return pydantic.parse_obj_as(type_, object_) - - -def to_jsonable_with_fallback( - obj: typing.Any, fallback_serializer: typing.Callable[[typing.Any], typing.Any] -) -> typing.Any: - if IS_PYDANTIC_V2: - from pydantic_core import to_jsonable_python - - return to_jsonable_python(obj, fallback=fallback_serializer) - else: - return fallback_serializer(obj) - - -class UniversalBaseModel(pydantic.BaseModel): - class Config: - populate_by_name = True - smart_union = True - allow_population_by_field_name = True - json_encoders = {dt.datetime: serialize_datetime} - # Allow fields begining with `model_` to be used in the model - protected_namespaces = () - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - if IS_PYDANTIC_V2: - return super().model_dump_json(**kwargs_with_defaults) # type: ignore # Pydantic v2 - else: - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - """ - Override the default dict method to `exclude_unset` by default. This function patches - `exclude_unset` to work include fields within non-None default values. - """ - # Note: the logic here is multi-plexed given the levers exposed in Pydantic V1 vs V2 - # Pydantic V1's .dict can be extremely slow, so we do not want to call it twice. - # - # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models - # that we have less control over, and this is less intrusive than custom serializers for now. - if IS_PYDANTIC_V2: - kwargs_with_defaults_exclude_unset: typing.Any = { - **kwargs, - "by_alias": True, - "exclude_unset": True, - "exclude_none": False, - } - kwargs_with_defaults_exclude_none: typing.Any = { - **kwargs, - "by_alias": True, - "exclude_none": True, - "exclude_unset": False, - } - return deep_union_pydantic_dicts( - super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore # Pydantic v2 - super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore # Pydantic v2 - ) - - else: - _fields_set = self.__fields_set__.copy() - - fields = _get_model_fields(self.__class__) - for name, field in fields.items(): - if name not in _fields_set: - default = _get_field_default(field) - - # If the default values are non-null act like they've been set - # This effectively allows exclude_unset to work like exclude_none where - # the latter passes through intentionally set none values. - if default is not None or ( - "exclude_unset" in kwargs and not kwargs["exclude_unset"] - ): - _fields_set.add(name) - - if default is not None: - self.__fields_set__.add(name) - - kwargs_with_defaults_exclude_unset_include_fields: typing.Any = { - "by_alias": True, - "exclude_unset": True, - "include": _fields_set, - **kwargs, - } - - return super().dict(**kwargs_with_defaults_exclude_unset_include_fields) - - -def _union_list_of_pydantic_dicts( - source: typing.List[typing.Any], destination: typing.List[typing.Any] -) -> typing.List[typing.Any]: - converted_list: typing.List[typing.Any] = [] - for i, item in enumerate(source): - destination_value = destination[i] # type: ignore - if isinstance(item, dict): - converted_list.append(deep_union_pydantic_dicts(item, destination_value)) - elif isinstance(item, list): - converted_list.append( - _union_list_of_pydantic_dicts(item, destination_value) - ) - else: - converted_list.append(item) - return converted_list - - -def deep_union_pydantic_dicts( - source: typing.Dict[str, typing.Any], destination: typing.Dict[str, typing.Any] -) -> typing.Dict[str, typing.Any]: - for key, value in source.items(): - node = destination.setdefault(key, {}) - if isinstance(value, dict): - deep_union_pydantic_dicts(value, node) - # Note: we do not do this same processing for sets given we do not have sets of models - # and given the sets are unordered, the processing of the set and matching objects would - # be non-trivial. - elif isinstance(value, list): - destination[key] = _union_list_of_pydantic_dicts(value, node) - else: - destination[key] = value - - return destination - - -if IS_PYDANTIC_V2: - - class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore # Pydantic v2 - pass - - UniversalRootModel: typing_extensions.TypeAlias = V2RootModel # type: ignore -else: - UniversalRootModel: typing_extensions.TypeAlias = UniversalBaseModel # type: ignore - - -def encode_by_type(o: typing.Any) -> typing.Any: - encoders_by_class_tuples: typing.Dict[ - typing.Callable[[typing.Any], typing.Any], typing.Tuple[typing.Any, ...] - ] = defaultdict(tuple) - for type_, encoder in encoders_by_type.items(): - encoders_by_class_tuples[encoder] += (type_,) - - if type(o) in encoders_by_type: - return encoders_by_type[type(o)](o) - for encoder, classes_tuple in encoders_by_class_tuples.items(): - if isinstance(o, classes_tuple): - return encoder(o) - - -def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None: - if IS_PYDANTIC_V2: - model.model_rebuild(raise_errors=False) # type: ignore # Pydantic v2 - else: - model.update_forward_refs(**localns) - - -# Mirrors Pydantic's internal typing -AnyCallable = typing.Callable[..., typing.Any] - - -def universal_root_validator( - pre: bool = False, -) -> typing.Callable[[AnyCallable], AnyCallable]: - def decorator(func: AnyCallable) -> AnyCallable: - if IS_PYDANTIC_V2: - return pydantic.model_validator(mode="before" if pre else "after")(func) # type: ignore # Pydantic v2 - else: - return pydantic.root_validator(pre=pre)(func) # type: ignore # Pydantic v1 - - return decorator - - -def universal_field_validator( - field_name: str, pre: bool = False -) -> typing.Callable[[AnyCallable], AnyCallable]: - def decorator(func: AnyCallable) -> AnyCallable: - if IS_PYDANTIC_V2: - return pydantic.field_validator( - field_name, mode="before" if pre else "after" - )(func) # type: ignore # Pydantic v2 - else: - return pydantic.validator(field_name, pre=pre)(func) # type: ignore # Pydantic v1 - - return decorator - - -PydanticField = typing.Union[ModelField, pydantic.fields.FieldInfo] - - -def _get_model_fields( - model: typing.Type["Model"], -) -> typing.Mapping[str, PydanticField]: - if IS_PYDANTIC_V2: - return model.model_fields # type: ignore # Pydantic v2 - else: - return model.__fields__ # type: ignore # Pydantic v1 - - -def _get_field_default(field: PydanticField) -> typing.Any: - try: - value = field.get_default() # type: ignore # Pydantic < v1.10.15 - except: - value = field.default - if IS_PYDANTIC_V2: - from pydantic_core import PydanticUndefined - - if value == PydanticUndefined: - return None - return value - return value diff --git a/seed/fastapi/inline-types/core/route_args.py b/seed/fastapi/inline-types/core/route_args.py deleted file mode 100644 index bd940bf4ddd..00000000000 --- a/seed/fastapi/inline-types/core/route_args.py +++ /dev/null @@ -1,73 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import inspect -import typing - -import typing_extensions - -T = typing.TypeVar("T", bound=typing.Callable[..., typing.Any]) - -FERN_CONFIG_KEY = "__fern" - - -class RouteArgs(typing_extensions.TypedDict): - openapi_extra: typing.Optional[typing.Dict[str, typing.Any]] - tags: typing.Optional[typing.List[typing.Union[str, enum.Enum]]] - include_in_schema: bool - - -DEFAULT_ROUTE_ARGS = RouteArgs(openapi_extra=None, tags=None, include_in_schema=True) - - -def get_route_args( - endpoint_function: typing.Callable[..., typing.Any], *, default_tag: str -) -> RouteArgs: - unwrapped = inspect.unwrap( - endpoint_function, stop=(lambda f: hasattr(f, FERN_CONFIG_KEY)) - ) - route_args = typing.cast( - RouteArgs, getattr(unwrapped, FERN_CONFIG_KEY, DEFAULT_ROUTE_ARGS) - ) - if route_args["tags"] is None: - return RouteArgs( - openapi_extra=route_args["openapi_extra"], - tags=[default_tag], - include_in_schema=route_args["include_in_schema"], - ) - return route_args - - -def route_args( - openapi_extra: typing.Optional[typing.Dict[str, typing.Any]] = None, - tags: typing.Optional[typing.List[typing.Union[str, enum.Enum]]] = None, - include_in_schema: bool = True, -) -> typing.Callable[[T], T]: - """ - this decorator allows you to forward certain args to the FastAPI route decorator. - - usage: - @route_args(openapi_extra=...) - def your_endpoint_method(... - - currently supported args: - - openapi_extra - - tags - - if there's another FastAPI route arg you need to pass through, please - contact the Fern team! - """ - - def decorator(endpoint_function: T) -> T: - setattr( - endpoint_function, - FERN_CONFIG_KEY, - RouteArgs( - openapi_extra=openapi_extra, - tags=tags, - include_in_schema=include_in_schema, - ), - ) - return endpoint_function - - return decorator diff --git a/seed/fastapi/inline-types/core/security/__init__.py b/seed/fastapi/inline-types/core/security/__init__.py deleted file mode 100644 index e69ee6d9c5a..00000000000 --- a/seed/fastapi/inline-types/core/security/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .bearer import BearerToken - -__all__ = ["BearerToken"] diff --git a/seed/fastapi/inline-types/core/security/bearer.py b/seed/fastapi/inline-types/core/security/bearer.py deleted file mode 100644 index 023342b668d..00000000000 --- a/seed/fastapi/inline-types/core/security/bearer.py +++ /dev/null @@ -1,22 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import fastapi - -from ..exceptions import UnauthorizedException - - -class BearerToken: - def __init__(self, token: str): - self.token = token - - -def HTTPBearer(request: fastapi.requests.Request) -> BearerToken: - authorization_header_value = request.headers.get("Authorization") - if not authorization_header_value: - raise UnauthorizedException("Missing Authorization header") - scheme, _, token = authorization_header_value.partition(" ") - if scheme.lower() != "bearer": - raise UnauthorizedException("Authorization header scheme is not bearer") - if not token: - raise UnauthorizedException("Authorization header is missing a token") - return BearerToken(token) diff --git a/seed/fastapi/inline-types/core/serialization.py b/seed/fastapi/inline-types/core/serialization.py deleted file mode 100644 index 5679deb8a56..00000000000 --- a/seed/fastapi/inline-types/core/serialization.py +++ /dev/null @@ -1,276 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import collections -import inspect -import typing - -import typing_extensions - -import pydantic - - -class FieldMetadata: - """ - Metadata class used to annotate fields to provide additional information. - - Example: - class MyDict(TypedDict): - field: typing.Annotated[str, FieldMetadata(alias="field_name")] - - Will serialize: `{"field": "value"}` - To: `{"field_name": "value"}` - """ - - alias: str - - def __init__(self, *, alias: str) -> None: - self.alias = alias - - -def convert_and_respect_annotation_metadata( - *, - object_: typing.Any, - annotation: typing.Any, - inner_type: typing.Optional[typing.Any] = None, - direction: typing.Literal["read", "write"], -) -> typing.Any: - """ - Respect the metadata annotations on a field, such as aliasing. This function effectively - manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for - TypedDicts, which cannot support aliasing out of the box, and can be extended for additional - utilities, such as defaults. - - Parameters - ---------- - object_ : typing.Any - - annotation : type - The type we're looking to apply typing annotations from - - inner_type : typing.Optional[type] - - Returns - ------- - typing.Any - """ - - if object_ is None: - return None - if inner_type is None: - inner_type = annotation - - clean_type = _remove_annotations(inner_type) - # Pydantic models - if ( - inspect.isclass(clean_type) - and issubclass(clean_type, pydantic.BaseModel) - and isinstance(object_, typing.Mapping) - ): - return _convert_mapping(object_, clean_type, direction) - # TypedDicts - if typing_extensions.is_typeddict(clean_type) and isinstance( - object_, typing.Mapping - ): - return _convert_mapping(object_, clean_type, direction) - - if ( - typing_extensions.get_origin(clean_type) == typing.Dict - or typing_extensions.get_origin(clean_type) == dict - or clean_type == typing.Dict - ) and isinstance(object_, typing.Dict): - key_type = typing_extensions.get_args(clean_type)[0] - value_type = typing_extensions.get_args(clean_type)[1] - - return { - key: convert_and_respect_annotation_metadata( - object_=value, - annotation=annotation, - inner_type=value_type, - direction=direction, - ) - for key, value in object_.items() - } - - # If you're iterating on a string, do not bother to coerce it to a sequence. - if not isinstance(object_, str): - if ( - typing_extensions.get_origin(clean_type) == typing.Set - or typing_extensions.get_origin(clean_type) == set - or clean_type == typing.Set - ) and isinstance(object_, typing.Set): - inner_type = typing_extensions.get_args(clean_type)[0] - return { - convert_and_respect_annotation_metadata( - object_=item, - annotation=annotation, - inner_type=inner_type, - direction=direction, - ) - for item in object_ - } - elif ( - ( - typing_extensions.get_origin(clean_type) == typing.List - or typing_extensions.get_origin(clean_type) == list - or clean_type == typing.List - ) - and isinstance(object_, typing.List) - ) or ( - ( - typing_extensions.get_origin(clean_type) == typing.Sequence - or typing_extensions.get_origin(clean_type) == collections.abc.Sequence - or clean_type == typing.Sequence - ) - and isinstance(object_, typing.Sequence) - ): - inner_type = typing_extensions.get_args(clean_type)[0] - return [ - convert_and_respect_annotation_metadata( - object_=item, - annotation=annotation, - inner_type=inner_type, - direction=direction, - ) - for item in object_ - ] - - if typing_extensions.get_origin(clean_type) == typing.Union: - # We should be able to ~relatively~ safely try to convert keys against all - # member types in the union, the edge case here is if one member aliases a field - # of the same name to a different name from another member - # Or if another member aliases a field of the same name that another member does not. - for member in typing_extensions.get_args(clean_type): - object_ = convert_and_respect_annotation_metadata( - object_=object_, - annotation=annotation, - inner_type=member, - direction=direction, - ) - return object_ - - annotated_type = _get_annotation(annotation) - if annotated_type is None: - return object_ - - # If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.) - # Then we can safely call it on the recursive conversion. - return object_ - - -def _convert_mapping( - object_: typing.Mapping[str, object], - expected_type: typing.Any, - direction: typing.Literal["read", "write"], -) -> typing.Mapping[str, object]: - converted_object: typing.Dict[str, object] = {} - annotations = typing_extensions.get_type_hints(expected_type, include_extras=True) - aliases_to_field_names = _get_alias_to_field_name(annotations) - for key, value in object_.items(): - if direction == "read" and key in aliases_to_field_names: - dealiased_key = aliases_to_field_names.get(key) - if dealiased_key is not None: - type_ = annotations.get(dealiased_key) - else: - type_ = annotations.get(key) - # Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map - # - # So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias - # then we can just pass the value through as is - if type_ is None: - converted_object[key] = value - elif direction == "read" and key not in aliases_to_field_names: - converted_object[key] = convert_and_respect_annotation_metadata( - object_=value, annotation=type_, direction=direction - ) - else: - converted_object[ - _alias_key(key, type_, direction, aliases_to_field_names) - ] = convert_and_respect_annotation_metadata( - object_=value, annotation=type_, direction=direction - ) - return converted_object - - -def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]: - maybe_annotated_type = typing_extensions.get_origin(type_) - if maybe_annotated_type is None: - return None - - if maybe_annotated_type == typing_extensions.NotRequired: - type_ = typing_extensions.get_args(type_)[0] - maybe_annotated_type = typing_extensions.get_origin(type_) - - if maybe_annotated_type == typing_extensions.Annotated: - return type_ - - return None - - -def _remove_annotations(type_: typing.Any) -> typing.Any: - maybe_annotated_type = typing_extensions.get_origin(type_) - if maybe_annotated_type is None: - return type_ - - if maybe_annotated_type == typing_extensions.NotRequired: - return _remove_annotations(typing_extensions.get_args(type_)[0]) - - if maybe_annotated_type == typing_extensions.Annotated: - return _remove_annotations(typing_extensions.get_args(type_)[0]) - - return type_ - - -def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]: - annotations = typing_extensions.get_type_hints(type_, include_extras=True) - return _get_alias_to_field_name(annotations) - - -def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]: - annotations = typing_extensions.get_type_hints(type_, include_extras=True) - return _get_field_to_alias_name(annotations) - - -def _get_alias_to_field_name( - field_to_hint: typing.Dict[str, typing.Any], -) -> typing.Dict[str, str]: - aliases = {} - for field, hint in field_to_hint.items(): - maybe_alias = _get_alias_from_type(hint) - if maybe_alias is not None: - aliases[maybe_alias] = field - return aliases - - -def _get_field_to_alias_name( - field_to_hint: typing.Dict[str, typing.Any], -) -> typing.Dict[str, str]: - aliases = {} - for field, hint in field_to_hint.items(): - maybe_alias = _get_alias_from_type(hint) - if maybe_alias is not None: - aliases[field] = maybe_alias - return aliases - - -def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]: - maybe_annotated_type = _get_annotation(type_) - - if maybe_annotated_type is not None: - # The actual annotations are 1 onward, the first is the annotated type - annotations = typing_extensions.get_args(maybe_annotated_type)[1:] - - for annotation in annotations: - if isinstance(annotation, FieldMetadata) and annotation.alias is not None: - return annotation.alias - return None - - -def _alias_key( - key: str, - type_: typing.Any, - direction: typing.Literal["read", "write"], - aliases_to_field_names: typing.Dict[str, str], -) -> str: - if direction == "read": - return aliases_to_field_names.get(key, key) - return _get_alias_from_type(type_=type_) or key diff --git a/seed/fastapi/inline-types/register.py b/seed/fastapi/inline-types/register.py deleted file mode 100644 index ce9f38fa412..00000000000 --- a/seed/fastapi/inline-types/register.py +++ /dev/null @@ -1,48 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import fastapi -from .service.service import AbstractRootService -import typing -from fastapi import params -from .core.exceptions.fern_http_exception import FernHTTPException -from .core.exceptions import fern_http_exception_handler -import starlette.exceptions -from .core.exceptions import http_exception_handler -from .core.exceptions import default_exception_handler -from .core.abstract_fern_service import AbstractFernService -import types -import os -import glob -import importlib - - -def register( - _app: fastapi.FastAPI, - *, - root: AbstractRootService, - dependencies: typing.Optional[typing.Sequence[params.Depends]] = None, -) -> None: - _app.include_router(__register_service(root), dependencies=dependencies) - - _app.add_exception_handler(FernHTTPException, fern_http_exception_handler) # type: ignore - _app.add_exception_handler( - starlette.exceptions.HTTPException, http_exception_handler - ) # type: ignore - _app.add_exception_handler(Exception, default_exception_handler) # type: ignore - - -def __register_service(service: AbstractFernService) -> fastapi.APIRouter: - router = fastapi.APIRouter() - type(service)._init_fern(router) - return router - - -def register_validators(module: types.ModuleType) -> None: - validators_directory: str = os.path.dirname(module.__file__) # type: ignore - for path in glob.glob( - os.path.join(validators_directory, "**/*.py"), recursive=True - ): - if os.path.isfile(path): - relative_path = os.path.relpath(path, start=validators_directory) - module_path = ".".join([module.__name__] + relative_path[:-3].split("/")) - importlib.import_module(module_path) diff --git a/seed/fastapi/inline-types/service/__init__.py b/seed/fastapi/inline-types/service/__init__.py deleted file mode 100644 index 8ff97f9a38d..00000000000 --- a/seed/fastapi/inline-types/service/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .post_root_request import PostRootRequest -from .service import AbstractRootService - -__all__ = ["AbstractRootService", "PostRootRequest"] diff --git a/seed/fastapi/inline-types/service/post_root_request.py b/seed/fastapi/inline-types/service/post_root_request.py deleted file mode 100644 index daa4e9c3328..00000000000 --- a/seed/fastapi/inline-types/service/post_root_request.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.pydantic_utilities import UniversalBaseModel -from ..types.inline_type_1 import InlineType1 -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class PostRootRequest(UniversalBaseModel): - bar: InlineType1 - foo: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( - extra="forbid" - ) # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid diff --git a/seed/fastapi/inline-types/service/service.py b/seed/fastapi/inline-types/service/service.py deleted file mode 100644 index dd90aa43cd6..00000000000 --- a/seed/fastapi/inline-types/service/service.py +++ /dev/null @@ -1,77 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.abstract_fern_service import AbstractFernService -from .post_root_request import PostRootRequest -from ..types.root_type_1 import RootType1 -import abc -import fastapi -import inspect -import typing -from ..core.exceptions.fern_http_exception import FernHTTPException -import logging -import functools -from ..core.route_args import get_route_args - - -class AbstractRootService(AbstractFernService): - """ - AbstractRootService is an abstract class containing the methods that you should implement. - - Each method is associated with an API route, which will be registered - with FastAPI when you register your implementation using Fern's register() - function. - """ - - @abc.abstractmethod - def get_root(self, *, body: PostRootRequest) -> RootType1: ... - - """ - Below are internal methods used by Fern to register your implementation. - You can ignore them. - """ - - @classmethod - def _init_fern(cls, router: fastapi.APIRouter) -> None: - cls.__init_get_root(router=router) - - @classmethod - def __init_get_root(cls, router: fastapi.APIRouter) -> None: - endpoint_function = inspect.signature(cls.get_root) - new_parameters: typing.List[inspect.Parameter] = [] - for index, (parameter_name, parameter) in enumerate( - endpoint_function.parameters.items() - ): - if index == 0: - new_parameters.append(parameter.replace(default=fastapi.Depends(cls))) - elif parameter_name == "body": - new_parameters.append(parameter.replace(default=fastapi.Body(...))) - else: - new_parameters.append(parameter) - setattr( - cls.get_root, - "__signature__", - endpoint_function.replace(parameters=new_parameters), - ) - - @functools.wraps(cls.get_root) - def wrapper(*args: typing.Any, **kwargs: typing.Any) -> RootType1: - try: - return cls.get_root(*args, **kwargs) - except FernHTTPException as e: - logging.getLogger(f"{cls.__module__}.{cls.__name__}").warn( - f"Endpoint 'get_root' unexpectedly threw {e.__class__.__name__}. " - + f"If this was intentional, please add {e.__class__.__name__} to " - + "the endpoint's errors list in your Fern Definition." - ) - raise e - - # this is necessary for FastAPI to find forward-ref'ed type hints. - # https://github.com/tiangolo/fastapi/pull/5077 - wrapper.__globals__.update(cls.get_root.__globals__) - - router.post( - path="/root/root", - response_model=RootType1, - description=AbstractRootService.get_root.__doc__, - **get_route_args(cls.get_root, default_tag=""), - )(wrapper) diff --git a/seed/fastapi/inline-types/snippet-templates.json b/seed/fastapi/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/fastapi/inline-types/snippet.json b/seed/fastapi/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/fastapi/inline-types/types/__init__.py b/seed/fastapi/inline-types/types/__init__.py deleted file mode 100644 index b143012e4f8..00000000000 --- a/seed/fastapi/inline-types/types/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .inline_enum import InlineEnum -from .inline_type_1 import InlineType1 -from .inline_type_2 import InlineType2 -from .inlined_discriminated_union_1 import InlinedDiscriminatedUnion1 -from .inlined_undiscriminated_union_1 import InlinedUndiscriminatedUnion1 -from .nested_inline_type_1 import NestedInlineType1 -from .root_type_1 import RootType1 - -__all__ = [ - "InlineEnum", - "InlineType1", - "InlineType2", - "InlinedDiscriminatedUnion1", - "InlinedUndiscriminatedUnion1", - "NestedInlineType1", - "RootType1", -] diff --git a/seed/fastapi/inline-types/types/inline_enum.py b/seed/fastapi/inline-types/types/inline_enum.py deleted file mode 100644 index b46f498c663..00000000000 --- a/seed/fastapi/inline-types/types/inline_enum.py +++ /dev/null @@ -1,29 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import enum -import typing - -T_Result = typing.TypeVar("T_Result") - - -class InlineEnum(str, enum.Enum): - SUNNY = "SUNNY" - CLOUDY = "CLOUDY" - RAINING = "RAINING" - SNOWING = "SNOWING" - - def visit( - self, - sunny: typing.Callable[[], T_Result], - cloudy: typing.Callable[[], T_Result], - raining: typing.Callable[[], T_Result], - snowing: typing.Callable[[], T_Result], - ) -> T_Result: - if self is InlineEnum.SUNNY: - return sunny() - if self is InlineEnum.CLOUDY: - return cloudy() - if self is InlineEnum.RAINING: - return raining() - if self is InlineEnum.SNOWING: - return snowing() diff --git a/seed/fastapi/inline-types/types/inline_type_1.py b/seed/fastapi/inline-types/types/inline_type_1.py deleted file mode 100644 index 26b6b8c2cf1..00000000000 --- a/seed/fastapi/inline-types/types/inline_type_1.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.pydantic_utilities import UniversalBaseModel -from .nested_inline_type_1 import NestedInlineType1 -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class InlineType1(UniversalBaseModel): - foo: str - bar: NestedInlineType1 - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( - extra="forbid" - ) # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid diff --git a/seed/fastapi/inline-types/types/inline_type_2.py b/seed/fastapi/inline-types/types/inline_type_2.py deleted file mode 100644 index 37881d22fa6..00000000000 --- a/seed/fastapi/inline-types/types/inline_type_2.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.pydantic_utilities import UniversalBaseModel -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class InlineType2(UniversalBaseModel): - baz: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( - extra="forbid" - ) # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid diff --git a/seed/fastapi/inline-types/types/inlined_discriminated_union_1.py b/seed/fastapi/inline-types/types/inlined_discriminated_union_1.py deleted file mode 100644 index b3bff091fd1..00000000000 --- a/seed/fastapi/inline-types/types/inlined_discriminated_union_1.py +++ /dev/null @@ -1,108 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations -from .inline_type_1 import InlineType1 -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from .inline_type_2 import InlineType2 -from ..core.pydantic_utilities import UniversalRootModel -import typing -import typing_extensions -import pydantic -from ..core.pydantic_utilities import update_forward_refs - -T_Result = typing.TypeVar("T_Result") - - -class _Factory: - def type_1(self, value: InlineType1) -> InlinedDiscriminatedUnion1: - if IS_PYDANTIC_V2: - return InlinedDiscriminatedUnion1( - root=_InlinedDiscriminatedUnion1.Type1( - **value.dict(exclude_unset=True), type="type1" - ) - ) # type: ignore - else: - return InlinedDiscriminatedUnion1( - __root__=_InlinedDiscriminatedUnion1.Type1( - **value.dict(exclude_unset=True), type="type1" - ) - ) # type: ignore - - def type_2(self, value: InlineType2) -> InlinedDiscriminatedUnion1: - if IS_PYDANTIC_V2: - return InlinedDiscriminatedUnion1( - root=_InlinedDiscriminatedUnion1.Type2( - **value.dict(exclude_unset=True), type="type2" - ) - ) # type: ignore - else: - return InlinedDiscriminatedUnion1( - __root__=_InlinedDiscriminatedUnion1.Type2( - **value.dict(exclude_unset=True), type="type2" - ) - ) # type: ignore - - -class InlinedDiscriminatedUnion1(UniversalRootModel): - factory: typing.ClassVar[_Factory] = _Factory() - - if IS_PYDANTIC_V2: - root: typing_extensions.Annotated[ - typing.Union[ - _InlinedDiscriminatedUnion1.Type1, _InlinedDiscriminatedUnion1.Type2 - ], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[ - _InlinedDiscriminatedUnion1.Type1, _InlinedDiscriminatedUnion1.Type2 - ]: - return self.root - else: - __root__: typing_extensions.Annotated[ - typing.Union[ - _InlinedDiscriminatedUnion1.Type1, _InlinedDiscriminatedUnion1.Type2 - ], - pydantic.Field(discriminator="type"), - ] - - def get_as_union( - self, - ) -> typing.Union[ - _InlinedDiscriminatedUnion1.Type1, _InlinedDiscriminatedUnion1.Type2 - ]: - return self.__root__ - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - if IS_PYDANTIC_V2: - return self.root.dict(**kwargs) - else: - return self.__root__.dict(**kwargs) - - def visit( - self, - type_1: typing.Callable[[InlineType1], T_Result], - type_2: typing.Callable[[InlineType2], T_Result], - ) -> T_Result: - unioned_value = self.get_as_union() - if unioned_value.type == "type1": - return type_1( - InlineType1(**unioned_value.dict(exclude_unset=True, exclude={"type"})) - ) - if unioned_value.type == "type2": - return type_2( - InlineType2(**unioned_value.dict(exclude_unset=True, exclude={"type"})) - ) - - -class _InlinedDiscriminatedUnion1: - class Type1(InlineType1): - type: typing.Literal["type1"] = "type1" - - class Type2(InlineType2): - type: typing.Literal["type2"] = "type2" - - -update_forward_refs(InlinedDiscriminatedUnion1) diff --git a/seed/fastapi/inline-types/types/inlined_undiscriminated_union_1.py b/seed/fastapi/inline-types/types/inlined_undiscriminated_union_1.py deleted file mode 100644 index aaf1f02b5df..00000000000 --- a/seed/fastapi/inline-types/types/inlined_undiscriminated_union_1.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from .inline_type_1 import InlineType1 -from .inline_type_2 import InlineType2 - -InlinedUndiscriminatedUnion1 = typing.Union[InlineType1, InlineType2] diff --git a/seed/fastapi/inline-types/types/nested_inline_type_1.py b/seed/fastapi/inline-types/types/nested_inline_type_1.py deleted file mode 100644 index 1e1f501b2a4..00000000000 --- a/seed/fastapi/inline-types/types/nested_inline_type_1.py +++ /dev/null @@ -1,22 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.pydantic_utilities import UniversalBaseModel -from .inline_enum import InlineEnum -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing - - -class NestedInlineType1(UniversalBaseModel): - foo: str - bar: str - my_enum: InlineEnum = pydantic.Field(alias="myEnum") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( - extra="forbid" - ) # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid diff --git a/seed/fastapi/inline-types/types/root_type_1.py b/seed/fastapi/inline-types/types/root_type_1.py deleted file mode 100644 index cae376ec55d..00000000000 --- a/seed/fastapi/inline-types/types/root_type_1.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.pydantic_utilities import UniversalBaseModel -from .inline_type_1 import InlineType1 -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class RootType1(UniversalBaseModel): - foo: str - bar: InlineType1 - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( - extra="forbid" - ) # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.forbid diff --git a/seed/go-fiber/inline-types/.github/workflows/ci.yml b/seed/go-fiber/inline-types/.github/workflows/ci.yml deleted file mode 100644 index d4c0a5dcd95..00000000000 --- a/seed/go-fiber/inline-types/.github/workflows/ci.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: ci - -on: [push] - -jobs: - compile: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up go - uses: actions/setup-go@v4 - - - name: Compile - run: go build ./... - test: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up go - uses: actions/setup-go@v4 - - - name: Test - run: go test ./... diff --git a/seed/go-fiber/inline-types/.mock/definition/__package__.yml b/seed/go-fiber/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/go-fiber/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/go-fiber/inline-types/.mock/definition/api.yml b/seed/go-fiber/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/go-fiber/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/go-fiber/inline-types/.mock/fern.config.json b/seed/go-fiber/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/go-fiber/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/go-fiber/inline-types/.mock/generators.yml b/seed/go-fiber/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/go-fiber/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/go-fiber/inline-types/go.mod b/seed/go-fiber/inline-types/go.mod deleted file mode 100644 index bc88e459c8c..00000000000 --- a/seed/go-fiber/inline-types/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/inline-types/fern - -go 1.13 - -require ( - github.com/stretchr/testify v1.7.0 - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/seed/go-fiber/inline-types/go.sum b/seed/go-fiber/inline-types/go.sum deleted file mode 100644 index fc3dd9e67e8..00000000000 --- a/seed/go-fiber/inline-types/go.sum +++ /dev/null @@ -1,12 +0,0 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/seed/go-fiber/inline-types/internal/extra_properties.go b/seed/go-fiber/inline-types/internal/extra_properties.go deleted file mode 100644 index 540c3fd89ee..00000000000 --- a/seed/go-fiber/inline-types/internal/extra_properties.go +++ /dev/null @@ -1,141 +0,0 @@ -package internal - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "strings" -) - -// MarshalJSONWithExtraProperty marshals the given value to JSON, including the extra property. -func MarshalJSONWithExtraProperty(marshaler interface{}, key string, value interface{}) ([]byte, error) { - return MarshalJSONWithExtraProperties(marshaler, map[string]interface{}{key: value}) -} - -// MarshalJSONWithExtraProperties marshals the given value to JSON, including any extra properties. -func MarshalJSONWithExtraProperties(marshaler interface{}, extraProperties map[string]interface{}) ([]byte, error) { - bytes, err := json.Marshal(marshaler) - if err != nil { - return nil, err - } - if len(extraProperties) == 0 { - return bytes, nil - } - keys, err := getKeys(marshaler) - if err != nil { - return nil, err - } - for _, key := range keys { - if _, ok := extraProperties[key]; ok { - return nil, fmt.Errorf("cannot add extra property %q because it is already defined on the type", key) - } - } - extraBytes, err := json.Marshal(extraProperties) - if err != nil { - return nil, err - } - if isEmptyJSON(bytes) { - if isEmptyJSON(extraBytes) { - return bytes, nil - } - return extraBytes, nil - } - result := bytes[:len(bytes)-1] - result = append(result, ',') - result = append(result, extraBytes[1:len(extraBytes)-1]...) - result = append(result, '}') - return result, nil -} - -// ExtractExtraProperties extracts any extra properties from the given value. -func ExtractExtraProperties(bytes []byte, value interface{}, exclude ...string) (map[string]interface{}, error) { - val := reflect.ValueOf(value) - for val.Kind() == reflect.Ptr { - if val.IsNil() { - return nil, fmt.Errorf("value must be non-nil to extract extra properties") - } - val = val.Elem() - } - if err := json.Unmarshal(bytes, &value); err != nil { - return nil, err - } - var extraProperties map[string]interface{} - if err := json.Unmarshal(bytes, &extraProperties); err != nil { - return nil, err - } - for i := 0; i < val.Type().NumField(); i++ { - key := jsonKey(val.Type().Field(i)) - if key == "" || key == "-" { - continue - } - delete(extraProperties, key) - } - for _, key := range exclude { - delete(extraProperties, key) - } - if len(extraProperties) == 0 { - return nil, nil - } - return extraProperties, nil -} - -// getKeys returns the keys associated with the given value. The value must be a -// a struct or a map with string keys. -func getKeys(value interface{}) ([]string, error) { - val := reflect.ValueOf(value) - if val.Kind() == reflect.Ptr { - val = val.Elem() - } - if !val.IsValid() { - return nil, nil - } - switch val.Kind() { - case reflect.Struct: - return getKeysForStructType(val.Type()), nil - case reflect.Map: - var keys []string - if val.Type().Key().Kind() != reflect.String { - return nil, fmt.Errorf("cannot extract keys from %T; only structs and maps with string keys are supported", value) - } - for _, key := range val.MapKeys() { - keys = append(keys, key.String()) - } - return keys, nil - default: - return nil, fmt.Errorf("cannot extract keys from %T; only structs and maps with string keys are supported", value) - } -} - -// getKeysForStructType returns all the keys associated with the given struct type, -// visiting embedded fields recursively. -func getKeysForStructType(structType reflect.Type) []string { - if structType.Kind() == reflect.Pointer { - structType = structType.Elem() - } - if structType.Kind() != reflect.Struct { - return nil - } - var keys []string - for i := 0; i < structType.NumField(); i++ { - field := structType.Field(i) - if field.Anonymous { - keys = append(keys, getKeysForStructType(field.Type)...) - continue - } - keys = append(keys, jsonKey(field)) - } - return keys -} - -// jsonKey returns the JSON key from the struct tag of the given field, -// excluding the omitempty flag (if any). -func jsonKey(field reflect.StructField) string { - return strings.TrimSuffix(field.Tag.Get("json"), ",omitempty") -} - -// isEmptyJSON returns true if the given data is empty, the empty JSON object, or -// an explicit null. -func isEmptyJSON(data []byte) bool { - return len(data) <= 2 || bytes.Equal(data, []byte("null")) -} diff --git a/seed/go-fiber/inline-types/internal/extra_properties_test.go b/seed/go-fiber/inline-types/internal/extra_properties_test.go deleted file mode 100644 index aa2510ee512..00000000000 --- a/seed/go-fiber/inline-types/internal/extra_properties_test.go +++ /dev/null @@ -1,228 +0,0 @@ -package internal - -import ( - "encoding/json" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -type testMarshaler struct { - Name string `json:"name"` - BirthDate time.Time `json:"birthDate"` - CreatedAt time.Time `json:"created_at"` -} - -func (t *testMarshaler) MarshalJSON() ([]byte, error) { - type embed testMarshaler - var marshaler = struct { - embed - BirthDate string `json:"birthDate"` - CreatedAt string `json:"created_at"` - }{ - embed: embed(*t), - BirthDate: t.BirthDate.Format("2006-01-02"), - CreatedAt: t.CreatedAt.Format(time.RFC3339), - } - return MarshalJSONWithExtraProperty(marshaler, "type", "test") -} - -func TestMarshalJSONWithExtraProperties(t *testing.T) { - tests := []struct { - desc string - giveMarshaler interface{} - giveExtraProperties map[string]interface{} - wantBytes []byte - wantError string - }{ - { - desc: "invalid type", - giveMarshaler: []string{"invalid"}, - giveExtraProperties: map[string]interface{}{"key": "overwrite"}, - wantError: `cannot extract keys from []string; only structs and maps with string keys are supported`, - }, - { - desc: "invalid key type", - giveMarshaler: map[int]interface{}{42: "value"}, - giveExtraProperties: map[string]interface{}{"key": "overwrite"}, - wantError: `cannot extract keys from map[int]interface {}; only structs and maps with string keys are supported`, - }, - { - desc: "invalid map overwrite", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{"key": "overwrite"}, - wantError: `cannot add extra property "key" because it is already defined on the type`, - }, - { - desc: "invalid struct overwrite", - giveMarshaler: new(testMarshaler), - giveExtraProperties: map[string]interface{}{"birthDate": "2000-01-01"}, - wantError: `cannot add extra property "birthDate" because it is already defined on the type`, - }, - { - desc: "invalid struct overwrite embedded type", - giveMarshaler: new(testMarshaler), - giveExtraProperties: map[string]interface{}{"name": "bob"}, - wantError: `cannot add extra property "name" because it is already defined on the type`, - }, - { - desc: "nil", - giveMarshaler: nil, - giveExtraProperties: nil, - wantBytes: []byte(`null`), - }, - { - desc: "empty", - giveMarshaler: map[string]interface{}{}, - giveExtraProperties: map[string]interface{}{}, - wantBytes: []byte(`{}`), - }, - { - desc: "no extra properties", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{}, - wantBytes: []byte(`{"key":"value"}`), - }, - { - desc: "only extra properties", - giveMarshaler: map[string]interface{}{}, - giveExtraProperties: map[string]interface{}{"key": "value"}, - wantBytes: []byte(`{"key":"value"}`), - }, - { - desc: "single extra property", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{"extra": "property"}, - wantBytes: []byte(`{"key":"value","extra":"property"}`), - }, - { - desc: "multiple extra properties", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{"one": 1, "two": 2}, - wantBytes: []byte(`{"key":"value","one":1,"two":2}`), - }, - { - desc: "nested properties", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{ - "user": map[string]interface{}{ - "age": 42, - "name": "alice", - }, - }, - wantBytes: []byte(`{"key":"value","user":{"age":42,"name":"alice"}}`), - }, - { - desc: "multiple nested properties", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{ - "metadata": map[string]interface{}{ - "ip": "127.0.0.1", - }, - "user": map[string]interface{}{ - "age": 42, - "name": "alice", - }, - }, - wantBytes: []byte(`{"key":"value","metadata":{"ip":"127.0.0.1"},"user":{"age":42,"name":"alice"}}`), - }, - { - desc: "custom marshaler", - giveMarshaler: &testMarshaler{ - Name: "alice", - BirthDate: time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC), - CreatedAt: time.Date(2024, 1, 1, 0, 0, 0, 0, time.UTC), - }, - giveExtraProperties: map[string]interface{}{ - "extra": "property", - }, - wantBytes: []byte(`{"name":"alice","birthDate":"2000-01-01","created_at":"2024-01-01T00:00:00Z","type":"test","extra":"property"}`), - }, - } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - bytes, err := MarshalJSONWithExtraProperties(tt.giveMarshaler, tt.giveExtraProperties) - if tt.wantError != "" { - require.EqualError(t, err, tt.wantError) - assert.Nil(t, tt.wantBytes) - return - } - require.NoError(t, err) - assert.Equal(t, tt.wantBytes, bytes) - - value := make(map[string]interface{}) - require.NoError(t, json.Unmarshal(bytes, &value)) - }) - } -} - -func TestExtractExtraProperties(t *testing.T) { - t.Run("none", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - value := &user{ - Name: "alice", - } - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice"}`), value) - require.NoError(t, err) - assert.Nil(t, extraProperties) - }) - - t.Run("non-nil pointer", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - value := &user{ - Name: "alice", - } - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value) - require.NoError(t, err) - assert.Equal(t, map[string]interface{}{"age": float64(42)}, extraProperties) - }) - - t.Run("nil pointer", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - var value *user - _, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value) - assert.EqualError(t, err, "value must be non-nil to extract extra properties") - }) - - t.Run("non-zero value", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - value := user{ - Name: "alice", - } - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value) - require.NoError(t, err) - assert.Equal(t, map[string]interface{}{"age": float64(42)}, extraProperties) - }) - - t.Run("zero value", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - var value user - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value) - require.NoError(t, err) - assert.Equal(t, map[string]interface{}{"age": float64(42)}, extraProperties) - }) - - t.Run("exclude", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - value := &user{ - Name: "alice", - } - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value, "age") - require.NoError(t, err) - assert.Nil(t, extraProperties) - }) -} diff --git a/seed/go-fiber/inline-types/internal/stringer.go b/seed/go-fiber/inline-types/internal/stringer.go deleted file mode 100644 index 312801851e0..00000000000 --- a/seed/go-fiber/inline-types/internal/stringer.go +++ /dev/null @@ -1,13 +0,0 @@ -package internal - -import "encoding/json" - -// StringifyJSON returns a pretty JSON string representation of -// the given value. -func StringifyJSON(value interface{}) (string, error) { - bytes, err := json.MarshalIndent(value, "", " ") - if err != nil { - return "", err - } - return string(bytes), nil -} diff --git a/seed/go-fiber/inline-types/internal/time.go b/seed/go-fiber/inline-types/internal/time.go deleted file mode 100644 index ab0e269fade..00000000000 --- a/seed/go-fiber/inline-types/internal/time.go +++ /dev/null @@ -1,137 +0,0 @@ -package internal - -import ( - "encoding/json" - "time" -) - -const dateFormat = "2006-01-02" - -// DateTime wraps time.Time and adapts its JSON representation -// to conform to a RFC3339 date (e.g. 2006-01-02). -// -// Ref: https://ijmacd.github.io/rfc3339-iso8601 -type Date struct { - t *time.Time -} - -// NewDate returns a new *Date. If the given time.Time -// is nil, nil will be returned. -func NewDate(t time.Time) *Date { - return &Date{t: &t} -} - -// NewOptionalDate returns a new *Date. If the given time.Time -// is nil, nil will be returned. -func NewOptionalDate(t *time.Time) *Date { - if t == nil { - return nil - } - return &Date{t: t} -} - -// Time returns the Date's underlying time, if any. If the -// date is nil, the zero value is returned. -func (d *Date) Time() time.Time { - if d == nil || d.t == nil { - return time.Time{} - } - return *d.t -} - -// TimePtr returns a pointer to the Date's underlying time.Time, if any. -func (d *Date) TimePtr() *time.Time { - if d == nil || d.t == nil { - return nil - } - if d.t.IsZero() { - return nil - } - return d.t -} - -func (d *Date) MarshalJSON() ([]byte, error) { - if d == nil || d.t == nil { - return nil, nil - } - return json.Marshal(d.t.Format(dateFormat)) -} - -func (d *Date) UnmarshalJSON(data []byte) error { - var raw string - if err := json.Unmarshal(data, &raw); err != nil { - return err - } - - parsedTime, err := time.Parse(dateFormat, raw) - if err != nil { - return err - } - - *d = Date{t: &parsedTime} - return nil -} - -// DateTime wraps time.Time and adapts its JSON representation -// to conform to a RFC3339 date-time (e.g. 2017-07-21T17:32:28Z). -// -// Ref: https://ijmacd.github.io/rfc3339-iso8601 -type DateTime struct { - t *time.Time -} - -// NewDateTime returns a new *DateTime. -func NewDateTime(t time.Time) *DateTime { - return &DateTime{t: &t} -} - -// NewOptionalDateTime returns a new *DateTime. If the given time.Time -// is nil, nil will be returned. -func NewOptionalDateTime(t *time.Time) *DateTime { - if t == nil { - return nil - } - return &DateTime{t: t} -} - -// Time returns the DateTime's underlying time, if any. If the -// date-time is nil, the zero value is returned. -func (d *DateTime) Time() time.Time { - if d == nil || d.t == nil { - return time.Time{} - } - return *d.t -} - -// TimePtr returns a pointer to the DateTime's underlying time.Time, if any. -func (d *DateTime) TimePtr() *time.Time { - if d == nil || d.t == nil { - return nil - } - if d.t.IsZero() { - return nil - } - return d.t -} - -func (d *DateTime) MarshalJSON() ([]byte, error) { - if d == nil || d.t == nil { - return nil, nil - } - return json.Marshal(d.t.Format(time.RFC3339)) -} - -func (d *DateTime) UnmarshalJSON(data []byte) error { - var raw string - if err := json.Unmarshal(data, &raw); err != nil { - return err - } - - parsedTime, err := time.Parse(time.RFC3339, raw) - if err != nil { - return err - } - - *d = DateTime{t: &parsedTime} - return nil -} diff --git a/seed/go-fiber/inline-types/snippet-templates.json b/seed/go-fiber/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/go-fiber/inline-types/snippet.json b/seed/go-fiber/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/go-fiber/inline-types/types.go b/seed/go-fiber/inline-types/types.go deleted file mode 100644 index bfd99d439c1..00000000000 --- a/seed/go-fiber/inline-types/types.go +++ /dev/null @@ -1,390 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package object - -import ( - json "encoding/json" - fmt "fmt" - internal "github.com/inline-types/fern/internal" -) - -type PostRootRequest struct { - Bar *InlineType1 `json:"bar,omitempty" url:"-"` - Foo string `json:"foo" url:"-"` -} - -type InlineEnum string - -const ( - InlineEnumSunny InlineEnum = "SUNNY" - InlineEnumCloudy InlineEnum = "CLOUDY" - InlineEnumRaining InlineEnum = "RAINING" - InlineEnumSnowing InlineEnum = "SNOWING" -) - -func NewInlineEnumFromString(s string) (InlineEnum, error) { - switch s { - case "SUNNY": - return InlineEnumSunny, nil - case "CLOUDY": - return InlineEnumCloudy, nil - case "RAINING": - return InlineEnumRaining, nil - case "SNOWING": - return InlineEnumSnowing, nil - } - var t InlineEnum - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (i InlineEnum) Ptr() *InlineEnum { - return &i -} - -type InlineType1 struct { - Foo string `json:"foo" url:"foo"` - Bar *NestedInlineType1 `json:"bar,omitempty" url:"bar,omitempty"` - - extraProperties map[string]interface{} -} - -func (i *InlineType1) GetFoo() string { - if i == nil { - return "" - } - return i.Foo -} - -func (i *InlineType1) GetBar() *NestedInlineType1 { - if i == nil { - return nil - } - return i.Bar -} - -func (i *InlineType1) GetExtraProperties() map[string]interface{} { - return i.extraProperties -} - -func (i *InlineType1) UnmarshalJSON(data []byte) error { - type unmarshaler InlineType1 - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *i = InlineType1(value) - extraProperties, err := internal.ExtractExtraProperties(data, *i) - if err != nil { - return err - } - i.extraProperties = extraProperties - return nil -} - -func (i *InlineType1) String() string { - if value, err := internal.StringifyJSON(i); err == nil { - return value - } - return fmt.Sprintf("%#v", i) -} - -type InlineType2 struct { - Baz string `json:"baz" url:"baz"` - - extraProperties map[string]interface{} -} - -func (i *InlineType2) GetBaz() string { - if i == nil { - return "" - } - return i.Baz -} - -func (i *InlineType2) GetExtraProperties() map[string]interface{} { - return i.extraProperties -} - -func (i *InlineType2) UnmarshalJSON(data []byte) error { - type unmarshaler InlineType2 - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *i = InlineType2(value) - extraProperties, err := internal.ExtractExtraProperties(data, *i) - if err != nil { - return err - } - i.extraProperties = extraProperties - return nil -} - -func (i *InlineType2) String() string { - if value, err := internal.StringifyJSON(i); err == nil { - return value - } - return fmt.Sprintf("%#v", i) -} - -type InlinedDiscriminatedUnion1 struct { - Type string - Type1 *InlineType1 - Type2 *InlineType2 -} - -func NewInlinedDiscriminatedUnion1FromType1(value *InlineType1) *InlinedDiscriminatedUnion1 { - return &InlinedDiscriminatedUnion1{Type: "type1", Type1: value} -} - -func NewInlinedDiscriminatedUnion1FromType2(value *InlineType2) *InlinedDiscriminatedUnion1 { - return &InlinedDiscriminatedUnion1{Type: "type2", Type2: value} -} - -func (i *InlinedDiscriminatedUnion1) GetType() string { - if i == nil { - return "" - } - return i.Type -} - -func (i *InlinedDiscriminatedUnion1) GetType1() *InlineType1 { - if i == nil { - return nil - } - return i.Type1 -} - -func (i *InlinedDiscriminatedUnion1) GetType2() *InlineType2 { - if i == nil { - return nil - } - return i.Type2 -} - -func (i *InlinedDiscriminatedUnion1) UnmarshalJSON(data []byte) error { - var unmarshaler struct { - Type string `json:"type"` - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - i.Type = unmarshaler.Type - if unmarshaler.Type == "" { - return fmt.Errorf("%T did not include discriminant type", i) - } - switch unmarshaler.Type { - case "type1": - value := new(InlineType1) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - i.Type1 = value - case "type2": - value := new(InlineType2) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - i.Type2 = value - } - return nil -} - -func (i InlinedDiscriminatedUnion1) MarshalJSON() ([]byte, error) { - switch i.Type { - default: - return nil, fmt.Errorf("invalid type %s in %T", i.Type, i) - case "type1": - return internal.MarshalJSONWithExtraProperty(i.Type1, "type", "type1") - case "type2": - return internal.MarshalJSONWithExtraProperty(i.Type2, "type", "type2") - } -} - -type InlinedDiscriminatedUnion1Visitor interface { - VisitType1(*InlineType1) error - VisitType2(*InlineType2) error -} - -func (i *InlinedDiscriminatedUnion1) Accept(visitor InlinedDiscriminatedUnion1Visitor) error { - switch i.Type { - default: - return fmt.Errorf("invalid type %s in %T", i.Type, i) - case "type1": - return visitor.VisitType1(i.Type1) - case "type2": - return visitor.VisitType2(i.Type2) - } -} - -type InlinedUndiscriminatedUnion1 struct { - InlineType1 *InlineType1 - InlineType2 *InlineType2 - - typ string -} - -func NewInlinedUndiscriminatedUnion1FromInlineType1(value *InlineType1) *InlinedUndiscriminatedUnion1 { - return &InlinedUndiscriminatedUnion1{typ: "InlineType1", InlineType1: value} -} - -func NewInlinedUndiscriminatedUnion1FromInlineType2(value *InlineType2) *InlinedUndiscriminatedUnion1 { - return &InlinedUndiscriminatedUnion1{typ: "InlineType2", InlineType2: value} -} - -func (i *InlinedUndiscriminatedUnion1) GetInlineType1() *InlineType1 { - if i == nil { - return nil - } - return i.InlineType1 -} - -func (i *InlinedUndiscriminatedUnion1) GetInlineType2() *InlineType2 { - if i == nil { - return nil - } - return i.InlineType2 -} - -func (i *InlinedUndiscriminatedUnion1) UnmarshalJSON(data []byte) error { - valueInlineType1 := new(InlineType1) - if err := json.Unmarshal(data, &valueInlineType1); err == nil { - i.typ = "InlineType1" - i.InlineType1 = valueInlineType1 - return nil - } - valueInlineType2 := new(InlineType2) - if err := json.Unmarshal(data, &valueInlineType2); err == nil { - i.typ = "InlineType2" - i.InlineType2 = valueInlineType2 - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, i) -} - -func (i InlinedUndiscriminatedUnion1) MarshalJSON() ([]byte, error) { - if i.typ == "InlineType1" || i.InlineType1 != nil { - return json.Marshal(i.InlineType1) - } - if i.typ == "InlineType2" || i.InlineType2 != nil { - return json.Marshal(i.InlineType2) - } - return nil, fmt.Errorf("type %T does not include a non-empty union type", i) -} - -type InlinedUndiscriminatedUnion1Visitor interface { - VisitInlineType1(*InlineType1) error - VisitInlineType2(*InlineType2) error -} - -func (i *InlinedUndiscriminatedUnion1) Accept(visitor InlinedUndiscriminatedUnion1Visitor) error { - if i.typ == "InlineType1" || i.InlineType1 != nil { - return visitor.VisitInlineType1(i.InlineType1) - } - if i.typ == "InlineType2" || i.InlineType2 != nil { - return visitor.VisitInlineType2(i.InlineType2) - } - return fmt.Errorf("type %T does not include a non-empty union type", i) -} - -type NestedInlineType1 struct { - Foo string `json:"foo" url:"foo"` - Bar string `json:"bar" url:"bar"` - MyEnum InlineEnum `json:"myEnum" url:"myEnum"` - - extraProperties map[string]interface{} -} - -func (n *NestedInlineType1) GetFoo() string { - if n == nil { - return "" - } - return n.Foo -} - -func (n *NestedInlineType1) GetBar() string { - if n == nil { - return "" - } - return n.Bar -} - -func (n *NestedInlineType1) GetMyEnum() InlineEnum { - if n == nil { - return "" - } - return n.MyEnum -} - -func (n *NestedInlineType1) GetExtraProperties() map[string]interface{} { - return n.extraProperties -} - -func (n *NestedInlineType1) UnmarshalJSON(data []byte) error { - type unmarshaler NestedInlineType1 - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *n = NestedInlineType1(value) - extraProperties, err := internal.ExtractExtraProperties(data, *n) - if err != nil { - return err - } - n.extraProperties = extraProperties - return nil -} - -func (n *NestedInlineType1) String() string { - if value, err := internal.StringifyJSON(n); err == nil { - return value - } - return fmt.Sprintf("%#v", n) -} - -type RootType1 struct { - Foo string `json:"foo" url:"foo"` - Bar *InlineType1 `json:"bar,omitempty" url:"bar,omitempty"` - - extraProperties map[string]interface{} -} - -func (r *RootType1) GetFoo() string { - if r == nil { - return "" - } - return r.Foo -} - -func (r *RootType1) GetBar() *InlineType1 { - if r == nil { - return nil - } - return r.Bar -} - -func (r *RootType1) GetExtraProperties() map[string]interface{} { - return r.extraProperties -} - -func (r *RootType1) UnmarshalJSON(data []byte) error { - type unmarshaler RootType1 - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *r = RootType1(value) - extraProperties, err := internal.ExtractExtraProperties(data, *r) - if err != nil { - return err - } - r.extraProperties = extraProperties - return nil -} - -func (r *RootType1) String() string { - if value, err := internal.StringifyJSON(r); err == nil { - return value - } - return fmt.Sprintf("%#v", r) -} diff --git a/seed/go-model/inline-types/.github/workflows/ci.yml b/seed/go-model/inline-types/.github/workflows/ci.yml deleted file mode 100644 index d4c0a5dcd95..00000000000 --- a/seed/go-model/inline-types/.github/workflows/ci.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: ci - -on: [push] - -jobs: - compile: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up go - uses: actions/setup-go@v4 - - - name: Compile - run: go build ./... - test: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up go - uses: actions/setup-go@v4 - - - name: Test - run: go test ./... diff --git a/seed/go-model/inline-types/.mock/definition/__package__.yml b/seed/go-model/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/go-model/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/go-model/inline-types/.mock/definition/api.yml b/seed/go-model/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/go-model/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/go-model/inline-types/.mock/fern.config.json b/seed/go-model/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/go-model/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/go-model/inline-types/.mock/generators.yml b/seed/go-model/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/go-model/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/go-model/inline-types/go.mod b/seed/go-model/inline-types/go.mod deleted file mode 100644 index bc88e459c8c..00000000000 --- a/seed/go-model/inline-types/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/inline-types/fern - -go 1.13 - -require ( - github.com/stretchr/testify v1.7.0 - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/seed/go-model/inline-types/go.sum b/seed/go-model/inline-types/go.sum deleted file mode 100644 index fc3dd9e67e8..00000000000 --- a/seed/go-model/inline-types/go.sum +++ /dev/null @@ -1,12 +0,0 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/seed/go-model/inline-types/internal/extra_properties.go b/seed/go-model/inline-types/internal/extra_properties.go deleted file mode 100644 index 540c3fd89ee..00000000000 --- a/seed/go-model/inline-types/internal/extra_properties.go +++ /dev/null @@ -1,141 +0,0 @@ -package internal - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "strings" -) - -// MarshalJSONWithExtraProperty marshals the given value to JSON, including the extra property. -func MarshalJSONWithExtraProperty(marshaler interface{}, key string, value interface{}) ([]byte, error) { - return MarshalJSONWithExtraProperties(marshaler, map[string]interface{}{key: value}) -} - -// MarshalJSONWithExtraProperties marshals the given value to JSON, including any extra properties. -func MarshalJSONWithExtraProperties(marshaler interface{}, extraProperties map[string]interface{}) ([]byte, error) { - bytes, err := json.Marshal(marshaler) - if err != nil { - return nil, err - } - if len(extraProperties) == 0 { - return bytes, nil - } - keys, err := getKeys(marshaler) - if err != nil { - return nil, err - } - for _, key := range keys { - if _, ok := extraProperties[key]; ok { - return nil, fmt.Errorf("cannot add extra property %q because it is already defined on the type", key) - } - } - extraBytes, err := json.Marshal(extraProperties) - if err != nil { - return nil, err - } - if isEmptyJSON(bytes) { - if isEmptyJSON(extraBytes) { - return bytes, nil - } - return extraBytes, nil - } - result := bytes[:len(bytes)-1] - result = append(result, ',') - result = append(result, extraBytes[1:len(extraBytes)-1]...) - result = append(result, '}') - return result, nil -} - -// ExtractExtraProperties extracts any extra properties from the given value. -func ExtractExtraProperties(bytes []byte, value interface{}, exclude ...string) (map[string]interface{}, error) { - val := reflect.ValueOf(value) - for val.Kind() == reflect.Ptr { - if val.IsNil() { - return nil, fmt.Errorf("value must be non-nil to extract extra properties") - } - val = val.Elem() - } - if err := json.Unmarshal(bytes, &value); err != nil { - return nil, err - } - var extraProperties map[string]interface{} - if err := json.Unmarshal(bytes, &extraProperties); err != nil { - return nil, err - } - for i := 0; i < val.Type().NumField(); i++ { - key := jsonKey(val.Type().Field(i)) - if key == "" || key == "-" { - continue - } - delete(extraProperties, key) - } - for _, key := range exclude { - delete(extraProperties, key) - } - if len(extraProperties) == 0 { - return nil, nil - } - return extraProperties, nil -} - -// getKeys returns the keys associated with the given value. The value must be a -// a struct or a map with string keys. -func getKeys(value interface{}) ([]string, error) { - val := reflect.ValueOf(value) - if val.Kind() == reflect.Ptr { - val = val.Elem() - } - if !val.IsValid() { - return nil, nil - } - switch val.Kind() { - case reflect.Struct: - return getKeysForStructType(val.Type()), nil - case reflect.Map: - var keys []string - if val.Type().Key().Kind() != reflect.String { - return nil, fmt.Errorf("cannot extract keys from %T; only structs and maps with string keys are supported", value) - } - for _, key := range val.MapKeys() { - keys = append(keys, key.String()) - } - return keys, nil - default: - return nil, fmt.Errorf("cannot extract keys from %T; only structs and maps with string keys are supported", value) - } -} - -// getKeysForStructType returns all the keys associated with the given struct type, -// visiting embedded fields recursively. -func getKeysForStructType(structType reflect.Type) []string { - if structType.Kind() == reflect.Pointer { - structType = structType.Elem() - } - if structType.Kind() != reflect.Struct { - return nil - } - var keys []string - for i := 0; i < structType.NumField(); i++ { - field := structType.Field(i) - if field.Anonymous { - keys = append(keys, getKeysForStructType(field.Type)...) - continue - } - keys = append(keys, jsonKey(field)) - } - return keys -} - -// jsonKey returns the JSON key from the struct tag of the given field, -// excluding the omitempty flag (if any). -func jsonKey(field reflect.StructField) string { - return strings.TrimSuffix(field.Tag.Get("json"), ",omitempty") -} - -// isEmptyJSON returns true if the given data is empty, the empty JSON object, or -// an explicit null. -func isEmptyJSON(data []byte) bool { - return len(data) <= 2 || bytes.Equal(data, []byte("null")) -} diff --git a/seed/go-model/inline-types/internal/extra_properties_test.go b/seed/go-model/inline-types/internal/extra_properties_test.go deleted file mode 100644 index aa2510ee512..00000000000 --- a/seed/go-model/inline-types/internal/extra_properties_test.go +++ /dev/null @@ -1,228 +0,0 @@ -package internal - -import ( - "encoding/json" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -type testMarshaler struct { - Name string `json:"name"` - BirthDate time.Time `json:"birthDate"` - CreatedAt time.Time `json:"created_at"` -} - -func (t *testMarshaler) MarshalJSON() ([]byte, error) { - type embed testMarshaler - var marshaler = struct { - embed - BirthDate string `json:"birthDate"` - CreatedAt string `json:"created_at"` - }{ - embed: embed(*t), - BirthDate: t.BirthDate.Format("2006-01-02"), - CreatedAt: t.CreatedAt.Format(time.RFC3339), - } - return MarshalJSONWithExtraProperty(marshaler, "type", "test") -} - -func TestMarshalJSONWithExtraProperties(t *testing.T) { - tests := []struct { - desc string - giveMarshaler interface{} - giveExtraProperties map[string]interface{} - wantBytes []byte - wantError string - }{ - { - desc: "invalid type", - giveMarshaler: []string{"invalid"}, - giveExtraProperties: map[string]interface{}{"key": "overwrite"}, - wantError: `cannot extract keys from []string; only structs and maps with string keys are supported`, - }, - { - desc: "invalid key type", - giveMarshaler: map[int]interface{}{42: "value"}, - giveExtraProperties: map[string]interface{}{"key": "overwrite"}, - wantError: `cannot extract keys from map[int]interface {}; only structs and maps with string keys are supported`, - }, - { - desc: "invalid map overwrite", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{"key": "overwrite"}, - wantError: `cannot add extra property "key" because it is already defined on the type`, - }, - { - desc: "invalid struct overwrite", - giveMarshaler: new(testMarshaler), - giveExtraProperties: map[string]interface{}{"birthDate": "2000-01-01"}, - wantError: `cannot add extra property "birthDate" because it is already defined on the type`, - }, - { - desc: "invalid struct overwrite embedded type", - giveMarshaler: new(testMarshaler), - giveExtraProperties: map[string]interface{}{"name": "bob"}, - wantError: `cannot add extra property "name" because it is already defined on the type`, - }, - { - desc: "nil", - giveMarshaler: nil, - giveExtraProperties: nil, - wantBytes: []byte(`null`), - }, - { - desc: "empty", - giveMarshaler: map[string]interface{}{}, - giveExtraProperties: map[string]interface{}{}, - wantBytes: []byte(`{}`), - }, - { - desc: "no extra properties", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{}, - wantBytes: []byte(`{"key":"value"}`), - }, - { - desc: "only extra properties", - giveMarshaler: map[string]interface{}{}, - giveExtraProperties: map[string]interface{}{"key": "value"}, - wantBytes: []byte(`{"key":"value"}`), - }, - { - desc: "single extra property", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{"extra": "property"}, - wantBytes: []byte(`{"key":"value","extra":"property"}`), - }, - { - desc: "multiple extra properties", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{"one": 1, "two": 2}, - wantBytes: []byte(`{"key":"value","one":1,"two":2}`), - }, - { - desc: "nested properties", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{ - "user": map[string]interface{}{ - "age": 42, - "name": "alice", - }, - }, - wantBytes: []byte(`{"key":"value","user":{"age":42,"name":"alice"}}`), - }, - { - desc: "multiple nested properties", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{ - "metadata": map[string]interface{}{ - "ip": "127.0.0.1", - }, - "user": map[string]interface{}{ - "age": 42, - "name": "alice", - }, - }, - wantBytes: []byte(`{"key":"value","metadata":{"ip":"127.0.0.1"},"user":{"age":42,"name":"alice"}}`), - }, - { - desc: "custom marshaler", - giveMarshaler: &testMarshaler{ - Name: "alice", - BirthDate: time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC), - CreatedAt: time.Date(2024, 1, 1, 0, 0, 0, 0, time.UTC), - }, - giveExtraProperties: map[string]interface{}{ - "extra": "property", - }, - wantBytes: []byte(`{"name":"alice","birthDate":"2000-01-01","created_at":"2024-01-01T00:00:00Z","type":"test","extra":"property"}`), - }, - } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - bytes, err := MarshalJSONWithExtraProperties(tt.giveMarshaler, tt.giveExtraProperties) - if tt.wantError != "" { - require.EqualError(t, err, tt.wantError) - assert.Nil(t, tt.wantBytes) - return - } - require.NoError(t, err) - assert.Equal(t, tt.wantBytes, bytes) - - value := make(map[string]interface{}) - require.NoError(t, json.Unmarshal(bytes, &value)) - }) - } -} - -func TestExtractExtraProperties(t *testing.T) { - t.Run("none", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - value := &user{ - Name: "alice", - } - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice"}`), value) - require.NoError(t, err) - assert.Nil(t, extraProperties) - }) - - t.Run("non-nil pointer", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - value := &user{ - Name: "alice", - } - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value) - require.NoError(t, err) - assert.Equal(t, map[string]interface{}{"age": float64(42)}, extraProperties) - }) - - t.Run("nil pointer", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - var value *user - _, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value) - assert.EqualError(t, err, "value must be non-nil to extract extra properties") - }) - - t.Run("non-zero value", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - value := user{ - Name: "alice", - } - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value) - require.NoError(t, err) - assert.Equal(t, map[string]interface{}{"age": float64(42)}, extraProperties) - }) - - t.Run("zero value", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - var value user - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value) - require.NoError(t, err) - assert.Equal(t, map[string]interface{}{"age": float64(42)}, extraProperties) - }) - - t.Run("exclude", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - value := &user{ - Name: "alice", - } - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value, "age") - require.NoError(t, err) - assert.Nil(t, extraProperties) - }) -} diff --git a/seed/go-model/inline-types/internal/stringer.go b/seed/go-model/inline-types/internal/stringer.go deleted file mode 100644 index 312801851e0..00000000000 --- a/seed/go-model/inline-types/internal/stringer.go +++ /dev/null @@ -1,13 +0,0 @@ -package internal - -import "encoding/json" - -// StringifyJSON returns a pretty JSON string representation of -// the given value. -func StringifyJSON(value interface{}) (string, error) { - bytes, err := json.MarshalIndent(value, "", " ") - if err != nil { - return "", err - } - return string(bytes), nil -} diff --git a/seed/go-model/inline-types/internal/time.go b/seed/go-model/inline-types/internal/time.go deleted file mode 100644 index ab0e269fade..00000000000 --- a/seed/go-model/inline-types/internal/time.go +++ /dev/null @@ -1,137 +0,0 @@ -package internal - -import ( - "encoding/json" - "time" -) - -const dateFormat = "2006-01-02" - -// DateTime wraps time.Time and adapts its JSON representation -// to conform to a RFC3339 date (e.g. 2006-01-02). -// -// Ref: https://ijmacd.github.io/rfc3339-iso8601 -type Date struct { - t *time.Time -} - -// NewDate returns a new *Date. If the given time.Time -// is nil, nil will be returned. -func NewDate(t time.Time) *Date { - return &Date{t: &t} -} - -// NewOptionalDate returns a new *Date. If the given time.Time -// is nil, nil will be returned. -func NewOptionalDate(t *time.Time) *Date { - if t == nil { - return nil - } - return &Date{t: t} -} - -// Time returns the Date's underlying time, if any. If the -// date is nil, the zero value is returned. -func (d *Date) Time() time.Time { - if d == nil || d.t == nil { - return time.Time{} - } - return *d.t -} - -// TimePtr returns a pointer to the Date's underlying time.Time, if any. -func (d *Date) TimePtr() *time.Time { - if d == nil || d.t == nil { - return nil - } - if d.t.IsZero() { - return nil - } - return d.t -} - -func (d *Date) MarshalJSON() ([]byte, error) { - if d == nil || d.t == nil { - return nil, nil - } - return json.Marshal(d.t.Format(dateFormat)) -} - -func (d *Date) UnmarshalJSON(data []byte) error { - var raw string - if err := json.Unmarshal(data, &raw); err != nil { - return err - } - - parsedTime, err := time.Parse(dateFormat, raw) - if err != nil { - return err - } - - *d = Date{t: &parsedTime} - return nil -} - -// DateTime wraps time.Time and adapts its JSON representation -// to conform to a RFC3339 date-time (e.g. 2017-07-21T17:32:28Z). -// -// Ref: https://ijmacd.github.io/rfc3339-iso8601 -type DateTime struct { - t *time.Time -} - -// NewDateTime returns a new *DateTime. -func NewDateTime(t time.Time) *DateTime { - return &DateTime{t: &t} -} - -// NewOptionalDateTime returns a new *DateTime. If the given time.Time -// is nil, nil will be returned. -func NewOptionalDateTime(t *time.Time) *DateTime { - if t == nil { - return nil - } - return &DateTime{t: t} -} - -// Time returns the DateTime's underlying time, if any. If the -// date-time is nil, the zero value is returned. -func (d *DateTime) Time() time.Time { - if d == nil || d.t == nil { - return time.Time{} - } - return *d.t -} - -// TimePtr returns a pointer to the DateTime's underlying time.Time, if any. -func (d *DateTime) TimePtr() *time.Time { - if d == nil || d.t == nil { - return nil - } - if d.t.IsZero() { - return nil - } - return d.t -} - -func (d *DateTime) MarshalJSON() ([]byte, error) { - if d == nil || d.t == nil { - return nil, nil - } - return json.Marshal(d.t.Format(time.RFC3339)) -} - -func (d *DateTime) UnmarshalJSON(data []byte) error { - var raw string - if err := json.Unmarshal(data, &raw); err != nil { - return err - } - - parsedTime, err := time.Parse(time.RFC3339, raw) - if err != nil { - return err - } - - *d = DateTime{t: &parsedTime} - return nil -} diff --git a/seed/go-model/inline-types/snippet-templates.json b/seed/go-model/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/go-model/inline-types/snippet.json b/seed/go-model/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/go-model/inline-types/types.go b/seed/go-model/inline-types/types.go deleted file mode 100644 index 44f1e804e10..00000000000 --- a/seed/go-model/inline-types/types.go +++ /dev/null @@ -1,385 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package object - -import ( - json "encoding/json" - fmt "fmt" - internal "github.com/inline-types/fern/internal" -) - -type InlineEnum string - -const ( - InlineEnumSunny InlineEnum = "SUNNY" - InlineEnumCloudy InlineEnum = "CLOUDY" - InlineEnumRaining InlineEnum = "RAINING" - InlineEnumSnowing InlineEnum = "SNOWING" -) - -func NewInlineEnumFromString(s string) (InlineEnum, error) { - switch s { - case "SUNNY": - return InlineEnumSunny, nil - case "CLOUDY": - return InlineEnumCloudy, nil - case "RAINING": - return InlineEnumRaining, nil - case "SNOWING": - return InlineEnumSnowing, nil - } - var t InlineEnum - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (i InlineEnum) Ptr() *InlineEnum { - return &i -} - -type InlineType1 struct { - Foo string `json:"foo" url:"foo"` - Bar *NestedInlineType1 `json:"bar,omitempty" url:"bar,omitempty"` - - extraProperties map[string]interface{} -} - -func (i *InlineType1) GetFoo() string { - if i == nil { - return "" - } - return i.Foo -} - -func (i *InlineType1) GetBar() *NestedInlineType1 { - if i == nil { - return nil - } - return i.Bar -} - -func (i *InlineType1) GetExtraProperties() map[string]interface{} { - return i.extraProperties -} - -func (i *InlineType1) UnmarshalJSON(data []byte) error { - type unmarshaler InlineType1 - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *i = InlineType1(value) - extraProperties, err := internal.ExtractExtraProperties(data, *i) - if err != nil { - return err - } - i.extraProperties = extraProperties - return nil -} - -func (i *InlineType1) String() string { - if value, err := internal.StringifyJSON(i); err == nil { - return value - } - return fmt.Sprintf("%#v", i) -} - -type InlineType2 struct { - Baz string `json:"baz" url:"baz"` - - extraProperties map[string]interface{} -} - -func (i *InlineType2) GetBaz() string { - if i == nil { - return "" - } - return i.Baz -} - -func (i *InlineType2) GetExtraProperties() map[string]interface{} { - return i.extraProperties -} - -func (i *InlineType2) UnmarshalJSON(data []byte) error { - type unmarshaler InlineType2 - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *i = InlineType2(value) - extraProperties, err := internal.ExtractExtraProperties(data, *i) - if err != nil { - return err - } - i.extraProperties = extraProperties - return nil -} - -func (i *InlineType2) String() string { - if value, err := internal.StringifyJSON(i); err == nil { - return value - } - return fmt.Sprintf("%#v", i) -} - -type InlinedDiscriminatedUnion1 struct { - Type string - Type1 *InlineType1 - Type2 *InlineType2 -} - -func NewInlinedDiscriminatedUnion1FromType1(value *InlineType1) *InlinedDiscriminatedUnion1 { - return &InlinedDiscriminatedUnion1{Type: "type1", Type1: value} -} - -func NewInlinedDiscriminatedUnion1FromType2(value *InlineType2) *InlinedDiscriminatedUnion1 { - return &InlinedDiscriminatedUnion1{Type: "type2", Type2: value} -} - -func (i *InlinedDiscriminatedUnion1) GetType() string { - if i == nil { - return "" - } - return i.Type -} - -func (i *InlinedDiscriminatedUnion1) GetType1() *InlineType1 { - if i == nil { - return nil - } - return i.Type1 -} - -func (i *InlinedDiscriminatedUnion1) GetType2() *InlineType2 { - if i == nil { - return nil - } - return i.Type2 -} - -func (i *InlinedDiscriminatedUnion1) UnmarshalJSON(data []byte) error { - var unmarshaler struct { - Type string `json:"type"` - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - i.Type = unmarshaler.Type - if unmarshaler.Type == "" { - return fmt.Errorf("%T did not include discriminant type", i) - } - switch unmarshaler.Type { - case "type1": - value := new(InlineType1) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - i.Type1 = value - case "type2": - value := new(InlineType2) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - i.Type2 = value - } - return nil -} - -func (i InlinedDiscriminatedUnion1) MarshalJSON() ([]byte, error) { - switch i.Type { - default: - return nil, fmt.Errorf("invalid type %s in %T", i.Type, i) - case "type1": - return internal.MarshalJSONWithExtraProperty(i.Type1, "type", "type1") - case "type2": - return internal.MarshalJSONWithExtraProperty(i.Type2, "type", "type2") - } -} - -type InlinedDiscriminatedUnion1Visitor interface { - VisitType1(*InlineType1) error - VisitType2(*InlineType2) error -} - -func (i *InlinedDiscriminatedUnion1) Accept(visitor InlinedDiscriminatedUnion1Visitor) error { - switch i.Type { - default: - return fmt.Errorf("invalid type %s in %T", i.Type, i) - case "type1": - return visitor.VisitType1(i.Type1) - case "type2": - return visitor.VisitType2(i.Type2) - } -} - -type InlinedUndiscriminatedUnion1 struct { - InlineType1 *InlineType1 - InlineType2 *InlineType2 - - typ string -} - -func NewInlinedUndiscriminatedUnion1FromInlineType1(value *InlineType1) *InlinedUndiscriminatedUnion1 { - return &InlinedUndiscriminatedUnion1{typ: "InlineType1", InlineType1: value} -} - -func NewInlinedUndiscriminatedUnion1FromInlineType2(value *InlineType2) *InlinedUndiscriminatedUnion1 { - return &InlinedUndiscriminatedUnion1{typ: "InlineType2", InlineType2: value} -} - -func (i *InlinedUndiscriminatedUnion1) GetInlineType1() *InlineType1 { - if i == nil { - return nil - } - return i.InlineType1 -} - -func (i *InlinedUndiscriminatedUnion1) GetInlineType2() *InlineType2 { - if i == nil { - return nil - } - return i.InlineType2 -} - -func (i *InlinedUndiscriminatedUnion1) UnmarshalJSON(data []byte) error { - valueInlineType1 := new(InlineType1) - if err := json.Unmarshal(data, &valueInlineType1); err == nil { - i.typ = "InlineType1" - i.InlineType1 = valueInlineType1 - return nil - } - valueInlineType2 := new(InlineType2) - if err := json.Unmarshal(data, &valueInlineType2); err == nil { - i.typ = "InlineType2" - i.InlineType2 = valueInlineType2 - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, i) -} - -func (i InlinedUndiscriminatedUnion1) MarshalJSON() ([]byte, error) { - if i.typ == "InlineType1" || i.InlineType1 != nil { - return json.Marshal(i.InlineType1) - } - if i.typ == "InlineType2" || i.InlineType2 != nil { - return json.Marshal(i.InlineType2) - } - return nil, fmt.Errorf("type %T does not include a non-empty union type", i) -} - -type InlinedUndiscriminatedUnion1Visitor interface { - VisitInlineType1(*InlineType1) error - VisitInlineType2(*InlineType2) error -} - -func (i *InlinedUndiscriminatedUnion1) Accept(visitor InlinedUndiscriminatedUnion1Visitor) error { - if i.typ == "InlineType1" || i.InlineType1 != nil { - return visitor.VisitInlineType1(i.InlineType1) - } - if i.typ == "InlineType2" || i.InlineType2 != nil { - return visitor.VisitInlineType2(i.InlineType2) - } - return fmt.Errorf("type %T does not include a non-empty union type", i) -} - -type NestedInlineType1 struct { - Foo string `json:"foo" url:"foo"` - Bar string `json:"bar" url:"bar"` - MyEnum InlineEnum `json:"myEnum" url:"myEnum"` - - extraProperties map[string]interface{} -} - -func (n *NestedInlineType1) GetFoo() string { - if n == nil { - return "" - } - return n.Foo -} - -func (n *NestedInlineType1) GetBar() string { - if n == nil { - return "" - } - return n.Bar -} - -func (n *NestedInlineType1) GetMyEnum() InlineEnum { - if n == nil { - return "" - } - return n.MyEnum -} - -func (n *NestedInlineType1) GetExtraProperties() map[string]interface{} { - return n.extraProperties -} - -func (n *NestedInlineType1) UnmarshalJSON(data []byte) error { - type unmarshaler NestedInlineType1 - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *n = NestedInlineType1(value) - extraProperties, err := internal.ExtractExtraProperties(data, *n) - if err != nil { - return err - } - n.extraProperties = extraProperties - return nil -} - -func (n *NestedInlineType1) String() string { - if value, err := internal.StringifyJSON(n); err == nil { - return value - } - return fmt.Sprintf("%#v", n) -} - -type RootType1 struct { - Foo string `json:"foo" url:"foo"` - Bar *InlineType1 `json:"bar,omitempty" url:"bar,omitempty"` - - extraProperties map[string]interface{} -} - -func (r *RootType1) GetFoo() string { - if r == nil { - return "" - } - return r.Foo -} - -func (r *RootType1) GetBar() *InlineType1 { - if r == nil { - return nil - } - return r.Bar -} - -func (r *RootType1) GetExtraProperties() map[string]interface{} { - return r.extraProperties -} - -func (r *RootType1) UnmarshalJSON(data []byte) error { - type unmarshaler RootType1 - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *r = RootType1(value) - extraProperties, err := internal.ExtractExtraProperties(data, *r) - if err != nil { - return err - } - r.extraProperties = extraProperties - return nil -} - -func (r *RootType1) String() string { - if value, err := internal.StringifyJSON(r); err == nil { - return value - } - return fmt.Sprintf("%#v", r) -} diff --git a/seed/go-sdk/inline-types/.github/workflows/ci.yml b/seed/go-sdk/inline-types/.github/workflows/ci.yml deleted file mode 100644 index d4c0a5dcd95..00000000000 --- a/seed/go-sdk/inline-types/.github/workflows/ci.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: ci - -on: [push] - -jobs: - compile: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up go - uses: actions/setup-go@v4 - - - name: Compile - run: go build ./... - test: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up go - uses: actions/setup-go@v4 - - - name: Test - run: go test ./... diff --git a/seed/go-sdk/inline-types/.mock/definition/__package__.yml b/seed/go-sdk/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/go-sdk/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/go-sdk/inline-types/.mock/definition/api.yml b/seed/go-sdk/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/go-sdk/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/go-sdk/inline-types/.mock/fern.config.json b/seed/go-sdk/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/go-sdk/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/go-sdk/inline-types/.mock/generators.yml b/seed/go-sdk/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/go-sdk/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/go-sdk/inline-types/client/client.go b/seed/go-sdk/inline-types/client/client.go deleted file mode 100644 index ccf71df33e5..00000000000 --- a/seed/go-sdk/inline-types/client/client.go +++ /dev/null @@ -1,70 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package client - -import ( - context "context" - fern "github.com/inline-types/fern" - core "github.com/inline-types/fern/core" - internal "github.com/inline-types/fern/internal" - option "github.com/inline-types/fern/option" - http "net/http" -) - -type Client struct { - baseURL string - caller *internal.Caller - header http.Header -} - -func NewClient(opts ...option.RequestOption) *Client { - options := core.NewRequestOptions(opts...) - return &Client{ - baseURL: options.BaseURL, - caller: internal.NewCaller( - &internal.CallerParams{ - Client: options.HTTPClient, - MaxAttempts: options.MaxAttempts, - }, - ), - header: options.ToHeader(), - } -} - -func (c *Client) GetRoot( - ctx context.Context, - request *fern.PostRootRequest, - opts ...option.RequestOption, -) (*fern.RootType1, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "", - ) - endpointURL := baseURL + "/root/root" - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *fern.RootType1 - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} diff --git a/seed/go-sdk/inline-types/client/client_test.go b/seed/go-sdk/inline-types/client/client_test.go deleted file mode 100644 index 73ba53c8db4..00000000000 --- a/seed/go-sdk/inline-types/client/client_test.go +++ /dev/null @@ -1,45 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package client - -import ( - option "github.com/inline-types/fern/option" - assert "github.com/stretchr/testify/assert" - http "net/http" - testing "testing" - time "time" -) - -func TestNewClient(t *testing.T) { - t.Run("default", func(t *testing.T) { - c := NewClient() - assert.Empty(t, c.baseURL) - }) - - t.Run("base url", func(t *testing.T) { - c := NewClient( - option.WithBaseURL("test.co"), - ) - assert.Equal(t, "test.co", c.baseURL) - }) - - t.Run("http client", func(t *testing.T) { - httpClient := &http.Client{ - Timeout: 5 * time.Second, - } - c := NewClient( - option.WithHTTPClient(httpClient), - ) - assert.Empty(t, c.baseURL) - }) - - t.Run("http header", func(t *testing.T) { - header := make(http.Header) - header.Set("X-API-Tenancy", "test") - c := NewClient( - option.WithHTTPHeader(header), - ) - assert.Empty(t, c.baseURL) - assert.Equal(t, "test", c.header.Get("X-API-Tenancy")) - }) -} diff --git a/seed/go-sdk/inline-types/core/api_error.go b/seed/go-sdk/inline-types/core/api_error.go deleted file mode 100644 index dc4190ca1cd..00000000000 --- a/seed/go-sdk/inline-types/core/api_error.go +++ /dev/null @@ -1,42 +0,0 @@ -package core - -import "fmt" - -// APIError is a lightweight wrapper around the standard error -// interface that preserves the status code from the RPC, if any. -type APIError struct { - err error - - StatusCode int `json:"-"` -} - -// NewAPIError constructs a new API error. -func NewAPIError(statusCode int, err error) *APIError { - return &APIError{ - err: err, - StatusCode: statusCode, - } -} - -// Unwrap returns the underlying error. This also makes the error compatible -// with errors.As and errors.Is. -func (a *APIError) Unwrap() error { - if a == nil { - return nil - } - return a.err -} - -// Error returns the API error's message. -func (a *APIError) Error() string { - if a == nil || (a.err == nil && a.StatusCode == 0) { - return "" - } - if a.err == nil { - return fmt.Sprintf("%d", a.StatusCode) - } - if a.StatusCode == 0 { - return a.err.Error() - } - return fmt.Sprintf("%d: %s", a.StatusCode, a.err.Error()) -} diff --git a/seed/go-sdk/inline-types/core/http.go b/seed/go-sdk/inline-types/core/http.go deleted file mode 100644 index b553350b84e..00000000000 --- a/seed/go-sdk/inline-types/core/http.go +++ /dev/null @@ -1,8 +0,0 @@ -package core - -import "net/http" - -// HTTPClient is an interface for a subset of the *http.Client. -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} diff --git a/seed/go-sdk/inline-types/core/request_option.go b/seed/go-sdk/inline-types/core/request_option.go deleted file mode 100644 index 59b90a18fb8..00000000000 --- a/seed/go-sdk/inline-types/core/request_option.go +++ /dev/null @@ -1,108 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package core - -import ( - http "net/http" - url "net/url" -) - -// RequestOption adapts the behavior of the client or an individual request. -type RequestOption interface { - applyRequestOptions(*RequestOptions) -} - -// RequestOptions defines all of the possible request options. -// -// This type is primarily used by the generated code and is not meant -// to be used directly; use the option package instead. -type RequestOptions struct { - BaseURL string - HTTPClient HTTPClient - HTTPHeader http.Header - BodyProperties map[string]interface{} - QueryParameters url.Values - MaxAttempts uint -} - -// NewRequestOptions returns a new *RequestOptions value. -// -// This function is primarily used by the generated code and is not meant -// to be used directly; use RequestOption instead. -func NewRequestOptions(opts ...RequestOption) *RequestOptions { - options := &RequestOptions{ - HTTPHeader: make(http.Header), - BodyProperties: make(map[string]interface{}), - QueryParameters: make(url.Values), - } - for _, opt := range opts { - opt.applyRequestOptions(options) - } - return options -} - -// ToHeader maps the configured request options into a http.Header used -// for the request(s). -func (r *RequestOptions) ToHeader() http.Header { return r.cloneHeader() } - -func (r *RequestOptions) cloneHeader() http.Header { - headers := r.HTTPHeader.Clone() - headers.Set("X-Fern-Language", "Go") - headers.Set("X-Fern-SDK-Name", "github.com/inline-types/fern") - headers.Set("X-Fern-SDK-Version", "0.0.1") - return headers -} - -// BaseURLOption implements the RequestOption interface. -type BaseURLOption struct { - BaseURL string -} - -func (b *BaseURLOption) applyRequestOptions(opts *RequestOptions) { - opts.BaseURL = b.BaseURL -} - -// HTTPClientOption implements the RequestOption interface. -type HTTPClientOption struct { - HTTPClient HTTPClient -} - -func (h *HTTPClientOption) applyRequestOptions(opts *RequestOptions) { - opts.HTTPClient = h.HTTPClient -} - -// HTTPHeaderOption implements the RequestOption interface. -type HTTPHeaderOption struct { - HTTPHeader http.Header -} - -func (h *HTTPHeaderOption) applyRequestOptions(opts *RequestOptions) { - opts.HTTPHeader = h.HTTPHeader -} - -// BodyPropertiesOption implements the RequestOption interface. -type BodyPropertiesOption struct { - BodyProperties map[string]interface{} -} - -func (b *BodyPropertiesOption) applyRequestOptions(opts *RequestOptions) { - opts.BodyProperties = b.BodyProperties -} - -// QueryParametersOption implements the RequestOption interface. -type QueryParametersOption struct { - QueryParameters url.Values -} - -func (q *QueryParametersOption) applyRequestOptions(opts *RequestOptions) { - opts.QueryParameters = q.QueryParameters -} - -// MaxAttemptsOption implements the RequestOption interface. -type MaxAttemptsOption struct { - MaxAttempts uint -} - -func (m *MaxAttemptsOption) applyRequestOptions(opts *RequestOptions) { - opts.MaxAttempts = m.MaxAttempts -} diff --git a/seed/go-sdk/inline-types/dynamic-snippets/example0/snippet.go b/seed/go-sdk/inline-types/dynamic-snippets/example0/snippet.go deleted file mode 100644 index 3dc762bbee3..00000000000 --- a/seed/go-sdk/inline-types/dynamic-snippets/example0/snippet.go +++ /dev/null @@ -1,25 +0,0 @@ -package example - -import ( - client "github.com/inline-types/fern/client" - context "context" - fern "github.com/inline-types/fern" -) - -func do() () { - client := client.NewClient() - client.GetRoot( - context.TODO(), - &fern.PostRootRequest{ - Bar: &fern.InlineType1{ - Foo: "foo", - Bar: &fern.NestedInlineType1{ - Foo: "foo", - Bar: "bar", - MyEnum: fern.InlineEnumSunny, - }, - }, - Foo: "foo", - }, - ) -} diff --git a/seed/go-sdk/inline-types/file_param.go b/seed/go-sdk/inline-types/file_param.go deleted file mode 100644 index 33abc01dbcd..00000000000 --- a/seed/go-sdk/inline-types/file_param.go +++ /dev/null @@ -1,41 +0,0 @@ -package object - -import ( - "io" -) - -// FileParam is a file type suitable for multipart/form-data uploads. -type FileParam struct { - io.Reader - filename string - contentType string -} - -// FileParamOption adapts the behavior of the FileParam. No options are -// implemented yet, but this interface allows for future extensibility. -type FileParamOption interface { - apply() -} - -// NewFileParam returns a *FileParam type suitable for multipart/form-data uploads. All file -// upload endpoints accept a simple io.Reader, which is usually created by opening a file -// via os.Open. -// -// However, some endpoints require additional metadata about the file such as a specific -// Content-Type or custom filename. FileParam makes it easier to create the correct type -// signature for these endpoints. -func NewFileParam( - reader io.Reader, - filename string, - contentType string, - opts ...FileParamOption, -) *FileParam { - return &FileParam{ - Reader: reader, - filename: filename, - contentType: contentType, - } -} - -func (f *FileParam) Name() string { return f.filename } -func (f *FileParam) ContentType() string { return f.contentType } diff --git a/seed/go-sdk/inline-types/go.mod b/seed/go-sdk/inline-types/go.mod deleted file mode 100644 index 744d58e186e..00000000000 --- a/seed/go-sdk/inline-types/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module github.com/inline-types/fern - -go 1.13 - -require ( - github.com/google/uuid v1.4.0 - github.com/stretchr/testify v1.7.0 - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/seed/go-sdk/inline-types/go.sum b/seed/go-sdk/inline-types/go.sum deleted file mode 100644 index b3766d4366b..00000000000 --- a/seed/go-sdk/inline-types/go.sum +++ /dev/null @@ -1,14 +0,0 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/seed/go-sdk/inline-types/internal/caller.go b/seed/go-sdk/inline-types/internal/caller.go deleted file mode 100644 index 213837b3617..00000000000 --- a/seed/go-sdk/inline-types/internal/caller.go +++ /dev/null @@ -1,238 +0,0 @@ -package internal - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "net/url" - "reflect" - "strings" - - "github.com/inline-types/fern/core" -) - -const ( - // contentType specifies the JSON Content-Type header value. - contentType = "application/json" - contentTypeHeader = "Content-Type" -) - -// Caller calls APIs and deserializes their response, if any. -type Caller struct { - client core.HTTPClient - retrier *Retrier -} - -// CallerParams represents the parameters used to constrcut a new *Caller. -type CallerParams struct { - Client core.HTTPClient - MaxAttempts uint -} - -// NewCaller returns a new *Caller backed by the given parameters. -func NewCaller(params *CallerParams) *Caller { - var httpClient core.HTTPClient = http.DefaultClient - if params.Client != nil { - httpClient = params.Client - } - var retryOptions []RetryOption - if params.MaxAttempts > 0 { - retryOptions = append(retryOptions, WithMaxAttempts(params.MaxAttempts)) - } - return &Caller{ - client: httpClient, - retrier: NewRetrier(retryOptions...), - } -} - -// CallParams represents the parameters used to issue an API call. -type CallParams struct { - URL string - Method string - MaxAttempts uint - Headers http.Header - BodyProperties map[string]interface{} - QueryParameters url.Values - Client core.HTTPClient - Request interface{} - Response interface{} - ResponseIsOptional bool - ErrorDecoder ErrorDecoder -} - -// Call issues an API call according to the given call parameters. -func (c *Caller) Call(ctx context.Context, params *CallParams) error { - url := buildURL(params.URL, params.QueryParameters) - req, err := newRequest( - ctx, - url, - params.Method, - params.Headers, - params.Request, - params.BodyProperties, - ) - if err != nil { - return err - } - - // If the call has been cancelled, don't issue the request. - if err := ctx.Err(); err != nil { - return err - } - - client := c.client - if params.Client != nil { - // Use the HTTP client scoped to the request. - client = params.Client - } - - var retryOptions []RetryOption - if params.MaxAttempts > 0 { - retryOptions = append(retryOptions, WithMaxAttempts(params.MaxAttempts)) - } - - resp, err := c.retrier.Run( - client.Do, - req, - params.ErrorDecoder, - retryOptions..., - ) - if err != nil { - return err - } - - // Close the response body after we're done. - defer resp.Body.Close() - - // Check if the call was cancelled before we return the error - // associated with the call and/or unmarshal the response data. - if err := ctx.Err(); err != nil { - return err - } - - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - return decodeError(resp, params.ErrorDecoder) - } - - // Mutate the response parameter in-place. - if params.Response != nil { - if writer, ok := params.Response.(io.Writer); ok { - _, err = io.Copy(writer, resp.Body) - } else { - err = json.NewDecoder(resp.Body).Decode(params.Response) - } - if err != nil { - if err == io.EOF { - if params.ResponseIsOptional { - // The response is optional, so we should ignore the - // io.EOF error - return nil - } - return fmt.Errorf("expected a %T response, but the server responded with nothing", params.Response) - } - return err - } - } - - return nil -} - -// buildURL constructs the final URL by appending the given query parameters (if any). -func buildURL( - url string, - queryParameters url.Values, -) string { - if len(queryParameters) == 0 { - return url - } - if strings.ContainsRune(url, '?') { - url += "&" - } else { - url += "?" - } - url += queryParameters.Encode() - return url -} - -// newRequest returns a new *http.Request with all of the fields -// required to issue the call. -func newRequest( - ctx context.Context, - url string, - method string, - endpointHeaders http.Header, - request interface{}, - bodyProperties map[string]interface{}, -) (*http.Request, error) { - requestBody, err := newRequestBody(request, bodyProperties) - if err != nil { - return nil, err - } - req, err := http.NewRequestWithContext(ctx, method, url, requestBody) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - req.Header.Set(contentTypeHeader, contentType) - for name, values := range endpointHeaders { - req.Header[name] = values - } - return req, nil -} - -// newRequestBody returns a new io.Reader that represents the HTTP request body. -func newRequestBody(request interface{}, bodyProperties map[string]interface{}) (io.Reader, error) { - if isNil(request) { - if len(bodyProperties) == 0 { - return nil, nil - } - requestBytes, err := json.Marshal(bodyProperties) - if err != nil { - return nil, err - } - return bytes.NewReader(requestBytes), nil - } - if body, ok := request.(io.Reader); ok { - return body, nil - } - requestBytes, err := MarshalJSONWithExtraProperties(request, bodyProperties) - if err != nil { - return nil, err - } - return bytes.NewReader(requestBytes), nil -} - -// decodeError decodes the error from the given HTTP response. Note that -// it's the caller's responsibility to close the response body. -func decodeError(response *http.Response, errorDecoder ErrorDecoder) error { - if errorDecoder != nil { - // This endpoint has custom errors, so we'll - // attempt to unmarshal the error into a structured - // type based on the status code. - return errorDecoder(response.StatusCode, response.Body) - } - // This endpoint doesn't have any custom error - // types, so we just read the body as-is, and - // put it into a normal error. - bytes, err := io.ReadAll(response.Body) - if err != nil && err != io.EOF { - return err - } - if err == io.EOF { - // The error didn't have a response body, - // so all we can do is return an error - // with the status code. - return core.NewAPIError(response.StatusCode, nil) - } - return core.NewAPIError(response.StatusCode, errors.New(string(bytes))) -} - -// isNil is used to determine if the request value is equal to nil (i.e. an interface -// value that holds a nil concrete value is itself non-nil). -func isNil(value interface{}) bool { - return value == nil || reflect.ValueOf(value).IsNil() -} diff --git a/seed/go-sdk/inline-types/internal/caller_test.go b/seed/go-sdk/inline-types/internal/caller_test.go deleted file mode 100644 index c7558afaef8..00000000000 --- a/seed/go-sdk/inline-types/internal/caller_test.go +++ /dev/null @@ -1,391 +0,0 @@ -package internal - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "net/http/httptest" - "net/url" - "strconv" - "testing" - - "github.com/inline-types/fern/core" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -// TestCase represents a single test case. -type TestCase struct { - description string - - // Server-side assertions. - givePathSuffix string - giveMethod string - giveResponseIsOptional bool - giveHeader http.Header - giveErrorDecoder ErrorDecoder - giveRequest *Request - giveQueryParams url.Values - giveBodyProperties map[string]interface{} - - // Client-side assertions. - wantResponse *Response - wantError error -} - -// Request a simple request body. -type Request struct { - Id string `json:"id"` -} - -// Response a simple response body. -type Response struct { - Id string `json:"id"` - ExtraBodyProperties map[string]interface{} `json:"extraBodyProperties,omitempty"` - QueryParameters url.Values `json:"queryParameters,omitempty"` -} - -// NotFoundError represents a 404. -type NotFoundError struct { - *core.APIError - - Message string `json:"message"` -} - -func TestCall(t *testing.T) { - tests := []*TestCase{ - { - description: "GET success", - giveMethod: http.MethodGet, - giveHeader: http.Header{ - "X-API-Status": []string{"success"}, - }, - giveRequest: &Request{ - Id: "123", - }, - wantResponse: &Response{ - Id: "123", - }, - }, - { - description: "GET success with query", - givePathSuffix: "?limit=1", - giveMethod: http.MethodGet, - giveHeader: http.Header{ - "X-API-Status": []string{"success"}, - }, - giveRequest: &Request{ - Id: "123", - }, - wantResponse: &Response{ - Id: "123", - QueryParameters: url.Values{ - "limit": []string{"1"}, - }, - }, - }, - { - description: "GET not found", - giveMethod: http.MethodGet, - giveHeader: http.Header{ - "X-API-Status": []string{"fail"}, - }, - giveRequest: &Request{ - Id: strconv.Itoa(http.StatusNotFound), - }, - giveErrorDecoder: newTestErrorDecoder(t), - wantError: &NotFoundError{ - APIError: core.NewAPIError( - http.StatusNotFound, - errors.New(`{"message":"ID \"404\" not found"}`), - ), - }, - }, - { - description: "POST empty body", - giveMethod: http.MethodPost, - giveHeader: http.Header{ - "X-API-Status": []string{"fail"}, - }, - giveRequest: nil, - wantError: core.NewAPIError( - http.StatusBadRequest, - errors.New("invalid request"), - ), - }, - { - description: "POST optional response", - giveMethod: http.MethodPost, - giveHeader: http.Header{ - "X-API-Status": []string{"success"}, - }, - giveRequest: &Request{ - Id: "123", - }, - giveResponseIsOptional: true, - }, - { - description: "POST API error", - giveMethod: http.MethodPost, - giveHeader: http.Header{ - "X-API-Status": []string{"fail"}, - }, - giveRequest: &Request{ - Id: strconv.Itoa(http.StatusInternalServerError), - }, - wantError: core.NewAPIError( - http.StatusInternalServerError, - errors.New("failed to process request"), - ), - }, - { - description: "POST extra properties", - giveMethod: http.MethodPost, - giveHeader: http.Header{ - "X-API-Status": []string{"success"}, - }, - giveRequest: new(Request), - giveBodyProperties: map[string]interface{}{ - "key": "value", - }, - wantResponse: &Response{ - ExtraBodyProperties: map[string]interface{}{ - "key": "value", - }, - }, - }, - { - description: "GET extra query parameters", - giveMethod: http.MethodGet, - giveHeader: http.Header{ - "X-API-Status": []string{"success"}, - }, - giveQueryParams: url.Values{ - "extra": []string{"true"}, - }, - giveRequest: &Request{ - Id: "123", - }, - wantResponse: &Response{ - Id: "123", - QueryParameters: url.Values{ - "extra": []string{"true"}, - }, - }, - }, - { - description: "GET merge extra query parameters", - givePathSuffix: "?limit=1", - giveMethod: http.MethodGet, - giveHeader: http.Header{ - "X-API-Status": []string{"success"}, - }, - giveRequest: &Request{ - Id: "123", - }, - giveQueryParams: url.Values{ - "extra": []string{"true"}, - }, - wantResponse: &Response{ - Id: "123", - QueryParameters: url.Values{ - "limit": []string{"1"}, - "extra": []string{"true"}, - }, - }, - }, - } - for _, test := range tests { - t.Run(test.description, func(t *testing.T) { - var ( - server = newTestServer(t, test) - client = server.Client() - ) - caller := NewCaller( - &CallerParams{ - Client: client, - }, - ) - var response *Response - err := caller.Call( - context.Background(), - &CallParams{ - URL: server.URL + test.givePathSuffix, - Method: test.giveMethod, - Headers: test.giveHeader, - BodyProperties: test.giveBodyProperties, - QueryParameters: test.giveQueryParams, - Request: test.giveRequest, - Response: &response, - ResponseIsOptional: test.giveResponseIsOptional, - ErrorDecoder: test.giveErrorDecoder, - }, - ) - if test.wantError != nil { - assert.EqualError(t, err, test.wantError.Error()) - return - } - require.NoError(t, err) - assert.Equal(t, test.wantResponse, response) - }) - } -} - -func TestMergeHeaders(t *testing.T) { - t.Run("both empty", func(t *testing.T) { - merged := MergeHeaders(make(http.Header), make(http.Header)) - assert.Empty(t, merged) - }) - - t.Run("empty left", func(t *testing.T) { - left := make(http.Header) - - right := make(http.Header) - right.Set("X-API-Version", "0.0.1") - - merged := MergeHeaders(left, right) - assert.Equal(t, "0.0.1", merged.Get("X-API-Version")) - }) - - t.Run("empty right", func(t *testing.T) { - left := make(http.Header) - left.Set("X-API-Version", "0.0.1") - - right := make(http.Header) - - merged := MergeHeaders(left, right) - assert.Equal(t, "0.0.1", merged.Get("X-API-Version")) - }) - - t.Run("single value override", func(t *testing.T) { - left := make(http.Header) - left.Set("X-API-Version", "0.0.0") - - right := make(http.Header) - right.Set("X-API-Version", "0.0.1") - - merged := MergeHeaders(left, right) - assert.Equal(t, []string{"0.0.1"}, merged.Values("X-API-Version")) - }) - - t.Run("multiple value override", func(t *testing.T) { - left := make(http.Header) - left.Set("X-API-Versions", "0.0.0") - - right := make(http.Header) - right.Add("X-API-Versions", "0.0.1") - right.Add("X-API-Versions", "0.0.2") - - merged := MergeHeaders(left, right) - assert.Equal(t, []string{"0.0.1", "0.0.2"}, merged.Values("X-API-Versions")) - }) - - t.Run("disjoint merge", func(t *testing.T) { - left := make(http.Header) - left.Set("X-API-Tenancy", "test") - - right := make(http.Header) - right.Set("X-API-Version", "0.0.1") - - merged := MergeHeaders(left, right) - assert.Equal(t, []string{"test"}, merged.Values("X-API-Tenancy")) - assert.Equal(t, []string{"0.0.1"}, merged.Values("X-API-Version")) - }) -} - -// newTestServer returns a new *httptest.Server configured with the -// given test parameters. -func newTestServer(t *testing.T, tc *TestCase) *httptest.Server { - return httptest.NewServer( - http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) { - assert.Equal(t, tc.giveMethod, r.Method) - assert.Equal(t, contentType, r.Header.Get(contentTypeHeader)) - for header, value := range tc.giveHeader { - assert.Equal(t, value, r.Header.Values(header)) - } - - request := new(Request) - - bytes, err := io.ReadAll(r.Body) - if tc.giveRequest == nil { - require.Empty(t, bytes) - w.WriteHeader(http.StatusBadRequest) - _, err = w.Write([]byte("invalid request")) - require.NoError(t, err) - return - } - require.NoError(t, err) - require.NoError(t, json.Unmarshal(bytes, request)) - - switch request.Id { - case strconv.Itoa(http.StatusNotFound): - notFoundError := &NotFoundError{ - APIError: &core.APIError{ - StatusCode: http.StatusNotFound, - }, - Message: fmt.Sprintf("ID %q not found", request.Id), - } - bytes, err = json.Marshal(notFoundError) - require.NoError(t, err) - - w.WriteHeader(http.StatusNotFound) - _, err = w.Write(bytes) - require.NoError(t, err) - return - - case strconv.Itoa(http.StatusInternalServerError): - w.WriteHeader(http.StatusInternalServerError) - _, err = w.Write([]byte("failed to process request")) - require.NoError(t, err) - return - } - - if tc.giveResponseIsOptional { - w.WriteHeader(http.StatusOK) - return - } - - extraBodyProperties := make(map[string]interface{}) - require.NoError(t, json.Unmarshal(bytes, &extraBodyProperties)) - delete(extraBodyProperties, "id") - - response := &Response{ - Id: request.Id, - ExtraBodyProperties: extraBodyProperties, - QueryParameters: r.URL.Query(), - } - bytes, err = json.Marshal(response) - require.NoError(t, err) - - _, err = w.Write(bytes) - require.NoError(t, err) - }, - ), - ) -} - -// newTestErrorDecoder returns an error decoder suitable for tests. -func newTestErrorDecoder(t *testing.T) func(int, io.Reader) error { - return func(statusCode int, body io.Reader) error { - raw, err := io.ReadAll(body) - require.NoError(t, err) - - var ( - apiError = core.NewAPIError(statusCode, errors.New(string(raw))) - decoder = json.NewDecoder(bytes.NewReader(raw)) - ) - if statusCode == http.StatusNotFound { - value := new(NotFoundError) - value.APIError = apiError - require.NoError(t, decoder.Decode(value)) - - return value - } - return apiError - } -} diff --git a/seed/go-sdk/inline-types/internal/error_decoder.go b/seed/go-sdk/inline-types/internal/error_decoder.go deleted file mode 100644 index 1321c464c24..00000000000 --- a/seed/go-sdk/inline-types/internal/error_decoder.go +++ /dev/null @@ -1,45 +0,0 @@ -package internal - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io" - - "github.com/inline-types/fern/core" -) - -// ErrorDecoder decodes *http.Response errors and returns a -// typed API error (e.g. *core.APIError). -type ErrorDecoder func(statusCode int, body io.Reader) error - -// ErrorCodes maps HTTP status codes to error constructors. -type ErrorCodes map[int]func(*core.APIError) error - -// NewErrorDecoder returns a new ErrorDecoder backed by the given error codes. -func NewErrorDecoder(errorCodes ErrorCodes) ErrorDecoder { - return func(statusCode int, body io.Reader) error { - raw, err := io.ReadAll(body) - if err != nil { - return fmt.Errorf("failed to read error from response body: %w", err) - } - apiError := core.NewAPIError( - statusCode, - errors.New(string(raw)), - ) - newErrorFunc, ok := errorCodes[statusCode] - if !ok { - // This status code isn't recognized, so we return - // the API error as-is. - return apiError - } - customError := newErrorFunc(apiError) - if err := json.NewDecoder(bytes.NewReader(raw)).Decode(customError); err != nil { - // If we fail to decode the error, we return the - // API error as-is. - return apiError - } - return customError - } -} diff --git a/seed/go-sdk/inline-types/internal/error_decoder_test.go b/seed/go-sdk/inline-types/internal/error_decoder_test.go deleted file mode 100644 index 2bc84bfa21d..00000000000 --- a/seed/go-sdk/inline-types/internal/error_decoder_test.go +++ /dev/null @@ -1,55 +0,0 @@ -package internal - -import ( - "bytes" - "errors" - "net/http" - "testing" - - "github.com/inline-types/fern/core" - "github.com/stretchr/testify/assert" -) - -func TestErrorDecoder(t *testing.T) { - decoder := NewErrorDecoder( - ErrorCodes{ - http.StatusNotFound: func(apiError *core.APIError) error { - return &NotFoundError{APIError: apiError} - }, - }) - - tests := []struct { - description string - giveStatusCode int - giveBody string - wantError error - }{ - { - description: "unrecognized status code", - giveStatusCode: http.StatusInternalServerError, - giveBody: "Internal Server Error", - wantError: core.NewAPIError(http.StatusInternalServerError, errors.New("Internal Server Error")), - }, - { - description: "not found with valid JSON", - giveStatusCode: http.StatusNotFound, - giveBody: `{"message": "Resource not found"}`, - wantError: &NotFoundError{ - APIError: core.NewAPIError(http.StatusNotFound, errors.New(`{"message": "Resource not found"}`)), - Message: "Resource not found", - }, - }, - { - description: "not found with invalid JSON", - giveStatusCode: http.StatusNotFound, - giveBody: `Resource not found`, - wantError: core.NewAPIError(http.StatusNotFound, errors.New("Resource not found")), - }, - } - - for _, tt := range tests { - t.Run(tt.description, func(t *testing.T) { - assert.Equal(t, tt.wantError, decoder(tt.giveStatusCode, bytes.NewReader([]byte(tt.giveBody)))) - }) - } -} diff --git a/seed/go-sdk/inline-types/internal/extra_properties.go b/seed/go-sdk/inline-types/internal/extra_properties.go deleted file mode 100644 index 540c3fd89ee..00000000000 --- a/seed/go-sdk/inline-types/internal/extra_properties.go +++ /dev/null @@ -1,141 +0,0 @@ -package internal - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "strings" -) - -// MarshalJSONWithExtraProperty marshals the given value to JSON, including the extra property. -func MarshalJSONWithExtraProperty(marshaler interface{}, key string, value interface{}) ([]byte, error) { - return MarshalJSONWithExtraProperties(marshaler, map[string]interface{}{key: value}) -} - -// MarshalJSONWithExtraProperties marshals the given value to JSON, including any extra properties. -func MarshalJSONWithExtraProperties(marshaler interface{}, extraProperties map[string]interface{}) ([]byte, error) { - bytes, err := json.Marshal(marshaler) - if err != nil { - return nil, err - } - if len(extraProperties) == 0 { - return bytes, nil - } - keys, err := getKeys(marshaler) - if err != nil { - return nil, err - } - for _, key := range keys { - if _, ok := extraProperties[key]; ok { - return nil, fmt.Errorf("cannot add extra property %q because it is already defined on the type", key) - } - } - extraBytes, err := json.Marshal(extraProperties) - if err != nil { - return nil, err - } - if isEmptyJSON(bytes) { - if isEmptyJSON(extraBytes) { - return bytes, nil - } - return extraBytes, nil - } - result := bytes[:len(bytes)-1] - result = append(result, ',') - result = append(result, extraBytes[1:len(extraBytes)-1]...) - result = append(result, '}') - return result, nil -} - -// ExtractExtraProperties extracts any extra properties from the given value. -func ExtractExtraProperties(bytes []byte, value interface{}, exclude ...string) (map[string]interface{}, error) { - val := reflect.ValueOf(value) - for val.Kind() == reflect.Ptr { - if val.IsNil() { - return nil, fmt.Errorf("value must be non-nil to extract extra properties") - } - val = val.Elem() - } - if err := json.Unmarshal(bytes, &value); err != nil { - return nil, err - } - var extraProperties map[string]interface{} - if err := json.Unmarshal(bytes, &extraProperties); err != nil { - return nil, err - } - for i := 0; i < val.Type().NumField(); i++ { - key := jsonKey(val.Type().Field(i)) - if key == "" || key == "-" { - continue - } - delete(extraProperties, key) - } - for _, key := range exclude { - delete(extraProperties, key) - } - if len(extraProperties) == 0 { - return nil, nil - } - return extraProperties, nil -} - -// getKeys returns the keys associated with the given value. The value must be a -// a struct or a map with string keys. -func getKeys(value interface{}) ([]string, error) { - val := reflect.ValueOf(value) - if val.Kind() == reflect.Ptr { - val = val.Elem() - } - if !val.IsValid() { - return nil, nil - } - switch val.Kind() { - case reflect.Struct: - return getKeysForStructType(val.Type()), nil - case reflect.Map: - var keys []string - if val.Type().Key().Kind() != reflect.String { - return nil, fmt.Errorf("cannot extract keys from %T; only structs and maps with string keys are supported", value) - } - for _, key := range val.MapKeys() { - keys = append(keys, key.String()) - } - return keys, nil - default: - return nil, fmt.Errorf("cannot extract keys from %T; only structs and maps with string keys are supported", value) - } -} - -// getKeysForStructType returns all the keys associated with the given struct type, -// visiting embedded fields recursively. -func getKeysForStructType(structType reflect.Type) []string { - if structType.Kind() == reflect.Pointer { - structType = structType.Elem() - } - if structType.Kind() != reflect.Struct { - return nil - } - var keys []string - for i := 0; i < structType.NumField(); i++ { - field := structType.Field(i) - if field.Anonymous { - keys = append(keys, getKeysForStructType(field.Type)...) - continue - } - keys = append(keys, jsonKey(field)) - } - return keys -} - -// jsonKey returns the JSON key from the struct tag of the given field, -// excluding the omitempty flag (if any). -func jsonKey(field reflect.StructField) string { - return strings.TrimSuffix(field.Tag.Get("json"), ",omitempty") -} - -// isEmptyJSON returns true if the given data is empty, the empty JSON object, or -// an explicit null. -func isEmptyJSON(data []byte) bool { - return len(data) <= 2 || bytes.Equal(data, []byte("null")) -} diff --git a/seed/go-sdk/inline-types/internal/extra_properties_test.go b/seed/go-sdk/inline-types/internal/extra_properties_test.go deleted file mode 100644 index aa2510ee512..00000000000 --- a/seed/go-sdk/inline-types/internal/extra_properties_test.go +++ /dev/null @@ -1,228 +0,0 @@ -package internal - -import ( - "encoding/json" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -type testMarshaler struct { - Name string `json:"name"` - BirthDate time.Time `json:"birthDate"` - CreatedAt time.Time `json:"created_at"` -} - -func (t *testMarshaler) MarshalJSON() ([]byte, error) { - type embed testMarshaler - var marshaler = struct { - embed - BirthDate string `json:"birthDate"` - CreatedAt string `json:"created_at"` - }{ - embed: embed(*t), - BirthDate: t.BirthDate.Format("2006-01-02"), - CreatedAt: t.CreatedAt.Format(time.RFC3339), - } - return MarshalJSONWithExtraProperty(marshaler, "type", "test") -} - -func TestMarshalJSONWithExtraProperties(t *testing.T) { - tests := []struct { - desc string - giveMarshaler interface{} - giveExtraProperties map[string]interface{} - wantBytes []byte - wantError string - }{ - { - desc: "invalid type", - giveMarshaler: []string{"invalid"}, - giveExtraProperties: map[string]interface{}{"key": "overwrite"}, - wantError: `cannot extract keys from []string; only structs and maps with string keys are supported`, - }, - { - desc: "invalid key type", - giveMarshaler: map[int]interface{}{42: "value"}, - giveExtraProperties: map[string]interface{}{"key": "overwrite"}, - wantError: `cannot extract keys from map[int]interface {}; only structs and maps with string keys are supported`, - }, - { - desc: "invalid map overwrite", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{"key": "overwrite"}, - wantError: `cannot add extra property "key" because it is already defined on the type`, - }, - { - desc: "invalid struct overwrite", - giveMarshaler: new(testMarshaler), - giveExtraProperties: map[string]interface{}{"birthDate": "2000-01-01"}, - wantError: `cannot add extra property "birthDate" because it is already defined on the type`, - }, - { - desc: "invalid struct overwrite embedded type", - giveMarshaler: new(testMarshaler), - giveExtraProperties: map[string]interface{}{"name": "bob"}, - wantError: `cannot add extra property "name" because it is already defined on the type`, - }, - { - desc: "nil", - giveMarshaler: nil, - giveExtraProperties: nil, - wantBytes: []byte(`null`), - }, - { - desc: "empty", - giveMarshaler: map[string]interface{}{}, - giveExtraProperties: map[string]interface{}{}, - wantBytes: []byte(`{}`), - }, - { - desc: "no extra properties", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{}, - wantBytes: []byte(`{"key":"value"}`), - }, - { - desc: "only extra properties", - giveMarshaler: map[string]interface{}{}, - giveExtraProperties: map[string]interface{}{"key": "value"}, - wantBytes: []byte(`{"key":"value"}`), - }, - { - desc: "single extra property", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{"extra": "property"}, - wantBytes: []byte(`{"key":"value","extra":"property"}`), - }, - { - desc: "multiple extra properties", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{"one": 1, "two": 2}, - wantBytes: []byte(`{"key":"value","one":1,"two":2}`), - }, - { - desc: "nested properties", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{ - "user": map[string]interface{}{ - "age": 42, - "name": "alice", - }, - }, - wantBytes: []byte(`{"key":"value","user":{"age":42,"name":"alice"}}`), - }, - { - desc: "multiple nested properties", - giveMarshaler: map[string]interface{}{"key": "value"}, - giveExtraProperties: map[string]interface{}{ - "metadata": map[string]interface{}{ - "ip": "127.0.0.1", - }, - "user": map[string]interface{}{ - "age": 42, - "name": "alice", - }, - }, - wantBytes: []byte(`{"key":"value","metadata":{"ip":"127.0.0.1"},"user":{"age":42,"name":"alice"}}`), - }, - { - desc: "custom marshaler", - giveMarshaler: &testMarshaler{ - Name: "alice", - BirthDate: time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC), - CreatedAt: time.Date(2024, 1, 1, 0, 0, 0, 0, time.UTC), - }, - giveExtraProperties: map[string]interface{}{ - "extra": "property", - }, - wantBytes: []byte(`{"name":"alice","birthDate":"2000-01-01","created_at":"2024-01-01T00:00:00Z","type":"test","extra":"property"}`), - }, - } - for _, tt := range tests { - t.Run(tt.desc, func(t *testing.T) { - bytes, err := MarshalJSONWithExtraProperties(tt.giveMarshaler, tt.giveExtraProperties) - if tt.wantError != "" { - require.EqualError(t, err, tt.wantError) - assert.Nil(t, tt.wantBytes) - return - } - require.NoError(t, err) - assert.Equal(t, tt.wantBytes, bytes) - - value := make(map[string]interface{}) - require.NoError(t, json.Unmarshal(bytes, &value)) - }) - } -} - -func TestExtractExtraProperties(t *testing.T) { - t.Run("none", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - value := &user{ - Name: "alice", - } - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice"}`), value) - require.NoError(t, err) - assert.Nil(t, extraProperties) - }) - - t.Run("non-nil pointer", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - value := &user{ - Name: "alice", - } - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value) - require.NoError(t, err) - assert.Equal(t, map[string]interface{}{"age": float64(42)}, extraProperties) - }) - - t.Run("nil pointer", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - var value *user - _, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value) - assert.EqualError(t, err, "value must be non-nil to extract extra properties") - }) - - t.Run("non-zero value", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - value := user{ - Name: "alice", - } - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value) - require.NoError(t, err) - assert.Equal(t, map[string]interface{}{"age": float64(42)}, extraProperties) - }) - - t.Run("zero value", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - var value user - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value) - require.NoError(t, err) - assert.Equal(t, map[string]interface{}{"age": float64(42)}, extraProperties) - }) - - t.Run("exclude", func(t *testing.T) { - type user struct { - Name string `json:"name"` - } - value := &user{ - Name: "alice", - } - extraProperties, err := ExtractExtraProperties([]byte(`{"name": "alice", "age": 42}`), value, "age") - require.NoError(t, err) - assert.Nil(t, extraProperties) - }) -} diff --git a/seed/go-sdk/inline-types/internal/http.go b/seed/go-sdk/inline-types/internal/http.go deleted file mode 100644 index 768968bd621..00000000000 --- a/seed/go-sdk/inline-types/internal/http.go +++ /dev/null @@ -1,48 +0,0 @@ -package internal - -import ( - "fmt" - "net/http" - "net/url" -) - -// HTTPClient is an interface for a subset of the *http.Client. -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -// ResolveBaseURL resolves the base URL from the given arguments, -// preferring the first non-empty value. -func ResolveBaseURL(values ...string) string { - for _, value := range values { - if value != "" { - return value - } - } - return "" -} - -// EncodeURL encodes the given arguments into the URL, escaping -// values as needed. -func EncodeURL(urlFormat string, args ...interface{}) string { - escapedArgs := make([]interface{}, 0, len(args)) - for _, arg := range args { - escapedArgs = append(escapedArgs, url.PathEscape(fmt.Sprintf("%v", arg))) - } - return fmt.Sprintf(urlFormat, escapedArgs...) -} - -// MergeHeaders merges the given headers together, where the right -// takes precedence over the left. -func MergeHeaders(left, right http.Header) http.Header { - for key, values := range right { - if len(values) > 1 { - left[key] = values - continue - } - if value := right.Get(key); value != "" { - left.Set(key, value) - } - } - return left -} diff --git a/seed/go-sdk/inline-types/internal/query.go b/seed/go-sdk/inline-types/internal/query.go deleted file mode 100644 index 6129e71ffe5..00000000000 --- a/seed/go-sdk/inline-types/internal/query.go +++ /dev/null @@ -1,231 +0,0 @@ -package internal - -import ( - "encoding/base64" - "fmt" - "net/url" - "reflect" - "strings" - "time" - - "github.com/google/uuid" -) - -var ( - bytesType = reflect.TypeOf([]byte{}) - queryEncoderType = reflect.TypeOf(new(QueryEncoder)).Elem() - timeType = reflect.TypeOf(time.Time{}) - uuidType = reflect.TypeOf(uuid.UUID{}) -) - -// QueryEncoder is an interface implemented by any type that wishes to encode -// itself into URL values in a non-standard way. -type QueryEncoder interface { - EncodeQueryValues(key string, v *url.Values) error -} - -// QueryValues encodes url.Values from request objects. -// -// Note: This type is inspired by Google's query encoding library, but -// supports far less customization and is tailored to fit this SDK's use case. -// -// Ref: https://github.com/google/go-querystring -func QueryValues(v interface{}) (url.Values, error) { - values := make(url.Values) - val := reflect.ValueOf(v) - for val.Kind() == reflect.Ptr { - if val.IsNil() { - return values, nil - } - val = val.Elem() - } - - if v == nil { - return values, nil - } - - if val.Kind() != reflect.Struct { - return nil, fmt.Errorf("query: Values() expects struct input. Got %v", val.Kind()) - } - - err := reflectValue(values, val, "") - return values, err -} - -// reflectValue populates the values parameter from the struct fields in val. -// Embedded structs are followed recursively (using the rules defined in the -// Values function documentation) breadth-first. -func reflectValue(values url.Values, val reflect.Value, scope string) error { - typ := val.Type() - for i := 0; i < typ.NumField(); i++ { - sf := typ.Field(i) - if sf.PkgPath != "" && !sf.Anonymous { - // Skip unexported fields. - continue - } - - sv := val.Field(i) - tag := sf.Tag.Get("url") - if tag == "" || tag == "-" { - continue - } - - name, opts := parseTag(tag) - if name == "" { - name = sf.Name - } - - if scope != "" { - name = scope + "[" + name + "]" - } - - if opts.Contains("omitempty") && isEmptyValue(sv) { - continue - } - - if sv.Type().Implements(queryEncoderType) { - // If sv is a nil pointer and the custom encoder is defined on a non-pointer - // method receiver, set sv to the zero value of the underlying type - if !reflect.Indirect(sv).IsValid() && sv.Type().Elem().Implements(queryEncoderType) { - sv = reflect.New(sv.Type().Elem()) - } - - m := sv.Interface().(QueryEncoder) - if err := m.EncodeQueryValues(name, &values); err != nil { - return err - } - continue - } - - // Recursively dereference pointers, but stop at nil pointers. - for sv.Kind() == reflect.Ptr { - if sv.IsNil() { - break - } - sv = sv.Elem() - } - - if sv.Type() == uuidType || sv.Type() == bytesType || sv.Type() == timeType { - values.Add(name, valueString(sv, opts, sf)) - continue - } - - if sv.Kind() == reflect.Slice || sv.Kind() == reflect.Array { - if sv.Len() == 0 { - // Skip if slice or array is empty. - continue - } - for i := 0; i < sv.Len(); i++ { - value := sv.Index(i) - if isStructPointer(value) && !value.IsNil() { - if err := reflectValue(values, value.Elem(), name); err != nil { - return err - } - } else { - values.Add(name, valueString(value, opts, sf)) - } - } - continue - } - - if sv.Kind() == reflect.Struct { - if err := reflectValue(values, sv, name); err != nil { - return err - } - continue - } - - values.Add(name, valueString(sv, opts, sf)) - } - - return nil -} - -// valueString returns the string representation of a value. -func valueString(v reflect.Value, opts tagOptions, sf reflect.StructField) string { - for v.Kind() == reflect.Ptr { - if v.IsNil() { - return "" - } - v = v.Elem() - } - - if v.Type() == timeType { - t := v.Interface().(time.Time) - if format := sf.Tag.Get("format"); format == "date" { - return t.Format("2006-01-02") - } - return t.Format(time.RFC3339) - } - - if v.Type() == uuidType { - u := v.Interface().(uuid.UUID) - return u.String() - } - - if v.Type() == bytesType { - b := v.Interface().([]byte) - return base64.StdEncoding.EncodeToString(b) - } - - return fmt.Sprint(v.Interface()) -} - -// isEmptyValue checks if a value should be considered empty for the purposes -// of omitting fields with the "omitempty" option. -func isEmptyValue(v reflect.Value) bool { - type zeroable interface { - IsZero() bool - } - - if !v.IsZero() { - if z, ok := v.Interface().(zeroable); ok { - return z.IsZero() - } - } - - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - case reflect.Invalid, reflect.Complex64, reflect.Complex128, reflect.Chan, reflect.Func, reflect.Struct, reflect.UnsafePointer: - return false - } - - return false -} - -// isStructPointer returns true if the given reflect.Value is a pointer to a struct. -func isStructPointer(v reflect.Value) bool { - return v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Struct -} - -// tagOptions is the string following a comma in a struct field's "url" tag, or -// the empty string. It does not include the leading comma. -type tagOptions []string - -// parseTag splits a struct field's url tag into its name and comma-separated -// options. -func parseTag(tag string) (string, tagOptions) { - s := strings.Split(tag, ",") - return s[0], s[1:] -} - -// Contains checks whether the tagOptions contains the specified option. -func (o tagOptions) Contains(option string) bool { - for _, s := range o { - if s == option { - return true - } - } - return false -} diff --git a/seed/go-sdk/inline-types/internal/query_test.go b/seed/go-sdk/inline-types/internal/query_test.go deleted file mode 100644 index 2e58ccadde1..00000000000 --- a/seed/go-sdk/inline-types/internal/query_test.go +++ /dev/null @@ -1,187 +0,0 @@ -package internal - -import ( - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestQueryValues(t *testing.T) { - t.Run("empty optional", func(t *testing.T) { - type nested struct { - Value *string `json:"value,omitempty" url:"value,omitempty"` - } - type example struct { - Nested *nested `json:"nested,omitempty" url:"nested,omitempty"` - } - - values, err := QueryValues(&example{}) - require.NoError(t, err) - assert.Empty(t, values) - }) - - t.Run("empty required", func(t *testing.T) { - type nested struct { - Value *string `json:"value,omitempty" url:"value,omitempty"` - } - type example struct { - Required string `json:"required" url:"required"` - Nested *nested `json:"nested,omitempty" url:"nested,omitempty"` - } - - values, err := QueryValues(&example{}) - require.NoError(t, err) - assert.Equal(t, "required=", values.Encode()) - }) - - t.Run("allow multiple", func(t *testing.T) { - type example struct { - Values []string `json:"values" url:"values"` - } - - values, err := QueryValues( - &example{ - Values: []string{"foo", "bar", "baz"}, - }, - ) - require.NoError(t, err) - assert.Equal(t, "values=foo&values=bar&values=baz", values.Encode()) - }) - - t.Run("nested object", func(t *testing.T) { - type nested struct { - Value *string `json:"value,omitempty" url:"value,omitempty"` - } - type example struct { - Required string `json:"required" url:"required"` - Nested *nested `json:"nested,omitempty" url:"nested,omitempty"` - } - - nestedValue := "nestedValue" - values, err := QueryValues( - &example{ - Required: "requiredValue", - Nested: &nested{ - Value: &nestedValue, - }, - }, - ) - require.NoError(t, err) - assert.Equal(t, "nested%5Bvalue%5D=nestedValue&required=requiredValue", values.Encode()) - }) - - t.Run("url unspecified", func(t *testing.T) { - type example struct { - Required string `json:"required" url:"required"` - NotFound string `json:"notFound"` - } - - values, err := QueryValues( - &example{ - Required: "requiredValue", - NotFound: "notFound", - }, - ) - require.NoError(t, err) - assert.Equal(t, "required=requiredValue", values.Encode()) - }) - - t.Run("url ignored", func(t *testing.T) { - type example struct { - Required string `json:"required" url:"required"` - NotFound string `json:"notFound" url:"-"` - } - - values, err := QueryValues( - &example{ - Required: "requiredValue", - NotFound: "notFound", - }, - ) - require.NoError(t, err) - assert.Equal(t, "required=requiredValue", values.Encode()) - }) - - t.Run("datetime", func(t *testing.T) { - type example struct { - DateTime time.Time `json:"dateTime" url:"dateTime"` - } - - values, err := QueryValues( - &example{ - DateTime: time.Date(1994, 3, 16, 12, 34, 56, 0, time.UTC), - }, - ) - require.NoError(t, err) - assert.Equal(t, "dateTime=1994-03-16T12%3A34%3A56Z", values.Encode()) - }) - - t.Run("date", func(t *testing.T) { - type example struct { - Date time.Time `json:"date" url:"date" format:"date"` - } - - values, err := QueryValues( - &example{ - Date: time.Date(1994, 3, 16, 12, 34, 56, 0, time.UTC), - }, - ) - require.NoError(t, err) - assert.Equal(t, "date=1994-03-16", values.Encode()) - }) - - t.Run("optional time", func(t *testing.T) { - type example struct { - Date *time.Time `json:"date,omitempty" url:"date,omitempty" format:"date"` - } - - values, err := QueryValues( - &example{}, - ) - require.NoError(t, err) - assert.Empty(t, values.Encode()) - }) - - t.Run("omitempty with non-pointer zero value", func(t *testing.T) { - type enum string - - type example struct { - Enum enum `json:"enum,omitempty" url:"enum,omitempty"` - } - - values, err := QueryValues( - &example{}, - ) - require.NoError(t, err) - assert.Empty(t, values.Encode()) - }) - - t.Run("object array", func(t *testing.T) { - type object struct { - Key string `json:"key" url:"key"` - Value string `json:"value" url:"value"` - } - type example struct { - Objects []*object `json:"objects,omitempty" url:"objects,omitempty"` - } - - values, err := QueryValues( - &example{ - Objects: []*object{ - { - Key: "hello", - Value: "world", - }, - { - Key: "foo", - Value: "bar", - }, - }, - }, - ) - require.NoError(t, err) - assert.Equal(t, "objects%5Bkey%5D=hello&objects%5Bkey%5D=foo&objects%5Bvalue%5D=world&objects%5Bvalue%5D=bar", values.Encode()) - }) -} diff --git a/seed/go-sdk/inline-types/internal/retrier.go b/seed/go-sdk/inline-types/internal/retrier.go deleted file mode 100644 index 6040147154b..00000000000 --- a/seed/go-sdk/inline-types/internal/retrier.go +++ /dev/null @@ -1,165 +0,0 @@ -package internal - -import ( - "crypto/rand" - "math/big" - "net/http" - "time" -) - -const ( - defaultRetryAttempts = 2 - minRetryDelay = 500 * time.Millisecond - maxRetryDelay = 5000 * time.Millisecond -) - -// RetryOption adapts the behavior the *Retrier. -type RetryOption func(*retryOptions) - -// RetryFunc is a retriable HTTP function call (i.e. *http.Client.Do). -type RetryFunc func(*http.Request) (*http.Response, error) - -// WithMaxAttempts configures the maximum number of attempts -// of the *Retrier. -func WithMaxAttempts(attempts uint) RetryOption { - return func(opts *retryOptions) { - opts.attempts = attempts - } -} - -// Retrier retries failed requests a configurable number of times with an -// exponential back-off between each retry. -type Retrier struct { - attempts uint -} - -// NewRetrier constructs a new *Retrier with the given options, if any. -func NewRetrier(opts ...RetryOption) *Retrier { - options := new(retryOptions) - for _, opt := range opts { - opt(options) - } - attempts := uint(defaultRetryAttempts) - if options.attempts > 0 { - attempts = options.attempts - } - return &Retrier{ - attempts: attempts, - } -} - -// Run issues the request and, upon failure, retries the request if possible. -// -// The request will be retried as long as the request is deemed retriable and the -// number of retry attempts has not grown larger than the configured retry limit. -func (r *Retrier) Run( - fn RetryFunc, - request *http.Request, - errorDecoder ErrorDecoder, - opts ...RetryOption, -) (*http.Response, error) { - options := new(retryOptions) - for _, opt := range opts { - opt(options) - } - maxRetryAttempts := r.attempts - if options.attempts > 0 { - maxRetryAttempts = options.attempts - } - var ( - retryAttempt uint - previousError error - ) - return r.run( - fn, - request, - errorDecoder, - maxRetryAttempts, - retryAttempt, - previousError, - ) -} - -func (r *Retrier) run( - fn RetryFunc, - request *http.Request, - errorDecoder ErrorDecoder, - maxRetryAttempts uint, - retryAttempt uint, - previousError error, -) (*http.Response, error) { - if retryAttempt >= maxRetryAttempts { - return nil, previousError - } - - // If the call has been cancelled, don't issue the request. - if err := request.Context().Err(); err != nil { - return nil, err - } - - response, err := fn(request) - if err != nil { - return nil, err - } - - if r.shouldRetry(response) { - defer response.Body.Close() - - delay, err := r.retryDelay(retryAttempt) - if err != nil { - return nil, err - } - - time.Sleep(delay) - - return r.run( - fn, - request, - errorDecoder, - maxRetryAttempts, - retryAttempt+1, - decodeError(response, errorDecoder), - ) - } - - return response, nil -} - -// shouldRetry returns true if the request should be retried based on the given -// response status code. -func (r *Retrier) shouldRetry(response *http.Response) bool { - return response.StatusCode == http.StatusTooManyRequests || - response.StatusCode == http.StatusRequestTimeout || - response.StatusCode >= http.StatusInternalServerError -} - -// retryDelay calculates the delay time in milliseconds based on the retry attempt. -func (r *Retrier) retryDelay(retryAttempt uint) (time.Duration, error) { - // Apply exponential backoff. - delay := minRetryDelay + minRetryDelay*time.Duration(retryAttempt*retryAttempt) - - // Do not allow the number to exceed maxRetryDelay. - if delay > maxRetryDelay { - delay = maxRetryDelay - } - - // Apply some itter by randomizing the value in the range of 75%-100%. - max := big.NewInt(int64(delay / 4)) - jitter, err := rand.Int(rand.Reader, max) - if err != nil { - return 0, err - } - - delay -= time.Duration(jitter.Int64()) - - // Never sleep less than the base sleep seconds. - if delay < minRetryDelay { - delay = minRetryDelay - } - - return delay, nil -} - -type retryOptions struct { - attempts uint -} diff --git a/seed/go-sdk/inline-types/internal/retrier_test.go b/seed/go-sdk/inline-types/internal/retrier_test.go deleted file mode 100644 index 750180114ce..00000000000 --- a/seed/go-sdk/inline-types/internal/retrier_test.go +++ /dev/null @@ -1,211 +0,0 @@ -package internal - -import ( - "context" - "encoding/json" - "io" - "net/http" - "net/http/httptest" - "testing" - "time" - - "github.com/inline-types/fern/core" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -type RetryTestCase struct { - description string - - giveAttempts uint - giveStatusCodes []int - giveResponse *Response - - wantResponse *Response - wantError *core.APIError -} - -func TestRetrier(t *testing.T) { - tests := []*RetryTestCase{ - { - description: "retry request succeeds after multiple failures", - giveAttempts: 3, - giveStatusCodes: []int{ - http.StatusServiceUnavailable, - http.StatusServiceUnavailable, - http.StatusOK, - }, - giveResponse: &Response{ - Id: "1", - }, - wantResponse: &Response{ - Id: "1", - }, - }, - { - description: "retry request fails if MaxAttempts is exceeded", - giveAttempts: 3, - giveStatusCodes: []int{ - http.StatusRequestTimeout, - http.StatusRequestTimeout, - http.StatusRequestTimeout, - http.StatusOK, - }, - wantError: &core.APIError{ - StatusCode: http.StatusRequestTimeout, - }, - }, - { - description: "retry durations increase exponentially and stay within the min and max delay values", - giveAttempts: 4, - giveStatusCodes: []int{ - http.StatusServiceUnavailable, - http.StatusServiceUnavailable, - http.StatusServiceUnavailable, - http.StatusOK, - }, - }, - { - description: "retry does not occur on status code 404", - giveAttempts: 2, - giveStatusCodes: []int{http.StatusNotFound, http.StatusOK}, - wantError: &core.APIError{ - StatusCode: http.StatusNotFound, - }, - }, - { - description: "retries occur on status code 429", - giveAttempts: 2, - giveStatusCodes: []int{http.StatusTooManyRequests, http.StatusOK}, - }, - { - description: "retries occur on status code 408", - giveAttempts: 2, - giveStatusCodes: []int{http.StatusRequestTimeout, http.StatusOK}, - }, - { - description: "retries occur on status code 500", - giveAttempts: 2, - giveStatusCodes: []int{http.StatusInternalServerError, http.StatusOK}, - }, - } - - for _, tc := range tests { - t.Run(tc.description, func(t *testing.T) { - var ( - test = tc - server = newTestRetryServer(t, test) - client = server.Client() - ) - - t.Parallel() - - caller := NewCaller( - &CallerParams{ - Client: client, - }, - ) - - var response *Response - err := caller.Call( - context.Background(), - &CallParams{ - URL: server.URL, - Method: http.MethodGet, - Request: &Request{}, - Response: &response, - MaxAttempts: test.giveAttempts, - ResponseIsOptional: true, - }, - ) - - if test.wantError != nil { - require.IsType(t, err, &core.APIError{}) - expectedErrorCode := test.wantError.StatusCode - actualErrorCode := err.(*core.APIError).StatusCode - assert.Equal(t, expectedErrorCode, actualErrorCode) - return - } - - require.NoError(t, err) - assert.Equal(t, test.wantResponse, response) - }) - } -} - -// newTestRetryServer returns a new *httptest.Server configured with the -// given test parameters, suitable for testing retries. -func newTestRetryServer(t *testing.T, tc *RetryTestCase) *httptest.Server { - var index int - timestamps := make([]time.Time, 0, len(tc.giveStatusCodes)) - - return httptest.NewServer( - http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) { - timestamps = append(timestamps, time.Now()) - if index > 0 && index < len(expectedRetryDurations) { - // Ensure that the duration between retries increases exponentially, - // and that it is within the minimum and maximum retry delay values. - actualDuration := timestamps[index].Sub(timestamps[index-1]) - expectedDurationMin := expectedRetryDurations[index-1] * 75 / 100 - expectedDurationMax := expectedRetryDurations[index-1] * 125 / 100 - assert.True( - t, - actualDuration >= expectedDurationMin && actualDuration <= expectedDurationMax, - "expected duration to be in range [%v, %v], got %v", - expectedDurationMin, - expectedDurationMax, - actualDuration, - ) - assert.LessOrEqual( - t, - actualDuration, - maxRetryDelay, - "expected duration to be less than the maxRetryDelay (%v), got %v", - maxRetryDelay, - actualDuration, - ) - assert.GreaterOrEqual( - t, - actualDuration, - minRetryDelay, - "expected duration to be greater than the minRetryDelay (%v), got %v", - minRetryDelay, - actualDuration, - ) - } - - request := new(Request) - bytes, err := io.ReadAll(r.Body) - require.NoError(t, err) - require.NoError(t, json.Unmarshal(bytes, request)) - require.LessOrEqual(t, index, len(tc.giveStatusCodes)) - - statusCode := tc.giveStatusCodes[index] - w.WriteHeader(statusCode) - - if tc.giveResponse != nil && statusCode == http.StatusOK { - bytes, err = json.Marshal(tc.giveResponse) - require.NoError(t, err) - _, err = w.Write(bytes) - require.NoError(t, err) - } - - index++ - }, - ), - ) -} - -// expectedRetryDurations holds an array of calculated retry durations, -// where the index of the array should correspond to the retry attempt. -// -// Values are calculated based off of `minRetryDelay + minRetryDelay*i*i`, with -// a max and min value of 5000ms and 500ms respectively. -var expectedRetryDurations = []time.Duration{ - 500 * time.Millisecond, - 1000 * time.Millisecond, - 2500 * time.Millisecond, - 5000 * time.Millisecond, - 5000 * time.Millisecond, -} diff --git a/seed/go-sdk/inline-types/internal/stringer.go b/seed/go-sdk/inline-types/internal/stringer.go deleted file mode 100644 index 312801851e0..00000000000 --- a/seed/go-sdk/inline-types/internal/stringer.go +++ /dev/null @@ -1,13 +0,0 @@ -package internal - -import "encoding/json" - -// StringifyJSON returns a pretty JSON string representation of -// the given value. -func StringifyJSON(value interface{}) (string, error) { - bytes, err := json.MarshalIndent(value, "", " ") - if err != nil { - return "", err - } - return string(bytes), nil -} diff --git a/seed/go-sdk/inline-types/internal/time.go b/seed/go-sdk/inline-types/internal/time.go deleted file mode 100644 index ab0e269fade..00000000000 --- a/seed/go-sdk/inline-types/internal/time.go +++ /dev/null @@ -1,137 +0,0 @@ -package internal - -import ( - "encoding/json" - "time" -) - -const dateFormat = "2006-01-02" - -// DateTime wraps time.Time and adapts its JSON representation -// to conform to a RFC3339 date (e.g. 2006-01-02). -// -// Ref: https://ijmacd.github.io/rfc3339-iso8601 -type Date struct { - t *time.Time -} - -// NewDate returns a new *Date. If the given time.Time -// is nil, nil will be returned. -func NewDate(t time.Time) *Date { - return &Date{t: &t} -} - -// NewOptionalDate returns a new *Date. If the given time.Time -// is nil, nil will be returned. -func NewOptionalDate(t *time.Time) *Date { - if t == nil { - return nil - } - return &Date{t: t} -} - -// Time returns the Date's underlying time, if any. If the -// date is nil, the zero value is returned. -func (d *Date) Time() time.Time { - if d == nil || d.t == nil { - return time.Time{} - } - return *d.t -} - -// TimePtr returns a pointer to the Date's underlying time.Time, if any. -func (d *Date) TimePtr() *time.Time { - if d == nil || d.t == nil { - return nil - } - if d.t.IsZero() { - return nil - } - return d.t -} - -func (d *Date) MarshalJSON() ([]byte, error) { - if d == nil || d.t == nil { - return nil, nil - } - return json.Marshal(d.t.Format(dateFormat)) -} - -func (d *Date) UnmarshalJSON(data []byte) error { - var raw string - if err := json.Unmarshal(data, &raw); err != nil { - return err - } - - parsedTime, err := time.Parse(dateFormat, raw) - if err != nil { - return err - } - - *d = Date{t: &parsedTime} - return nil -} - -// DateTime wraps time.Time and adapts its JSON representation -// to conform to a RFC3339 date-time (e.g. 2017-07-21T17:32:28Z). -// -// Ref: https://ijmacd.github.io/rfc3339-iso8601 -type DateTime struct { - t *time.Time -} - -// NewDateTime returns a new *DateTime. -func NewDateTime(t time.Time) *DateTime { - return &DateTime{t: &t} -} - -// NewOptionalDateTime returns a new *DateTime. If the given time.Time -// is nil, nil will be returned. -func NewOptionalDateTime(t *time.Time) *DateTime { - if t == nil { - return nil - } - return &DateTime{t: t} -} - -// Time returns the DateTime's underlying time, if any. If the -// date-time is nil, the zero value is returned. -func (d *DateTime) Time() time.Time { - if d == nil || d.t == nil { - return time.Time{} - } - return *d.t -} - -// TimePtr returns a pointer to the DateTime's underlying time.Time, if any. -func (d *DateTime) TimePtr() *time.Time { - if d == nil || d.t == nil { - return nil - } - if d.t.IsZero() { - return nil - } - return d.t -} - -func (d *DateTime) MarshalJSON() ([]byte, error) { - if d == nil || d.t == nil { - return nil, nil - } - return json.Marshal(d.t.Format(time.RFC3339)) -} - -func (d *DateTime) UnmarshalJSON(data []byte) error { - var raw string - if err := json.Unmarshal(data, &raw); err != nil { - return err - } - - parsedTime, err := time.Parse(time.RFC3339, raw) - if err != nil { - return err - } - - *d = DateTime{t: &parsedTime} - return nil -} diff --git a/seed/go-sdk/inline-types/option/request_option.go b/seed/go-sdk/inline-types/option/request_option.go deleted file mode 100644 index b9c9cd68f5e..00000000000 --- a/seed/go-sdk/inline-types/option/request_option.go +++ /dev/null @@ -1,64 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package option - -import ( - core "github.com/inline-types/fern/core" - http "net/http" - url "net/url" -) - -// RequestOption adapts the behavior of an indivdual request. -type RequestOption = core.RequestOption - -// WithBaseURL sets the base URL, overriding the default -// environment, if any. -func WithBaseURL(baseURL string) *core.BaseURLOption { - return &core.BaseURLOption{ - BaseURL: baseURL, - } -} - -// WithHTTPClient uses the given HTTPClient to issue the request. -func WithHTTPClient(httpClient core.HTTPClient) *core.HTTPClientOption { - return &core.HTTPClientOption{ - HTTPClient: httpClient, - } -} - -// WithHTTPHeader adds the given http.Header to the request. -func WithHTTPHeader(httpHeader http.Header) *core.HTTPHeaderOption { - return &core.HTTPHeaderOption{ - // Clone the headers so they can't be modified after the option call. - HTTPHeader: httpHeader.Clone(), - } -} - -// WithBodyProperties adds the given body properties to the request. -func WithBodyProperties(bodyProperties map[string]interface{}) *core.BodyPropertiesOption { - copiedBodyProperties := make(map[string]interface{}, len(bodyProperties)) - for key, value := range bodyProperties { - copiedBodyProperties[key] = value - } - return &core.BodyPropertiesOption{ - BodyProperties: copiedBodyProperties, - } -} - -// WithQueryParameters adds the given query parameters to the request. -func WithQueryParameters(queryParameters url.Values) *core.QueryParametersOption { - copiedQueryParameters := make(url.Values, len(queryParameters)) - for key, values := range queryParameters { - copiedQueryParameters[key] = values - } - return &core.QueryParametersOption{ - QueryParameters: copiedQueryParameters, - } -} - -// WithMaxAttempts configures the maximum number of retry attempts. -func WithMaxAttempts(attempts uint) *core.MaxAttemptsOption { - return &core.MaxAttemptsOption{ - MaxAttempts: attempts, - } -} diff --git a/seed/go-sdk/inline-types/pointer.go b/seed/go-sdk/inline-types/pointer.go deleted file mode 100644 index d7fa5bf11bb..00000000000 --- a/seed/go-sdk/inline-types/pointer.go +++ /dev/null @@ -1,132 +0,0 @@ -package object - -import ( - "time" - - "github.com/google/uuid" -) - -// Bool returns a pointer to the given bool value. -func Bool(b bool) *bool { - return &b -} - -// Byte returns a pointer to the given byte value. -func Byte(b byte) *byte { - return &b -} - -// Complex64 returns a pointer to the given complex64 value. -func Complex64(c complex64) *complex64 { - return &c -} - -// Complex128 returns a pointer to the given complex128 value. -func Complex128(c complex128) *complex128 { - return &c -} - -// Float32 returns a pointer to the given float32 value. -func Float32(f float32) *float32 { - return &f -} - -// Float64 returns a pointer to the given float64 value. -func Float64(f float64) *float64 { - return &f -} - -// Int returns a pointer to the given int value. -func Int(i int) *int { - return &i -} - -// Int8 returns a pointer to the given int8 value. -func Int8(i int8) *int8 { - return &i -} - -// Int16 returns a pointer to the given int16 value. -func Int16(i int16) *int16 { - return &i -} - -// Int32 returns a pointer to the given int32 value. -func Int32(i int32) *int32 { - return &i -} - -// Int64 returns a pointer to the given int64 value. -func Int64(i int64) *int64 { - return &i -} - -// Rune returns a pointer to the given rune value. -func Rune(r rune) *rune { - return &r -} - -// String returns a pointer to the given string value. -func String(s string) *string { - return &s -} - -// Uint returns a pointer to the given uint value. -func Uint(u uint) *uint { - return &u -} - -// Uint8 returns a pointer to the given uint8 value. -func Uint8(u uint8) *uint8 { - return &u -} - -// Uint16 returns a pointer to the given uint16 value. -func Uint16(u uint16) *uint16 { - return &u -} - -// Uint32 returns a pointer to the given uint32 value. -func Uint32(u uint32) *uint32 { - return &u -} - -// Uint64 returns a pointer to the given uint64 value. -func Uint64(u uint64) *uint64 { - return &u -} - -// Uintptr returns a pointer to the given uintptr value. -func Uintptr(u uintptr) *uintptr { - return &u -} - -// UUID returns a pointer to the given uuid.UUID value. -func UUID(u uuid.UUID) *uuid.UUID { - return &u -} - -// Time returns a pointer to the given time.Time value. -func Time(t time.Time) *time.Time { - return &t -} - -// MustParseDate attempts to parse the given string as a -// date time.Time, and panics upon failure. -func MustParseDate(date string) time.Time { - t, err := time.Parse("2006-01-02", date) - if err != nil { - panic(err) - } - return t -} - -// MustParseDateTime attempts to parse the given string as a -// datetime time.Time, and panics upon failure. -func MustParseDateTime(datetime string) time.Time { - t, err := time.Parse(time.RFC3339, datetime) - if err != nil { - panic(err) - } - return t -} diff --git a/seed/go-sdk/inline-types/snippet-templates.json b/seed/go-sdk/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/go-sdk/inline-types/snippet.json b/seed/go-sdk/inline-types/snippet.json deleted file mode 100644 index a8b1cd64cf3..00000000000 --- a/seed/go-sdk/inline-types/snippet.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "endpoints": [ - { - "id": { - "path": "/root/root", - "method": "POST", - "identifier_override": "endpoint_.getRoot" - }, - "snippet": { - "type": "go", - "client": "import (\n\tcontext \"context\"\n\tfern \"github.com/inline-types/fern\"\n\tfernclient \"github.com/inline-types/fern/client\"\n)\n\nclient := fernclient.NewClient()\nresponse, err := client.GetRoot(\n\tcontext.TODO(),\n\t\u0026fern.PostRootRequest{\n\t\tBar: \u0026fern.InlineType1{\n\t\t\tFoo: \"foo\",\n\t\t\tBar: \u0026fern.NestedInlineType1{\n\t\t\t\tFoo: \"foo\",\n\t\t\t\tBar: \"bar\",\n\t\t\t\tMyEnum: fern.InlineEnumSunny,\n\t\t\t},\n\t\t},\n\t\tFoo: \"foo\",\n\t},\n)\n" - } - } - ] -} \ No newline at end of file diff --git a/seed/go-sdk/inline-types/types.go b/seed/go-sdk/inline-types/types.go deleted file mode 100644 index e5314b8bcc1..00000000000 --- a/seed/go-sdk/inline-types/types.go +++ /dev/null @@ -1,418 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -package object - -import ( - json "encoding/json" - fmt "fmt" - internal "github.com/inline-types/fern/internal" -) - -type PostRootRequest struct { - Bar *InlineType1 `json:"bar,omitempty" url:"-"` - Foo string `json:"foo" url:"-"` -} - -type InlineEnum string - -const ( - InlineEnumSunny InlineEnum = "SUNNY" - InlineEnumCloudy InlineEnum = "CLOUDY" - InlineEnumRaining InlineEnum = "RAINING" - InlineEnumSnowing InlineEnum = "SNOWING" -) - -func NewInlineEnumFromString(s string) (InlineEnum, error) { - switch s { - case "SUNNY": - return InlineEnumSunny, nil - case "CLOUDY": - return InlineEnumCloudy, nil - case "RAINING": - return InlineEnumRaining, nil - case "SNOWING": - return InlineEnumSnowing, nil - } - var t InlineEnum - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (i InlineEnum) Ptr() *InlineEnum { - return &i -} - -type InlineType1 struct { - Foo string `json:"foo" url:"foo"` - Bar *NestedInlineType1 `json:"bar,omitempty" url:"bar,omitempty"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (i *InlineType1) GetFoo() string { - if i == nil { - return "" - } - return i.Foo -} - -func (i *InlineType1) GetBar() *NestedInlineType1 { - if i == nil { - return nil - } - return i.Bar -} - -func (i *InlineType1) GetExtraProperties() map[string]interface{} { - return i.extraProperties -} - -func (i *InlineType1) UnmarshalJSON(data []byte) error { - type unmarshaler InlineType1 - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *i = InlineType1(value) - extraProperties, err := internal.ExtractExtraProperties(data, *i) - if err != nil { - return err - } - i.extraProperties = extraProperties - i.rawJSON = json.RawMessage(data) - return nil -} - -func (i *InlineType1) String() string { - if len(i.rawJSON) > 0 { - if value, err := internal.StringifyJSON(i.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(i); err == nil { - return value - } - return fmt.Sprintf("%#v", i) -} - -type InlineType2 struct { - Baz string `json:"baz" url:"baz"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (i *InlineType2) GetBaz() string { - if i == nil { - return "" - } - return i.Baz -} - -func (i *InlineType2) GetExtraProperties() map[string]interface{} { - return i.extraProperties -} - -func (i *InlineType2) UnmarshalJSON(data []byte) error { - type unmarshaler InlineType2 - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *i = InlineType2(value) - extraProperties, err := internal.ExtractExtraProperties(data, *i) - if err != nil { - return err - } - i.extraProperties = extraProperties - i.rawJSON = json.RawMessage(data) - return nil -} - -func (i *InlineType2) String() string { - if len(i.rawJSON) > 0 { - if value, err := internal.StringifyJSON(i.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(i); err == nil { - return value - } - return fmt.Sprintf("%#v", i) -} - -type InlinedDiscriminatedUnion1 struct { - Type string - Type1 *InlineType1 - Type2 *InlineType2 -} - -func NewInlinedDiscriminatedUnion1FromType1(value *InlineType1) *InlinedDiscriminatedUnion1 { - return &InlinedDiscriminatedUnion1{Type: "type1", Type1: value} -} - -func NewInlinedDiscriminatedUnion1FromType2(value *InlineType2) *InlinedDiscriminatedUnion1 { - return &InlinedDiscriminatedUnion1{Type: "type2", Type2: value} -} - -func (i *InlinedDiscriminatedUnion1) GetType() string { - if i == nil { - return "" - } - return i.Type -} - -func (i *InlinedDiscriminatedUnion1) GetType1() *InlineType1 { - if i == nil { - return nil - } - return i.Type1 -} - -func (i *InlinedDiscriminatedUnion1) GetType2() *InlineType2 { - if i == nil { - return nil - } - return i.Type2 -} - -func (i *InlinedDiscriminatedUnion1) UnmarshalJSON(data []byte) error { - var unmarshaler struct { - Type string `json:"type"` - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - i.Type = unmarshaler.Type - if unmarshaler.Type == "" { - return fmt.Errorf("%T did not include discriminant type", i) - } - switch unmarshaler.Type { - case "type1": - value := new(InlineType1) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - i.Type1 = value - case "type2": - value := new(InlineType2) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - i.Type2 = value - } - return nil -} - -func (i InlinedDiscriminatedUnion1) MarshalJSON() ([]byte, error) { - switch i.Type { - default: - return nil, fmt.Errorf("invalid type %s in %T", i.Type, i) - case "type1": - return internal.MarshalJSONWithExtraProperty(i.Type1, "type", "type1") - case "type2": - return internal.MarshalJSONWithExtraProperty(i.Type2, "type", "type2") - } -} - -type InlinedDiscriminatedUnion1Visitor interface { - VisitType1(*InlineType1) error - VisitType2(*InlineType2) error -} - -func (i *InlinedDiscriminatedUnion1) Accept(visitor InlinedDiscriminatedUnion1Visitor) error { - switch i.Type { - default: - return fmt.Errorf("invalid type %s in %T", i.Type, i) - case "type1": - return visitor.VisitType1(i.Type1) - case "type2": - return visitor.VisitType2(i.Type2) - } -} - -type InlinedUndiscriminatedUnion1 struct { - InlineType1 *InlineType1 - InlineType2 *InlineType2 - - typ string -} - -func NewInlinedUndiscriminatedUnion1FromInlineType1(value *InlineType1) *InlinedUndiscriminatedUnion1 { - return &InlinedUndiscriminatedUnion1{typ: "InlineType1", InlineType1: value} -} - -func NewInlinedUndiscriminatedUnion1FromInlineType2(value *InlineType2) *InlinedUndiscriminatedUnion1 { - return &InlinedUndiscriminatedUnion1{typ: "InlineType2", InlineType2: value} -} - -func (i *InlinedUndiscriminatedUnion1) GetInlineType1() *InlineType1 { - if i == nil { - return nil - } - return i.InlineType1 -} - -func (i *InlinedUndiscriminatedUnion1) GetInlineType2() *InlineType2 { - if i == nil { - return nil - } - return i.InlineType2 -} - -func (i *InlinedUndiscriminatedUnion1) UnmarshalJSON(data []byte) error { - valueInlineType1 := new(InlineType1) - if err := json.Unmarshal(data, &valueInlineType1); err == nil { - i.typ = "InlineType1" - i.InlineType1 = valueInlineType1 - return nil - } - valueInlineType2 := new(InlineType2) - if err := json.Unmarshal(data, &valueInlineType2); err == nil { - i.typ = "InlineType2" - i.InlineType2 = valueInlineType2 - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, i) -} - -func (i InlinedUndiscriminatedUnion1) MarshalJSON() ([]byte, error) { - if i.typ == "InlineType1" || i.InlineType1 != nil { - return json.Marshal(i.InlineType1) - } - if i.typ == "InlineType2" || i.InlineType2 != nil { - return json.Marshal(i.InlineType2) - } - return nil, fmt.Errorf("type %T does not include a non-empty union type", i) -} - -type InlinedUndiscriminatedUnion1Visitor interface { - VisitInlineType1(*InlineType1) error - VisitInlineType2(*InlineType2) error -} - -func (i *InlinedUndiscriminatedUnion1) Accept(visitor InlinedUndiscriminatedUnion1Visitor) error { - if i.typ == "InlineType1" || i.InlineType1 != nil { - return visitor.VisitInlineType1(i.InlineType1) - } - if i.typ == "InlineType2" || i.InlineType2 != nil { - return visitor.VisitInlineType2(i.InlineType2) - } - return fmt.Errorf("type %T does not include a non-empty union type", i) -} - -type NestedInlineType1 struct { - Foo string `json:"foo" url:"foo"` - Bar string `json:"bar" url:"bar"` - MyEnum InlineEnum `json:"myEnum" url:"myEnum"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (n *NestedInlineType1) GetFoo() string { - if n == nil { - return "" - } - return n.Foo -} - -func (n *NestedInlineType1) GetBar() string { - if n == nil { - return "" - } - return n.Bar -} - -func (n *NestedInlineType1) GetMyEnum() InlineEnum { - if n == nil { - return "" - } - return n.MyEnum -} - -func (n *NestedInlineType1) GetExtraProperties() map[string]interface{} { - return n.extraProperties -} - -func (n *NestedInlineType1) UnmarshalJSON(data []byte) error { - type unmarshaler NestedInlineType1 - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *n = NestedInlineType1(value) - extraProperties, err := internal.ExtractExtraProperties(data, *n) - if err != nil { - return err - } - n.extraProperties = extraProperties - n.rawJSON = json.RawMessage(data) - return nil -} - -func (n *NestedInlineType1) String() string { - if len(n.rawJSON) > 0 { - if value, err := internal.StringifyJSON(n.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(n); err == nil { - return value - } - return fmt.Sprintf("%#v", n) -} - -type RootType1 struct { - Foo string `json:"foo" url:"foo"` - Bar *InlineType1 `json:"bar,omitempty" url:"bar,omitempty"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (r *RootType1) GetFoo() string { - if r == nil { - return "" - } - return r.Foo -} - -func (r *RootType1) GetBar() *InlineType1 { - if r == nil { - return nil - } - return r.Bar -} - -func (r *RootType1) GetExtraProperties() map[string]interface{} { - return r.extraProperties -} - -func (r *RootType1) UnmarshalJSON(data []byte) error { - type unmarshaler RootType1 - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *r = RootType1(value) - extraProperties, err := internal.ExtractExtraProperties(data, *r) - if err != nil { - return err - } - r.extraProperties = extraProperties - r.rawJSON = json.RawMessage(data) - return nil -} - -func (r *RootType1) String() string { - if len(r.rawJSON) > 0 { - if value, err := internal.StringifyJSON(r.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(r); err == nil { - return value - } - return fmt.Sprintf("%#v", r) -} diff --git a/seed/java-model/inline-types/.github/workflows/ci.yml b/seed/java-model/inline-types/.github/workflows/ci.yml deleted file mode 100644 index 9910fd269c2..00000000000 --- a/seed/java-model/inline-types/.github/workflows/ci.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: ci - -on: [push] - -jobs: - compile: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up Java - id: setup-jre - uses: actions/setup-java@v1 - with: - java-version: "11" - architecture: x64 - - - name: Compile - run: ./gradlew compileJava - - test: - needs: [ compile ] - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up Java - id: setup-jre - uses: actions/setup-java@v1 - with: - java-version: "11" - architecture: x64 - - - name: Test - run: ./gradlew test - publish: - needs: [ compile, test ] - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up Java - id: setup-jre - uses: actions/setup-java@v1 - with: - java-version: "11" - architecture: x64 - - - name: Publish to maven - run: | - ./gradlew publish - env: - MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - MAVEN_PUBLISH_REGISTRY_URL: "" diff --git a/seed/java-model/inline-types/.gitignore b/seed/java-model/inline-types/.gitignore deleted file mode 100644 index d4199abc2cd..00000000000 --- a/seed/java-model/inline-types/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -*.class -.project -.gradle -? -.classpath -.checkstyle -.settings -.node -build - -# IntelliJ -*.iml -*.ipr -*.iws -.idea/ -out/ - -# Eclipse/IntelliJ APT -generated_src/ -generated_testSrc/ -generated/ - -bin -build \ No newline at end of file diff --git a/seed/java-model/inline-types/.gradle/8.5/checksums/checksums.lock b/seed/java-model/inline-types/.gradle/8.5/checksums/checksums.lock deleted file mode 100644 index eae337d783f1821ce16c64670f5bd5710d199971..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17 UcmZQBIl8kkoYMjZi>)pY)PNnVizNCG4Qk^o77BtQ}%36KOx0we*F07-x(KoTGckOW8qBmt5D zNq{8q|B`?YSO^a;MsJ2P{X*~^MOlsoFJ^DIlYFu}V{j9`?e!A>|6oVOKTltcoNEWU zM;hk)b{3mIEvbJDx#$q)DUoyZlrL{}gxq^O=BcW`A6?$G^9AG*KIZb^Qx0QgvDT1# zUco%~Okz-(o%Vh-|9Z?%udH3>8g?!Ya<7CD{w`M2r2m^p$i-2ZpK+Hg+I(f~cr=d+ z=0%)T<4!xH=a9RrV_vf7L91lV-D1cka?Gz#Md3P)l5LPLX~g{I$F%aP-O(2ycMHS3 zW$NAIoVXqn$i2lQd_WvMzhuLG$lYx*e^fALV{OVUE}G{U<~`DjFT8TH(fr;oFn`N0 z+rB?4Mg@*vk~hL99&_@~6J(-!>PPri8@>Hz^~sQnTQTqFZ@Olk&E=zcgqXkoS98yt zn9g&MdzxYXVbvaqa@sv~97PqF56%0dW2)!iVL0C72Ij*FL0)R#$M1mLTOV_3mAP@b z>JbCT-8YW#!;xhfy|Qk|J^e9P>NwTy>{W|Crz8|}o!-=Q1LppEaJ*O-bE9vXYBpyl zKun1SF*mi+5D)J9M+tnx>k{VX=Wne}zbQ(Cd`URwR+GNWDz$y{6ms`!%&m7<6`35q z(E+(f{|JBkQSwCS@GInQj+oE)wl3l%IQpS^vN3lom(M*nPHKC-FjD=ie zg?WUgi%HwrI<)_nIAb2YXUJ^+Z~fYEy!Uy`@pp<+Er9Qlo+LmLAPJBJNCG4Qk^o77 zBtQ}%36KOx0we*F07-x(KoTGckOW8qBmt5DNq{6k5+DhX1V{oT0g?bofFwW?APJBJ zNCG4Qk^o77BtR1Q-vs7@AI!j)A^oMq@g_N?2WPl70z`fic(5T%egld8p>JV zyT#v)AH9yxsq}w8L2Xd`M4_sm02(zm(BK_s8wLU1AA~hk0XDjY7DjWXgS(IE8a36> z(53IzX4VKSnpW_5OL}MA>Vf7bnRlU4dk-4i)of$Or2L;uX3z8~zu28%z^w;&bkj9z zUqXYE%Qp6UCG`egw34^Zvn+`}csd6e1JK~*v5hvR-N$9qnoWK9;swjctGOfNH8jSk zvW={cuKCkD+fUdPZrht)9o+(rhxAC$)IoO4l^dRHJDbN(igH<0)f9c7elUYx$HNGE zJVj~IcUCj9$~#~@c|e~1A-61JwJ5n+hzxXdyv8ZE;a9EqDk$QM_$uECx<0=y1b1;O zYFwo&P*m(m&@pOA8N~*oH=7YO{ZCm+k&T-K#AZYu$!M{S0VW^|FoG>yJEZG5#&na*XlH^#R2W zs0O`a(6s$Q$5_W&u3G1~*Sns5elLkXY;mX^8R$8PaUa=+JX|+_xOBsHKYsg)x#L&v zgGK|ov)+e(5`$60-f?gLtAME2zU?>07woTCfQ)D`5;QG3Glr4qeSVTttLYQh!GP0O zO_RU~`gk;;UGh17o-hoTduyY3GexpOohaRkdhsP>bkh|mYDEm_7{;{^ng{bkE^c$R zvN>QO5b7!nIR`!YU{K38CZDXxL!zXg9g_Kj0A1fD$p@%_#F+m5AbCLycU9Np*%?(+6`%>`4h{E^*8e>Me`aJKM7?~>VQRgh>7q>psZ$d^nG_2LwHKNvR@O2Rd z_f47kebB9SC%}poHNv1Vy@qX6y^U+GYCit8jnR}W{h$o6k7z@E95nps=YAMj4LMKw zclGX)r$>^9dpoYonTKlp7aEhj*+xKLv*?jjt)iy&&bt`X`@zU~0*%?%*v164RkgNe zvZvzw>bREB2ynqytm8k>(5Lq><5NA)KA^u`^0?2|DJyNBSz<3T=;HvI)+f+049*1I z+eXV@?G(SLt4I$M97M)8g+NWJVjCKL6+=H}<=3?d8ss1u??pTx1^dg z=YC0B+?0Gc$#pX_wm^eB%JoY9t1T^|+&lcclVxg!Zz{pLr&u{M1f%Q{9Yfcj@2dwE zSQ%cDDEs$--K{u+4`2cp z;vLX2j05g`Ub^8X;ktE|8$Oe6e*bra>%cayri=V`J9($o=$zEMonD0YE-xL71Z`pg z=omFBbTkD{s)r&UnMpg8p7(*zulQ8-kps>2I_Mb2<-SE8LhX%Dv|QuuZ+H0OTR diff --git a/seed/java-model/inline-types/.gradle/8.5/checksums/sha1-checksums.bin b/seed/java-model/inline-types/.gradle/8.5/checksums/sha1-checksums.bin deleted file mode 100644 index 041b1c83303e327fe5bcf9f15db3cfe27939a0f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23627 zcmeI4c{EjBAIC36T$wXdC_^DhN&_O(CDS!unVKGrijq_)x~2?~5YbgpJsQl_BS}#y zA&SgXnR-exKBo7ayU+Hn_uk%rtk(O-yUt$AS$BQh&-v~BJ!kK8tjUtHLG z)xI(KGvE#ZkjJG?a0{+TDgoT=C*%ndS1w<4b$<%DVP6)HYmhaE3F7092i>N4@}*q#i&@Aw?@5`)P+=R+*7 z0Jn{Ryi~F^E0#587;s}<$e)ktXS`bSYyse=G|0=O4(wjm*uMsFGb_knmUcmA8ejo60m z=Pu+meS}_(&~qtRT`kDpbNbr{ZKBx$PEm!tUQzKzl&97vz{!=6x5TMWlK01?0`4#{ z$FEfh4_+o)Q5uUSvTRnxmtHjqVDZ@7ka7zQozeLrp3icSY0o;5gvzBp7vYG)mafbYdm}9f&^e8XjcDo=ScDlZC8A0j|;G`drk1Wbl zlDRV|1Ne6CInGmfHjiLifqh>L^3k`v-!^^^&jH+?4f20nBCJ^BDzW}=zYqBoQLX*H z%kXCKeM$}F)5U2bZlMeI0&eyM@|mOUq{kw8ae!O)Kt3C?%Z%+b^&H?fxsVenwLX>` zgO332C(B+ZaKv;#gY9+qUIz zz)kBRS1rhGswGW20B-FG`5H5anVdsE1OPX8g?#lyaAlFWlxJeyIQw7}O6XZJ5jrnX`qyoV0 zsvy_X`z&@{Nhua^TU*HW-?dD>(dERhFZP*`8_0;TEb`8O48Cu@agJ{a@?|%(QNZ@I z406)Zu;#0L=a&Ia`U`T4QgL;k9*#c1OW2Dl|JyRJ6wkjr%78V4!=>f=n_zdLRvp-e??jQ*H>BywY zEssCQ15P>*`I*>r)ai7Ea==X#APNz(Z&xFI;zJa$!$)QZnmCmAx-2(0+zVA zYn9kj>8$8e&})B(bs@;@pq7pkA6uE&O`hXwgP&exJOj0Au_v&J8O*ijXVt6o%7yt! z`%U<%g&x@ZCcEtPG2|&xbX>LA)7v8G)3XfYnxDm0bJ<$S=tuk)ago%_;=L8-P67>} zR$V1h18E$t$cCX-@Rer~QV*<6@|4E)u6?i3e^f2?5wj2*ZBl{AhQX@X6L)0R=$5E{ zpU3QrYL=l7`}mO>=(y?zP=`QRl#Xl|EZ5uhzG>T6u<6vaxmgZ(-Cmo}@fx#!(j@}> zLT2lS@gapcF4?IPlRHfG%2Np4t+4?r%TtsOxA7(F0C_LXMM)mcl zod(tiv z?e%mEcSt|Py7OYje#{C17Izl2mEDr(?B$st-Lx_+wBQWYX6lIFcg!jUR?wfn%PQ%V zC9%F+VLqi1rL=f=%8{IyC3plD0oiX%9G-GykWa4ei z!k(4qnPj#$b#esW)pE|ruJ|g})#`twMWucxX7!_$kT-&ckPSnv+A5yKO%Ao?fAQ1yY#sIhLxg6>|yOUM(-=y}+Hol$b= zoMsr;dKaq{zK^60OfxIX#OEf$hAvz33Npk{xz_PSfq_ky4A`0(*URxEOK=@$01 zI=XByj>|NwNAkJ!va7u!pjEqT3hL5qSx#_k#a5Ax<=gep*CS1@?ILfhv+IpAh1Rtvy{iPs_k;;aFK=#I~a`{hMoC3t<{x z=oagzL}ttSj};P&oeechdN=SXrq^5{{jKMRACnXQ(=2hoS#-dj}kC~h~! zXWg6LiJWoFa-r8^)4s`Uee2|)@P-*EWCcsG<>~El7wQbbR?)^dx+QRy#%u*kiT9YB zzVv%pm(Bjed7($M-%Di1qZu}RqFYLfT+mb)tm%-zh_%Y)H4U$4xtFheY9E(!37PqHiwrEO zU(_OUhnooVEvz~u*8gqd^$wqNjqb>|=@$0pl>l&zUzTS?<^O z^o($07WN(v$1ko9vdzoN27>o3jTzE9PkkFgiPHUq)S%bGEZ$$-+fZfLw1~?CDRMHM zg8EutE*TXYful_0I0MGT{tIiL&0usw)2&W!(Yw=zG54}OHRkh5P)lH7Xj7yfLiRX1<(%2(SXlGuY!z{4c z5G1RZE!nyhDmA&>TZ6Yev~gR0K#*luBxV(XT8l%OEu96FewKREdwyI^G3;C84a_Sx ztidc~d}xzGS8j%J4fy8En|@NRu(REGP+yPd`=;8jyqHx^mk8_GewXE*s;08R`;V#d z`h}$<$7goNDjk!@YIT5GYR{Q#g$<5p4vE_cxDY$WRv&D!%$E#7?z-sb#vrhknloFo z2U1hFmaf$p_tVeYmE>e}w;~c;iD;ZWz@nh54nrFAv*y>s`K2+xqddPes?e}QBB6rp zex-HkY}4^f>Tvup@=h?CJm-6mAvb!JV8}3+-?v_GyNe_3zI5tO0mqFdWyyw^h22MS zp?8-ImUDc?PYLm7-#4Ecx!T1Q#*0;HxG$?Odw1$SwFKF=hJ%_cTIW>9@R_hX|C3c&+*8Hsb zC0}^>W!KKv4_57P$_Tg`8~3)p)tHF&5V>nc+Y0nb%W%9_*>9~jxS~2VU|X#9ly!XU zdhQcp%);Ifl>Ein+d45wQz+_mIxymX`*7W#IoZKMvzUd=WvUxSYH?wIr*I@N zTaOo5i55jLr*hx&GA=i`BzJyak^adezRb9nOsA#w-)MMKEh;wxZ+) za#d{$(cJe;vjl0p*y0?wM=P>xzc=^ bwH)E>IX`u>L_Sg)L@?_l-I8orhg$yv+{HdX diff --git a/seed/java-model/inline-types/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock b/seed/java-model/inline-types/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock deleted file mode 100644 index 8e914806b42b1ebe4c167b77bf0538b3e8270db8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17 ScmZSfZ_ah&kJ4&nfC2y^Bm$iP diff --git a/seed/java-model/inline-types/.gradle/8.5/dependencies-accessors/gc.properties b/seed/java-model/inline-types/.gradle/8.5/dependencies-accessors/gc.properties deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/java-model/inline-types/.gradle/8.5/executionHistory/executionHistory.bin b/seed/java-model/inline-types/.gradle/8.5/executionHistory/executionHistory.bin deleted file mode 100644 index 145a20425b6a03f5176d5f1715e8bd0cf2cbd644..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26343 zcmeI3d0bP++Q;VrZn#CQin~=@Uy`sXxKxXP3bF_R(OSeqasmgFlW@+2fOhd(1g%z3 zL9G=*y=q0R8zT0K6>r_Dt(98WR;^ubdwuoVqF2$jzR#Q_Cc&WC-uut{Ieb2WFq!A~ zJkNJ#o|!Xz2t&wA_Q?8$>|dSjZ>4t<0f~S_Kq4R!kO)WwBmxoviGV~vA|Mfv2uK7Z z0uljk2#I)FlJW9!BX8Q95%O&VZ`=p9rZ-=|{sOjqJn5e8?+3o> z9#h@gZdz+;pBQ3mPf4ttdJEsbW@(QeVQaVjg!XBc&!q1X0f~S_Kq4R!kO)WwBmxov ziGV~vA|Mfv2uK7Z0uljdq)1i=3TY=_rI@_H|m&k&dlA(PJ1YO{^Q(zGU82vqBN zCez~EZ8zFs;L{XoJgw0&3fjmjFfGgy6lR__8W~=ZWcisA#;6TEjTwzB+>L8i<@VXb zK+}L@mkuAFO#NvE&&4#aPG_^2akRj+{GciEcu%HrI_bW2LVQSARCr3FDm*@AVr+D{ zO^bAJUt&!|sbK{yEG6H0Hr0e#1NWcsIUpv!|5!{n(frK`v93ukf6!KV{N@I1pO3kxI zOuehrGCZdQGouMx-I*281IY$va=s_74Q~EYRPK<`#V&{yx`~54rcr3`E`SGld zp?0`1R@%nX8oF(kf(?>!L-EbB#0AT4J+l1X$P(>v%$sO(%nE|9v^6 z>-&HF~+mA$%m;du-;d zS@K~g29!+x^w_kTin%4ZfRG{tsWCvX8`QjRCFJ!?g3W1E^;Cc=D@g(^LT}VP72JPJ zs@XyqDuagQ(%kbB6UNJf3z=*+VnxXi>8_~Ci?YCt*mSe&>!c1tC(J!s6jK;eTm&wLF zt(d^#5Nz2X7$M3o>mASN3~CzFsXE5uA}&*Y^tXyh=Sk!|@^LL1MbFLw_-2|X!P!7q zS1=`}1WAu`ZTyUgLTPn6qp_y_Rqghbe|skuIKnWt)i7Gxq{EiaFzRR-M;*az=b(?9T^3&DANpvG#%{r8b+x$aB36JGaOK17(oe#1U6e4`nWZo{7!~y zRJIW#$`jHFCh6EE6b&R4qJ+YQ#Dle3PtO}EMQ+GF3bp3I{dii94SWtpK~0N`*eGM{ zhLEQRZ!lnte4kSQEL)j*7Bf)>^(>5DbXW@Ze3URJW(i8t1=5GqH@iBhD(Gni3W zM<6tv=2c9l306Pjkipq`S?3b={-u>|fh7L{4{DGWtkQ~xexev!8)MSxrqDVQQ(0;l zb-d%;6gNagAukpRk)F(3O&a59hLM-UjB@-$oCF9!47RUhJ1&KY3pOU0O+3wE!cCj_ zzK_rGj2ogy4XQ<)trx7TNbgr$r8l2 zs`vV$@~~H4v)B%Mifu?LoH=18$C(%tqan8Gyn$n9GdyG;Y8o5=Eo2`71sub93W~|_ zCTPW)IZ}%p#R9JG*uPzG*dk69u}m(4<2n=x4ChW4yGDeyAoe0BPe!d{jRK>{NMo@= z$EGS`Q!^Mfj?g$2EAtE1U!8trTekQ%lnWl8O8Hu+m^_f@2EVQphgrt->^? zfr4psY~eeoiRR8$Lz`d)4xKl`KV8p*TzeHqbutZQ7_)pN>~ofFnIuk<#*967DB?1$ zxM>3!>ruRsI^GfvzM?foeZ?AQWBm9mrHr)p5Lah&e}$i~!WY(PZ`WbkdOJnaRtx8G z6`RJ<*aTGz4QRv_IsQKG1~pWsr?VI?)LQY;+7?>|YmD?s>570yrPR@dF}|0l3EIVngHPR~3QV-<*&I z`&lIN5MaSiM;@^4reowbeH?5}9Ic0^@HbF%Q5qfs{LK&@e73Ew>;2{}6Rz33_8n99 z)%j7;y4?>0tKT?#>D*=i+0>2gukW0(Z{f>Xd(MR|#i%PRboDHTmy^?$JV4lYe4edxn8AhN^fobO4WaC&G*e)c(22# zAH(woJ_VkBI3|VWI0MX4II;THOD1Gm0%JAXe$FQl1>PJkGjJcEbg=!~;pv|aAS9lj^}rB&1Y z4qdCLZF8zp(>>^)^;3=}wEH;o%iJF#=U~)5!{3map_V(6^iu>h5T!gP*hM{N&^s$O zOgQsDd8g&=%=&+31#oeP`SuALV73P!y%XgGlwI44yYAHOGPHcL*j3lA9I z>!S+4lM}zCyvhb;WnNkG_LL2~y5%mrK1o^G?0nJ;7$2K3-1#tM#Gh2`T<&F8tjIe! z;^L#o9}k%4DKf!L33-1&!>&^+i?z~9yUd|HK5_LLE~DLnz+oadga5> z!$(x^8M3=Tx8iJ{yB)?PU+jEkbN?j2sjGwMc?2DSgPEf$h8q#NWz<|ojPhpMwR091 zz8P1}2s17oUvYlk$8NiV5^M9zI@Q%*Dwv}he4+;G=@Z%+npwfF!$#iNE`2g(@C!2A_HZ=a94bt-uMqEdeS=ksrcF3Rro)8NmK!39f(zz6sagIeIL z@NY29P|KBesXcsI(AoZ;8{a(m=t^Dta~;R7X(O*n_WbPgHcR*8y0PzKG)70R62udS z)z;UzlJ?xIlH@@ckU`_W^ zEu)U8T9y2^TwT+y%4b5suQhaFYF%6}8Ag4K*8NgEo5?MEVj~5p=Rv#j>oEoM-7nni zm9VeSujqmLr<>mooU`uXlB4gQ{$aGCMeP4#)ZeADU}PQDoA^LVVH7|%FqBdOl)k;0ha!R5Dk6?O=%7yQLeR?Oj?qf6*wGeuW zZ?`s~yAnzg9P=ou&}L`$)3{E|CfWM z@^tU=Uex<8qj=JE*K?qNvcTvlYDGh7vHi^Rlx5>mHGed`aL%N+lJfj{>B|?FZo7W3U3~r)UxPoj>1n|{Haz@C zU6X5m+bA7)U9)NNcSY4d95CVFqElvS^V59WE&r5rvUiXv(tpVPk^{#Ie!1p;J8;^t zkj!U0w^$y3{>)?GL4na&CapaSciD&yKMxxc-e=`U3tk;J@oKky)OOeTyS6{{{DH*7 z<&k3mpDnLHc53f3ufmEU!R>}Bf2KCN4#3%tdav=NFFSIlj`p5Z-zWSpdBUzw-#j9_ z^xcu7+8ZNAUeEufOSe|IgetWB^(2htp;W_l7~0|_XSqGMJyAb??2Cj!L%Fb(p!sAk zLG#HdBC?O5`DCX+`Ig#`=8N@vb)$tB$tKj`<*%Q4aPot~`xXB_-7oI&Msn-^YkO+> zlT{AMB7ZNE*DK9!HM4z|Z|PkQI6>XW`PNqZ^N0FS~t{cx0LDRgDe zs82|C(AZ~)d9iM_F)S@UdH$oWe}A8d&XrT^t)`7HdL;WfX#MAxtN!8FvstG@dp|x~ zRlS86U+78|T8tkrQY1SaG^iZrIt6#I?Yq9G!cWPtT5TiAhG>3XgrSj&Ta8vYRIOoMEy>8s=#@2A({C>hVG?`8M?v`+sCvS|K;^h#h#U&0l1Jl zXWzK=RUfyFXg~ApH02^_`Z4b0;mV8q6O_BJSKoTILp|wL_x8G-w=aCZzW8FkM@Mx4 zG%f4+ZRlt3^!Yk8_xBq;-L95EQ_`x6F1;^yDy={0ANtoy(|5%1?$X=Q>(*cN_7%=} zj4o^qO|KcBQFIP=!u`haM?0E9mnr`L)2Rl%o Aq5uE@ diff --git a/seed/java-model/inline-types/.gradle/8.5/executionHistory/executionHistory.lock b/seed/java-model/inline-types/.gradle/8.5/executionHistory/executionHistory.lock deleted file mode 100644 index 1b4ac04842c0f837eec8f8d3de13adb0e88af550..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17 UcmZQxI%DpSFv)#v3=qH$05xs|5C8xG diff --git a/seed/java-model/inline-types/.gradle/8.5/fileChanges/last-build.bin b/seed/java-model/inline-types/.gradle/8.5/fileChanges/last-build.bin deleted file mode 100644 index f76dd238ade08917e6712764a16a22005a50573d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1 IcmZPo000310RR91 diff --git a/seed/java-model/inline-types/.gradle/8.5/fileHashes/fileHashes.bin b/seed/java-model/inline-types/.gradle/8.5/fileHashes/fileHashes.bin deleted file mode 100644 index 5f1d751448e4531971b7cb30d91e0e2d8c7fb65f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19647 zcmeI3drVVT9Dpw{29&232HPCq1Vfwh9G$SiCJvEDqZET+fB}>65ERK+y0~BnREHZ3 zq%8^p1q~>Qh#O^$(asW)5Ohe;IVP)&u!kcoytK6Fx?9gVm~s7o$@05NZ*RVyk8|&L z?|mz{Qsb$Msq=4tsLH7@w|6e`GW|rOC$Msyda5iVQapL zhsrb=jgQVEJYH|bP94AVC+4+;?+Ivd|FYl*+*!aOJbT}Y?;{QWXMCOmgp+TIG7Uz* z!5#`g0Vn_kpa2wr0#E=7KmjNK1)u;FfC5ke3P1rU00p1`6o3Ly017|>C;$bZ02F`% zPyh-*0Vn_kpa2wr0#E=7KmjNK1^%l7Z_pES=+8#u$6<59LBF9%uNOlFVor$6afPBx zB$6h*89F=bK>FL~-^M|1;cQcUS@n!qlQbo5q2F~k8e06$d)sxUaj~wi(d~Y3oCjt2 z$!c_rhmBe^2W4D+ux5^Taw_X{oZjm8)HEqW7Ii(y(8-apafxXt2Gjn^_2v(GHpJc> z+^eSFc&E>**{&EFlnK-LW=7NY@gB>71(n=8+vCD(XpYj&$S_Z28qV5FveOmaXOe#@ z7OsmceumnuQThU)}Iez9`$5$ff z4`xOF*cd~G^=C{YwP`7~Bz@;d=oMi^T5EebHoirM(|V@Cnm@61{6zbd)-LYTHoyD; zY&<}Q$pq8b#940W8?0QIG@A?D%MUBSMmjPqxlAMY>^z^d-R2|CV~|d_}eyhk24VS0%mL!+6ix^z&uh z%=gi|HP6)!b)lqaR6pENwcPb+i4a(8p~vCL00F`P9^(RM diff --git a/seed/java-model/inline-types/.gradle/buildOutputCleanup/cache.properties b/seed/java-model/inline-types/.gradle/buildOutputCleanup/cache.properties deleted file mode 100644 index 38753e2af99..00000000000 --- a/seed/java-model/inline-types/.gradle/buildOutputCleanup/cache.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Wed Dec 04 21:43:30 UTC 2024 -gradle.version=8.5 diff --git a/seed/java-model/inline-types/.gradle/buildOutputCleanup/outputFiles.bin b/seed/java-model/inline-types/.gradle/buildOutputCleanup/outputFiles.bin deleted file mode 100644 index 8eff991d1a8478828dec9889276b32ccc2831188..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18749 zcmeI%y-NaN9Ki9@rB^HhLC0PoF^3>(Y6%*0Dv=s{fjX|DK^%;rh6U+}j#|vvdV|rEfZRvI++_o-J5P3%qA{hRWC^I&jil)Ke}|) z)6&PX-u8i1cG>EFxAZ`LF1KlHb*TAs(&uOMDSgLttLFDe4?Ul!<4*@oYJNnz+%?TM zV?E=F00IagfB*srAb { - private static final SimpleModule MODULE; - - static { - MODULE = new SimpleModule().addDeserializer(OffsetDateTime.class, new DateTimeDeserializer()); - } - - /** - * Gets a module wrapping this deserializer as an adapter for the Jackson ObjectMapper. - * - * @return A {@link SimpleModule} to be plugged onto Jackson ObjectMapper. - */ - public static SimpleModule getModule() { - return MODULE; - } - - @Override - public OffsetDateTime deserialize(JsonParser parser, DeserializationContext context) throws IOException { - JsonToken token = parser.currentToken(); - if (token == JsonToken.VALUE_NUMBER_INT) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(parser.getValueAsLong()), ZoneOffset.UTC); - } else { - TemporalAccessor temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest( - parser.getValueAsString(), OffsetDateTime::from, LocalDateTime::from); - - if (temporal.query(TemporalQueries.offset()) == null) { - return LocalDateTime.from(temporal).atOffset(ZoneOffset.UTC); - } else { - return OffsetDateTime.from(temporal); - } - } - } -} diff --git a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ObjectMappers.java b/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ObjectMappers.java deleted file mode 100644 index c889a5b4c3d..00000000000 --- a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ObjectMappers.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import java.io.IOException; - -public final class ObjectMappers { - public static final ObjectMapper JSON_MAPPER = JsonMapper.builder() - .addModule(new Jdk8Module()) - .addModule(new JavaTimeModule()) - .addModule(DateTimeDeserializer.getModule()) - .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) - .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .build(); - - private ObjectMappers() {} - - public static String stringify(Object o) { - try { - return JSON_MAPPER - .setSerializationInclusion(JsonInclude.Include.ALWAYS) - .writerWithDefaultPrettyPrinter() - .writeValueAsString(o); - } catch (IOException e) { - return o.getClass().getName() + "@" + Integer.toHexString(o.hashCode()); - } - } -} diff --git a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlineEnum.java b/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlineEnum.java deleted file mode 100644 index 66d978305f7..00000000000 --- a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlineEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum InlineEnum { - SUNNY("SUNNY"), - - CLOUDY("CLOUDY"), - - RAINING("RAINING"), - - SNOWING("SNOWING"); - - private final String value; - - InlineEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlineType1.java b/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlineType1.java deleted file mode 100644 index bcafb30642f..00000000000 --- a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlineType1.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = InlineType1.Builder.class) -public final class InlineType1 { - private final String foo; - - private final NestedInlineType1 bar; - - private InlineType1(String foo, NestedInlineType1 bar) { - this.foo = foo; - this.bar = bar; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public NestedInlineType1 getBar() { - return bar; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlineType1 && equalTo((InlineType1) other); - } - - private boolean equalTo(InlineType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(String foo); - - Builder from(InlineType1 other); - } - - public interface BarStage { - _FinalStage bar(NestedInlineType1 bar); - } - - public interface _FinalStage { - InlineType1 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FooStage, BarStage, _FinalStage { - private String foo; - - private NestedInlineType1 bar; - - private Builder() {} - - @java.lang.Override - public Builder from(InlineType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public _FinalStage bar(NestedInlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - public InlineType1 build() { - return new InlineType1(foo, bar); - } - } -} diff --git a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlineType2.java b/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlineType2.java deleted file mode 100644 index c885d7a08ed..00000000000 --- a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlineType2.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = InlineType2.Builder.class) -public final class InlineType2 { - private final String baz; - - private InlineType2(String baz) { - this.baz = baz; - } - - @JsonProperty("baz") - public String getBaz() { - return baz; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlineType2 && equalTo((InlineType2) other); - } - - private boolean equalTo(InlineType2 other) { - return baz.equals(other.baz); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.baz); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BazStage builder() { - return new Builder(); - } - - public interface BazStage { - _FinalStage baz(String baz); - - Builder from(InlineType2 other); - } - - public interface _FinalStage { - InlineType2 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements BazStage, _FinalStage { - private String baz; - - private Builder() {} - - @java.lang.Override - public Builder from(InlineType2 other) { - baz(other.getBaz()); - return this; - } - - @java.lang.Override - @JsonSetter("baz") - public _FinalStage baz(String baz) { - this.baz = Objects.requireNonNull(baz, "baz must not be null"); - return this; - } - - @java.lang.Override - public InlineType2 build() { - return new InlineType2(baz); - } - } -} diff --git a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlinedDiscriminatedUnion1.java b/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlinedDiscriminatedUnion1.java deleted file mode 100644 index c2d65055d7d..00000000000 --- a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlinedDiscriminatedUnion1.java +++ /dev/null @@ -1,200 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonUnwrapped; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Objects; -import java.util.Optional; - -public final class InlinedDiscriminatedUnion1 { - private final Value value; - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - private InlinedDiscriminatedUnion1(Value value) { - this.value = value; - } - - public T visit(Visitor visitor) { - return value.visit(visitor); - } - - public static InlinedDiscriminatedUnion1 type1(InlineType1 value) { - return new InlinedDiscriminatedUnion1(new Type1Value(value)); - } - - public static InlinedDiscriminatedUnion1 type2(InlineType2 value) { - return new InlinedDiscriminatedUnion1(new Type2Value(value)); - } - - public boolean isType1() { - return value instanceof Type1Value; - } - - public boolean isType2() { - return value instanceof Type2Value; - } - - public boolean _isUnknown() { - return value instanceof _UnknownValue; - } - - public Optional getType1() { - if (isType1()) { - return Optional.of(((Type1Value) value).value); - } - return Optional.empty(); - } - - public Optional getType2() { - if (isType2()) { - return Optional.of(((Type2Value) value).value); - } - return Optional.empty(); - } - - public Optional _getUnknown() { - if (_isUnknown()) { - return Optional.of(((_UnknownValue) value).value); - } - return Optional.empty(); - } - - @JsonValue - private Value getValue() { - return this.value; - } - - public interface Visitor { - T visitType1(InlineType1 type1); - - T visitType2(InlineType2 type2); - - T _visitUnknown(Object unknownType); - } - - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) - @JsonSubTypes({@JsonSubTypes.Type(Type1Value.class), @JsonSubTypes.Type(Type2Value.class)}) - @JsonIgnoreProperties(ignoreUnknown = true) - private interface Value { - T visit(Visitor visitor); - } - - @JsonTypeName("type1") - private static final class Type1Value implements Value { - @JsonUnwrapped - private InlineType1 value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private Type1Value() {} - - private Type1Value(InlineType1 value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitType1(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Type1Value && equalTo((Type1Value) other); - } - - private boolean equalTo(Type1Value other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "value: " + value + "}"; - } - } - - @JsonTypeName("type2") - private static final class Type2Value implements Value { - @JsonUnwrapped - private InlineType2 value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private Type2Value() {} - - private Type2Value(InlineType2 value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitType2(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Type2Value && equalTo((Type2Value) other); - } - - private boolean equalTo(Type2Value other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "value: " + value + "}"; - } - } - - private static final class _UnknownValue implements Value { - private String type; - - @JsonValue - private Object value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private _UnknownValue(@JsonProperty("value") Object value) {} - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor._visitUnknown(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof _UnknownValue && equalTo((_UnknownValue) other); - } - - private boolean equalTo(_UnknownValue other) { - return type.equals(other.type) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.type, this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "type: " + type + ", value: " + value + "}"; - } - } -} diff --git a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlinedUndiscriminatedUnion1.java b/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlinedUndiscriminatedUnion1.java deleted file mode 100644 index 2ddc4805b32..00000000000 --- a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/InlinedUndiscriminatedUnion1.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.seed.object.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = InlinedUndiscriminatedUnion1.Deserializer.class) -public final class InlinedUndiscriminatedUnion1 { - private final Object value; - - private final int type; - - private InlinedUndiscriminatedUnion1(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((InlineType1) this.value); - } else if (this.type == 1) { - return visitor.visit((InlineType2) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlinedUndiscriminatedUnion1 && equalTo((InlinedUndiscriminatedUnion1) other); - } - - private boolean equalTo(InlinedUndiscriminatedUnion1 other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InlinedUndiscriminatedUnion1 of(InlineType1 value) { - return new InlinedUndiscriminatedUnion1(value, 0); - } - - public static InlinedUndiscriminatedUnion1 of(InlineType2 value) { - return new InlinedUndiscriminatedUnion1(value, 1); - } - - public interface Visitor { - T visit(InlineType1 value); - - T visit(InlineType2 value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InlinedUndiscriminatedUnion1.class); - } - - @java.lang.Override - public InlinedUndiscriminatedUnion1 deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InlineType1.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InlineType2.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/NestedInlineType1.java b/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/NestedInlineType1.java deleted file mode 100644 index dd48a14900d..00000000000 --- a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/NestedInlineType1.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = NestedInlineType1.Builder.class) -public final class NestedInlineType1 { - private final String foo; - - private final String bar; - - private final InlineEnum myEnum; - - private NestedInlineType1(String foo, String bar, InlineEnum myEnum) { - this.foo = foo; - this.bar = bar; - this.myEnum = myEnum; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public String getBar() { - return bar; - } - - @JsonProperty("myEnum") - public InlineEnum getMyEnum() { - return myEnum; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof NestedInlineType1 && equalTo((NestedInlineType1) other); - } - - private boolean equalTo(NestedInlineType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar) && myEnum.equals(other.myEnum); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar, this.myEnum); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(String foo); - - Builder from(NestedInlineType1 other); - } - - public interface BarStage { - MyEnumStage bar(String bar); - } - - public interface MyEnumStage { - _FinalStage myEnum(InlineEnum myEnum); - } - - public interface _FinalStage { - NestedInlineType1 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FooStage, BarStage, MyEnumStage, _FinalStage { - private String foo; - - private String bar; - - private InlineEnum myEnum; - - private Builder() {} - - @java.lang.Override - public Builder from(NestedInlineType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - myEnum(other.getMyEnum()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public MyEnumStage bar(String bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("myEnum") - public _FinalStage myEnum(InlineEnum myEnum) { - this.myEnum = Objects.requireNonNull(myEnum, "myEnum must not be null"); - return this; - } - - @java.lang.Override - public NestedInlineType1 build() { - return new NestedInlineType1(foo, bar, myEnum); - } - } -} diff --git a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/RootType1.java b/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/RootType1.java deleted file mode 100644 index 6125d099de1..00000000000 --- a/seed/java-model/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/model/RootType1.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RootType1.Builder.class) -public final class RootType1 { - private final String foo; - - private final InlineType1 bar; - - private RootType1(String foo, InlineType1 bar) { - this.foo = foo; - this.bar = bar; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public InlineType1 getBar() { - return bar; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RootType1 && equalTo((RootType1) other); - } - - private boolean equalTo(RootType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(String foo); - - Builder from(RootType1 other); - } - - public interface BarStage { - _FinalStage bar(InlineType1 bar); - } - - public interface _FinalStage { - RootType1 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FooStage, BarStage, _FinalStage { - private String foo; - - private InlineType1 bar; - - private Builder() {} - - @java.lang.Override - public Builder from(RootType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public _FinalStage bar(InlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - public RootType1 build() { - return new RootType1(foo, bar); - } - } -} diff --git a/seed/java-model/inline-types/build/tmp/spotless-register-dependencies b/seed/java-model/inline-types/build/tmp/spotless-register-dependencies deleted file mode 100644 index 56a6051ca2b..00000000000 --- a/seed/java-model/inline-types/build/tmp/spotless-register-dependencies +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/seed/java-model/inline-types/settings.gradle b/seed/java-model/inline-types/settings.gradle deleted file mode 100644 index 24f0d4e99ad..00000000000 --- a/seed/java-model/inline-types/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -rootProject.name = 'inline-types' - diff --git a/seed/java-model/inline-types/snippet-templates.json b/seed/java-model/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/java-model/inline-types/snippet.json b/seed/java-model/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/java-model/inline-types/src/main/java/com/seed/object/core/DateTimeDeserializer.java b/seed/java-model/inline-types/src/main/java/com/seed/object/core/DateTimeDeserializer.java deleted file mode 100644 index ad231070a3d..00000000000 --- a/seed/java-model/inline-types/src/main/java/com/seed/object/core/DateTimeDeserializer.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.module.SimpleModule; -import java.io.IOException; -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalQueries; - -/** - * Custom deserializer that handles converting ISO8601 dates into {@link OffsetDateTime} objects. - */ -class DateTimeDeserializer extends JsonDeserializer { - private static final SimpleModule MODULE; - - static { - MODULE = new SimpleModule().addDeserializer(OffsetDateTime.class, new DateTimeDeserializer()); - } - - /** - * Gets a module wrapping this deserializer as an adapter for the Jackson ObjectMapper. - * - * @return A {@link SimpleModule} to be plugged onto Jackson ObjectMapper. - */ - public static SimpleModule getModule() { - return MODULE; - } - - @Override - public OffsetDateTime deserialize(JsonParser parser, DeserializationContext context) throws IOException { - JsonToken token = parser.currentToken(); - if (token == JsonToken.VALUE_NUMBER_INT) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(parser.getValueAsLong()), ZoneOffset.UTC); - } else { - TemporalAccessor temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest( - parser.getValueAsString(), OffsetDateTime::from, LocalDateTime::from); - - if (temporal.query(TemporalQueries.offset()) == null) { - return LocalDateTime.from(temporal).atOffset(ZoneOffset.UTC); - } else { - return OffsetDateTime.from(temporal); - } - } - } -} diff --git a/seed/java-model/inline-types/src/main/java/com/seed/object/core/ObjectMappers.java b/seed/java-model/inline-types/src/main/java/com/seed/object/core/ObjectMappers.java deleted file mode 100644 index c889a5b4c3d..00000000000 --- a/seed/java-model/inline-types/src/main/java/com/seed/object/core/ObjectMappers.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import java.io.IOException; - -public final class ObjectMappers { - public static final ObjectMapper JSON_MAPPER = JsonMapper.builder() - .addModule(new Jdk8Module()) - .addModule(new JavaTimeModule()) - .addModule(DateTimeDeserializer.getModule()) - .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) - .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .build(); - - private ObjectMappers() {} - - public static String stringify(Object o) { - try { - return JSON_MAPPER - .setSerializationInclusion(JsonInclude.Include.ALWAYS) - .writerWithDefaultPrettyPrinter() - .writeValueAsString(o); - } catch (IOException e) { - return o.getClass().getName() + "@" + Integer.toHexString(o.hashCode()); - } - } -} diff --git a/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlineEnum.java b/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlineEnum.java deleted file mode 100644 index 66d978305f7..00000000000 --- a/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlineEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum InlineEnum { - SUNNY("SUNNY"), - - CLOUDY("CLOUDY"), - - RAINING("RAINING"), - - SNOWING("SNOWING"); - - private final String value; - - InlineEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlineType1.java b/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlineType1.java deleted file mode 100644 index bcafb30642f..00000000000 --- a/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlineType1.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = InlineType1.Builder.class) -public final class InlineType1 { - private final String foo; - - private final NestedInlineType1 bar; - - private InlineType1(String foo, NestedInlineType1 bar) { - this.foo = foo; - this.bar = bar; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public NestedInlineType1 getBar() { - return bar; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlineType1 && equalTo((InlineType1) other); - } - - private boolean equalTo(InlineType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(String foo); - - Builder from(InlineType1 other); - } - - public interface BarStage { - _FinalStage bar(NestedInlineType1 bar); - } - - public interface _FinalStage { - InlineType1 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FooStage, BarStage, _FinalStage { - private String foo; - - private NestedInlineType1 bar; - - private Builder() {} - - @java.lang.Override - public Builder from(InlineType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public _FinalStage bar(NestedInlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - public InlineType1 build() { - return new InlineType1(foo, bar); - } - } -} diff --git a/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlineType2.java b/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlineType2.java deleted file mode 100644 index c885d7a08ed..00000000000 --- a/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlineType2.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = InlineType2.Builder.class) -public final class InlineType2 { - private final String baz; - - private InlineType2(String baz) { - this.baz = baz; - } - - @JsonProperty("baz") - public String getBaz() { - return baz; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlineType2 && equalTo((InlineType2) other); - } - - private boolean equalTo(InlineType2 other) { - return baz.equals(other.baz); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.baz); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BazStage builder() { - return new Builder(); - } - - public interface BazStage { - _FinalStage baz(String baz); - - Builder from(InlineType2 other); - } - - public interface _FinalStage { - InlineType2 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements BazStage, _FinalStage { - private String baz; - - private Builder() {} - - @java.lang.Override - public Builder from(InlineType2 other) { - baz(other.getBaz()); - return this; - } - - @java.lang.Override - @JsonSetter("baz") - public _FinalStage baz(String baz) { - this.baz = Objects.requireNonNull(baz, "baz must not be null"); - return this; - } - - @java.lang.Override - public InlineType2 build() { - return new InlineType2(baz); - } - } -} diff --git a/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlinedDiscriminatedUnion1.java b/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlinedDiscriminatedUnion1.java deleted file mode 100644 index c2d65055d7d..00000000000 --- a/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlinedDiscriminatedUnion1.java +++ /dev/null @@ -1,200 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonUnwrapped; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Objects; -import java.util.Optional; - -public final class InlinedDiscriminatedUnion1 { - private final Value value; - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - private InlinedDiscriminatedUnion1(Value value) { - this.value = value; - } - - public T visit(Visitor visitor) { - return value.visit(visitor); - } - - public static InlinedDiscriminatedUnion1 type1(InlineType1 value) { - return new InlinedDiscriminatedUnion1(new Type1Value(value)); - } - - public static InlinedDiscriminatedUnion1 type2(InlineType2 value) { - return new InlinedDiscriminatedUnion1(new Type2Value(value)); - } - - public boolean isType1() { - return value instanceof Type1Value; - } - - public boolean isType2() { - return value instanceof Type2Value; - } - - public boolean _isUnknown() { - return value instanceof _UnknownValue; - } - - public Optional getType1() { - if (isType1()) { - return Optional.of(((Type1Value) value).value); - } - return Optional.empty(); - } - - public Optional getType2() { - if (isType2()) { - return Optional.of(((Type2Value) value).value); - } - return Optional.empty(); - } - - public Optional _getUnknown() { - if (_isUnknown()) { - return Optional.of(((_UnknownValue) value).value); - } - return Optional.empty(); - } - - @JsonValue - private Value getValue() { - return this.value; - } - - public interface Visitor { - T visitType1(InlineType1 type1); - - T visitType2(InlineType2 type2); - - T _visitUnknown(Object unknownType); - } - - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) - @JsonSubTypes({@JsonSubTypes.Type(Type1Value.class), @JsonSubTypes.Type(Type2Value.class)}) - @JsonIgnoreProperties(ignoreUnknown = true) - private interface Value { - T visit(Visitor visitor); - } - - @JsonTypeName("type1") - private static final class Type1Value implements Value { - @JsonUnwrapped - private InlineType1 value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private Type1Value() {} - - private Type1Value(InlineType1 value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitType1(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Type1Value && equalTo((Type1Value) other); - } - - private boolean equalTo(Type1Value other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "value: " + value + "}"; - } - } - - @JsonTypeName("type2") - private static final class Type2Value implements Value { - @JsonUnwrapped - private InlineType2 value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private Type2Value() {} - - private Type2Value(InlineType2 value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitType2(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Type2Value && equalTo((Type2Value) other); - } - - private boolean equalTo(Type2Value other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "value: " + value + "}"; - } - } - - private static final class _UnknownValue implements Value { - private String type; - - @JsonValue - private Object value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private _UnknownValue(@JsonProperty("value") Object value) {} - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor._visitUnknown(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof _UnknownValue && equalTo((_UnknownValue) other); - } - - private boolean equalTo(_UnknownValue other) { - return type.equals(other.type) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.type, this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "type: " + type + ", value: " + value + "}"; - } - } -} diff --git a/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlinedUndiscriminatedUnion1.java b/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlinedUndiscriminatedUnion1.java deleted file mode 100644 index 2ddc4805b32..00000000000 --- a/seed/java-model/inline-types/src/main/java/com/seed/object/model/InlinedUndiscriminatedUnion1.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.seed.object.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = InlinedUndiscriminatedUnion1.Deserializer.class) -public final class InlinedUndiscriminatedUnion1 { - private final Object value; - - private final int type; - - private InlinedUndiscriminatedUnion1(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((InlineType1) this.value); - } else if (this.type == 1) { - return visitor.visit((InlineType2) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlinedUndiscriminatedUnion1 && equalTo((InlinedUndiscriminatedUnion1) other); - } - - private boolean equalTo(InlinedUndiscriminatedUnion1 other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InlinedUndiscriminatedUnion1 of(InlineType1 value) { - return new InlinedUndiscriminatedUnion1(value, 0); - } - - public static InlinedUndiscriminatedUnion1 of(InlineType2 value) { - return new InlinedUndiscriminatedUnion1(value, 1); - } - - public interface Visitor { - T visit(InlineType1 value); - - T visit(InlineType2 value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InlinedUndiscriminatedUnion1.class); - } - - @java.lang.Override - public InlinedUndiscriminatedUnion1 deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InlineType1.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InlineType2.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/seed/java-model/inline-types/src/main/java/com/seed/object/model/NestedInlineType1.java b/seed/java-model/inline-types/src/main/java/com/seed/object/model/NestedInlineType1.java deleted file mode 100644 index dd48a14900d..00000000000 --- a/seed/java-model/inline-types/src/main/java/com/seed/object/model/NestedInlineType1.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = NestedInlineType1.Builder.class) -public final class NestedInlineType1 { - private final String foo; - - private final String bar; - - private final InlineEnum myEnum; - - private NestedInlineType1(String foo, String bar, InlineEnum myEnum) { - this.foo = foo; - this.bar = bar; - this.myEnum = myEnum; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public String getBar() { - return bar; - } - - @JsonProperty("myEnum") - public InlineEnum getMyEnum() { - return myEnum; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof NestedInlineType1 && equalTo((NestedInlineType1) other); - } - - private boolean equalTo(NestedInlineType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar) && myEnum.equals(other.myEnum); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar, this.myEnum); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(String foo); - - Builder from(NestedInlineType1 other); - } - - public interface BarStage { - MyEnumStage bar(String bar); - } - - public interface MyEnumStage { - _FinalStage myEnum(InlineEnum myEnum); - } - - public interface _FinalStage { - NestedInlineType1 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FooStage, BarStage, MyEnumStage, _FinalStage { - private String foo; - - private String bar; - - private InlineEnum myEnum; - - private Builder() {} - - @java.lang.Override - public Builder from(NestedInlineType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - myEnum(other.getMyEnum()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public MyEnumStage bar(String bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("myEnum") - public _FinalStage myEnum(InlineEnum myEnum) { - this.myEnum = Objects.requireNonNull(myEnum, "myEnum must not be null"); - return this; - } - - @java.lang.Override - public NestedInlineType1 build() { - return new NestedInlineType1(foo, bar, myEnum); - } - } -} diff --git a/seed/java-model/inline-types/src/main/java/com/seed/object/model/RootType1.java b/seed/java-model/inline-types/src/main/java/com/seed/object/model/RootType1.java deleted file mode 100644 index 6125d099de1..00000000000 --- a/seed/java-model/inline-types/src/main/java/com/seed/object/model/RootType1.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.Objects; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RootType1.Builder.class) -public final class RootType1 { - private final String foo; - - private final InlineType1 bar; - - private RootType1(String foo, InlineType1 bar) { - this.foo = foo; - this.bar = bar; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public InlineType1 getBar() { - return bar; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RootType1 && equalTo((RootType1) other); - } - - private boolean equalTo(RootType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(String foo); - - Builder from(RootType1 other); - } - - public interface BarStage { - _FinalStage bar(InlineType1 bar); - } - - public interface _FinalStage { - RootType1 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FooStage, BarStage, _FinalStage { - private String foo; - - private InlineType1 bar; - - private Builder() {} - - @java.lang.Override - public Builder from(RootType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public _FinalStage bar(InlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - public RootType1 build() { - return new RootType1(foo, bar); - } - } -} diff --git a/seed/java-sdk/inline-types/.github/workflows/ci.yml b/seed/java-sdk/inline-types/.github/workflows/ci.yml deleted file mode 100644 index 9910fd269c2..00000000000 --- a/seed/java-sdk/inline-types/.github/workflows/ci.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: ci - -on: [push] - -jobs: - compile: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up Java - id: setup-jre - uses: actions/setup-java@v1 - with: - java-version: "11" - architecture: x64 - - - name: Compile - run: ./gradlew compileJava - - test: - needs: [ compile ] - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up Java - id: setup-jre - uses: actions/setup-java@v1 - with: - java-version: "11" - architecture: x64 - - - name: Test - run: ./gradlew test - publish: - needs: [ compile, test ] - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up Java - id: setup-jre - uses: actions/setup-java@v1 - with: - java-version: "11" - architecture: x64 - - - name: Publish to maven - run: | - ./gradlew publish - env: - MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - MAVEN_PUBLISH_REGISTRY_URL: "" diff --git a/seed/java-sdk/inline-types/.gitignore b/seed/java-sdk/inline-types/.gitignore deleted file mode 100644 index d4199abc2cd..00000000000 --- a/seed/java-sdk/inline-types/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -*.class -.project -.gradle -? -.classpath -.checkstyle -.settings -.node -build - -# IntelliJ -*.iml -*.ipr -*.iws -.idea/ -out/ - -# Eclipse/IntelliJ APT -generated_src/ -generated_testSrc/ -generated/ - -bin -build \ No newline at end of file diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/checksums/checksums.lock b/seed/java-sdk/inline-types/.gradle/8.11.1/checksums/checksums.lock deleted file mode 100644 index 8a3b233acb590ab1251bef5181b783e22e8f3e97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17 UcmZQ>a1c8?U-a`+1_+o905T#3&Hw-a diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/checksums/md5-checksums.bin b/seed/java-sdk/inline-types/.gradle/8.11.1/checksums/md5-checksums.bin deleted file mode 100644 index 3e88913d86758abff4383a1ad336e89b82aecefe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20947 zcmeI3`CAj$9*2WK2t*)Z3;GBGwIWnOP+UNeMH&(afwo}T1Pa21s}hT7Empl(!(s(w z2aDl?Rd&Rsg4C;Aw-yl)0iy&3gkqtEwC)v^p2?YGYlgqzKIc3S!|>+3^F8yKGm{^f zvyMhHW=)fg_E$6fYZvd~1aJa40h|C%04IPGzzN_4Z~{01oB&P$Cx8>c3E%{90yqJj z08RiW@c)uP05}mXcrwO|XAwKPJ7~0}v%!v?SUb!*|K-sS;m6*Q=>G?){RRbdHm#LG z?sF0GoVw@khkf!sfSmvOEq|sqekM`yf;`T1#B=q&=k#P)w?XcE8u5Zt*PQDttkLm* zN4&6WuBamVv)^HVUMb?meNwYC;jO9UasGw4{oT)=SeUST?AwJZv zQczkKxCwIJX2gdbTO0}{Dih>!91tJjU-;B0dps0!FDc?bd*-+f*(co~kIzJW%x>@o zw_&9R%yKzvSy_(XY}8_9W^h|e=9uPuo= zBZB?C+}`q7^Zu3dqsZI9I~Q?_H~scyI_n?6{=#I$7fGUa_kTJ`+&ZA~x)5I+akjf< zvP2HK;M`kYU2A_L+U0A={q7>ZMA*Q2l;&3oInN1kr}p2bta?1}LN2UBd<{=7l7xlZ34a`>zW`Q9(R)0XzPMc3E%{90yqJj08RiWfD^z8-~@02I02jhP5>u>6Tk`J1aJa40h|C%04IPGzzN_4 zZ~{01oB&P$C-Chic!y2s}7xih+ns@T*`6^Y7D=IXaO72;&PVx=ySrX96 z=3V2k;JAH9$R9@Pul1|z)q=sh!GzJh0`vq;>p0jb8DJ`R0 zXfVR5hUDS+O6#%F>NWLW9?a|7(@z>dLPL{yuUaXqiu?tpFUm?^mY**S=V!^-(73G! z4eeU0VO}$MvVxhJ?CIRux98>>(194$ZAWP6-J}}9UB-{1wy#a;3^L*be7|}hX^?Nh z@2jC2@pn}`9uArx=_s0o%EiBxnbK?YR9?9?`wcXtQP9wR zL^bSUONRRw{I_T+eL+}k#93EzRK3v9C$7CxR@(L1vXJs|r<~$n!dUhI5seNs^pvcW<6BH zw5H3rS^5Dj@j7b@_q+5#(ntY4LEEqaY?RKtNOVXm^rK@51+qI5rb{!EG|1UbpW(?6 zd?d*wBH%%@aP7GJlYcsabw9+Y)S?w7XeKj^YGh*0&g}RJO^uJ3X9tE&z{(kgL9QNH zK|E8GMwR?oT#zS!qkR67T~R;AR9lcn46I?@O*M{L`kYJ%GW&R}Ps~u=Wta30v=RYfC0?cm36(sIG z(6nc`YvZNX&y$YTXjq8KdXq24!S5&@oevEL@uXAA%A--=jPC6{KG=5f+M$w5=V1*x z3mQx?`;`rgVb%R!sgGG3T|blztcfRQBAxhF292>8Y?NvwEbpUvr!UlzXD$7qHcbSs z192YoB85O>U7#9SN!LDhycKW89ZMhfjO2nfb_(MgXlPxh8s9drvVB&*Pd9Q(wc3e) zB9t_Uj6hpNtWHxJRX&fYm1n+{9TU?LH#h$CKi(Y`!fz z@efr-?FbG|bd}uI6sfMnG;KtR$ihD1_ VYQHp1F9AQBt8)d5D5?o5D5?o5D5?o5D5?o5D5?o5D5?o5D5?o5D5?o5D5?o5D5?o5DEOh zB;bhc2rt+f33Yb-gJ3X;^vitggLfEju5|AK+4bO`9VgNMKM1Qxr3U#qTLNyKgg8x( z<8*0G;WXfu2WNS!ms)Y*ZwCOkHAejO+E2?4gqen8u57Ax94(|FN^?p8JXn;lZL65iE4mb zUPnAZ=3USmHX^>FdWVw>nDiUyjj_` z?bJ#(u)TdU;!kAGb{kF{o(H%^7UE4h*@ZHJcTE9zszC;0g{o zIlmHYZ@Cfi-pdinJM)gid2V$V@qu*}I>{Mq@4)sJyJq>fQ2N5PboSssX4Q}Quo>B_giWKw_!tk$T(iVPkVnI;4a4yA6E9}Xf8fb4Y+G8;vWJPmgYHy z*#hp|HOu2;rN)HfGXb~vMSLt%y==Jr9Xu|M(TGo66xD6L`Y)J|t25%Cj=tVeT=8rM zd=JHDmZybo5EWAh0NlI=@vkQuADi%-!}()DNBo=0_&n|et=;f@J|h0zT2}bG|Ejfs z+sPu%KJwr!wQhbSc&#nA&f?AC2;$@+0XDv|0}6n;M@9-tT8X$_ zaKg3K%j{Nx?d_k=^22?Vu_ry@dF^s*mebPD%Xmj!1>0LmBThXuBTkjja{=6O5#mlK zzbsOy^Mcne7YgF82L#%(_6jY_Rp|l!hQU7_1uNHsw8s+_G^u{Kg_)kYBj+pBYAUKYt7A~uMku^ z9V#C>9jbL|*VZS6RfmJRL9J%^bfb7FYpuCi-dE@$nU+hq^cs77Y$pb;Xeak!PuAlZ zwzz`~xj9*DeN^}34IJ!{UQTM=7qn2MYG&8HDrltui#Lzes@;;{KVy1X!f1H=%)>b*iys<|?lj0^Z%#1w3p;LjlMTZj=tS7jul1onxOVUD)W*vssW85K; zcm%PI$x=&k<1O8};>^~)K2a{&yV*DWmb(*Jt?+4J{(M&Jj*0F|-OLR80?NzIGOKFI zi{#Gf!mgX10eh3>J5)}eDmg-P`05{uJ<*KsS1UI6@fQ9E*8LQ# zqF<51{%nc$ltw_!vSSG=5|te6VXYQMDUv8YN0@4{v#s@c_5RpCjkw&g*Alri%VSfn zKrQ21ZMu68>HWlVx%{?_>$D@-`lKny~MB7w4nr zn&G+J{u{9HGw0`6X~K(dC8bgR7>PRjR#in`#jXD@RL^Zg8TAgHu#pQ~Rl*!V58eneN891GOF@oAC zWpR50Y2_nmVX0t^JsN*ofytt7TOvK*(_~G>&}yM&*^Q~Z<91HK>S7Fy#2JysYNh=e zpl`2Qa+st$T;i{OS*qf`*H>ua>jn0)c{!`~zMt$Sc-mMwKSG-8rr{Rfh5eCmJ?whN zutbh$v07cDH{y2JU7J^SC*fDO11p~lO&4KD7oWY|dl(kih8$KaLRM{J3}8~XFP88;#VLNNo_g)ZXHt^chm#&Tqd@^ws0JXD(Aj_Ik5ZbpTPQ*%CJH$ z@cGDOWqwrd$PJ6`Pno_J>S?pISjMktJ;S1K!1pfX@%JN`tTl4s)$$4vYizT}H2O9e z#4RrS%mFPLqZY}_i`AkjaOv_c4s%md=odB8eVu4pZVED_aKLK{_YdwIzD0&bYpYi` zw$;q=FIKtdoRFS~rGTYD;rtcUlKsI5dHJKv#e_KPcT2u`KV9Q-;KU1Guwqj{|En!Wo*ZPmP9Gfn#1Cshi;T|^rZntw$SJvrwiYQT_0DE;$C_sy zd2|9=TR|PfN9l)l%$SR5cQ@L+=0uLMl{rN`m+ zhK+7C`b>-6YU-k6kwh!=0)RZfNP{nsr@1V_d{_t$9_N39z_@7!rvu zlGXA|svVb>y8mJQp-&e&d+LsPwP}N^1BKfhSY-SzjH%Y#Ea~7s4^9`A_B8i-<^9F) z6zg^82|O#glVGjathHhjo=&t`9hDti)#G!}xVmTFFIn*X;>NGySQ9G8I;IgOYjy;R zdp{HP3URdG@owmGQ}Ny)mM! zCs7uizncDGGME&=b3VU41>2fo<=_s9q-ce8OqOiD?7)eO_mVEP-H1psc^sWD5)aq; zc~2Phx~X9A=dBWuRPaIO)E;}2$_wVzDzFx`$jPjhs(2#SFwNH2HzWGY>CC z;?NFewW8V2#$xZ__9VLu_6uru4;>J_0)Ayvc=#9=m!~tU_362}Y`qDIL#%mzjIX4h zS(j6A6|99_Td=n9ssyWLk+rN?UT94dIf}bzTrXd|)eZmciq9w>{5X+FGHokaE#Zvp kqB41R(bGXqcEN|_N7dr}vEM?t#fxu^{pY_;j5~*a13?oUp#T5? diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/executionHistory/executionHistory.bin b/seed/java-sdk/inline-types/.gradle/8.11.1/executionHistory/executionHistory.bin deleted file mode 100644 index 8d2e5586fe08b98ce6bbb3a123e7312394d2a734..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29880 zcmeHOd0b5E|9?&kNjSD-NiJo(%}fiGkQ;?a(IN>s&7A7gY@IpNhAT_5i#8ELwp@fH zyRu*IMH1Pri)+{Q)#Xd{^?S~lnPzE9-TVFi^Lw3Muc?`5p3nR9dETGT^Z9(9XC@B- zEYPpYAE5r}tbWQqV;Nu>U>RT;U>RT;U>RT;U>RT;U>RT;U>RT;U>RT;U>RT;U>RT; zU>RT;`2WH{AY6#4VlfuB2K1A5aRAtv!6%0OT4OsNJ?ca$-uCXM`uxC--+hWfo9!DF z<73@bv(s4;AAR;#A|Rzi>QQ@gDn|Wq@UXWq@UXWq@UXWq@UXWq@UXWq@UX zWq@UXWq@UXWq@UXWq@UXWq@UXWq@UXWq@UXWq@UXWq@UXWq@UXWq@UXWq@UXWq@UX zWq@UXWq@UXWq@UXWq@Vif5Ctw{C|LJ@NtoTtmivml#_69m^><+kO~Jm;e3Y}d1Ne~ zkE2#b!z<>y+e{hSqHtdh$&Vyr@sXGeH`&`1d#op7R3trp z^%y^Q4{y)VKz~oa(6PP~JXKiq1jCieW$*-qjFPRUf0IO*oFXLR|AsCtKs^dGH5K|t zVh)3y{N*B`B^Hn%#Z8Kuv}O+t^J%e#BfWf5HB|(XLc`NYBt=POt~{O$Cu0ddE>k%d z>R@K!DNmFpT0y`twObN+H?2aGVtLpqNxnDV4@?;S7M<<58vSJAEig zOf|Qv2|Vt;u6FBzV-A^Jj21^>OBm49S^HgqCEjA=GMCJnfpcCTk>*YAIQwwPJ)Q4b>o?&X_sVIE;v)NQqpM7#Hb~fR=>^9iT>J6fWwLu*PO_@_wUwBj7Z`mx#CmB0O9w zl-KQWnN&gvahZ(kheyD0!buNYii-ufm=9SAfLmWWb%#K4qvZN4 zS*8i~5=n)PlKNkRGF}4RC=n3i2*X8z0i!uCsdzjem(tm8qC`mW6FMWPu1{-`pWXmt z842vQ7NjDYJ6b}DFv?RK#~)@5l;bRmQCd3sgCdF{h*A|YyMO#h+ zTm7KkSYiSsKMo^l<5WZ_y9tC@5?u61{led{XcWee#0AP_-z(dbb!>$%PNq(T{SdbN&&OP`I~*A5DSpG`50zJvheNvN_PFu;aLgEz8ReE4lBu4t<*3ag7y}&yTGLI5e-7YJ*Jw8yff! zTBd~N>gw^vv2Y)`P&gSA%JHI2lA#wnB!wE#)ysl_iAY4ptsnx|6r+HJMnq}8!vq0< zMD$nhV>Mk|hAvpNU^J1Kn4)Mdok)2qtQr~AciT4*BIGa($@Y^KtcVWrfRf? zQ6G*GBrS?Bc6jDL>r`vSCgwC5f|f1rxg|Z{W9n>$?BGUZ-NRtV3L|-v9GBw)S~ilD zh>1j;gsUGVAK~{HuHFkKa0<3zFqt?t0n0Z|Oy?p^Fvs8a9oZw2>|#QNNt4T9vk#L5 z1-n)~Rl`e}5H0Dx73T{HsSM{vMGzEMNQ7~H!=i9L#+{^>h_X;_Rc}7A-iXK?ZQMgaA{S$`}YaFr+EwSVO}g1#(h3Utct8n$OIycFs3F z*=8~9k6`-&EkGf04aK6a@bqciL3`$oiG}rS959l>4IcuGVA+kNfI-MeSenF`2&cQK z77R2zJ2=Ea>)?AoRd@N=!X)6KN^38-+0R z|Kd3PeUil{vrSdI@A>x`QSwKNme!jo&>JU72^k6xO=3J06N@DoU z0^On_3sy5<+P0xy^KoeHSYIb8KnhFT9j=J z9ygT&J)_Hx&2~e9;{qCdF%eJ3)egv z&nq&%6*L3-M+FRTjBwiH^$|PgTc{BW7o8kZ`E}g$<8kv7c-$TBTxZ>>3c2o_RF-io zVx;}P3JP>rA;QZB3|>}&pM#B=CMpH*Q#cB*>9rUvnyJQ4Se`m}Qa&!5QF$@**8H;u`<(;JQgS<1f4Z}3 zmVf_CB`}}X!;TU}yXZF?SW{}~%c1>e#I;PHQL(YW{m{hmWBVobz0WEA{djcAf(vg% zwqgnlP(h0%0=W?9NHG%T0+{SMbWUKlSbf65gokP!u~B8Y@gw@CWZEvh0cYM+R+68zo6D1=Z?FPeKV8?aPi3VVjrG`34<~o=6G2J%zX-i)KDi47#69w*hvb9`1M8{U3n8E`n&KD~zj;>{m@XKntx@_hEyr^6&IeP2_c zk6vV%l+Z+P;(-*QfFoVNRFH7Zv6#YESJjy20$ddtG(H|lp)fK6r}}Ktx@eM-e4Yp+ z#5@`Y9>GKivJn2xYkU&CE5ro|vINd#p6+hKbRJAeu+2k|RF#x+q@d}-&_EJLkPICJ zX7~)!OdQ@QApwsEzRZP(j3Lqxwb^jfrB~OW10H3s#!SCzl7Q^gr%R9M&&^iv0h<*1 zdej4lH?Pb+1-w6}-C&4z`S+fT^(%_DO#3})Qu}csGm(9It!NOTq}j%Jiem{_eMOKE zr41d+ZS5SN=EOYTTZy!`|5}7>*K32W;OS;8G59fzg7KVy-`G(yOgNAT~_)h@6y?Wm~rvl%RdduIdIKwX9HWc5sXXCWc!^ZMPb<+l}PuSE(gd*bJ?tA~(wrBwH6* z^;Wa|rxM~#l*lMQcx9_hAxa8|-I{JXR5Eb~*U>RJe8_= zX-s~9GrUV5q@ZgvbzRGhUvJL7WF&ZAV)`Q*0sM#=ezpp)lwp%42o%G!I(Da0(Y5cd|DER5ra17}_vXmQdolIHP_JO=-(@BMhJwmV zzEeJR9kwg)v3a7;-L3O#ha)>0BSJ0tkCf9#S2{$59W%r)O833Y4m#|}MS7CoR<4k2 z)&^8?=L5S=T%ZVA^(qX}Co72DL+$$RP1~8Cml*i9OZ^Sln0&KZPX!R22sI7J-DBa~ z;d~_TPF2#4;f5x+>$jfz5JHJ9xk;eefw}(e|m$5%VYIYQG>#~0BEXK9yYJs z?;IiuwoMw9+3#nwd7enFZV>8-7_6_SuI_M+7FZf`l1KB*ruGh-)7QZnz(O)tZVQ*3eYhnRN9>DHJA6Mek}ZOwfCe2S+vlXcF1bo10+C& zk0M8|xpl(Zb@|f59-Ax#%b2-K4UtrxBOgGmk^tf4R(SWUF^7DnvX&Pb}xQ3{|}t%46u$Z-ialA95Qi?XCU znW-BLkhJr0fS$PMxa!&AXNSMHvF+;)xV-0#*g+E{TP>#DG6Qt!+ZUrHMJvp@jsFc4e%c;h z#mH{hqxqc_&R^iKZq<-Vf*UzlmxJ&;xYTFoUuH>O*@8okG~Wynsf z;_98`nJd@Q(YD&y5THJXmRbzjk-TC}>4n%l>d*_YMAgnA8TuMRfMy(g+|GLPIf;CB zq)S5LDVJ>w*zWESY|fn;=cOh)+iu^U7StoYz#GX_FH$3u05m(#GcRS>txm5^PT#w* z)$Pm~2BWMCvO!lsvkwF4Il~ScQg^j*GquY)I{y9zhcZSk)fg;dvM-YRjdlm1<*i5U ztwLL*cds7q7?Ux^b3ryuMG^h z>zW0Crar%or5E2myk>v#Uh`222J4uq4-Jvky2TBk0k4fLJgL)#x3_E={b6QMEyz$;Naa#4S9X_s{S$UtCdAu9+Y^K@a(E+pP?J0Mu0VW?L zE8$R9wUwRM`F1&*i}7^^R z1EcbI-inr@?DPFRPqy!QR224{vHd;#rVna;W!p;2;SYh|!y)c@N3VZ|LtR6DOy4!z zwa+P$kL#((A+zC7ZS}*Y+pK!OD;#^QJpb9-6gc#-Ta|USVXH*r`%iZiCY+PPA@dEj zBiv?$oeT4m9{o9Eff*dK71#R7#+JG+cv~aRsqRX%b+M$yXRC-irFSbWhnyOHtTp`w Ix_-m|4{u@>bpQYW diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/executionHistory/executionHistory.lock b/seed/java-sdk/inline-types/.gradle/8.11.1/executionHistory/executionHistory.lock deleted file mode 100644 index af931a05bd134b1329f6d57434db335549b4530b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17 UcmZR6bIwX*OV+us3=qH$06q8x2mk;8 diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/fileChanges/last-build.bin b/seed/java-sdk/inline-types/.gradle/8.11.1/fileChanges/last-build.bin deleted file mode 100644 index f76dd238ade08917e6712764a16a22005a50573d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1 IcmZPo000310RR91 diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/fileHashes/fileHashes.bin b/seed/java-sdk/inline-types/.gradle/8.11.1/fileHashes/fileHashes.bin deleted file mode 100644 index 1d10caee1701224b8e9efd73420bc04c4f3cd6b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21347 zcmeI3do+|=AIF~=moVd!TU0Jxre0D+q7F)kai=6vp^{79PMw4iNr^a0t|=u^q^J%F zU6IgDLdfM*q@q-Gk;wZzv-ft^JLAvyuXpXemS<*t?9cPt`}=I0wahjp2nDGz*oc3c z+&^#eJDdPc04IPGzzN_4Z~{01oB&P$Cx8>c3E%{90yqJj08RiWfD^z8-~|3(5^y3X zA_gX-ph2hJNCpyw7L$ClBx*z;oH!{x2)=C>g8qLH+kLrw@!74ifIBoG9+%RYmyvLF z7;yVm#8dRo_-MYEIs&*O!eeQfCF*unoLs=!qUamP?+>su!=j>Lf4y=3#eZYO@qZNo zZgCdz43}Kzory2I;C(U>FK}p2G>cF;2e|cZ#0#B!B@cu}?1lFiLi~mxGu@ExD+RdS z6vS`(HEVQwHC6#`VLZ-rBWERx)GmYfk3;;{zzfx}=rBpZtr8J0@0znuS2ofFa0f%g z>+J7e?_?HN0&c5>_!DNjQA-6Q58lTE@p_l6p+y%Ox4`~(h&L_F)w}aKLkn=rQN&vh zR)z;PA6Wr7`!~ctUG@#r@OBRc+~N(O%Ruh@>D;h zW@ihyRTbjOB^_r?Yu8!B{*w`BarUq|%)xda;#$WzAu|Wv zRN?(K5!bFQ=&?%kf%)6?A+FmpdzFwx=mpT<+I5__I+UgVob3g;MKj_n!kThoy$%Hc z&h{VYHLBfSe`aR_Zl8m=>5S&okz)>?fLnbZ=g}eOOdp+sKaV!0h?|Y5zOj((3IhG@ z@)5VDbB?z$tyLjskMlm!NI8}g{NJMG1H|naTAsZ#cEjiEz(CwlGh-}Y{XjgpkL_#3 zU3+dn&Uag*2DtTS#5dK@dQ78x;k+!jBEFe^Pwu5yt{&)b2RGmY)3q- z{6qH7`C+c0zoQT0=#?OZU~SL?UvUCB0h|C%04IPGzzN_4Z~{01oB&P$Cx8>c3E%{9 z0yqJj08RiWfD^z8-~@02I02jhP5>u>6Tk`J1aJa40h|C%04IPGzzN_4a036U1a!z7 zQ6I#eL48Rr+~QktLiSrZCthA<*y)BbLC_M5Eq)yb)fg${>w^C_qIVCLzgJ;7YquMC zMby8Y35_Yh$fG_(&tuRx2wdLPSDj`Yu*ft2(R%Vz+uR!P)B!QdZ}ca-vBJXD9wfFa zZ&aN3_zg7RIf9u>`Hid9?)`rAb!%BC?H^UUl#?e5$Qo?1U@$6z#&6iI{h?@ZKD$ev zW80RsZ`2UfsCWkqW*NV+E_z3fhMvoE-+*M>A`gXBXbb>@L469IXXdZ{+PCX!eHdM1 z@#ZC)r8gZKpMfDK&2Px8o%TJEEnebueV#mRsC@@C;K>bIJHN3_Ci&m*DlYY=IbYLR zKvUicjXqFA>>$6<9p`iUs^px4#N4E8j?)k)(E|)-IKLsQY84Xqv25LH&vJvoL~U}haceXIL+mlXvBE3kQ>k;%&ban0i7dJ# z`I&jHLCu(Kbn1)*PrBmErMnHaw{-=GDSEV@w+n&BGp;}g`|}$zjT%}yJ?T5%7PQhB z3&)C~L5+rNv{>@OQzPJ_b(4{O;F{Bif}Pf0cK;n3ja-2co?w-f_H~{QS|g%8a4TcJ z_v}0+Xgmal&|3Z)tdmXps*28knLh0^UtcFeu37HP$&{%k_K3XjjLN5E;G=V7-I)2T z)2im`H%>$2CDosNKa0HZ80;ZkrIUBde0>Usr7~?Fk|$%hHQKlWAu+)-*J!9I8F2Iq zcJ%J>UhV10fd+hn!XNo-O!=Old?K#+jN8j_hsl<%?$CG+YD}U|4e^Ysw=s1KZEsV< zozHH&LMzmNK%)Z~G-^fi7^^ITDmXE{^;Mx6pO(Dc(*TX9zz{maZ)DfrE%Xp7X?t*S zQTks`jL0()+?m6y1Sj(wt_R<@8mKy_?r&>Izx=~*8#LfE7ggjp44T)A{kGjcXMv86 zi`Nphuh19*qhd~w)#eblBBNzZp(#I;ww?%2wSvYMV2Dwxg=gmKLD%NfhelMtCR=3gJIB|o-E^VU%Xj}z`_-=kQ$?`^7uLj8zO5B;>1qMTq--u8ReV7?VyBM08 z=@z$PsW&vp=R!3pCVAnRNBk)PnTD@o9Jj&8(nE*cTcH70ySM?ru~y2Bb0T!Ek;C0}_)HT5VfFE%hQ zB|&k=7bV*e^6U<`#uH!&ldGTC*!IeMMMCpU>!p9j6iv@i*bEJ7_aqx_g5QJ7(x1#f z^-Lw(=H8K~rCy2Gp-}@2;ZpLIXH=HIlIH)=3>4qY(MUY6d=u>LY{nH}2yNmwSS~9F z1DT4k+r1+CzcbVQU=4D|rW$iSdEu#1r{Yp*ldkU~7{K%?I+#lK zUcM_aw0`(OLHtnBx4M}Q(15FbqFprR)4P@1i{qG6t^Ov8ew_1yMn9-Q%OYQSX8x=# zuSGeiGV7h@iKXwCog>fnap!Rx7(x^53^!|Zj=Z_{=Gr`##vEf}0sN_Dz@0&m`V*0- z23u`8(LM6)!{$0!L#vYDJFo^^?V=O>#z`*hlAOJ!YJ0#QZ~b7-ZGB)cSzuJ+7x-(W zWt(M388pkj7rE13on=%B4HIB6sNV`aqpA{+J{f;r*how(walucS{oXUz@U?>pIGo8 Dk*AYj diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/fileHashes/fileHashes.lock b/seed/java-sdk/inline-types/.gradle/8.11.1/fileHashes/fileHashes.lock deleted file mode 100644 index ceb63f493a0e56b34ebe229d6011aeacc7ce5743..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17 UcmZR!JvA-8XIrc@0|eLt05SChCjbBd diff --git a/seed/java-sdk/inline-types/.gradle/8.11.1/gc.properties b/seed/java-sdk/inline-types/.gradle/8.11.1/gc.properties deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/buildOutputCleanup.lock deleted file mode 100644 index 994c2c1f1da9fdd171dfdefe1cf520e5da536d66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17 UcmZQRwtd%oG3f)23=kj;06Dn?ZvX%Q diff --git a/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/cache.properties b/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/cache.properties deleted file mode 100644 index a44f3f3f1bb..00000000000 --- a/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/cache.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Wed Dec 11 15:14:03 UTC 2024 -gradle.version=8.11.1 diff --git a/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/outputFiles.bin b/seed/java-sdk/inline-types/.gradle/buildOutputCleanup/outputFiles.bin deleted file mode 100644 index d8ba9331271521b85eb716a8d243f673103141b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18749 zcmeI%y-NaN9Ki9@rB^HhLC0PoF^3>(Y7rW8Dv=s{fjX|DK^%;rh6!&)j%HgaG86kiG z0tg_000IagfB*srAb1iVsDF+YcbEU>gUqq_N;&0T?|`2P$xaPaOb<%Z&PZ%U;1U|dP@Je4yk@9 zJv-sND%m22>buelNAs&bV`@e9E$Mb6(tT2TeO5gr-J59}%q1^gR4+>J&jwHT-n(?w zGtx(M-u8iXZprEaxAb6rKEGjXcBuKY(&uIhX?@#sqvrQW4?mq{5|8^$YJOC@+%?TM zZ9U_P00IagfB*srAb - - - - - - - - - - - - Gradle Configuration Cache - - - -
- -
- Loading... -
- - - - - - diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/SeedObjectClient.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/SeedObjectClient.java deleted file mode 100644 index 372519d5daa..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/SeedObjectClient.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.seed.object.core.ClientOptions; -import com.seed.object.core.MediaTypes; -import com.seed.object.core.ObjectMappers; -import com.seed.object.core.RequestOptions; -import com.seed.object.core.SeedObjectApiException; -import com.seed.object.core.SeedObjectException; -import com.seed.object.requests.PostRootRequest; -import com.seed.object.types.RootType1; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class SeedObjectClient { - protected final ClientOptions clientOptions; - - public SeedObjectClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public RootType1 getRoot(PostRootRequest request) { - return getRoot(request, null); - } - - public RootType1 getRoot(PostRootRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("root") - .addPathSegments("root") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new SeedObjectException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RootType1.class); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new SeedObjectApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); - } catch (IOException e) { - throw new SeedObjectException("Network error executing HTTP request", e); - } - } - - public static SeedObjectClientBuilder builder() { - return new SeedObjectClientBuilder(); - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/SeedObjectClientBuilder.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/SeedObjectClientBuilder.java deleted file mode 100644 index 0421ff3dee7..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/SeedObjectClientBuilder.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object; - -import com.seed.object.core.ClientOptions; -import com.seed.object.core.Environment; - -public final class SeedObjectClientBuilder { - private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); - - private Environment environment; - - public SeedObjectClientBuilder url(String url) { - this.environment = Environment.custom(url); - return this; - } - - public SeedObjectClient build() { - clientOptionsBuilder.environment(this.environment); - return new SeedObjectClient(clientOptionsBuilder.build()); - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ClientOptions.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ClientOptions.java deleted file mode 100644 index c403c535450..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ClientOptions.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; -import okhttp3.OkHttpClient; - -public final class ClientOptions { - private final Environment environment; - - private final Map headers; - - private final Map> headerSuppliers; - - private final OkHttpClient httpClient; - - private ClientOptions( - Environment environment, - Map headers, - Map> headerSuppliers, - OkHttpClient httpClient) { - this.environment = environment; - this.headers = new HashMap<>(); - this.headers.putAll(headers); - this.headers.putAll(new HashMap() { - { - put("X-Fern-Language", "JAVA"); - } - }); - this.headerSuppliers = headerSuppliers; - this.httpClient = httpClient; - } - - public Environment environment() { - return this.environment; - } - - public Map headers(RequestOptions requestOptions) { - Map values = new HashMap<>(this.headers); - headerSuppliers.forEach((key, supplier) -> { - values.put(key, supplier.get()); - }); - if (requestOptions != null) { - values.putAll(requestOptions.getHeaders()); - } - return values; - } - - public OkHttpClient httpClient() { - return this.httpClient; - } - - public OkHttpClient httpClientWithTimeout(RequestOptions requestOptions) { - if (requestOptions == null) { - return this.httpClient; - } - return this.httpClient - .newBuilder() - .callTimeout(requestOptions.getTimeout().get(), requestOptions.getTimeoutTimeUnit()) - .connectTimeout(0, TimeUnit.SECONDS) - .writeTimeout(0, TimeUnit.SECONDS) - .readTimeout(0, TimeUnit.SECONDS) - .build(); - } - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder { - private Environment environment; - - private final Map headers = new HashMap<>(); - - private final Map> headerSuppliers = new HashMap<>(); - - public Builder environment(Environment environment) { - this.environment = environment; - return this; - } - - public Builder addHeader(String key, String value) { - this.headers.put(key, value); - return this; - } - - public Builder addHeader(String key, Supplier value) { - this.headerSuppliers.put(key, value); - return this; - } - - public ClientOptions build() { - OkHttpClient okhttpClient = new OkHttpClient.Builder() - .addInterceptor(new RetryInterceptor(3)) - .build(); - return new ClientOptions(environment, headers, headerSuppliers, okhttpClient); - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/DateTimeDeserializer.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/DateTimeDeserializer.java deleted file mode 100644 index ad231070a3d..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/DateTimeDeserializer.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.module.SimpleModule; -import java.io.IOException; -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalQueries; - -/** - * Custom deserializer that handles converting ISO8601 dates into {@link OffsetDateTime} objects. - */ -class DateTimeDeserializer extends JsonDeserializer { - private static final SimpleModule MODULE; - - static { - MODULE = new SimpleModule().addDeserializer(OffsetDateTime.class, new DateTimeDeserializer()); - } - - /** - * Gets a module wrapping this deserializer as an adapter for the Jackson ObjectMapper. - * - * @return A {@link SimpleModule} to be plugged onto Jackson ObjectMapper. - */ - public static SimpleModule getModule() { - return MODULE; - } - - @Override - public OffsetDateTime deserialize(JsonParser parser, DeserializationContext context) throws IOException { - JsonToken token = parser.currentToken(); - if (token == JsonToken.VALUE_NUMBER_INT) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(parser.getValueAsLong()), ZoneOffset.UTC); - } else { - TemporalAccessor temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest( - parser.getValueAsString(), OffsetDateTime::from, LocalDateTime::from); - - if (temporal.query(TemporalQueries.offset()) == null) { - return LocalDateTime.from(temporal).atOffset(ZoneOffset.UTC); - } else { - return OffsetDateTime.from(temporal); - } - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/Environment.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/Environment.java deleted file mode 100644 index 19b694c5b93..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/Environment.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -public final class Environment { - private final String url; - - private Environment(String url) { - this.url = url; - } - - public String getUrl() { - return this.url; - } - - public static Environment custom(String url) { - return new Environment(url); - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/FileStream.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/FileStream.java deleted file mode 100644 index eef28eef8bd..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/FileStream.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.io.InputStream; -import java.util.Objects; -import okhttp3.MediaType; -import okhttp3.RequestBody; -import org.jetbrains.annotations.Nullable; - -/** - * Represents a file stream with associated metadata for file uploads. - */ -public class FileStream { - private final InputStream inputStream; - private final String fileName; - private final MediaType contentType; - - /** - * Constructs a FileStream with the given input stream and optional metadata. - * - * @param inputStream The input stream of the file content. Must not be null. - * @param fileName The name of the file, or null if unknown. - * @param contentType The MIME type of the file content, or null if unknown. - * @throws NullPointerException if inputStream is null - */ - public FileStream(InputStream inputStream, @Nullable String fileName, @Nullable MediaType contentType) { - this.inputStream = Objects.requireNonNull(inputStream, "Input stream cannot be null"); - this.fileName = fileName; - this.contentType = contentType; - } - - public FileStream(InputStream inputStream) { - this(inputStream, null, null); - } - - public InputStream getInputStream() { - return inputStream; - } - - @Nullable - public String getFileName() { - return fileName; - } - - @Nullable - public MediaType getContentType() { - return contentType; - } - - /** - * Creates a RequestBody suitable for use with OkHttp client. - * - * @return A RequestBody instance representing this file stream. - */ - public RequestBody toRequestBody() { - return new InputStreamRequestBody(contentType, inputStream); - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/InputStreamRequestBody.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/InputStreamRequestBody.java deleted file mode 100644 index 433d823fbed..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/InputStreamRequestBody.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Objects; -import okhttp3.MediaType; -import okhttp3.RequestBody; -import okhttp3.internal.Util; -import okio.BufferedSink; -import okio.Okio; -import okio.Source; -import org.jetbrains.annotations.Nullable; - -/** - * A custom implementation of OkHttp's RequestBody that wraps an InputStream. - * This class allows streaming of data from an InputStream directly to an HTTP request body, - * which is useful for file uploads or sending large amounts of data without loading it all into memory. - */ -public class InputStreamRequestBody extends RequestBody { - private final InputStream inputStream; - private final MediaType contentType; - - /** - * Constructs an InputStreamRequestBody with the specified content type and input stream. - * - * @param contentType the MediaType of the content, or null if not known - * @param inputStream the InputStream containing the data to be sent - * @throws NullPointerException if inputStream is null - */ - public InputStreamRequestBody(@Nullable MediaType contentType, InputStream inputStream) { - this.contentType = contentType; - this.inputStream = Objects.requireNonNull(inputStream, "inputStream == null"); - } - - /** - * Returns the content type of this request body. - * - * @return the MediaType of the content, or null if not specified - */ - @Nullable - @Override - public MediaType contentType() { - return contentType; - } - - /** - * Returns the content length of this request body, if known. - * This method attempts to determine the length using the InputStream's available() method, - * which may not always accurately reflect the total length of the stream. - * - * @return the content length, or -1 if the length is unknown - * @throws IOException if an I/O error occurs - */ - @Override - public long contentLength() throws IOException { - return inputStream.available() == 0 ? -1 : inputStream.available(); - } - - /** - * Writes the content of the InputStream to the given BufferedSink. - * This method is responsible for transferring the data from the InputStream to the network request. - * - * @param sink the BufferedSink to write the content to - * @throws IOException if an I/O error occurs during writing - */ - @Override - public void writeTo(BufferedSink sink) throws IOException { - Source source = null; - try { - source = Okio.source(inputStream); - sink.writeAll(source); - } finally { - Util.closeQuietly(Objects.requireNonNull(source)); - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/MediaTypes.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/MediaTypes.java deleted file mode 100644 index df45659067e..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/MediaTypes.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import okhttp3.MediaType; - -public final class MediaTypes { - - public static final MediaType APPLICATION_JSON = MediaType.parse("application/json"); - - private MediaTypes() {} -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ObjectMappers.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ObjectMappers.java deleted file mode 100644 index c889a5b4c3d..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ObjectMappers.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import java.io.IOException; - -public final class ObjectMappers { - public static final ObjectMapper JSON_MAPPER = JsonMapper.builder() - .addModule(new Jdk8Module()) - .addModule(new JavaTimeModule()) - .addModule(DateTimeDeserializer.getModule()) - .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) - .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .build(); - - private ObjectMappers() {} - - public static String stringify(Object o) { - try { - return JSON_MAPPER - .setSerializationInclusion(JsonInclude.Include.ALWAYS) - .writerWithDefaultPrettyPrinter() - .writeValueAsString(o); - } catch (IOException e) { - return o.getClass().getName() + "@" + Integer.toHexString(o.hashCode()); - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/RequestOptions.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/RequestOptions.java deleted file mode 100644 index 5ea45c533b5..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/RequestOptions.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.TimeUnit; - -public final class RequestOptions { - private final Optional timeout; - - private final TimeUnit timeoutTimeUnit; - - private RequestOptions(Optional timeout, TimeUnit timeoutTimeUnit) { - this.timeout = timeout; - this.timeoutTimeUnit = timeoutTimeUnit; - } - - public Optional getTimeout() { - return timeout; - } - - public TimeUnit getTimeoutTimeUnit() { - return timeoutTimeUnit; - } - - public Map getHeaders() { - Map headers = new HashMap<>(); - return headers; - } - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder { - private Optional timeout = Optional.empty(); - - private TimeUnit timeoutTimeUnit = TimeUnit.SECONDS; - - public Builder timeout(Integer timeout) { - this.timeout = Optional.of(timeout); - return this; - } - - public Builder timeout(Integer timeout, TimeUnit timeoutTimeUnit) { - this.timeout = Optional.of(timeout); - this.timeoutTimeUnit = timeoutTimeUnit; - return this; - } - - public RequestOptions build() { - return new RequestOptions(timeout, timeoutTimeUnit); - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ResponseBodyInputStream.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ResponseBodyInputStream.java deleted file mode 100644 index ea75c68fd88..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ResponseBodyInputStream.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.io.FilterInputStream; -import java.io.IOException; -import okhttp3.Response; - -/** - * A custom InputStream that wraps the InputStream from the OkHttp Response and ensures that the - * OkHttp Response object is properly closed when the stream is closed. - * - * This class extends FilterInputStream and takes an OkHttp Response object as a parameter. - * It retrieves the InputStream from the Response and overrides the close method to close - * both the InputStream and the Response object, ensuring proper resource management and preventing - * premature closure of the underlying HTTP connection. - */ -public class ResponseBodyInputStream extends FilterInputStream { - private final Response response; - - /** - * Constructs a ResponseBodyInputStream that wraps the InputStream from the given OkHttp - * Response object. - * - * @param response the OkHttp Response object from which the InputStream is retrieved - * @throws IOException if an I/O error occurs while retrieving the InputStream - */ - public ResponseBodyInputStream(Response response) throws IOException { - super(response.body().byteStream()); - this.response = response; - } - - /** - * Closes the InputStream and the associated OkHttp Response object. This ensures that the - * underlying HTTP connection is properly closed after the stream is no longer needed. - * - * @throws IOException if an I/O error occurs - */ - @Override - public void close() throws IOException { - super.close(); - response.close(); // Ensure the response is closed when the stream is closed - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ResponseBodyReader.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ResponseBodyReader.java deleted file mode 100644 index 3903eb7436c..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/ResponseBodyReader.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.io.FilterReader; -import java.io.IOException; -import okhttp3.Response; - -/** - * A custom Reader that wraps the Reader from the OkHttp Response and ensures that the - * OkHttp Response object is properly closed when the reader is closed. - * - * This class extends FilterReader and takes an OkHttp Response object as a parameter. - * It retrieves the Reader from the Response and overrides the close method to close - * both the Reader and the Response object, ensuring proper resource management and preventing - * premature closure of the underlying HTTP connection. - */ -public class ResponseBodyReader extends FilterReader { - private final Response response; - - /** - * Constructs a ResponseBodyReader that wraps the Reader from the given OkHttp Response object. - * - * @param response the OkHttp Response object from which the Reader is retrieved - * @throws IOException if an I/O error occurs while retrieving the Reader - */ - public ResponseBodyReader(Response response) throws IOException { - super(response.body().charStream()); - this.response = response; - } - - /** - * Closes the Reader and the associated OkHttp Response object. This ensures that the - * underlying HTTP connection is properly closed after the reader is no longer needed. - * - * @throws IOException if an I/O error occurs - */ - @Override - public void close() throws IOException { - super.close(); - response.close(); // Ensure the response is closed when the reader is closed - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/RetryInterceptor.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/RetryInterceptor.java deleted file mode 100644 index 9f541cea8fc..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/RetryInterceptor.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.io.IOException; -import java.time.Duration; -import java.util.Optional; -import java.util.Random; -import okhttp3.Interceptor; -import okhttp3.Response; - -public class RetryInterceptor implements Interceptor { - - private static final Duration ONE_SECOND = Duration.ofSeconds(1); - private final ExponentialBackoff backoff; - private final Random random = new Random(); - - public RetryInterceptor(int maxRetries) { - this.backoff = new ExponentialBackoff(maxRetries); - } - - @Override - public Response intercept(Chain chain) throws IOException { - Response response = chain.proceed(chain.request()); - - if (shouldRetry(response.code())) { - return retryChain(response, chain); - } - - return response; - } - - private Response retryChain(Response response, Chain chain) throws IOException { - Optional nextBackoff = this.backoff.nextBackoff(); - while (nextBackoff.isPresent()) { - try { - Thread.sleep(nextBackoff.get().toMillis()); - } catch (InterruptedException e) { - throw new IOException("Interrupted while trying request", e); - } - response.close(); - response = chain.proceed(chain.request()); - if (shouldRetry(response.code())) { - nextBackoff = this.backoff.nextBackoff(); - } else { - return response; - } - } - - return response; - } - - private static boolean shouldRetry(int statusCode) { - return statusCode == 408 || statusCode == 409 || statusCode == 429 || statusCode >= 500; - } - - private final class ExponentialBackoff { - - private final int maxNumRetries; - - private int retryNumber = 0; - - ExponentialBackoff(int maxNumRetries) { - this.maxNumRetries = maxNumRetries; - } - - public Optional nextBackoff() { - retryNumber += 1; - if (retryNumber > maxNumRetries) { - return Optional.empty(); - } - - int upperBound = (int) Math.pow(2, retryNumber); - return Optional.of(ONE_SECOND.multipliedBy(random.nextInt(upperBound))); - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/SeedObjectApiException.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/SeedObjectApiException.java deleted file mode 100644 index 64ec8313ea1..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/SeedObjectApiException.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -/** - * This exception type will be thrown for any non-2XX API responses. - */ -public class SeedObjectApiException extends SeedObjectException { - /** - * The error code of the response that triggered the exception. - */ - private final int statusCode; - - /** - * The body of the response that triggered the exception. - */ - private final Object body; - - public SeedObjectApiException(String message, int statusCode, Object body) { - super(message); - this.statusCode = statusCode; - this.body = body; - } - - /** - * @return the statusCode - */ - public int statusCode() { - return this.statusCode; - } - - /** - * @return the body - */ - public Object body() { - return this.body; - } - - @java.lang.Override - public String toString() { - return "SeedObjectApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " - + body + "}"; - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/SeedObjectException.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/SeedObjectException.java deleted file mode 100644 index a338879cb59..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/SeedObjectException.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -/** - * This class serves as the base exception for all errors in the SDK. - */ -public class SeedObjectException extends RuntimeException { - public SeedObjectException(String message) { - super(message); - } - - public SeedObjectException(String message, Exception e) { - super(message, e); - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/Stream.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/Stream.java deleted file mode 100644 index ecc1492c728..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/Stream.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.io.Reader; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Scanner; - -/** - * The {@code Stream} class implmenets {@link Iterable} to provide a simple mechanism for reading and parsing - * objects of a given type from data streamed via a {@link Reader} using a specified delimiter. - *

- * {@code Stream} assumes that data is being pushed to the provided {@link Reader} asynchronously and utilizes a - * {@code Scanner} to block during iteration if the next object is not available. - * - * @param The type of objects in the stream. - */ -public final class Stream implements Iterable { - /** - * The {@link Class} of the objects in the stream. - */ - private final Class valueType; - /** - * The {@link Scanner} used for reading from the input stream and blocking when neede during iteration. - */ - private final Scanner scanner; - - /** - * Constructs a new {@code Stream} with the specified value type, reader, and delimiter. - * - * @param valueType The class of the objects in the stream. - * @param reader The reader that provides the streamed data. - * @param delimiter The delimiter used to separate elements in the stream. - */ - public Stream(Class valueType, Reader reader, String delimiter) { - this.scanner = new Scanner(reader).useDelimiter(delimiter); - this.valueType = valueType; - } - - /** - * Returns an iterator over the elements in this stream that blocks during iteration when the next object is - * not yet available. - * - * @return An iterator that can be used to traverse the elements in the stream. - */ - @Override - public Iterator iterator() { - return new Iterator() { - /** - * Returns {@code true} if there are more elements in the stream. - *

- * Will block and wait for input if the stream has not ended and the next object is not yet available. - * - * @return {@code true} if there are more elements, {@code false} otherwise. - */ - @Override - public boolean hasNext() { - return scanner.hasNext(); - } - - /** - * Returns the next element in the stream. - *

- * Will block and wait for input if the stream has not ended and the next object is not yet available. - * - * @return The next element in the stream. - * @throws NoSuchElementException If there are no more elements in the stream. - */ - @Override - public T next() { - if (!scanner.hasNext()) { - throw new NoSuchElementException(); - } else { - try { - T parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - scanner.next().trim(), valueType); - return parsedResponse; - } catch (Exception e) { - throw new RuntimeException(e); - } - } - } - - /** - * Removing elements from {@code Stream} is not supported. - * - * @throws UnsupportedOperationException Always, as removal is not supported. - */ - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/Suppliers.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/Suppliers.java deleted file mode 100644 index 5001ddf4767..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/core/Suppliers.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.util.Objects; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Supplier; - -public final class Suppliers { - private Suppliers() {} - - public static Supplier memoize(Supplier delegate) { - AtomicReference value = new AtomicReference<>(); - return () -> { - T val = value.get(); - if (val == null) { - val = value.updateAndGet(cur -> cur == null ? Objects.requireNonNull(delegate.get()) : cur); - } - return val; - }; - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/requests/PostRootRequest.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/requests/PostRootRequest.java deleted file mode 100644 index 61d78f3a823..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/requests/PostRootRequest.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import com.seed.object.types.InlineType1; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PostRootRequest.Builder.class) -public final class PostRootRequest { - private final InlineType1 bar; - - private final String foo; - - private final Map additionalProperties; - - private PostRootRequest(InlineType1 bar, String foo, Map additionalProperties) { - this.bar = bar; - this.foo = foo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("bar") - public InlineType1 getBar() { - return bar; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PostRootRequest && equalTo((PostRootRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PostRootRequest other) { - return bar.equals(other.bar) && foo.equals(other.foo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.bar, this.foo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BarStage builder() { - return new Builder(); - } - - public interface BarStage { - FooStage bar(@NotNull InlineType1 bar); - - Builder from(PostRootRequest other); - } - - public interface FooStage { - _FinalStage foo(@NotNull String foo); - } - - public interface _FinalStage { - PostRootRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements BarStage, FooStage, _FinalStage { - private InlineType1 bar; - - private String foo; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(PostRootRequest other) { - bar(other.getBar()); - foo(other.getFoo()); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public FooStage bar(@NotNull InlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public _FinalStage foo(@NotNull String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - public PostRootRequest build() { - return new PostRootRequest(bar, foo, additionalProperties); - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlineEnum.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlineEnum.java deleted file mode 100644 index c092fdbeee4..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlineEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum InlineEnum { - SUNNY("SUNNY"), - - CLOUDY("CLOUDY"), - - RAINING("RAINING"), - - SNOWING("SNOWING"); - - private final String value; - - InlineEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlineType1.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlineType1.java deleted file mode 100644 index 1cd11b9008e..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlineType1.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = InlineType1.Builder.class) -public final class InlineType1 { - private final String foo; - - private final NestedInlineType1 bar; - - private final Map additionalProperties; - - private InlineType1(String foo, NestedInlineType1 bar, Map additionalProperties) { - this.foo = foo; - this.bar = bar; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public NestedInlineType1 getBar() { - return bar; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlineType1 && equalTo((InlineType1) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(InlineType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(@NotNull String foo); - - Builder from(InlineType1 other); - } - - public interface BarStage { - _FinalStage bar(@NotNull NestedInlineType1 bar); - } - - public interface _FinalStage { - InlineType1 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FooStage, BarStage, _FinalStage { - private String foo; - - private NestedInlineType1 bar; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(InlineType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(@NotNull String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public _FinalStage bar(@NotNull NestedInlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - public InlineType1 build() { - return new InlineType1(foo, bar, additionalProperties); - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlineType2.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlineType2.java deleted file mode 100644 index 4b02ac98287..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlineType2.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = InlineType2.Builder.class) -public final class InlineType2 { - private final String baz; - - private final Map additionalProperties; - - private InlineType2(String baz, Map additionalProperties) { - this.baz = baz; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("baz") - public String getBaz() { - return baz; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlineType2 && equalTo((InlineType2) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(InlineType2 other) { - return baz.equals(other.baz); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.baz); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BazStage builder() { - return new Builder(); - } - - public interface BazStage { - _FinalStage baz(@NotNull String baz); - - Builder from(InlineType2 other); - } - - public interface _FinalStage { - InlineType2 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements BazStage, _FinalStage { - private String baz; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(InlineType2 other) { - baz(other.getBaz()); - return this; - } - - @java.lang.Override - @JsonSetter("baz") - public _FinalStage baz(@NotNull String baz) { - this.baz = Objects.requireNonNull(baz, "baz must not be null"); - return this; - } - - @java.lang.Override - public InlineType2 build() { - return new InlineType2(baz, additionalProperties); - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlinedDiscriminatedUnion1.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlinedDiscriminatedUnion1.java deleted file mode 100644 index fa7004fcaa0..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlinedDiscriminatedUnion1.java +++ /dev/null @@ -1,200 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonUnwrapped; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Objects; -import java.util.Optional; - -public final class InlinedDiscriminatedUnion1 { - private final Value value; - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - private InlinedDiscriminatedUnion1(Value value) { - this.value = value; - } - - public T visit(Visitor visitor) { - return value.visit(visitor); - } - - public static InlinedDiscriminatedUnion1 type1(InlineType1 value) { - return new InlinedDiscriminatedUnion1(new Type1Value(value)); - } - - public static InlinedDiscriminatedUnion1 type2(InlineType2 value) { - return new InlinedDiscriminatedUnion1(new Type2Value(value)); - } - - public boolean isType1() { - return value instanceof Type1Value; - } - - public boolean isType2() { - return value instanceof Type2Value; - } - - public boolean _isUnknown() { - return value instanceof _UnknownValue; - } - - public Optional getType1() { - if (isType1()) { - return Optional.of(((Type1Value) value).value); - } - return Optional.empty(); - } - - public Optional getType2() { - if (isType2()) { - return Optional.of(((Type2Value) value).value); - } - return Optional.empty(); - } - - public Optional _getUnknown() { - if (_isUnknown()) { - return Optional.of(((_UnknownValue) value).value); - } - return Optional.empty(); - } - - @JsonValue - private Value getValue() { - return this.value; - } - - public interface Visitor { - T visitType1(InlineType1 type1); - - T visitType2(InlineType2 type2); - - T _visitUnknown(Object unknownType); - } - - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) - @JsonSubTypes({@JsonSubTypes.Type(Type1Value.class), @JsonSubTypes.Type(Type2Value.class)}) - @JsonIgnoreProperties(ignoreUnknown = true) - private interface Value { - T visit(Visitor visitor); - } - - @JsonTypeName("type1") - private static final class Type1Value implements Value { - @JsonUnwrapped - private InlineType1 value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private Type1Value() {} - - private Type1Value(InlineType1 value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitType1(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Type1Value && equalTo((Type1Value) other); - } - - private boolean equalTo(Type1Value other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "value: " + value + "}"; - } - } - - @JsonTypeName("type2") - private static final class Type2Value implements Value { - @JsonUnwrapped - private InlineType2 value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private Type2Value() {} - - private Type2Value(InlineType2 value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitType2(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Type2Value && equalTo((Type2Value) other); - } - - private boolean equalTo(Type2Value other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "value: " + value + "}"; - } - } - - private static final class _UnknownValue implements Value { - private String type; - - @JsonValue - private Object value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private _UnknownValue(@JsonProperty("value") Object value) {} - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor._visitUnknown(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof _UnknownValue && equalTo((_UnknownValue) other); - } - - private boolean equalTo(_UnknownValue other) { - return type.equals(other.type) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.type, this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "type: " + type + ", value: " + value + "}"; - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlinedUndiscriminatedUnion1.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlinedUndiscriminatedUnion1.java deleted file mode 100644 index cf244dd256e..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/InlinedUndiscriminatedUnion1.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.seed.object.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = InlinedUndiscriminatedUnion1.Deserializer.class) -public final class InlinedUndiscriminatedUnion1 { - private final Object value; - - private final int type; - - private InlinedUndiscriminatedUnion1(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((InlineType1) this.value); - } else if (this.type == 1) { - return visitor.visit((InlineType2) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlinedUndiscriminatedUnion1 && equalTo((InlinedUndiscriminatedUnion1) other); - } - - private boolean equalTo(InlinedUndiscriminatedUnion1 other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InlinedUndiscriminatedUnion1 of(InlineType1 value) { - return new InlinedUndiscriminatedUnion1(value, 0); - } - - public static InlinedUndiscriminatedUnion1 of(InlineType2 value) { - return new InlinedUndiscriminatedUnion1(value, 1); - } - - public interface Visitor { - T visit(InlineType1 value); - - T visit(InlineType2 value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InlinedUndiscriminatedUnion1.class); - } - - @java.lang.Override - public InlinedUndiscriminatedUnion1 deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InlineType1.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InlineType2.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/NestedInlineType1.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/NestedInlineType1.java deleted file mode 100644 index 64febcc9d97..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/NestedInlineType1.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = NestedInlineType1.Builder.class) -public final class NestedInlineType1 { - private final String foo; - - private final String bar; - - private final InlineEnum myEnum; - - private final Map additionalProperties; - - private NestedInlineType1(String foo, String bar, InlineEnum myEnum, Map additionalProperties) { - this.foo = foo; - this.bar = bar; - this.myEnum = myEnum; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public String getBar() { - return bar; - } - - @JsonProperty("myEnum") - public InlineEnum getMyEnum() { - return myEnum; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof NestedInlineType1 && equalTo((NestedInlineType1) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(NestedInlineType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar) && myEnum.equals(other.myEnum); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar, this.myEnum); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(@NotNull String foo); - - Builder from(NestedInlineType1 other); - } - - public interface BarStage { - MyEnumStage bar(@NotNull String bar); - } - - public interface MyEnumStage { - _FinalStage myEnum(@NotNull InlineEnum myEnum); - } - - public interface _FinalStage { - NestedInlineType1 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FooStage, BarStage, MyEnumStage, _FinalStage { - private String foo; - - private String bar; - - private InlineEnum myEnum; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(NestedInlineType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - myEnum(other.getMyEnum()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(@NotNull String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public MyEnumStage bar(@NotNull String bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("myEnum") - public _FinalStage myEnum(@NotNull InlineEnum myEnum) { - this.myEnum = Objects.requireNonNull(myEnum, "myEnum must not be null"); - return this; - } - - @java.lang.Override - public NestedInlineType1 build() { - return new NestedInlineType1(foo, bar, myEnum, additionalProperties); - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/RootType1.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/RootType1.java deleted file mode 100644 index 25cca383157..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/main/java/com/seed/object/types/RootType1.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RootType1.Builder.class) -public final class RootType1 { - private final String foo; - - private final InlineType1 bar; - - private final Map additionalProperties; - - private RootType1(String foo, InlineType1 bar, Map additionalProperties) { - this.foo = foo; - this.bar = bar; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public InlineType1 getBar() { - return bar; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RootType1 && equalTo((RootType1) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RootType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(@NotNull String foo); - - Builder from(RootType1 other); - } - - public interface BarStage { - _FinalStage bar(@NotNull InlineType1 bar); - } - - public interface _FinalStage { - RootType1 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FooStage, BarStage, _FinalStage { - private String foo; - - private InlineType1 bar; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RootType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(@NotNull String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public _FinalStage bar(@NotNull InlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - public RootType1 build() { - return new RootType1(foo, bar, additionalProperties); - } - } -} diff --git a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/test/java/com/seed/object/TestClient.java b/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/test/java/com/seed/object/TestClient.java deleted file mode 100644 index 37f1534fe0c..00000000000 --- a/seed/java-sdk/inline-types/build/spotless/spotlessJava/src/test/java/com/seed/object/TestClient.java +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object; - -public final class TestClient { - public void test() { - // Add tests here and mark this file in .fernignore - assert true; - } -} diff --git a/seed/java-sdk/inline-types/build/tmp/spotless-register-dependencies b/seed/java-sdk/inline-types/build/tmp/spotless-register-dependencies deleted file mode 100644 index 56a6051ca2b..00000000000 --- a/seed/java-sdk/inline-types/build/tmp/spotless-register-dependencies +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/seed/java-sdk/inline-types/sample-app/build.gradle b/seed/java-sdk/inline-types/sample-app/build.gradle deleted file mode 100644 index 4ee8f227b7a..00000000000 --- a/seed/java-sdk/inline-types/sample-app/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -plugins { - id 'java-library' -} - -repositories { - mavenCentral() - maven { - url 'https://s01.oss.sonatype.org/content/repositories/releases/' - } -} - -dependencies { - implementation rootProject -} - - -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - diff --git a/seed/java-sdk/inline-types/sample-app/src/main/java/sample/App.java b/seed/java-sdk/inline-types/sample-app/src/main/java/sample/App.java deleted file mode 100644 index b115384f1d2..00000000000 --- a/seed/java-sdk/inline-types/sample-app/src/main/java/sample/App.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -package sample; - -import java.lang.String; - -public final class App { - public static void main(String[] args) { - // import com.seed.object.SeedObjectClient - } -} diff --git a/seed/java-sdk/inline-types/settings.gradle b/seed/java-sdk/inline-types/settings.gradle deleted file mode 100644 index a6252c5d1bc..00000000000 --- a/seed/java-sdk/inline-types/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -rootProject.name = 'inline-types' - -include 'sample-app' \ No newline at end of file diff --git a/seed/java-sdk/inline-types/snippet-templates.json b/seed/java-sdk/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/java-sdk/inline-types/snippet.json b/seed/java-sdk/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/SeedObjectClient.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/SeedObjectClient.java deleted file mode 100644 index 372519d5daa..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/SeedObjectClient.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.seed.object.core.ClientOptions; -import com.seed.object.core.MediaTypes; -import com.seed.object.core.ObjectMappers; -import com.seed.object.core.RequestOptions; -import com.seed.object.core.SeedObjectApiException; -import com.seed.object.core.SeedObjectException; -import com.seed.object.requests.PostRootRequest; -import com.seed.object.types.RootType1; -import java.io.IOException; -import okhttp3.Headers; -import okhttp3.HttpUrl; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import okhttp3.ResponseBody; - -public class SeedObjectClient { - protected final ClientOptions clientOptions; - - public SeedObjectClient(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - } - - public RootType1 getRoot(PostRootRequest request) { - return getRoot(request, null); - } - - public RootType1 getRoot(PostRootRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) - .newBuilder() - .addPathSegments("root") - .addPathSegments("root") - .build(); - RequestBody body; - try { - body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new SeedObjectException("Failed to serialize request", e); - } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) - .method("POST", body) - .headers(Headers.of(clientOptions.headers(requestOptions))) - .addHeader("Content-Type", "application/json") - .build(); - OkHttpClient client = clientOptions.httpClient(); - if (requestOptions != null && requestOptions.getTimeout().isPresent()) { - client = clientOptions.httpClientWithTimeout(requestOptions); - } - try (Response response = client.newCall(okhttpRequest).execute()) { - ResponseBody responseBody = response.body(); - if (response.isSuccessful()) { - return ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RootType1.class); - } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new SeedObjectApiException( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class)); - } catch (IOException e) { - throw new SeedObjectException("Network error executing HTTP request", e); - } - } - - public static SeedObjectClientBuilder builder() { - return new SeedObjectClientBuilder(); - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/SeedObjectClientBuilder.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/SeedObjectClientBuilder.java deleted file mode 100644 index 0421ff3dee7..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/SeedObjectClientBuilder.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object; - -import com.seed.object.core.ClientOptions; -import com.seed.object.core.Environment; - -public final class SeedObjectClientBuilder { - private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); - - private Environment environment; - - public SeedObjectClientBuilder url(String url) { - this.environment = Environment.custom(url); - return this; - } - - public SeedObjectClient build() { - clientOptionsBuilder.environment(this.environment); - return new SeedObjectClient(clientOptionsBuilder.build()); - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ClientOptions.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ClientOptions.java deleted file mode 100644 index c403c535450..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ClientOptions.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; -import okhttp3.OkHttpClient; - -public final class ClientOptions { - private final Environment environment; - - private final Map headers; - - private final Map> headerSuppliers; - - private final OkHttpClient httpClient; - - private ClientOptions( - Environment environment, - Map headers, - Map> headerSuppliers, - OkHttpClient httpClient) { - this.environment = environment; - this.headers = new HashMap<>(); - this.headers.putAll(headers); - this.headers.putAll(new HashMap() { - { - put("X-Fern-Language", "JAVA"); - } - }); - this.headerSuppliers = headerSuppliers; - this.httpClient = httpClient; - } - - public Environment environment() { - return this.environment; - } - - public Map headers(RequestOptions requestOptions) { - Map values = new HashMap<>(this.headers); - headerSuppliers.forEach((key, supplier) -> { - values.put(key, supplier.get()); - }); - if (requestOptions != null) { - values.putAll(requestOptions.getHeaders()); - } - return values; - } - - public OkHttpClient httpClient() { - return this.httpClient; - } - - public OkHttpClient httpClientWithTimeout(RequestOptions requestOptions) { - if (requestOptions == null) { - return this.httpClient; - } - return this.httpClient - .newBuilder() - .callTimeout(requestOptions.getTimeout().get(), requestOptions.getTimeoutTimeUnit()) - .connectTimeout(0, TimeUnit.SECONDS) - .writeTimeout(0, TimeUnit.SECONDS) - .readTimeout(0, TimeUnit.SECONDS) - .build(); - } - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder { - private Environment environment; - - private final Map headers = new HashMap<>(); - - private final Map> headerSuppliers = new HashMap<>(); - - public Builder environment(Environment environment) { - this.environment = environment; - return this; - } - - public Builder addHeader(String key, String value) { - this.headers.put(key, value); - return this; - } - - public Builder addHeader(String key, Supplier value) { - this.headerSuppliers.put(key, value); - return this; - } - - public ClientOptions build() { - OkHttpClient okhttpClient = new OkHttpClient.Builder() - .addInterceptor(new RetryInterceptor(3)) - .build(); - return new ClientOptions(environment, headers, headerSuppliers, okhttpClient); - } - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/DateTimeDeserializer.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/DateTimeDeserializer.java deleted file mode 100644 index ad231070a3d..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/DateTimeDeserializer.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.module.SimpleModule; -import java.io.IOException; -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalQueries; - -/** - * Custom deserializer that handles converting ISO8601 dates into {@link OffsetDateTime} objects. - */ -class DateTimeDeserializer extends JsonDeserializer { - private static final SimpleModule MODULE; - - static { - MODULE = new SimpleModule().addDeserializer(OffsetDateTime.class, new DateTimeDeserializer()); - } - - /** - * Gets a module wrapping this deserializer as an adapter for the Jackson ObjectMapper. - * - * @return A {@link SimpleModule} to be plugged onto Jackson ObjectMapper. - */ - public static SimpleModule getModule() { - return MODULE; - } - - @Override - public OffsetDateTime deserialize(JsonParser parser, DeserializationContext context) throws IOException { - JsonToken token = parser.currentToken(); - if (token == JsonToken.VALUE_NUMBER_INT) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(parser.getValueAsLong()), ZoneOffset.UTC); - } else { - TemporalAccessor temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest( - parser.getValueAsString(), OffsetDateTime::from, LocalDateTime::from); - - if (temporal.query(TemporalQueries.offset()) == null) { - return LocalDateTime.from(temporal).atOffset(ZoneOffset.UTC); - } else { - return OffsetDateTime.from(temporal); - } - } - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/Environment.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/Environment.java deleted file mode 100644 index 19b694c5b93..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/Environment.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -public final class Environment { - private final String url; - - private Environment(String url) { - this.url = url; - } - - public String getUrl() { - return this.url; - } - - public static Environment custom(String url) { - return new Environment(url); - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/FileStream.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/FileStream.java deleted file mode 100644 index eef28eef8bd..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/FileStream.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.io.InputStream; -import java.util.Objects; -import okhttp3.MediaType; -import okhttp3.RequestBody; -import org.jetbrains.annotations.Nullable; - -/** - * Represents a file stream with associated metadata for file uploads. - */ -public class FileStream { - private final InputStream inputStream; - private final String fileName; - private final MediaType contentType; - - /** - * Constructs a FileStream with the given input stream and optional metadata. - * - * @param inputStream The input stream of the file content. Must not be null. - * @param fileName The name of the file, or null if unknown. - * @param contentType The MIME type of the file content, or null if unknown. - * @throws NullPointerException if inputStream is null - */ - public FileStream(InputStream inputStream, @Nullable String fileName, @Nullable MediaType contentType) { - this.inputStream = Objects.requireNonNull(inputStream, "Input stream cannot be null"); - this.fileName = fileName; - this.contentType = contentType; - } - - public FileStream(InputStream inputStream) { - this(inputStream, null, null); - } - - public InputStream getInputStream() { - return inputStream; - } - - @Nullable - public String getFileName() { - return fileName; - } - - @Nullable - public MediaType getContentType() { - return contentType; - } - - /** - * Creates a RequestBody suitable for use with OkHttp client. - * - * @return A RequestBody instance representing this file stream. - */ - public RequestBody toRequestBody() { - return new InputStreamRequestBody(contentType, inputStream); - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/InputStreamRequestBody.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/InputStreamRequestBody.java deleted file mode 100644 index 433d823fbed..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/InputStreamRequestBody.java +++ /dev/null @@ -1,79 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Objects; -import okhttp3.MediaType; -import okhttp3.RequestBody; -import okhttp3.internal.Util; -import okio.BufferedSink; -import okio.Okio; -import okio.Source; -import org.jetbrains.annotations.Nullable; - -/** - * A custom implementation of OkHttp's RequestBody that wraps an InputStream. - * This class allows streaming of data from an InputStream directly to an HTTP request body, - * which is useful for file uploads or sending large amounts of data without loading it all into memory. - */ -public class InputStreamRequestBody extends RequestBody { - private final InputStream inputStream; - private final MediaType contentType; - - /** - * Constructs an InputStreamRequestBody with the specified content type and input stream. - * - * @param contentType the MediaType of the content, or null if not known - * @param inputStream the InputStream containing the data to be sent - * @throws NullPointerException if inputStream is null - */ - public InputStreamRequestBody(@Nullable MediaType contentType, InputStream inputStream) { - this.contentType = contentType; - this.inputStream = Objects.requireNonNull(inputStream, "inputStream == null"); - } - - /** - * Returns the content type of this request body. - * - * @return the MediaType of the content, or null if not specified - */ - @Nullable - @Override - public MediaType contentType() { - return contentType; - } - - /** - * Returns the content length of this request body, if known. - * This method attempts to determine the length using the InputStream's available() method, - * which may not always accurately reflect the total length of the stream. - * - * @return the content length, or -1 if the length is unknown - * @throws IOException if an I/O error occurs - */ - @Override - public long contentLength() throws IOException { - return inputStream.available() == 0 ? -1 : inputStream.available(); - } - - /** - * Writes the content of the InputStream to the given BufferedSink. - * This method is responsible for transferring the data from the InputStream to the network request. - * - * @param sink the BufferedSink to write the content to - * @throws IOException if an I/O error occurs during writing - */ - @Override - public void writeTo(BufferedSink sink) throws IOException { - Source source = null; - try { - source = Okio.source(inputStream); - sink.writeAll(source); - } finally { - Util.closeQuietly(Objects.requireNonNull(source)); - } - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/MediaTypes.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/MediaTypes.java deleted file mode 100644 index df45659067e..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/MediaTypes.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import okhttp3.MediaType; - -public final class MediaTypes { - - public static final MediaType APPLICATION_JSON = MediaType.parse("application/json"); - - private MediaTypes() {} -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ObjectMappers.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ObjectMappers.java deleted file mode 100644 index c889a5b4c3d..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ObjectMappers.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import java.io.IOException; - -public final class ObjectMappers { - public static final ObjectMapper JSON_MAPPER = JsonMapper.builder() - .addModule(new Jdk8Module()) - .addModule(new JavaTimeModule()) - .addModule(DateTimeDeserializer.getModule()) - .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) - .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .build(); - - private ObjectMappers() {} - - public static String stringify(Object o) { - try { - return JSON_MAPPER - .setSerializationInclusion(JsonInclude.Include.ALWAYS) - .writerWithDefaultPrettyPrinter() - .writeValueAsString(o); - } catch (IOException e) { - return o.getClass().getName() + "@" + Integer.toHexString(o.hashCode()); - } - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/RequestOptions.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/RequestOptions.java deleted file mode 100644 index 5ea45c533b5..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/RequestOptions.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.TimeUnit; - -public final class RequestOptions { - private final Optional timeout; - - private final TimeUnit timeoutTimeUnit; - - private RequestOptions(Optional timeout, TimeUnit timeoutTimeUnit) { - this.timeout = timeout; - this.timeoutTimeUnit = timeoutTimeUnit; - } - - public Optional getTimeout() { - return timeout; - } - - public TimeUnit getTimeoutTimeUnit() { - return timeoutTimeUnit; - } - - public Map getHeaders() { - Map headers = new HashMap<>(); - return headers; - } - - public static Builder builder() { - return new Builder(); - } - - public static final class Builder { - private Optional timeout = Optional.empty(); - - private TimeUnit timeoutTimeUnit = TimeUnit.SECONDS; - - public Builder timeout(Integer timeout) { - this.timeout = Optional.of(timeout); - return this; - } - - public Builder timeout(Integer timeout, TimeUnit timeoutTimeUnit) { - this.timeout = Optional.of(timeout); - this.timeoutTimeUnit = timeoutTimeUnit; - return this; - } - - public RequestOptions build() { - return new RequestOptions(timeout, timeoutTimeUnit); - } - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ResponseBodyInputStream.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ResponseBodyInputStream.java deleted file mode 100644 index ea75c68fd88..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ResponseBodyInputStream.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.io.FilterInputStream; -import java.io.IOException; -import okhttp3.Response; - -/** - * A custom InputStream that wraps the InputStream from the OkHttp Response and ensures that the - * OkHttp Response object is properly closed when the stream is closed. - * - * This class extends FilterInputStream and takes an OkHttp Response object as a parameter. - * It retrieves the InputStream from the Response and overrides the close method to close - * both the InputStream and the Response object, ensuring proper resource management and preventing - * premature closure of the underlying HTTP connection. - */ -public class ResponseBodyInputStream extends FilterInputStream { - private final Response response; - - /** - * Constructs a ResponseBodyInputStream that wraps the InputStream from the given OkHttp - * Response object. - * - * @param response the OkHttp Response object from which the InputStream is retrieved - * @throws IOException if an I/O error occurs while retrieving the InputStream - */ - public ResponseBodyInputStream(Response response) throws IOException { - super(response.body().byteStream()); - this.response = response; - } - - /** - * Closes the InputStream and the associated OkHttp Response object. This ensures that the - * underlying HTTP connection is properly closed after the stream is no longer needed. - * - * @throws IOException if an I/O error occurs - */ - @Override - public void close() throws IOException { - super.close(); - response.close(); // Ensure the response is closed when the stream is closed - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ResponseBodyReader.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ResponseBodyReader.java deleted file mode 100644 index 3903eb7436c..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/ResponseBodyReader.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.io.FilterReader; -import java.io.IOException; -import okhttp3.Response; - -/** - * A custom Reader that wraps the Reader from the OkHttp Response and ensures that the - * OkHttp Response object is properly closed when the reader is closed. - * - * This class extends FilterReader and takes an OkHttp Response object as a parameter. - * It retrieves the Reader from the Response and overrides the close method to close - * both the Reader and the Response object, ensuring proper resource management and preventing - * premature closure of the underlying HTTP connection. - */ -public class ResponseBodyReader extends FilterReader { - private final Response response; - - /** - * Constructs a ResponseBodyReader that wraps the Reader from the given OkHttp Response object. - * - * @param response the OkHttp Response object from which the Reader is retrieved - * @throws IOException if an I/O error occurs while retrieving the Reader - */ - public ResponseBodyReader(Response response) throws IOException { - super(response.body().charStream()); - this.response = response; - } - - /** - * Closes the Reader and the associated OkHttp Response object. This ensures that the - * underlying HTTP connection is properly closed after the reader is no longer needed. - * - * @throws IOException if an I/O error occurs - */ - @Override - public void close() throws IOException { - super.close(); - response.close(); // Ensure the response is closed when the reader is closed - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/RetryInterceptor.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/RetryInterceptor.java deleted file mode 100644 index 9f541cea8fc..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/RetryInterceptor.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.io.IOException; -import java.time.Duration; -import java.util.Optional; -import java.util.Random; -import okhttp3.Interceptor; -import okhttp3.Response; - -public class RetryInterceptor implements Interceptor { - - private static final Duration ONE_SECOND = Duration.ofSeconds(1); - private final ExponentialBackoff backoff; - private final Random random = new Random(); - - public RetryInterceptor(int maxRetries) { - this.backoff = new ExponentialBackoff(maxRetries); - } - - @Override - public Response intercept(Chain chain) throws IOException { - Response response = chain.proceed(chain.request()); - - if (shouldRetry(response.code())) { - return retryChain(response, chain); - } - - return response; - } - - private Response retryChain(Response response, Chain chain) throws IOException { - Optional nextBackoff = this.backoff.nextBackoff(); - while (nextBackoff.isPresent()) { - try { - Thread.sleep(nextBackoff.get().toMillis()); - } catch (InterruptedException e) { - throw new IOException("Interrupted while trying request", e); - } - response.close(); - response = chain.proceed(chain.request()); - if (shouldRetry(response.code())) { - nextBackoff = this.backoff.nextBackoff(); - } else { - return response; - } - } - - return response; - } - - private static boolean shouldRetry(int statusCode) { - return statusCode == 408 || statusCode == 409 || statusCode == 429 || statusCode >= 500; - } - - private final class ExponentialBackoff { - - private final int maxNumRetries; - - private int retryNumber = 0; - - ExponentialBackoff(int maxNumRetries) { - this.maxNumRetries = maxNumRetries; - } - - public Optional nextBackoff() { - retryNumber += 1; - if (retryNumber > maxNumRetries) { - return Optional.empty(); - } - - int upperBound = (int) Math.pow(2, retryNumber); - return Optional.of(ONE_SECOND.multipliedBy(random.nextInt(upperBound))); - } - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/SeedObjectApiException.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/SeedObjectApiException.java deleted file mode 100644 index 64ec8313ea1..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/SeedObjectApiException.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -/** - * This exception type will be thrown for any non-2XX API responses. - */ -public class SeedObjectApiException extends SeedObjectException { - /** - * The error code of the response that triggered the exception. - */ - private final int statusCode; - - /** - * The body of the response that triggered the exception. - */ - private final Object body; - - public SeedObjectApiException(String message, int statusCode, Object body) { - super(message); - this.statusCode = statusCode; - this.body = body; - } - - /** - * @return the statusCode - */ - public int statusCode() { - return this.statusCode; - } - - /** - * @return the body - */ - public Object body() { - return this.body; - } - - @java.lang.Override - public String toString() { - return "SeedObjectApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " - + body + "}"; - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/SeedObjectException.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/SeedObjectException.java deleted file mode 100644 index a338879cb59..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/SeedObjectException.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -/** - * This class serves as the base exception for all errors in the SDK. - */ -public class SeedObjectException extends RuntimeException { - public SeedObjectException(String message) { - super(message); - } - - public SeedObjectException(String message, Exception e) { - super(message, e); - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/Stream.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/Stream.java deleted file mode 100644 index ecc1492c728..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/Stream.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.io.Reader; -import java.util.Iterator; -import java.util.NoSuchElementException; -import java.util.Scanner; - -/** - * The {@code Stream} class implmenets {@link Iterable} to provide a simple mechanism for reading and parsing - * objects of a given type from data streamed via a {@link Reader} using a specified delimiter. - *

- * {@code Stream} assumes that data is being pushed to the provided {@link Reader} asynchronously and utilizes a - * {@code Scanner} to block during iteration if the next object is not available. - * - * @param The type of objects in the stream. - */ -public final class Stream implements Iterable { - /** - * The {@link Class} of the objects in the stream. - */ - private final Class valueType; - /** - * The {@link Scanner} used for reading from the input stream and blocking when neede during iteration. - */ - private final Scanner scanner; - - /** - * Constructs a new {@code Stream} with the specified value type, reader, and delimiter. - * - * @param valueType The class of the objects in the stream. - * @param reader The reader that provides the streamed data. - * @param delimiter The delimiter used to separate elements in the stream. - */ - public Stream(Class valueType, Reader reader, String delimiter) { - this.scanner = new Scanner(reader).useDelimiter(delimiter); - this.valueType = valueType; - } - - /** - * Returns an iterator over the elements in this stream that blocks during iteration when the next object is - * not yet available. - * - * @return An iterator that can be used to traverse the elements in the stream. - */ - @Override - public Iterator iterator() { - return new Iterator() { - /** - * Returns {@code true} if there are more elements in the stream. - *

- * Will block and wait for input if the stream has not ended and the next object is not yet available. - * - * @return {@code true} if there are more elements, {@code false} otherwise. - */ - @Override - public boolean hasNext() { - return scanner.hasNext(); - } - - /** - * Returns the next element in the stream. - *

- * Will block and wait for input if the stream has not ended and the next object is not yet available. - * - * @return The next element in the stream. - * @throws NoSuchElementException If there are no more elements in the stream. - */ - @Override - public T next() { - if (!scanner.hasNext()) { - throw new NoSuchElementException(); - } else { - try { - T parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - scanner.next().trim(), valueType); - return parsedResponse; - } catch (Exception e) { - throw new RuntimeException(e); - } - } - } - - /** - * Removing elements from {@code Stream} is not supported. - * - * @throws UnsupportedOperationException Always, as removal is not supported. - */ - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/Suppliers.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/Suppliers.java deleted file mode 100644 index 5001ddf4767..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/core/Suppliers.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.core; - -import java.util.Objects; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Supplier; - -public final class Suppliers { - private Suppliers() {} - - public static Supplier memoize(Supplier delegate) { - AtomicReference value = new AtomicReference<>(); - return () -> { - T val = value.get(); - if (val == null) { - val = value.updateAndGet(cur -> cur == null ? Objects.requireNonNull(delegate.get()) : cur); - } - return val; - }; - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/requests/PostRootRequest.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/requests/PostRootRequest.java deleted file mode 100644 index 61d78f3a823..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/requests/PostRootRequest.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.requests; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import com.seed.object.types.InlineType1; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = PostRootRequest.Builder.class) -public final class PostRootRequest { - private final InlineType1 bar; - - private final String foo; - - private final Map additionalProperties; - - private PostRootRequest(InlineType1 bar, String foo, Map additionalProperties) { - this.bar = bar; - this.foo = foo; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("bar") - public InlineType1 getBar() { - return bar; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PostRootRequest && equalTo((PostRootRequest) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(PostRootRequest other) { - return bar.equals(other.bar) && foo.equals(other.foo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.bar, this.foo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BarStage builder() { - return new Builder(); - } - - public interface BarStage { - FooStage bar(@NotNull InlineType1 bar); - - Builder from(PostRootRequest other); - } - - public interface FooStage { - _FinalStage foo(@NotNull String foo); - } - - public interface _FinalStage { - PostRootRequest build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements BarStage, FooStage, _FinalStage { - private InlineType1 bar; - - private String foo; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(PostRootRequest other) { - bar(other.getBar()); - foo(other.getFoo()); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public FooStage bar(@NotNull InlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public _FinalStage foo(@NotNull String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - public PostRootRequest build() { - return new PostRootRequest(bar, foo, additionalProperties); - } - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlineEnum.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlineEnum.java deleted file mode 100644 index c092fdbeee4..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlineEnum.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum InlineEnum { - SUNNY("SUNNY"), - - CLOUDY("CLOUDY"), - - RAINING("RAINING"), - - SNOWING("SNOWING"); - - private final String value; - - InlineEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlineType1.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlineType1.java deleted file mode 100644 index 1cd11b9008e..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlineType1.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = InlineType1.Builder.class) -public final class InlineType1 { - private final String foo; - - private final NestedInlineType1 bar; - - private final Map additionalProperties; - - private InlineType1(String foo, NestedInlineType1 bar, Map additionalProperties) { - this.foo = foo; - this.bar = bar; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public NestedInlineType1 getBar() { - return bar; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlineType1 && equalTo((InlineType1) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(InlineType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(@NotNull String foo); - - Builder from(InlineType1 other); - } - - public interface BarStage { - _FinalStage bar(@NotNull NestedInlineType1 bar); - } - - public interface _FinalStage { - InlineType1 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FooStage, BarStage, _FinalStage { - private String foo; - - private NestedInlineType1 bar; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(InlineType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(@NotNull String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public _FinalStage bar(@NotNull NestedInlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - public InlineType1 build() { - return new InlineType1(foo, bar, additionalProperties); - } - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlineType2.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlineType2.java deleted file mode 100644 index 4b02ac98287..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlineType2.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = InlineType2.Builder.class) -public final class InlineType2 { - private final String baz; - - private final Map additionalProperties; - - private InlineType2(String baz, Map additionalProperties) { - this.baz = baz; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("baz") - public String getBaz() { - return baz; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlineType2 && equalTo((InlineType2) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(InlineType2 other) { - return baz.equals(other.baz); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.baz); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BazStage builder() { - return new Builder(); - } - - public interface BazStage { - _FinalStage baz(@NotNull String baz); - - Builder from(InlineType2 other); - } - - public interface _FinalStage { - InlineType2 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements BazStage, _FinalStage { - private String baz; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(InlineType2 other) { - baz(other.getBaz()); - return this; - } - - @java.lang.Override - @JsonSetter("baz") - public _FinalStage baz(@NotNull String baz) { - this.baz = Objects.requireNonNull(baz, "baz must not be null"); - return this; - } - - @java.lang.Override - public InlineType2 build() { - return new InlineType2(baz, additionalProperties); - } - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlinedDiscriminatedUnion1.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlinedDiscriminatedUnion1.java deleted file mode 100644 index fa7004fcaa0..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlinedDiscriminatedUnion1.java +++ /dev/null @@ -1,200 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonUnwrapped; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Objects; -import java.util.Optional; - -public final class InlinedDiscriminatedUnion1 { - private final Value value; - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - private InlinedDiscriminatedUnion1(Value value) { - this.value = value; - } - - public T visit(Visitor visitor) { - return value.visit(visitor); - } - - public static InlinedDiscriminatedUnion1 type1(InlineType1 value) { - return new InlinedDiscriminatedUnion1(new Type1Value(value)); - } - - public static InlinedDiscriminatedUnion1 type2(InlineType2 value) { - return new InlinedDiscriminatedUnion1(new Type2Value(value)); - } - - public boolean isType1() { - return value instanceof Type1Value; - } - - public boolean isType2() { - return value instanceof Type2Value; - } - - public boolean _isUnknown() { - return value instanceof _UnknownValue; - } - - public Optional getType1() { - if (isType1()) { - return Optional.of(((Type1Value) value).value); - } - return Optional.empty(); - } - - public Optional getType2() { - if (isType2()) { - return Optional.of(((Type2Value) value).value); - } - return Optional.empty(); - } - - public Optional _getUnknown() { - if (_isUnknown()) { - return Optional.of(((_UnknownValue) value).value); - } - return Optional.empty(); - } - - @JsonValue - private Value getValue() { - return this.value; - } - - public interface Visitor { - T visitType1(InlineType1 type1); - - T visitType2(InlineType2 type2); - - T _visitUnknown(Object unknownType); - } - - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) - @JsonSubTypes({@JsonSubTypes.Type(Type1Value.class), @JsonSubTypes.Type(Type2Value.class)}) - @JsonIgnoreProperties(ignoreUnknown = true) - private interface Value { - T visit(Visitor visitor); - } - - @JsonTypeName("type1") - private static final class Type1Value implements Value { - @JsonUnwrapped - private InlineType1 value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private Type1Value() {} - - private Type1Value(InlineType1 value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitType1(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Type1Value && equalTo((Type1Value) other); - } - - private boolean equalTo(Type1Value other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "value: " + value + "}"; - } - } - - @JsonTypeName("type2") - private static final class Type2Value implements Value { - @JsonUnwrapped - private InlineType2 value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private Type2Value() {} - - private Type2Value(InlineType2 value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitType2(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Type2Value && equalTo((Type2Value) other); - } - - private boolean equalTo(Type2Value other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "value: " + value + "}"; - } - } - - private static final class _UnknownValue implements Value { - private String type; - - @JsonValue - private Object value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private _UnknownValue(@JsonProperty("value") Object value) {} - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor._visitUnknown(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof _UnknownValue && equalTo((_UnknownValue) other); - } - - private boolean equalTo(_UnknownValue other) { - return type.equals(other.type) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.type, this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "type: " + type + ", value: " + value + "}"; - } - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlinedUndiscriminatedUnion1.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlinedUndiscriminatedUnion1.java deleted file mode 100644 index cf244dd256e..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/InlinedUndiscriminatedUnion1.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.seed.object.core.ObjectMappers; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = InlinedUndiscriminatedUnion1.Deserializer.class) -public final class InlinedUndiscriminatedUnion1 { - private final Object value; - - private final int type; - - private InlinedUndiscriminatedUnion1(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((InlineType1) this.value); - } else if (this.type == 1) { - return visitor.visit((InlineType2) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlinedUndiscriminatedUnion1 && equalTo((InlinedUndiscriminatedUnion1) other); - } - - private boolean equalTo(InlinedUndiscriminatedUnion1 other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InlinedUndiscriminatedUnion1 of(InlineType1 value) { - return new InlinedUndiscriminatedUnion1(value, 0); - } - - public static InlinedUndiscriminatedUnion1 of(InlineType2 value) { - return new InlinedUndiscriminatedUnion1(value, 1); - } - - public interface Visitor { - T visit(InlineType1 value); - - T visit(InlineType2 value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InlinedUndiscriminatedUnion1.class); - } - - @java.lang.Override - public InlinedUndiscriminatedUnion1 deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InlineType1.class)); - } catch (IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InlineType2.class)); - } catch (IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/NestedInlineType1.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/NestedInlineType1.java deleted file mode 100644 index 64febcc9d97..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/NestedInlineType1.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = NestedInlineType1.Builder.class) -public final class NestedInlineType1 { - private final String foo; - - private final String bar; - - private final InlineEnum myEnum; - - private final Map additionalProperties; - - private NestedInlineType1(String foo, String bar, InlineEnum myEnum, Map additionalProperties) { - this.foo = foo; - this.bar = bar; - this.myEnum = myEnum; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public String getBar() { - return bar; - } - - @JsonProperty("myEnum") - public InlineEnum getMyEnum() { - return myEnum; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof NestedInlineType1 && equalTo((NestedInlineType1) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(NestedInlineType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar) && myEnum.equals(other.myEnum); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar, this.myEnum); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(@NotNull String foo); - - Builder from(NestedInlineType1 other); - } - - public interface BarStage { - MyEnumStage bar(@NotNull String bar); - } - - public interface MyEnumStage { - _FinalStage myEnum(@NotNull InlineEnum myEnum); - } - - public interface _FinalStage { - NestedInlineType1 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FooStage, BarStage, MyEnumStage, _FinalStage { - private String foo; - - private String bar; - - private InlineEnum myEnum; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(NestedInlineType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - myEnum(other.getMyEnum()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(@NotNull String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public MyEnumStage bar(@NotNull String bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("myEnum") - public _FinalStage myEnum(@NotNull InlineEnum myEnum) { - this.myEnum = Objects.requireNonNull(myEnum, "myEnum must not be null"); - return this; - } - - @java.lang.Override - public NestedInlineType1 build() { - return new NestedInlineType1(foo, bar, myEnum, additionalProperties); - } - } -} diff --git a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/RootType1.java b/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/RootType1.java deleted file mode 100644 index 25cca383157..00000000000 --- a/seed/java-sdk/inline-types/src/main/java/com/seed/object/types/RootType1.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.seed.object.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = RootType1.Builder.class) -public final class RootType1 { - private final String foo; - - private final InlineType1 bar; - - private final Map additionalProperties; - - private RootType1(String foo, InlineType1 bar, Map additionalProperties) { - this.foo = foo; - this.bar = bar; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public InlineType1 getBar() { - return bar; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RootType1 && equalTo((RootType1) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(RootType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(@NotNull String foo); - - Builder from(RootType1 other); - } - - public interface BarStage { - _FinalStage bar(@NotNull InlineType1 bar); - } - - public interface _FinalStage { - RootType1 build(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements FooStage, BarStage, _FinalStage { - private String foo; - - private InlineType1 bar; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(RootType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(@NotNull String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public _FinalStage bar(@NotNull InlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - public RootType1 build() { - return new RootType1(foo, bar, additionalProperties); - } - } -} diff --git a/seed/java-sdk/inline-types/src/test/java/com/seed/object/TestClient.java b/seed/java-sdk/inline-types/src/test/java/com/seed/object/TestClient.java deleted file mode 100644 index 37f1534fe0c..00000000000 --- a/seed/java-sdk/inline-types/src/test/java/com/seed/object/TestClient.java +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.seed.object; - -public final class TestClient { - public void test() { - // Add tests here and mark this file in .fernignore - assert true; - } -} diff --git a/seed/java-spring/inline-types/.mock/definition/__package__.yml b/seed/java-spring/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/java-spring/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/java-spring/inline-types/.mock/definition/api.yml b/seed/java-spring/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/java-spring/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/java-spring/inline-types/.mock/fern.config.json b/seed/java-spring/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/java-spring/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/java-spring/inline-types/.mock/generators.yml b/seed/java-spring/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/java-spring/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/java-spring/inline-types/RootService.java b/seed/java-spring/inline-types/RootService.java deleted file mode 100644 index 5375c06c49a..00000000000 --- a/seed/java-spring/inline-types/RootService.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import requests.PostRootRequest; -import types.RootType1; - -@RequestMapping( - path = "/root" -) -public interface RootService { - @PostMapping( - value = "/root", - produces = "application/json", - consumes = "application/json" - ) - RootType1 getRoot(@RequestBody PostRootRequest body); -} diff --git a/seed/java-spring/inline-types/core/APIException.java b/seed/java-spring/inline-types/core/APIException.java deleted file mode 100644 index 27289cf9b2e..00000000000 --- a/seed/java-spring/inline-types/core/APIException.java +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -package core; - -import java.lang.Exception; - -public class APIException extends Exception { -} diff --git a/seed/java-spring/inline-types/core/DateTimeDeserializer.java b/seed/java-spring/inline-types/core/DateTimeDeserializer.java deleted file mode 100644 index 3d3174aec00..00000000000 --- a/seed/java-spring/inline-types/core/DateTimeDeserializer.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -package core; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.module.SimpleModule; -import java.io.IOException; -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.time.temporal.TemporalAccessor; -import java.time.temporal.TemporalQueries; - -/** - * Custom deserializer that handles converting ISO8601 dates into {@link OffsetDateTime} objects. - */ -class DateTimeDeserializer extends JsonDeserializer { - private static final SimpleModule MODULE; - - static { - MODULE = new SimpleModule().addDeserializer(OffsetDateTime.class, new DateTimeDeserializer()); - } - - /** - * Gets a module wrapping this deserializer as an adapter for the Jackson ObjectMapper. - * - * @return A {@link SimpleModule} to be plugged onto Jackson ObjectMapper. - */ - public static SimpleModule getModule() { - return MODULE; - } - - @Override - public OffsetDateTime deserialize(JsonParser parser, DeserializationContext context) throws IOException { - JsonToken token = parser.currentToken(); - if (token == JsonToken.VALUE_NUMBER_INT) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(parser.getValueAsLong()), ZoneOffset.UTC); - } else { - TemporalAccessor temporal = DateTimeFormatter.ISO_DATE_TIME.parseBest( - parser.getValueAsString(), OffsetDateTime::from, LocalDateTime::from); - - if (temporal.query(TemporalQueries.offset()) == null) { - return LocalDateTime.from(temporal).atOffset(ZoneOffset.UTC); - } else { - return OffsetDateTime.from(temporal); - } - } - } -} \ No newline at end of file diff --git a/seed/java-spring/inline-types/core/ObjectMappers.java b/seed/java-spring/inline-types/core/ObjectMappers.java deleted file mode 100644 index e02822614a8..00000000000 --- a/seed/java-spring/inline-types/core/ObjectMappers.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -package core; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import java.io.IOException; -import java.lang.Integer; -import java.lang.Object; -import java.lang.String; - -public final class ObjectMappers { - public static final ObjectMapper JSON_MAPPER = JsonMapper.builder() - .addModule(new Jdk8Module()) - .addModule(new JavaTimeModule()) - .addModule(DateTimeDeserializer.getModule()) - .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) - .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) - .build(); - - private ObjectMappers() { - } - - public static String stringify(Object o) { - try { - return JSON_MAPPER.setSerializationInclusion(JsonInclude.Include.ALWAYS) - .writerWithDefaultPrettyPrinter() - .writeValueAsString(o); - } - catch (IOException e) { - return o.getClass().getName() + "@" + Integer.toHexString(o.hashCode()); - } - } - } diff --git a/seed/java-spring/inline-types/requests/PostRootRequest.java b/seed/java-spring/inline-types/requests/PostRootRequest.java deleted file mode 100644 index ab93c023a4e..00000000000 --- a/seed/java-spring/inline-types/requests/PostRootRequest.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -package requests; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import core.ObjectMappers; -import java.lang.Object; -import java.lang.String; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; -import types.InlineType1; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize( - builder = PostRootRequest.Builder.class -) -public final class PostRootRequest { - private final InlineType1 bar; - - private final String foo; - - private PostRootRequest(InlineType1 bar, String foo) { - this.bar = bar; - this.foo = foo; - } - - @JsonProperty("bar") - public InlineType1 getBar() { - return bar; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof PostRootRequest && equalTo((PostRootRequest) other); - } - - private boolean equalTo(PostRootRequest other) { - return bar.equals(other.bar) && foo.equals(other.foo); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.bar, this.foo); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BarStage builder() { - return new Builder(); - } - - public interface BarStage { - FooStage bar(@NotNull InlineType1 bar); - - Builder from(PostRootRequest other); - } - - public interface FooStage { - _FinalStage foo(@NotNull String foo); - } - - public interface _FinalStage { - PostRootRequest build(); - } - - @JsonIgnoreProperties( - ignoreUnknown = true - ) - public static final class Builder implements BarStage, FooStage, _FinalStage { - private InlineType1 bar; - - private String foo; - - private Builder() { - } - - @java.lang.Override - public Builder from(PostRootRequest other) { - bar(other.getBar()); - foo(other.getFoo()); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public FooStage bar(@NotNull InlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public _FinalStage foo(@NotNull String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - public PostRootRequest build() { - return new PostRootRequest(bar, foo); - } - } -} diff --git a/seed/java-spring/inline-types/snippet-templates.json b/seed/java-spring/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/java-spring/inline-types/snippet.json b/seed/java-spring/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/java-spring/inline-types/types/InlineEnum.java b/seed/java-spring/inline-types/types/InlineEnum.java deleted file mode 100644 index c0251c9bd68..00000000000 --- a/seed/java-spring/inline-types/types/InlineEnum.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -package types; - -import com.fasterxml.jackson.annotation.JsonValue; -import java.lang.String; - -public enum InlineEnum { - SUNNY("SUNNY"), - - CLOUDY("CLOUDY"), - - RAINING("RAINING"), - - SNOWING("SNOWING"); - - private final String value; - - InlineEnum(String value) { - this.value = value; - } - - @JsonValue - @java.lang.Override - public String toString() { - return this.value; - } -} diff --git a/seed/java-spring/inline-types/types/InlineType1.java b/seed/java-spring/inline-types/types/InlineType1.java deleted file mode 100644 index f62f87ccbba..00000000000 --- a/seed/java-spring/inline-types/types/InlineType1.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -package types; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import core.ObjectMappers; -import java.lang.Object; -import java.lang.String; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize( - builder = InlineType1.Builder.class -) -public final class InlineType1 { - private final String foo; - - private final NestedInlineType1 bar; - - private InlineType1(String foo, NestedInlineType1 bar) { - this.foo = foo; - this.bar = bar; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public NestedInlineType1 getBar() { - return bar; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlineType1 && equalTo((InlineType1) other); - } - - private boolean equalTo(InlineType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(@NotNull String foo); - - Builder from(InlineType1 other); - } - - public interface BarStage { - _FinalStage bar(@NotNull NestedInlineType1 bar); - } - - public interface _FinalStage { - InlineType1 build(); - } - - @JsonIgnoreProperties( - ignoreUnknown = true - ) - public static final class Builder implements FooStage, BarStage, _FinalStage { - private String foo; - - private NestedInlineType1 bar; - - private Builder() { - } - - @java.lang.Override - public Builder from(InlineType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(@NotNull String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public _FinalStage bar(@NotNull NestedInlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - public InlineType1 build() { - return new InlineType1(foo, bar); - } - } -} diff --git a/seed/java-spring/inline-types/types/InlineType2.java b/seed/java-spring/inline-types/types/InlineType2.java deleted file mode 100644 index 1dafe23d4db..00000000000 --- a/seed/java-spring/inline-types/types/InlineType2.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -package types; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import core.ObjectMappers; -import java.lang.Object; -import java.lang.String; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize( - builder = InlineType2.Builder.class -) -public final class InlineType2 { - private final String baz; - - private InlineType2(String baz) { - this.baz = baz; - } - - @JsonProperty("baz") - public String getBaz() { - return baz; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlineType2 && equalTo((InlineType2) other); - } - - private boolean equalTo(InlineType2 other) { - return baz.equals(other.baz); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.baz); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static BazStage builder() { - return new Builder(); - } - - public interface BazStage { - _FinalStage baz(@NotNull String baz); - - Builder from(InlineType2 other); - } - - public interface _FinalStage { - InlineType2 build(); - } - - @JsonIgnoreProperties( - ignoreUnknown = true - ) - public static final class Builder implements BazStage, _FinalStage { - private String baz; - - private Builder() { - } - - @java.lang.Override - public Builder from(InlineType2 other) { - baz(other.getBaz()); - return this; - } - - @java.lang.Override - @JsonSetter("baz") - public _FinalStage baz(@NotNull String baz) { - this.baz = Objects.requireNonNull(baz, "baz must not be null"); - return this; - } - - @java.lang.Override - public InlineType2 build() { - return new InlineType2(baz); - } - } -} diff --git a/seed/java-spring/inline-types/types/InlinedDiscriminatedUnion1.java b/seed/java-spring/inline-types/types/InlinedDiscriminatedUnion1.java deleted file mode 100644 index 481c78656b0..00000000000 --- a/seed/java-spring/inline-types/types/InlinedDiscriminatedUnion1.java +++ /dev/null @@ -1,224 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -package types; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonUnwrapped; -import com.fasterxml.jackson.annotation.JsonValue; -import java.lang.Object; -import java.lang.String; -import java.util.Objects; -import java.util.Optional; - -public final class InlinedDiscriminatedUnion1 { - private final Value value; - - @JsonCreator( - mode = JsonCreator.Mode.DELEGATING - ) - private InlinedDiscriminatedUnion1(Value value) { - this.value = value; - } - - public T visit(Visitor visitor) { - return value.visit(visitor); - } - - public static InlinedDiscriminatedUnion1 type1(InlineType1 value) { - return new InlinedDiscriminatedUnion1(new Type1Value(value)); - } - - public static InlinedDiscriminatedUnion1 type2(InlineType2 value) { - return new InlinedDiscriminatedUnion1(new Type2Value(value)); - } - - public boolean isType1() { - return value instanceof Type1Value; - } - - public boolean isType2() { - return value instanceof Type2Value; - } - - public boolean _isUnknown() { - return value instanceof _UnknownValue; - } - - public Optional getType1() { - if (isType1()) { - return Optional.of(((Type1Value) value).value); - } - return Optional.empty(); - } - - public Optional getType2() { - if (isType2()) { - return Optional.of(((Type2Value) value).value); - } - return Optional.empty(); - } - - public Optional _getUnknown() { - if (_isUnknown()) { - return Optional.of(((_UnknownValue) value).value); - } - return Optional.empty(); - } - - @JsonValue - private Value getValue() { - return this.value; - } - - public interface Visitor { - T visitType1(InlineType1 type1); - - T visitType2(InlineType2 type2); - - T _visitUnknown(Object unknownType); - } - - @JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "type", - visible = true, - defaultImpl = _UnknownValue.class - ) - @JsonSubTypes({ - @JsonSubTypes.Type(Type1Value.class), - @JsonSubTypes.Type(Type2Value.class) - }) - @JsonIgnoreProperties( - ignoreUnknown = true - ) - private interface Value { - T visit(Visitor visitor); - } - - @JsonTypeName("type1") - private static final class Type1Value implements Value { - @JsonUnwrapped - private InlineType1 value; - - @JsonCreator( - mode = JsonCreator.Mode.PROPERTIES - ) - private Type1Value() { - } - - private Type1Value(InlineType1 value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitType1(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Type1Value && equalTo((Type1Value) other); - } - - private boolean equalTo(Type1Value other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "value: " + value + "}"; - } - } - - @JsonTypeName("type2") - private static final class Type2Value implements Value { - @JsonUnwrapped - private InlineType2 value; - - @JsonCreator( - mode = JsonCreator.Mode.PROPERTIES - ) - private Type2Value() { - } - - private Type2Value(InlineType2 value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitType2(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Type2Value && equalTo((Type2Value) other); - } - - private boolean equalTo(Type2Value other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "value: " + value + "}"; - } - } - - private static final class _UnknownValue implements Value { - private String type; - - @JsonValue - private Object value; - - @JsonCreator( - mode = JsonCreator.Mode.PROPERTIES - ) - private _UnknownValue(@JsonProperty("value") Object value) { - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor._visitUnknown(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof _UnknownValue && equalTo((_UnknownValue) other); - } - - private boolean equalTo(_UnknownValue other) { - return type.equals(other.type) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.type, this.value); - } - - @java.lang.Override - public String toString() { - return "InlinedDiscriminatedUnion1{" + "type: " + type + ", value: " + value + "}"; - } - } -} diff --git a/seed/java-spring/inline-types/types/InlinedUndiscriminatedUnion1.java b/seed/java-spring/inline-types/types/InlinedUndiscriminatedUnion1.java deleted file mode 100644 index 2aa7f956849..00000000000 --- a/seed/java-spring/inline-types/types/InlinedUndiscriminatedUnion1.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -package types; - -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import core.ObjectMappers; -import java.io.IOException; -import java.lang.IllegalArgumentException; -import java.lang.IllegalStateException; -import java.lang.Object; -import java.lang.String; -import java.util.Objects; - -@JsonDeserialize( - using = InlinedUndiscriminatedUnion1.Deserializer.class -) -public final class InlinedUndiscriminatedUnion1 { - private final Object value; - - private final int type; - - private InlinedUndiscriminatedUnion1(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - public T visit(Visitor visitor) { - if(this.type == 0) { - return visitor.visit((InlineType1) this.value); - } else if(this.type == 1) { - return visitor.visit((InlineType2) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof InlinedUndiscriminatedUnion1 && equalTo((InlinedUndiscriminatedUnion1) other); - } - - private boolean equalTo(InlinedUndiscriminatedUnion1 other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static InlinedUndiscriminatedUnion1 of(InlineType1 value) { - return new InlinedUndiscriminatedUnion1(value, 0); - } - - public static InlinedUndiscriminatedUnion1 of(InlineType2 value) { - return new InlinedUndiscriminatedUnion1(value, 1); - } - - public interface Visitor { - T visit(InlineType1 value); - - T visit(InlineType2 value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(InlinedUndiscriminatedUnion1.class); - } - - @java.lang.Override - public InlinedUndiscriminatedUnion1 deserialize(JsonParser p, DeserializationContext ctxt) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InlineType1.class)); - } catch(IllegalArgumentException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, InlineType2.class)); - } catch(IllegalArgumentException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/seed/java-spring/inline-types/types/NestedInlineType1.java b/seed/java-spring/inline-types/types/NestedInlineType1.java deleted file mode 100644 index 3c9301f4294..00000000000 --- a/seed/java-spring/inline-types/types/NestedInlineType1.java +++ /dev/null @@ -1,139 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -package types; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import core.ObjectMappers; -import java.lang.Object; -import java.lang.String; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize( - builder = NestedInlineType1.Builder.class -) -public final class NestedInlineType1 { - private final String foo; - - private final String bar; - - private final InlineEnum myEnum; - - private NestedInlineType1(String foo, String bar, InlineEnum myEnum) { - this.foo = foo; - this.bar = bar; - this.myEnum = myEnum; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public String getBar() { - return bar; - } - - @JsonProperty("myEnum") - public InlineEnum getMyEnum() { - return myEnum; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof NestedInlineType1 && equalTo((NestedInlineType1) other); - } - - private boolean equalTo(NestedInlineType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar) && myEnum.equals(other.myEnum); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar, this.myEnum); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(@NotNull String foo); - - Builder from(NestedInlineType1 other); - } - - public interface BarStage { - MyEnumStage bar(@NotNull String bar); - } - - public interface MyEnumStage { - _FinalStage myEnum(@NotNull InlineEnum myEnum); - } - - public interface _FinalStage { - NestedInlineType1 build(); - } - - @JsonIgnoreProperties( - ignoreUnknown = true - ) - public static final class Builder implements FooStage, BarStage, MyEnumStage, _FinalStage { - private String foo; - - private String bar; - - private InlineEnum myEnum; - - private Builder() { - } - - @java.lang.Override - public Builder from(NestedInlineType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - myEnum(other.getMyEnum()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(@NotNull String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public MyEnumStage bar(@NotNull String bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("myEnum") - public _FinalStage myEnum(@NotNull InlineEnum myEnum) { - this.myEnum = Objects.requireNonNull(myEnum, "myEnum must not be null"); - return this; - } - - @java.lang.Override - public NestedInlineType1 build() { - return new NestedInlineType1(foo, bar, myEnum); - } - } -} diff --git a/seed/java-spring/inline-types/types/RootType1.java b/seed/java-spring/inline-types/types/RootType1.java deleted file mode 100644 index a7512cf5ca8..00000000000 --- a/seed/java-spring/inline-types/types/RootType1.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -package types; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import core.ObjectMappers; -import java.lang.Object; -import java.lang.String; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize( - builder = RootType1.Builder.class -) -public final class RootType1 { - private final String foo; - - private final InlineType1 bar; - - private RootType1(String foo, InlineType1 bar) { - this.foo = foo; - this.bar = bar; - } - - @JsonProperty("foo") - public String getFoo() { - return foo; - } - - @JsonProperty("bar") - public InlineType1 getBar() { - return bar; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof RootType1 && equalTo((RootType1) other); - } - - private boolean equalTo(RootType1 other) { - return foo.equals(other.foo) && bar.equals(other.bar); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.foo, this.bar); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static FooStage builder() { - return new Builder(); - } - - public interface FooStage { - BarStage foo(@NotNull String foo); - - Builder from(RootType1 other); - } - - public interface BarStage { - _FinalStage bar(@NotNull InlineType1 bar); - } - - public interface _FinalStage { - RootType1 build(); - } - - @JsonIgnoreProperties( - ignoreUnknown = true - ) - public static final class Builder implements FooStage, BarStage, _FinalStage { - private String foo; - - private InlineType1 bar; - - private Builder() { - } - - @java.lang.Override - public Builder from(RootType1 other) { - foo(other.getFoo()); - bar(other.getBar()); - return this; - } - - @java.lang.Override - @JsonSetter("foo") - public BarStage foo(@NotNull String foo) { - this.foo = Objects.requireNonNull(foo, "foo must not be null"); - return this; - } - - @java.lang.Override - @JsonSetter("bar") - public _FinalStage bar(@NotNull InlineType1 bar) { - this.bar = Objects.requireNonNull(bar, "bar must not be null"); - return this; - } - - @java.lang.Override - public RootType1 build() { - return new RootType1(foo, bar); - } - } -} diff --git a/seed/openapi/inline-types/.mock/definition/__package__.yml b/seed/openapi/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/openapi/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/openapi/inline-types/.mock/definition/api.yml b/seed/openapi/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/openapi/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/openapi/inline-types/.mock/fern.config.json b/seed/openapi/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/openapi/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/openapi/inline-types/.mock/generators.yml b/seed/openapi/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/openapi/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/openapi/inline-types/openapi.yml b/seed/openapi/inline-types/openapi.yml deleted file mode 100644 index 4c6d6dc007c..00000000000 --- a/seed/openapi/inline-types/openapi.yml +++ /dev/null @@ -1,117 +0,0 @@ -openapi: 3.0.1 -info: - title: object - version: '' -paths: - /root/root: - post: - operationId: getRoot - tags: - - '' - parameters: [] - responses: - '200': - description: '' - content: - application/json: - schema: - $ref: '#/components/schemas/RootType1' - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - bar: - $ref: '#/components/schemas/InlineType1' - foo: - type: string - required: - - bar - - foo -components: - schemas: - RootType1: - title: RootType1 - type: object - properties: - foo: - type: string - bar: - $ref: '#/components/schemas/InlineType1' - required: - - foo - - bar - InlineType1: - title: InlineType1 - type: object - properties: - foo: - type: string - bar: - $ref: '#/components/schemas/NestedInlineType1' - required: - - foo - - bar - InlineType2: - title: InlineType2 - type: object - properties: - baz: - type: string - required: - - baz - NestedInlineType1: - title: NestedInlineType1 - type: object - properties: - foo: - type: string - bar: - type: string - myEnum: - $ref: '#/components/schemas/InlineEnum' - required: - - foo - - bar - - myEnum - InlinedDiscriminatedUnion1: - title: InlinedDiscriminatedUnion1 - oneOf: - - type: object - allOf: - - type: object - properties: - type: - type: string - enum: - - type1 - - $ref: '#/components/schemas/InlineType1' - required: - - type - - type: object - allOf: - - type: object - properties: - type: - type: string - enum: - - type2 - - $ref: '#/components/schemas/InlineType2' - required: - - type - InlinedUndiscriminatedUnion1: - title: InlinedUndiscriminatedUnion1 - oneOf: - - $ref: '#/components/schemas/InlineType1' - - $ref: '#/components/schemas/InlineType2' - InlineEnum: - title: InlineEnum - type: string - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING - securitySchemes: {} diff --git a/seed/openapi/inline-types/snippet-templates.json b/seed/openapi/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/openapi/inline-types/snippet.json b/seed/openapi/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/php-model/inline-types/.github/workflows/ci.yml b/seed/php-model/inline-types/.github/workflows/ci.yml deleted file mode 100644 index 258bf33a19f..00000000000 --- a/seed/php-model/inline-types/.github/workflows/ci.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: ci - -on: [push] - -jobs: - compile: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "8.1" - - - name: Install tools - run: | - composer install - - - name: Build - run: | - composer build - - - name: Analyze - run: | - composer analyze - - unit-tests: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "8.1" - - - name: Install tools - run: | - composer install - - - name: Run Tests - run: | - composer test \ No newline at end of file diff --git a/seed/php-model/inline-types/.gitignore b/seed/php-model/inline-types/.gitignore deleted file mode 100644 index f38efc46ade..00000000000 --- a/seed/php-model/inline-types/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.php-cs-fixer.cache -.phpunit.result.cache -composer.lock -vendor/ \ No newline at end of file diff --git a/seed/php-model/inline-types/.mock/definition/__package__.yml b/seed/php-model/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/php-model/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/php-model/inline-types/.mock/definition/api.yml b/seed/php-model/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/php-model/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/php-model/inline-types/.mock/fern.config.json b/seed/php-model/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/php-model/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/php-model/inline-types/.mock/generators.yml b/seed/php-model/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/php-model/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/php-model/inline-types/composer.json b/seed/php-model/inline-types/composer.json deleted file mode 100644 index 5c96c0056e0..00000000000 --- a/seed/php-model/inline-types/composer.json +++ /dev/null @@ -1,40 +0,0 @@ - -{ - "name": "seed/seed", - "version": "0.0.1", - "description": "Seed PHP Library", - "keywords": [ - "seed", - "api", - "sdk" - ], - "license": [], - "require": { - "php": "^8.1", - "ext-json": "*", - "guzzlehttp/guzzle": "^7.9" - }, - "require-dev": { - "phpunit/phpunit": "^9.0", - "friendsofphp/php-cs-fixer": "3.5.0", - "phpstan/phpstan": "^1.12" - }, - "autoload": { - "psr-4": { - "Seed\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "\\Seed\\Tests\\": "tests/" - } - }, - "scripts": { - "build": [ - "@php -l src", - "@php -l tests" - ], - "test": "phpunit", - "analyze": "phpstan analyze src tests" - } -} diff --git a/seed/php-model/inline-types/phpstan.neon b/seed/php-model/inline-types/phpstan.neon deleted file mode 100644 index 29a11a92a19..00000000000 --- a/seed/php-model/inline-types/phpstan.neon +++ /dev/null @@ -1,5 +0,0 @@ -parameters: - level: max - paths: - - src - - tests \ No newline at end of file diff --git a/seed/php-model/inline-types/phpunit.xml b/seed/php-model/inline-types/phpunit.xml deleted file mode 100644 index 54630a51163..00000000000 --- a/seed/php-model/inline-types/phpunit.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - tests - - - \ No newline at end of file diff --git a/seed/php-model/inline-types/snippet-templates.json b/seed/php-model/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/php-model/inline-types/snippet.json b/seed/php-model/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/php-model/inline-types/src/Core/Json/JsonDecoder.php b/seed/php-model/inline-types/src/Core/Json/JsonDecoder.php deleted file mode 100644 index 2ddff027348..00000000000 --- a/seed/php-model/inline-types/src/Core/Json/JsonDecoder.php +++ /dev/null @@ -1,161 +0,0 @@ - $type The type definition for deserialization. - * @return mixed[]|array The deserialized array. - * @throws JsonException If the decoded value is not an array. - */ - public static function decodeArray(string $json, array $type): array - { - $decoded = self::decode($json); - if (!is_array($decoded)) { - throw new JsonException("Unexpected non-array json value: " . $json); - } - return JsonDeserializer::deserializeArray($decoded, $type); - } - - /** - * Decodes a JSON string and deserializes it based on the provided union type definition. - * - * @param string $json The JSON string to decode. - * @param Union $union The union type definition for deserialization. - * @return mixed The deserialized value. - * @throws JsonException If the deserialization for all types in the union fails. - */ - public static function decodeUnion(string $json, Union $union): mixed - { - $decoded = self::decode($json); - return JsonDeserializer::deserializeUnion($decoded, $union); - } - /** - * Decodes a JSON string and returns a mixed. - * - * @param string $json The JSON string to decode. - * @return mixed The decoded mixed. - * @throws JsonException If the decoded value is not an mixed. - */ - public static function decodeMixed(string $json): mixed - { - return self::decode($json); - } - - /** - * Decodes a JSON string into a PHP value. - * - * @param string $json The JSON string to decode. - * @return mixed The decoded value. - * @throws JsonException If an error occurs during JSON decoding. - */ - public static function decode(string $json): mixed - { - return json_decode($json, associative: true, flags: JSON_THROW_ON_ERROR); - } -} diff --git a/seed/php-model/inline-types/src/Core/Json/JsonDeserializer.php b/seed/php-model/inline-types/src/Core/Json/JsonDeserializer.php deleted file mode 100644 index 5f0ca2d7ed0..00000000000 --- a/seed/php-model/inline-types/src/Core/Json/JsonDeserializer.php +++ /dev/null @@ -1,204 +0,0 @@ - $data The array to be deserialized. - * @param mixed[]|array $type The type definition from the annotation. - * @return mixed[]|array The deserialized array. - * @throws JsonException If deserialization fails. - */ - public static function deserializeArray(array $data, array $type): array - { - return Utils::isMapType($type) - ? self::deserializeMap($data, $type) - : self::deserializeList($data, $type); - } - - /** - * Deserializes a value based on its type definition. - * - * @param mixed $data The data to deserialize. - * @param mixed $type The type definition. - * @return mixed The deserialized value. - * @throws JsonException If deserialization fails. - */ - private static function deserializeValue(mixed $data, mixed $type): mixed - { - if ($type instanceof Union) { - return self::deserializeUnion($data, $type); - } - - if (is_array($type)) { - return self::deserializeArray((array)$data, $type); - } - - if (gettype($type) != "string") { - throw new JsonException("Unexpected non-string type."); - } - - return self::deserializeSingleValue($data, $type); - } - - /** - * Deserializes a value based on the possible types in a union type definition. - * - * @param mixed $data The data to deserialize. - * @param Union $type The union type definition. - * @return mixed The deserialized value. - * @throws JsonException If none of the union types can successfully deserialize the value. - */ - public static function deserializeUnion(mixed $data, Union $type): mixed - { - foreach ($type->types as $unionType) { - try { - return self::deserializeValue($data, $unionType); - } catch (Exception) { - continue; - } - } - $readableType = Utils::getReadableType($data); - throw new JsonException( - "Cannot deserialize value of type $readableType with any of the union types: " . $type - ); - } - - /** - * Deserializes a single value based on its expected type. - * - * @param mixed $data The data to deserialize. - * @param string $type The expected type. - * @return mixed The deserialized value. - * @throws JsonException If deserialization fails. - */ - private static function deserializeSingleValue(mixed $data, string $type): mixed - { - if ($type === 'null' && $data === null) { - return null; - } - - if ($type === 'date' && is_string($data)) { - return self::deserializeDate($data); - } - - if ($type === 'datetime' && is_string($data)) { - return self::deserializeDateTime($data); - } - - if ($type === 'mixed') { - return $data; - } - - if (class_exists($type) && is_array($data)) { - return self::deserializeObject($data, $type); - } - - // Handle floats as a special case since gettype($data) returns "double" for float values in PHP, and because - // floats make come through from json_decoded as integers - if ($type === 'float' && (is_numeric($data))) { - return (float) $data; - } - - if (gettype($data) === $type) { - return $data; - } - - throw new JsonException("Unable to deserialize value of type '" . gettype($data) . "' as '$type'."); - } - - /** - * Deserializes an array into an object of the given type. - * - * @param array $data The data to deserialize. - * @param string $type The class name of the object to deserialize into. - * - * @return object The deserialized object. - * - * @throws JsonException If the type does not implement JsonSerializableType. - */ - public static function deserializeObject(array $data, string $type): object - { - if (!is_subclass_of($type, JsonSerializableType::class)) { - throw new JsonException("$type is not a subclass of JsonSerializableType."); - } - return $type::jsonDeserialize($data); - } - - /** - * Deserializes a map (associative array) with defined key and value types. - * - * @param array $data The associative array to deserialize. - * @param array $type The type definition for the map. - * @return array The deserialized map. - * @throws JsonException If deserialization fails. - */ - private static function deserializeMap(array $data, array $type): array - { - $keyType = array_key_first($type); - $valueType = $type[$keyType]; - $result = []; - - foreach ($data as $key => $item) { - $key = Utils::castKey($key, (string)$keyType); - $result[$key] = self::deserializeValue($item, $valueType); - } - - return $result; - } - - /** - * Deserializes a list (indexed array) with a defined value type. - * - * @param array $data The list to deserialize. - * @param array $type The type definition for the list. - * @return array The deserialized list. - * @throws JsonException If deserialization fails. - */ - private static function deserializeList(array $data, array $type): array - { - $valueType = $type[0]; - return array_map(fn ($item) => self::deserializeValue($item, $valueType), $data); - } -} diff --git a/seed/php-model/inline-types/src/Core/Json/JsonEncoder.php b/seed/php-model/inline-types/src/Core/Json/JsonEncoder.php deleted file mode 100644 index 0dbf3fcc994..00000000000 --- a/seed/php-model/inline-types/src/Core/Json/JsonEncoder.php +++ /dev/null @@ -1,20 +0,0 @@ -jsonSerialize(); - $encoded = JsonEncoder::encode($serializedObject); - if (!$encoded) { - throw new Exception("Could not encode type"); - } - return $encoded; - } - - /** - * Serializes the object to an array. - * - * @return mixed[] Array representation of the object. - * @throws JsonException If serialization fails. - */ - public function jsonSerialize(): array - { - $result = []; - $reflectionClass = new \ReflectionClass($this); - - foreach ($reflectionClass->getProperties() as $property) { - $jsonKey = self::getJsonKey($property); - if ($jsonKey == null) { - continue; - } - $value = $property->getValue($this); - - // Handle DateTime properties - $dateTypeAttr = $property->getAttributes(Date::class)[0] ?? null; - if ($dateTypeAttr && $value instanceof DateTime) { - $dateType = $dateTypeAttr->newInstance()->type; - $value = ($dateType === Date::TYPE_DATE) - ? JsonSerializer::serializeDate($value) - : JsonSerializer::serializeDateTime($value); - } - - // Handle Union annotations - $unionTypeAttr = $property->getAttributes(Union::class)[0] ?? null; - if ($unionTypeAttr) { - $unionType = $unionTypeAttr->newInstance(); - $value = JsonSerializer::serializeUnion($value, $unionType); - } - - // Handle arrays with type annotations - $arrayTypeAttr = $property->getAttributes(ArrayType::class)[0] ?? null; - if ($arrayTypeAttr && is_array($value)) { - $arrayType = $arrayTypeAttr->newInstance()->type; - $value = JsonSerializer::serializeArray($value, $arrayType); - } - - // Handle object - if (is_object($value)) { - $value = JsonSerializer::serializeObject($value); - } - - if ($value !== null) { - $result[$jsonKey] = $value; - } - } - - return $result; - } - - /** - * Deserializes a JSON string into an instance of the calling class. - * - * @param string $json JSON string to deserialize. - * @return static Deserialized object. - * @throws JsonException If decoding fails or the result is not an array. - * @throws Exception If deserialization fails. - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - - /** - * Deserializes an array into an instance of the calling class. - * - * @param array $data Array data to deserialize. - * @return static Deserialized object. - * @throws JsonException If deserialization fails. - */ - public static function jsonDeserialize(array $data): static - { - $reflectionClass = new \ReflectionClass(static::class); - $constructor = $reflectionClass->getConstructor(); - - if ($constructor === null) { - throw new JsonException("No constructor found."); - } - - $args = []; - foreach ($reflectionClass->getProperties() as $property) { - $jsonKey = self::getJsonKey($property) ?? $property->getName(); - - if (array_key_exists($jsonKey, $data)) { - $value = $data[$jsonKey]; - - // Handle Date annotation - $dateTypeAttr = $property->getAttributes(Date::class)[0] ?? null; - if ($dateTypeAttr) { - $dateType = $dateTypeAttr->newInstance()->type; - if (!is_string($value)) { - throw new JsonException("Unexpected non-string type for date."); - } - $value = ($dateType === Date::TYPE_DATE) - ? JsonDeserializer::deserializeDate($value) - : JsonDeserializer::deserializeDateTime($value); - } - - // Handle Array annotation - $arrayTypeAttr = $property->getAttributes(ArrayType::class)[0] ?? null; - if (is_array($value) && $arrayTypeAttr) { - $arrayType = $arrayTypeAttr->newInstance()->type; - $value = JsonDeserializer::deserializeArray($value, $arrayType); - } - - // Handle Union annotations - $unionTypeAttr = $property->getAttributes(Union::class)[0] ?? null; - if ($unionTypeAttr) { - $unionType = $unionTypeAttr->newInstance(); - $value = JsonDeserializer::deserializeUnion($value, $unionType); - } - - // Handle object - $type = $property->getType(); - if (is_array($value) && $type instanceof ReflectionNamedType && !$type->isBuiltin()) { - $value = JsonDeserializer::deserializeObject($value, $type->getName()); - } - - $args[$property->getName()] = $value; - } else { - $defaultValue = $property->getDefaultValue() ?? null; - $args[$property->getName()] = $defaultValue; - } - } - // @phpstan-ignore-next-line - return new static($args); - } - - /** - * Retrieves the JSON key associated with a property. - * - * @param ReflectionProperty $property The reflection property. - * @return ?string The JSON key, or null if not available. - */ - private static function getJsonKey(ReflectionProperty $property): ?string - { - $jsonPropertyAttr = $property->getAttributes(JsonProperty::class)[0] ?? null; - return $jsonPropertyAttr?->newInstance()?->name; - } -} diff --git a/seed/php-model/inline-types/src/Core/Json/JsonSerializer.php b/seed/php-model/inline-types/src/Core/Json/JsonSerializer.php deleted file mode 100644 index 7dd6fe517af..00000000000 --- a/seed/php-model/inline-types/src/Core/Json/JsonSerializer.php +++ /dev/null @@ -1,192 +0,0 @@ -format(Constant::DateFormat); - } - - /** - * Serializes a DateTime object into a string using the date-time format. - * - * @param DateTime $date The DateTime object to serialize. - * @return string The serialized date-time string. - */ - public static function serializeDateTime(DateTime $date): string - { - return $date->format(Constant::DateTimeFormat); - } - - /** - * Serializes an array based on type annotations (either a list or map). - * - * @param mixed[]|array $data The array to be serialized. - * @param mixed[]|array $type The type definition from the annotation. - * @return mixed[]|array The serialized array. - * @throws JsonException If serialization fails. - */ - public static function serializeArray(array $data, array $type): array - { - return Utils::isMapType($type) - ? self::serializeMap($data, $type) - : self::serializeList($data, $type); - } - - /** - * Serializes a value based on its type definition. - * - * @param mixed $data The value to serialize. - * @param mixed $type The type definition. - * @return mixed The serialized value. - * @throws JsonException If serialization fails. - */ - private static function serializeValue(mixed $data, mixed $type): mixed - { - if ($type instanceof Union) { - return self::serializeUnion($data, $type); - } - - if (is_array($type)) { - return self::serializeArray((array)$data, $type); - } - - if (gettype($type) != "string") { - throw new JsonException("Unexpected non-string type."); - } - - return self::serializeSingleValue($data, $type); - } - - /** - * Serializes a value for a union type definition. - * - * @param mixed $data The value to serialize. - * @param Union $unionType The union type definition. - * @return mixed The serialized value. - * @throws JsonException If serialization fails for all union types. - */ - public static function serializeUnion(mixed $data, Union $unionType): mixed - { - foreach ($unionType->types as $type) { - try { - return self::serializeValue($data, $type); - } catch (Exception) { - // Try the next type in the union - continue; - } - } - $readableType = Utils::getReadableType($data); - throw new JsonException( - "Cannot serialize value of type $readableType with any of the union types: " . $unionType - ); - } - - /** - * Serializes a single value based on its type. - * - * @param mixed $data The value to serialize. - * @param string $type The expected type. - * @return mixed The serialized value. - * @throws JsonException If serialization fails. - */ - private static function serializeSingleValue(mixed $data, string $type): mixed - { - if ($type === 'null' && $data === null) { - return null; - } - - if (($type === 'date' || $type === 'datetime') && $data instanceof DateTime) { - return $type === 'date' ? self::serializeDate($data) : self::serializeDateTime($data); - } - - if ($type === 'mixed') { - return $data; - } - - if (class_exists($type) && $data instanceof $type) { - return self::serializeObject($data); - } - - // Handle floats as a special case since gettype($data) returns "double" for float values in PHP. - if ($type === 'float' && is_float($data)) { - return $data; - } - - if (gettype($data) === $type) { - return $data; - } - - throw new JsonException("Unable to serialize value of type '" . gettype($data) . "' as '$type'."); - } - - /** - * Serializes an object to a JSON-serializable format. - * - * @param object $data The object to serialize. - * @return mixed The serialized data. - * @throws JsonException If the object does not implement JsonSerializable. - */ - public static function serializeObject(object $data): mixed - { - if (!is_subclass_of($data, JsonSerializable::class)) { - $type = get_class($data); - throw new JsonException("Class $type must implement JsonSerializable."); - } - return $data->jsonSerialize(); - } - - /** - * Serializes a map (associative array) with defined key and value types. - * - * @param array $data The associative array to serialize. - * @param array $type The type definition for the map. - * @return array The serialized map. - * @throws JsonException If serialization fails. - */ - private static function serializeMap(array $data, array $type): array - { - $keyType = array_key_first($type); - if ($keyType === null) { - throw new JsonException("Unexpected no key in ArrayType."); - } - $valueType = $type[$keyType]; - $result = []; - - foreach ($data as $key => $item) { - $key = Utils::castKey($key, $keyType); - $result[$key] = self::serializeValue($item, $valueType); - } - - return $result; - } - - /** - * Serializes a list (indexed array) where only the value type is defined. - * - * @param array $data The list to serialize. - * @param array $type The type definition for the list. - * @return array The serialized list. - * @throws JsonException If serialization fails. - */ - private static function serializeList(array $data, array $type): array - { - $valueType = $type[0]; - return array_map(fn ($item) => self::serializeValue($item, $valueType), $data); - } -} diff --git a/seed/php-model/inline-types/src/Core/Json/Utils.php b/seed/php-model/inline-types/src/Core/Json/Utils.php deleted file mode 100644 index 7577c058916..00000000000 --- a/seed/php-model/inline-types/src/Core/Json/Utils.php +++ /dev/null @@ -1,61 +0,0 @@ - $type The type definition from the annotation. - * @return bool True if the type is a map, false if it's a list. - */ - public static function isMapType(array $type): bool - { - return count($type) === 1 && !array_is_list($type); - } - - /** - * Casts the key to the appropriate type based on the key type. - * - * @param mixed $key The key to be cast. - * @param string $keyType The type to cast the key to ('string', 'integer', 'float'). - * @return mixed The casted key. - * @throws JsonException - */ - public static function castKey(mixed $key, string $keyType): mixed - { - if (!is_scalar($key)) { - throw new JsonException("Key must be a scalar type."); - } - return match ($keyType) { - 'integer' => (int)$key, - 'float' => (float)$key, - 'string' => (string)$key, - default => $key, - }; - } - - /** - * Returns a human-readable representation of the input's type. - * - * @param mixed $input The input value to determine the type of. - * @return string A readable description of the input type. - */ - public static function getReadableType(mixed $input): string - { - if (is_object($input)) { - return get_class($input); - } elseif (is_array($input)) { - return 'array(' . count($input) . ' items)'; - } elseif (is_null($input)) { - return 'null'; - } else { - return gettype($input); - } - } -} diff --git a/seed/php-model/inline-types/src/Core/Types/ArrayType.php b/seed/php-model/inline-types/src/Core/Types/ArrayType.php deleted file mode 100644 index a26d29008ec..00000000000 --- a/seed/php-model/inline-types/src/Core/Types/ArrayType.php +++ /dev/null @@ -1,16 +0,0 @@ - 'valueType'] for maps, or ['valueType'] for lists - */ - public function __construct(public array $type) - { - } -} diff --git a/seed/php-model/inline-types/src/Core/Types/Constant.php b/seed/php-model/inline-types/src/Core/Types/Constant.php deleted file mode 100644 index 5ac4518cc6d..00000000000 --- a/seed/php-model/inline-types/src/Core/Types/Constant.php +++ /dev/null @@ -1,12 +0,0 @@ -> The types allowed for this property, which can be strings, arrays, or nested Union types. - */ - public array $types; - - /** - * Constructor for the Union attribute. - * - * @param string|Union|array ...$types The list of types that the property can accept. - * This can include primitive types (e.g., 'string', 'int'), arrays, or other Union instances. - * - * Example: - * ```php - * #[Union('string', 'null', 'date', new Union('boolean', 'int'))] - * ``` - */ - public function __construct(string|Union|array ...$types) - { - $this->types = $types; - } - - /** - * Converts the Union type to a string representation. - * - * @return string A string representation of the union types. - */ - public function __toString(): string - { - return implode(' | ', array_map(function ($type) { - if (is_string($type)) { - return $type; - } elseif ($type instanceof Union) { - return (string) $type; // Recursively handle nested unions - } elseif (is_array($type)) { - return 'array'; // Handle arrays - } - }, $this->types)); - } -} diff --git a/seed/php-model/inline-types/src/InlineEnum.php b/seed/php-model/inline-types/src/InlineEnum.php deleted file mode 100644 index 5df508c6949..00000000000 --- a/seed/php-model/inline-types/src/InlineEnum.php +++ /dev/null @@ -1,11 +0,0 @@ -foo = $values['foo']; - $this->bar = $values['bar']; - } -} diff --git a/seed/php-model/inline-types/src/InlineType2.php b/seed/php-model/inline-types/src/InlineType2.php deleted file mode 100644 index f59b4e9e761..00000000000 --- a/seed/php-model/inline-types/src/InlineType2.php +++ /dev/null @@ -1,26 +0,0 @@ -baz = $values['baz']; - } -} diff --git a/seed/php-model/inline-types/src/NestedInlineType1.php b/seed/php-model/inline-types/src/NestedInlineType1.php deleted file mode 100644 index 4bb55ace4a5..00000000000 --- a/seed/php-model/inline-types/src/NestedInlineType1.php +++ /dev/null @@ -1,42 +0,0 @@ - $myEnum - */ - #[JsonProperty('myEnum')] - public string $myEnum; - - /** - * @param array{ - * foo: string, - * bar: string, - * myEnum: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->foo = $values['foo']; - $this->bar = $values['bar']; - $this->myEnum = $values['myEnum']; - } -} diff --git a/seed/php-model/inline-types/src/RootType1.php b/seed/php-model/inline-types/src/RootType1.php deleted file mode 100644 index e0a6ecf3e71..00000000000 --- a/seed/php-model/inline-types/src/RootType1.php +++ /dev/null @@ -1,34 +0,0 @@ -foo = $values['foo']; - $this->bar = $values['bar']; - } -} diff --git a/seed/php-model/inline-types/tests/Seed/Core/Json/DateArrayTest.php b/seed/php-model/inline-types/tests/Seed/Core/Json/DateArrayTest.php deleted file mode 100644 index a72cfdbdd22..00000000000 --- a/seed/php-model/inline-types/tests/Seed/Core/Json/DateArrayTest.php +++ /dev/null @@ -1,54 +0,0 @@ -dates = $values['dates']; - } -} - -class DateArrayTest extends TestCase -{ - public function testDateTimeInArrays(): void - { - $expectedJson = json_encode( - [ - 'dates' => ['2023-01-01', '2023-02-01', '2023-03-01'] - ], - JSON_THROW_ON_ERROR - ); - - $object = DateArray::fromJson($expectedJson); - $this->assertInstanceOf(DateTime::class, $object->dates[0], 'dates[0] should be a DateTime instance.'); - $this->assertEquals('2023-01-01', $object->dates[0]->format('Y-m-d'), 'dates[0] should have the correct date.'); - $this->assertInstanceOf(DateTime::class, $object->dates[1], 'dates[1] should be a DateTime instance.'); - $this->assertEquals('2023-02-01', $object->dates[1]->format('Y-m-d'), 'dates[1] should have the correct date.'); - $this->assertInstanceOf(DateTime::class, $object->dates[2], 'dates[2] should be a DateTime instance.'); - $this->assertEquals('2023-03-01', $object->dates[2]->format('Y-m-d'), 'dates[2] should have the correct date.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for dates array.'); - } -} diff --git a/seed/php-model/inline-types/tests/Seed/Core/Json/EmptyArrayTest.php b/seed/php-model/inline-types/tests/Seed/Core/Json/EmptyArrayTest.php deleted file mode 100644 index d243a08916d..00000000000 --- a/seed/php-model/inline-types/tests/Seed/Core/Json/EmptyArrayTest.php +++ /dev/null @@ -1,71 +0,0 @@ - $emptyMapArray - */ - #[JsonProperty('empty_map_array')] - #[ArrayType(['integer' => new Union('string', 'null')])] - public array $emptyMapArray; - - /** - * @var array $emptyDatesArray - */ - #[ArrayType([new Union('date', 'null')])] - #[JsonProperty('empty_dates_array')] - public array $emptyDatesArray; - - /** - * @param array{ - * emptyStringArray: string[], - * emptyMapArray: array, - * emptyDatesArray: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->emptyStringArray = $values['emptyStringArray']; - $this->emptyMapArray = $values['emptyMapArray']; - $this->emptyDatesArray = $values['emptyDatesArray']; - } -} - -class EmptyArrayTest extends TestCase -{ - public function testEmptyArray(): void - { - $expectedJson = json_encode( - [ - 'empty_string_array' => [], - 'empty_map_array' => [], - 'empty_dates_array' => [] - ], - JSON_THROW_ON_ERROR - ); - - $object = EmptyArray::fromJson($expectedJson); - $this->assertEmpty($object->emptyStringArray, 'empty_string_array should be empty.'); - $this->assertEmpty($object->emptyMapArray, 'empty_map_array should be empty.'); - $this->assertEmpty($object->emptyDatesArray, 'empty_dates_array should be empty.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for EmptyArraysType.'); - } -} diff --git a/seed/php-model/inline-types/tests/Seed/Core/Json/EnumTest.php b/seed/php-model/inline-types/tests/Seed/Core/Json/EnumTest.php deleted file mode 100644 index bf83d5b8ab0..00000000000 --- a/seed/php-model/inline-types/tests/Seed/Core/Json/EnumTest.php +++ /dev/null @@ -1,76 +0,0 @@ -value; - } -} - -class ShapeType extends JsonSerializableType -{ - /** - * @var Shape $shape - */ - #[JsonProperty('shape')] - public Shape $shape; - - /** - * @var Shape[] $shapes - */ - #[ArrayType([Shape::class])] - #[JsonProperty('shapes')] - public array $shapes; - - /** - * @param Shape $shape - * @param Shape[] $shapes - */ - public function __construct( - Shape $shape, - array $shapes, - ) { - $this->shape = $shape; - $this->shapes = $shapes; - } -} - -class EnumTest extends TestCase -{ - public function testEnumSerialization(): void - { - $object = new ShapeType( - Shape::Circle, - [Shape::Square, Shape::Circle, Shape::Triangle] - ); - - $expectedJson = json_encode([ - 'shape' => 'CIRCLE', - 'shapes' => ['SQUARE', 'CIRCLE', 'TRIANGLE'] - ], JSON_THROW_ON_ERROR); - - $actualJson = $object->toJson(); - - $this->assertJsonStringEqualsJsonString( - $expectedJson, - $actualJson, - 'Serialized JSON does not match expected JSON for shape and shapes properties.' - ); - } -} diff --git a/seed/php-model/inline-types/tests/Seed/Core/Json/ExhaustiveTest.php b/seed/php-model/inline-types/tests/Seed/Core/Json/ExhaustiveTest.php deleted file mode 100644 index f542d6a535d..00000000000 --- a/seed/php-model/inline-types/tests/Seed/Core/Json/ExhaustiveTest.php +++ /dev/null @@ -1,197 +0,0 @@ -nestedProperty = $values['nestedProperty']; - } -} - -class Type extends JsonSerializableType -{ - /** - * @var Nested nestedType - */ - #[JsonProperty('nested_type')] - public Nested $nestedType; /** - - * @var string $simpleProperty - */ - #[JsonProperty('simple_property')] - public string $simpleProperty; - - /** - * @var DateTime $dateProperty - */ - #[Date(Date::TYPE_DATE)] - #[JsonProperty('date_property')] - public DateTime $dateProperty; - - /** - * @var DateTime $datetimeProperty - */ - #[Date(Date::TYPE_DATETIME)] - #[JsonProperty('datetime_property')] - public DateTime $datetimeProperty; - - /** - * @var array $stringArray - */ - #[ArrayType(['string'])] - #[JsonProperty('string_array')] - public array $stringArray; - - /** - * @var array $mapProperty - */ - #[ArrayType(['string' => 'integer'])] - #[JsonProperty('map_property')] - public array $mapProperty; - - /** - * @var array $objectArray - */ - #[ArrayType(['integer' => new Union(Nested::class, 'null')])] - #[JsonProperty('object_array')] - public array $objectArray; - - /** - * @var array> $nestedArray - */ - #[ArrayType(['integer' => ['integer' => new Union('string', 'null')]])] - #[JsonProperty('nested_array')] - public array $nestedArray; - - /** - * @var array $datesArray - */ - #[ArrayType([new Union('date', 'null')])] - #[JsonProperty('dates_array')] - public array $datesArray; - - /** - * @var string|null $nullableProperty - */ - #[JsonProperty('nullable_property')] - public ?string $nullableProperty; - - /** - * @param array{ - * nestedType: Nested, - * simpleProperty: string, - * dateProperty: DateTime, - * datetimeProperty: DateTime, - * stringArray: array, - * mapProperty: array, - * objectArray: array, - * nestedArray: array>, - * datesArray: array, - * nullableProperty?: string|null, - * } $values - */ - public function __construct( - array $values, - ) { - $this->nestedType = $values['nestedType']; - $this->simpleProperty = $values['simpleProperty']; - $this->dateProperty = $values['dateProperty']; - $this->datetimeProperty = $values['datetimeProperty']; - $this->stringArray = $values['stringArray']; - $this->mapProperty = $values['mapProperty']; - $this->objectArray = $values['objectArray']; - $this->nestedArray = $values['nestedArray']; - $this->datesArray = $values['datesArray']; - $this->nullableProperty = $values['nullableProperty'] ?? null; - } -} - -class ExhaustiveTest extends TestCase -{ - /** - * Test serialization and deserialization of all types in Type. - */ - public function testExhaustive(): void - { - $expectedJson = json_encode( - [ - 'nested_type' => ['nested_property' => '1995-07-20'], - 'simple_property' => 'Test String', - // Omit 'nullable_property' to test null serialization - 'date_property' => '2023-01-01', - 'datetime_property' => '2023-01-01T12:34:56+00:00', - 'string_array' => ['one', 'two', 'three'], - 'map_property' => ['key1' => 1, 'key2' => 2], - 'object_array' => [ - 1 => ['nested_property' => '2021-07-20'], - 2 => null, // Testing nullable objects in array - ], - 'nested_array' => [ - 1 => [1 => 'value1', 2 => null], // Testing nullable strings in nested array - 2 => [3 => 'value3', 4 => 'value4'] - ], - 'dates_array' => ['2023-01-01', null, '2023-03-01'] // Testing nullable dates in array> - ], - JSON_THROW_ON_ERROR - ); - - $object = Type::fromJson($expectedJson); - - // Check that nullable property is null and not included in JSON - $this->assertNull($object->nullableProperty, 'Nullable property should be null.'); - - // Check date properties - $this->assertInstanceOf(DateTime::class, $object->dateProperty, 'date_property should be a DateTime instance.'); - $this->assertEquals('2023-01-01', $object->dateProperty->format('Y-m-d'), 'date_property should have the correct date.'); - $this->assertInstanceOf(DateTime::class, $object->datetimeProperty, 'datetime_property should be a DateTime instance.'); - $this->assertEquals('2023-01-01 12:34:56', $object->datetimeProperty->format('Y-m-d H:i:s'), 'datetime_property should have the correct datetime.'); - - // Check scalar arrays - $this->assertEquals(['one', 'two', 'three'], $object->stringArray, 'string_array should match the original data.'); - $this->assertEquals(['key1' => 1, 'key2' => 2], $object->mapProperty, 'map_property should match the original data.'); - - // Check object array with nullable elements - $this->assertInstanceOf(Nested::class, $object->objectArray[1], 'object_array[1] should be an instance of TestNestedType1.'); - $this->assertEquals('2021-07-20', $object->objectArray[1]->nestedProperty->format('Y-m-d'), 'object_array[1]->nestedProperty should match the original data.'); - $this->assertNull($object->objectArray[2], 'object_array[2] should be null.'); - - // Check nested array with nullable strings - $this->assertEquals('value1', $object->nestedArray[1][1], 'nested_array[1][1] should match the original data.'); - $this->assertNull($object->nestedArray[1][2], 'nested_array[1][2] should be null.'); - $this->assertEquals('value3', $object->nestedArray[2][3], 'nested_array[2][3] should match the original data.'); - $this->assertEquals('value4', $object->nestedArray[2][4], 'nested_array[2][4] should match the original data.'); - - // Check dates array with nullable DateTime objects - $this->assertInstanceOf(DateTime::class, $object->datesArray[0], 'dates_array[0] should be a DateTime instance.'); - $this->assertEquals('2023-01-01', $object->datesArray[0]->format('Y-m-d'), 'dates_array[0] should have the correct date.'); - $this->assertNull($object->datesArray[1], 'dates_array[1] should be null.'); - $this->assertInstanceOf(DateTime::class, $object->datesArray[2], 'dates_array[2] should be a DateTime instance.'); - $this->assertEquals('2023-03-01', $object->datesArray[2]->format('Y-m-d'), 'dates_array[2] should have the correct date.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'The serialized JSON does not match the original JSON.'); - } -} diff --git a/seed/php-model/inline-types/tests/Seed/Core/Json/InvalidTest.php b/seed/php-model/inline-types/tests/Seed/Core/Json/InvalidTest.php deleted file mode 100644 index 7d1d79406a5..00000000000 --- a/seed/php-model/inline-types/tests/Seed/Core/Json/InvalidTest.php +++ /dev/null @@ -1,42 +0,0 @@ -integerProperty = $values['integerProperty']; - } -} - -class InvalidTest extends TestCase -{ - public function testInvalidJsonThrowsException(): void - { - $this->expectException(\TypeError::class); - $json = json_encode( - [ - 'integer_property' => 'not_an_integer' - ], - JSON_THROW_ON_ERROR - ); - Invalid::fromJson($json); - } -} diff --git a/seed/php-model/inline-types/tests/Seed/Core/Json/NestedUnionArrayTest.php b/seed/php-model/inline-types/tests/Seed/Core/Json/NestedUnionArrayTest.php deleted file mode 100644 index 0fcdd06667e..00000000000 --- a/seed/php-model/inline-types/tests/Seed/Core/Json/NestedUnionArrayTest.php +++ /dev/null @@ -1,89 +0,0 @@ -nestedProperty = $values['nestedProperty']; - } -} - -class NestedUnionArray extends JsonSerializableType -{ - /** - * @var array> $nestedArray - */ - #[ArrayType(['integer' => ['integer' => new Union(UnionObject::class, 'null', 'date')]])] - #[JsonProperty('nested_array')] - public array $nestedArray; - - /** - * @param array{ - * nestedArray: array>, - * } $values - */ - public function __construct( - array $values, - ) { - $this->nestedArray = $values['nestedArray']; - } -} - -class NestedUnionArrayTest extends TestCase -{ - public function testNestedUnionArray(): void - { - $expectedJson = json_encode( - [ - 'nested_array' => [ - 1 => [ - 1 => ['nested_property' => 'Nested One'], - 2 => null, - 4 => '2023-01-02' - ], - 2 => [ - 5 => ['nested_property' => 'Nested Two'], - 7 => '2023-02-02' - ] - ] - ], - JSON_THROW_ON_ERROR - ); - - $object = NestedUnionArray::fromJson($expectedJson); - $this->assertInstanceOf(UnionObject::class, $object->nestedArray[1][1], 'nested_array[1][1] should be an instance of Object.'); - $this->assertEquals('Nested One', $object->nestedArray[1][1]->nestedProperty, 'nested_array[1][1]->nestedProperty should match the original data.'); - $this->assertNull($object->nestedArray[1][2], 'nested_array[1][2] should be null.'); - $this->assertInstanceOf(DateTime::class, $object->nestedArray[1][4], 'nested_array[1][4] should be a DateTime instance.'); - $this->assertEquals('2023-01-02T00:00:00+00:00', $object->nestedArray[1][4]->format(Constant::DateTimeFormat), 'nested_array[1][4] should have the correct datetime.'); - $this->assertInstanceOf(UnionObject::class, $object->nestedArray[2][5], 'nested_array[2][5] should be an instance of Object.'); - $this->assertEquals('Nested Two', $object->nestedArray[2][5]->nestedProperty, 'nested_array[2][5]->nestedProperty should match the original data.'); - $this->assertInstanceOf(DateTime::class, $object->nestedArray[2][7], 'nested_array[1][4] should be a DateTime instance.'); - $this->assertEquals('2023-02-02', $object->nestedArray[2][7]->format('Y-m-d'), 'nested_array[1][4] should have the correct date.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for nested_array.'); - } -} diff --git a/seed/php-model/inline-types/tests/Seed/Core/Json/NullPropertyTest.php b/seed/php-model/inline-types/tests/Seed/Core/Json/NullPropertyTest.php deleted file mode 100644 index ce20a244282..00000000000 --- a/seed/php-model/inline-types/tests/Seed/Core/Json/NullPropertyTest.php +++ /dev/null @@ -1,53 +0,0 @@ -nonNullProperty = $values['nonNullProperty']; - $this->nullProperty = $values['nullProperty'] ?? null; - } -} - -class NullPropertyTest extends TestCase -{ - public function testNullPropertiesAreOmitted(): void - { - $object = new NullProperty( - [ - "nonNullProperty" => "Test String", - "nullProperty" => null - ] - ); - - $serialized = $object->jsonSerialize(); - $this->assertArrayHasKey('non_null_property', $serialized, 'non_null_property should be present in the serialized JSON.'); - $this->assertArrayNotHasKey('null_property', $serialized, 'null_property should be omitted from the serialized JSON.'); - $this->assertEquals('Test String', $serialized['non_null_property'], 'non_null_property should have the correct value.'); - } -} diff --git a/seed/php-model/inline-types/tests/Seed/Core/Json/NullableArrayTest.php b/seed/php-model/inline-types/tests/Seed/Core/Json/NullableArrayTest.php deleted file mode 100644 index fe0f19de6b1..00000000000 --- a/seed/php-model/inline-types/tests/Seed/Core/Json/NullableArrayTest.php +++ /dev/null @@ -1,49 +0,0 @@ - $nullableStringArray - */ - #[ArrayType([new Union('string', 'null')])] - #[JsonProperty('nullable_string_array')] - public array $nullableStringArray; - - /** - * @param array{ - * nullableStringArray: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->nullableStringArray = $values['nullableStringArray']; - } -} - -class NullableArrayTest extends TestCase -{ - public function testNullableArray(): void - { - $expectedJson = json_encode( - [ - 'nullable_string_array' => ['one', null, 'three'] - ], - JSON_THROW_ON_ERROR - ); - - $object = NullableArray::fromJson($expectedJson); - $this->assertEquals(['one', null, 'three'], $object->nullableStringArray, 'nullable_string_array should match the original data.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for nullable_string_array.'); - } -} diff --git a/seed/php-model/inline-types/tests/Seed/Core/Json/ScalarTest.php b/seed/php-model/inline-types/tests/Seed/Core/Json/ScalarTest.php deleted file mode 100644 index 604b7c0b959..00000000000 --- a/seed/php-model/inline-types/tests/Seed/Core/Json/ScalarTest.php +++ /dev/null @@ -1,116 +0,0 @@ - $intFloatArray - */ - #[ArrayType([new Union('integer', 'float')])] - #[JsonProperty('int_float_array')] - public array $intFloatArray; - - /** - * @var array $floatArray - */ - #[ArrayType(['float'])] - #[JsonProperty('float_array')] - public array $floatArray; - - /** - * @var bool|null $nullableBooleanProperty - */ - #[JsonProperty('nullable_boolean_property')] - public ?bool $nullableBooleanProperty; - - /** - * @param array{ - * integerProperty: int, - * floatProperty: float, - * otherFloatProperty: float, - * booleanProperty: bool, - * stringProperty: string, - * intFloatArray: array, - * floatArray: array, - * nullableBooleanProperty?: bool|null, - * } $values - */ - public function __construct( - array $values, - ) { - $this->integerProperty = $values['integerProperty']; - $this->floatProperty = $values['floatProperty']; - $this->otherFloatProperty = $values['otherFloatProperty']; - $this->booleanProperty = $values['booleanProperty']; - $this->stringProperty = $values['stringProperty']; - $this->intFloatArray = $values['intFloatArray']; - $this->floatArray = $values['floatArray']; - $this->nullableBooleanProperty = $values['nullableBooleanProperty'] ?? null; - } -} - -class ScalarTest extends TestCase -{ - public function testAllScalarTypesIncludingFloat(): void - { - $expectedJson = json_encode( - [ - 'integer_property' => 42, - 'float_property' => 3.14159, - 'other_float_property' => 3, - 'boolean_property' => true, - 'string_property' => 'Hello, World!', - 'int_float_array' => [1, 2.5, 3, 4.75], - 'float_array' => [1, 2, 3, 4] // Ensure we handle "integer-looking" floats - ], - JSON_THROW_ON_ERROR - ); - - $object = Scalar::fromJson($expectedJson); - $this->assertEquals(42, $object->integerProperty, 'integer_property should be 42.'); - $this->assertEquals(3.14159, $object->floatProperty, 'float_property should be 3.14159.'); - $this->assertTrue($object->booleanProperty, 'boolean_property should be true.'); - $this->assertEquals('Hello, World!', $object->stringProperty, 'string_property should be "Hello, World!".'); - $this->assertNull($object->nullableBooleanProperty, 'nullable_boolean_property should be null.'); - $this->assertEquals([1, 2.5, 3, 4.75], $object->intFloatArray, 'int_float_array should match the original data.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for ScalarTypesTest.'); - } -} diff --git a/seed/php-model/inline-types/tests/Seed/Core/Json/TraitTest.php b/seed/php-model/inline-types/tests/Seed/Core/Json/TraitTest.php deleted file mode 100644 index 837f239115f..00000000000 --- a/seed/php-model/inline-types/tests/Seed/Core/Json/TraitTest.php +++ /dev/null @@ -1,60 +0,0 @@ -integerProperty = $values['integerProperty']; - $this->stringProperty = $values['stringProperty']; - } -} - -class TraitTest extends TestCase -{ - public function testTraitPropertyAndString(): void - { - $expectedJson = json_encode( - [ - 'integer_property' => 42, - 'string_property' => 'Hello, World!', - ], - JSON_THROW_ON_ERROR - ); - - $object = TypeWithTrait::fromJson($expectedJson); - $this->assertEquals(42, $object->integerProperty, 'integer_property should be 42.'); - $this->assertEquals('Hello, World!', $object->stringProperty, 'string_property should be "Hello, World!".'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for ScalarTypesTestWithTrait.'); - } -} diff --git a/seed/php-model/inline-types/tests/Seed/Core/Json/UnionArrayTest.php b/seed/php-model/inline-types/tests/Seed/Core/Json/UnionArrayTest.php deleted file mode 100644 index 09933d2321d..00000000000 --- a/seed/php-model/inline-types/tests/Seed/Core/Json/UnionArrayTest.php +++ /dev/null @@ -1,57 +0,0 @@ - $mixedDates - */ - #[ArrayType(['integer' => new Union('datetime', 'string', 'null')])] - #[JsonProperty('mixed_dates')] - public array $mixedDates; - - /** - * @param array{ - * mixedDates: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->mixedDates = $values['mixedDates']; - } -} - -class UnionArrayTest extends TestCase -{ - public function testUnionArray(): void - { - $expectedJson = json_encode( - [ - 'mixed_dates' => [ - 1 => '2023-01-01T12:00:00+00:00', - 2 => null, - 3 => 'Some String' - ] - ], - JSON_THROW_ON_ERROR - ); - - $object = UnionArray::fromJson($expectedJson); - $this->assertInstanceOf(DateTime::class, $object->mixedDates[1], 'mixed_dates[1] should be a DateTime instance.'); - $this->assertEquals('2023-01-01 12:00:00', $object->mixedDates[1]->format('Y-m-d H:i:s'), 'mixed_dates[1] should have the correct datetime.'); - $this->assertNull($object->mixedDates[2], 'mixed_dates[2] should be null.'); - $this->assertEquals('Some String', $object->mixedDates[3], 'mixed_dates[3] should be "Some String".'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for mixed_dates.'); - } -} diff --git a/seed/php-model/inline-types/tests/Seed/Core/Json/UnionPropertyTest.php b/seed/php-model/inline-types/tests/Seed/Core/Json/UnionPropertyTest.php deleted file mode 100644 index 3119baace62..00000000000 --- a/seed/php-model/inline-types/tests/Seed/Core/Json/UnionPropertyTest.php +++ /dev/null @@ -1,115 +0,0 @@ - 'integer'], UnionProperty::class)] - #[JsonProperty('complexUnion')] - public mixed $complexUnion; - - /** - * @param array{ - * complexUnion: string|int|null|array|UnionProperty - * } $values - */ - public function __construct( - array $values, - ) { - $this->complexUnion = $values['complexUnion']; - } -} - -class UnionPropertyTest extends TestCase -{ - public function testWithMapOfIntToInt(): void - { - $expectedJson = json_encode( - [ - 'complexUnion' => [1 => 100, 2 => 200] - ], - JSON_THROW_ON_ERROR - ); - - $object = UnionProperty::fromJson($expectedJson); - $this->assertIsArray($object->complexUnion, 'complexUnion should be an array.'); - $this->assertEquals([1 => 100, 2 => 200], $object->complexUnion, 'complexUnion should match the original map of int => int.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); - } - - public function testWithNestedUnionPropertyType(): void - { - $expectedJson = json_encode( - [ - 'complexUnion' => new UnionProperty( - [ - 'complexUnion' => 'Nested String' - ] - ) - ], - JSON_THROW_ON_ERROR - ); - - $object = UnionProperty::fromJson($expectedJson); - $this->assertInstanceOf(UnionProperty::class, $object->complexUnion, 'complexUnion should be an instance of UnionPropertyType.'); - $this->assertEquals('Nested String', $object->complexUnion->complexUnion, 'Nested complexUnion should match the original value.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); - } - - public function testWithNull(): void - { - $expectedJson = json_encode( - [], - JSON_THROW_ON_ERROR - ); - - $object = UnionProperty::fromJson($expectedJson); - $this->assertNull($object->complexUnion, 'complexUnion should be null.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); - } - - public function testWithInteger(): void - { - $expectedJson = json_encode( - [ - 'complexUnion' => 42 - ], - JSON_THROW_ON_ERROR - ); - - $object = UnionProperty::fromJson($expectedJson); - $this->assertIsInt($object->complexUnion, 'complexUnion should be an integer.'); - $this->assertEquals(42, $object->complexUnion, 'complexUnion should match the original integer.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); - } - - public function testWithString(): void - { - $expectedJson = json_encode( - [ - 'complexUnion' => 'Some String' - ], - JSON_THROW_ON_ERROR - ); - - $object = UnionProperty::fromJson($expectedJson); - $this->assertIsString($object->complexUnion, 'complexUnion should be a string.'); - $this->assertEquals('Some String', $object->complexUnion, 'complexUnion should match the original string.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); - } -} diff --git a/seed/php-sdk/inline-types/.github/workflows/ci.yml b/seed/php-sdk/inline-types/.github/workflows/ci.yml deleted file mode 100644 index 258bf33a19f..00000000000 --- a/seed/php-sdk/inline-types/.github/workflows/ci.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: ci - -on: [push] - -jobs: - compile: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "8.1" - - - name: Install tools - run: | - composer install - - - name: Build - run: | - composer build - - - name: Analyze - run: | - composer analyze - - unit-tests: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "8.1" - - - name: Install tools - run: | - composer install - - - name: Run Tests - run: | - composer test \ No newline at end of file diff --git a/seed/php-sdk/inline-types/.gitignore b/seed/php-sdk/inline-types/.gitignore deleted file mode 100644 index f38efc46ade..00000000000 --- a/seed/php-sdk/inline-types/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.php-cs-fixer.cache -.phpunit.result.cache -composer.lock -vendor/ \ No newline at end of file diff --git a/seed/php-sdk/inline-types/.mock/definition/__package__.yml b/seed/php-sdk/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/php-sdk/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/php-sdk/inline-types/.mock/definition/api.yml b/seed/php-sdk/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/php-sdk/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/php-sdk/inline-types/.mock/fern.config.json b/seed/php-sdk/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/php-sdk/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/php-sdk/inline-types/.mock/generators.yml b/seed/php-sdk/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/php-sdk/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/php-sdk/inline-types/composer.json b/seed/php-sdk/inline-types/composer.json deleted file mode 100644 index 5c96c0056e0..00000000000 --- a/seed/php-sdk/inline-types/composer.json +++ /dev/null @@ -1,40 +0,0 @@ - -{ - "name": "seed/seed", - "version": "0.0.1", - "description": "Seed PHP Library", - "keywords": [ - "seed", - "api", - "sdk" - ], - "license": [], - "require": { - "php": "^8.1", - "ext-json": "*", - "guzzlehttp/guzzle": "^7.9" - }, - "require-dev": { - "phpunit/phpunit": "^9.0", - "friendsofphp/php-cs-fixer": "3.5.0", - "phpstan/phpstan": "^1.12" - }, - "autoload": { - "psr-4": { - "Seed\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "\\Seed\\Tests\\": "tests/" - } - }, - "scripts": { - "build": [ - "@php -l src", - "@php -l tests" - ], - "test": "phpunit", - "analyze": "phpstan analyze src tests" - } -} diff --git a/seed/php-sdk/inline-types/phpstan.neon b/seed/php-sdk/inline-types/phpstan.neon deleted file mode 100644 index 29a11a92a19..00000000000 --- a/seed/php-sdk/inline-types/phpstan.neon +++ /dev/null @@ -1,5 +0,0 @@ -parameters: - level: max - paths: - - src - - tests \ No newline at end of file diff --git a/seed/php-sdk/inline-types/phpunit.xml b/seed/php-sdk/inline-types/phpunit.xml deleted file mode 100644 index 54630a51163..00000000000 --- a/seed/php-sdk/inline-types/phpunit.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - tests - - - \ No newline at end of file diff --git a/seed/php-sdk/inline-types/snippet-templates.json b/seed/php-sdk/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/php-sdk/inline-types/snippet.json b/seed/php-sdk/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/php-sdk/inline-types/src/Core/Client/BaseApiRequest.php b/seed/php-sdk/inline-types/src/Core/Client/BaseApiRequest.php deleted file mode 100644 index 5e1283e2b6f..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Client/BaseApiRequest.php +++ /dev/null @@ -1,22 +0,0 @@ - $headers Additional headers for the request (optional) - * @param array $query Query parameters for the request (optional) - */ - public function __construct( - public readonly string $baseUrl, - public readonly string $path, - public readonly HttpMethod $method, - public readonly array $headers = [], - public readonly array $query = [], - ) { - } -} diff --git a/seed/php-sdk/inline-types/src/Core/Client/HttpMethod.php b/seed/php-sdk/inline-types/src/Core/Client/HttpMethod.php deleted file mode 100644 index b9a3e2d0321..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Client/HttpMethod.php +++ /dev/null @@ -1,12 +0,0 @@ - $headers - */ - private array $headers; - - /** - * @param ?array{ - * baseUrl?: string, - * client?: ClientInterface, - * headers?: array, - * } $options - */ - public function __construct( - public readonly ?array $options = null, - ) { - $this->client = $this->options['client'] ?? new Client(); - $this->headers = $this->options['headers'] ?? []; - } - - /** - * @throws ClientExceptionInterface - */ - public function sendRequest( - BaseApiRequest $request, - ): ResponseInterface { - $httpRequest = $this->buildRequest($request); - return $this->client->send($httpRequest); - } - - private function buildRequest( - BaseApiRequest $request - ): Request { - $url = $this->buildUrl($request); - $headers = $this->encodeHeaders($request); - $body = $this->encodeRequestBody($request); - return new Request( - $request->method->name, - $url, - $headers, - $body, - ); - } - - /** - * @return array - */ - private function encodeHeaders( - BaseApiRequest $request - ): array { - return match (get_class($request)) { - JsonApiRequest::class => array_merge( - ["Content-Type" => "application/json"], - $this->headers, - $request->headers - ), - MultipartApiRequest::class => array_merge( - $this->headers, - $request->headers - ), - default => throw new InvalidArgumentException('Unsupported request type: ' . get_class($request)), - }; - } - - private function encodeRequestBody( - BaseApiRequest $request - ): ?StreamInterface { - return match (get_class($request)) { - JsonApiRequest::class => $request->body != null ? Utils::streamFor(json_encode($request->body)) : null, - MultipartApiRequest::class => $request->body != null ? new MultipartStream($request->body->toArray()) : null, - default => throw new InvalidArgumentException('Unsupported request type: '.get_class($request)), - }; - } - - private function buildUrl( - BaseApiRequest $request - ): string { - $baseUrl = $request->baseUrl; - $trimmedBaseUrl = rtrim($baseUrl, '/'); - $trimmedBasePath = ltrim($request->path, '/'); - $url = "{$trimmedBaseUrl}/{$trimmedBasePath}"; - - if (!empty($request->query)) { - $url .= '?' . $this->encodeQuery($request->query); - } - - return $url; - } - - /** - * @param array $query - */ - private function encodeQuery( - array $query - ): string { - $parts = []; - foreach ($query as $key => $value) { - if (is_array($value)) { - foreach ($value as $item) { - $parts[] = urlencode($key).'='.$this->encodeQueryValue($item); - } - } else { - $parts[] = urlencode($key).'='.$this->encodeQueryValue($value); - } - } - return implode('&', $parts); - } - - private function encodeQueryValue( - mixed $value - ): string { - if (is_string($value)) { - return urlencode($value); - } - if (is_scalar($value)) { - return urlencode((string)$value); - } - if (is_null($value)) { - return 'null'; - } - // Unreachable, but included for a best effort. - return urlencode(strval(json_encode($value))); - } -} diff --git a/seed/php-sdk/inline-types/src/Core/Json/JsonApiRequest.php b/seed/php-sdk/inline-types/src/Core/Json/JsonApiRequest.php deleted file mode 100644 index 8fdf493606e..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Json/JsonApiRequest.php +++ /dev/null @@ -1,28 +0,0 @@ - $headers Additional headers for the request (optional) - * @param array $query Query parameters for the request (optional) - * @param mixed|null $body The JSON request body (optional) - */ - public function __construct( - string $baseUrl, - string $path, - HttpMethod $method, - array $headers = [], - array $query = [], - public readonly mixed $body = null - ) { - parent::__construct($baseUrl, $path, $method, $headers, $query); - } -} diff --git a/seed/php-sdk/inline-types/src/Core/Json/JsonDecoder.php b/seed/php-sdk/inline-types/src/Core/Json/JsonDecoder.php deleted file mode 100644 index 2ddff027348..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Json/JsonDecoder.php +++ /dev/null @@ -1,161 +0,0 @@ - $type The type definition for deserialization. - * @return mixed[]|array The deserialized array. - * @throws JsonException If the decoded value is not an array. - */ - public static function decodeArray(string $json, array $type): array - { - $decoded = self::decode($json); - if (!is_array($decoded)) { - throw new JsonException("Unexpected non-array json value: " . $json); - } - return JsonDeserializer::deserializeArray($decoded, $type); - } - - /** - * Decodes a JSON string and deserializes it based on the provided union type definition. - * - * @param string $json The JSON string to decode. - * @param Union $union The union type definition for deserialization. - * @return mixed The deserialized value. - * @throws JsonException If the deserialization for all types in the union fails. - */ - public static function decodeUnion(string $json, Union $union): mixed - { - $decoded = self::decode($json); - return JsonDeserializer::deserializeUnion($decoded, $union); - } - /** - * Decodes a JSON string and returns a mixed. - * - * @param string $json The JSON string to decode. - * @return mixed The decoded mixed. - * @throws JsonException If the decoded value is not an mixed. - */ - public static function decodeMixed(string $json): mixed - { - return self::decode($json); - } - - /** - * Decodes a JSON string into a PHP value. - * - * @param string $json The JSON string to decode. - * @return mixed The decoded value. - * @throws JsonException If an error occurs during JSON decoding. - */ - public static function decode(string $json): mixed - { - return json_decode($json, associative: true, flags: JSON_THROW_ON_ERROR); - } -} diff --git a/seed/php-sdk/inline-types/src/Core/Json/JsonDeserializer.php b/seed/php-sdk/inline-types/src/Core/Json/JsonDeserializer.php deleted file mode 100644 index 5f0ca2d7ed0..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Json/JsonDeserializer.php +++ /dev/null @@ -1,204 +0,0 @@ - $data The array to be deserialized. - * @param mixed[]|array $type The type definition from the annotation. - * @return mixed[]|array The deserialized array. - * @throws JsonException If deserialization fails. - */ - public static function deserializeArray(array $data, array $type): array - { - return Utils::isMapType($type) - ? self::deserializeMap($data, $type) - : self::deserializeList($data, $type); - } - - /** - * Deserializes a value based on its type definition. - * - * @param mixed $data The data to deserialize. - * @param mixed $type The type definition. - * @return mixed The deserialized value. - * @throws JsonException If deserialization fails. - */ - private static function deserializeValue(mixed $data, mixed $type): mixed - { - if ($type instanceof Union) { - return self::deserializeUnion($data, $type); - } - - if (is_array($type)) { - return self::deserializeArray((array)$data, $type); - } - - if (gettype($type) != "string") { - throw new JsonException("Unexpected non-string type."); - } - - return self::deserializeSingleValue($data, $type); - } - - /** - * Deserializes a value based on the possible types in a union type definition. - * - * @param mixed $data The data to deserialize. - * @param Union $type The union type definition. - * @return mixed The deserialized value. - * @throws JsonException If none of the union types can successfully deserialize the value. - */ - public static function deserializeUnion(mixed $data, Union $type): mixed - { - foreach ($type->types as $unionType) { - try { - return self::deserializeValue($data, $unionType); - } catch (Exception) { - continue; - } - } - $readableType = Utils::getReadableType($data); - throw new JsonException( - "Cannot deserialize value of type $readableType with any of the union types: " . $type - ); - } - - /** - * Deserializes a single value based on its expected type. - * - * @param mixed $data The data to deserialize. - * @param string $type The expected type. - * @return mixed The deserialized value. - * @throws JsonException If deserialization fails. - */ - private static function deserializeSingleValue(mixed $data, string $type): mixed - { - if ($type === 'null' && $data === null) { - return null; - } - - if ($type === 'date' && is_string($data)) { - return self::deserializeDate($data); - } - - if ($type === 'datetime' && is_string($data)) { - return self::deserializeDateTime($data); - } - - if ($type === 'mixed') { - return $data; - } - - if (class_exists($type) && is_array($data)) { - return self::deserializeObject($data, $type); - } - - // Handle floats as a special case since gettype($data) returns "double" for float values in PHP, and because - // floats make come through from json_decoded as integers - if ($type === 'float' && (is_numeric($data))) { - return (float) $data; - } - - if (gettype($data) === $type) { - return $data; - } - - throw new JsonException("Unable to deserialize value of type '" . gettype($data) . "' as '$type'."); - } - - /** - * Deserializes an array into an object of the given type. - * - * @param array $data The data to deserialize. - * @param string $type The class name of the object to deserialize into. - * - * @return object The deserialized object. - * - * @throws JsonException If the type does not implement JsonSerializableType. - */ - public static function deserializeObject(array $data, string $type): object - { - if (!is_subclass_of($type, JsonSerializableType::class)) { - throw new JsonException("$type is not a subclass of JsonSerializableType."); - } - return $type::jsonDeserialize($data); - } - - /** - * Deserializes a map (associative array) with defined key and value types. - * - * @param array $data The associative array to deserialize. - * @param array $type The type definition for the map. - * @return array The deserialized map. - * @throws JsonException If deserialization fails. - */ - private static function deserializeMap(array $data, array $type): array - { - $keyType = array_key_first($type); - $valueType = $type[$keyType]; - $result = []; - - foreach ($data as $key => $item) { - $key = Utils::castKey($key, (string)$keyType); - $result[$key] = self::deserializeValue($item, $valueType); - } - - return $result; - } - - /** - * Deserializes a list (indexed array) with a defined value type. - * - * @param array $data The list to deserialize. - * @param array $type The type definition for the list. - * @return array The deserialized list. - * @throws JsonException If deserialization fails. - */ - private static function deserializeList(array $data, array $type): array - { - $valueType = $type[0]; - return array_map(fn ($item) => self::deserializeValue($item, $valueType), $data); - } -} diff --git a/seed/php-sdk/inline-types/src/Core/Json/JsonEncoder.php b/seed/php-sdk/inline-types/src/Core/Json/JsonEncoder.php deleted file mode 100644 index 0dbf3fcc994..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Json/JsonEncoder.php +++ /dev/null @@ -1,20 +0,0 @@ -jsonSerialize(); - $encoded = JsonEncoder::encode($serializedObject); - if (!$encoded) { - throw new Exception("Could not encode type"); - } - return $encoded; - } - - /** - * Serializes the object to an array. - * - * @return mixed[] Array representation of the object. - * @throws JsonException If serialization fails. - */ - public function jsonSerialize(): array - { - $result = []; - $reflectionClass = new \ReflectionClass($this); - - foreach ($reflectionClass->getProperties() as $property) { - $jsonKey = self::getJsonKey($property); - if ($jsonKey == null) { - continue; - } - $value = $property->getValue($this); - - // Handle DateTime properties - $dateTypeAttr = $property->getAttributes(Date::class)[0] ?? null; - if ($dateTypeAttr && $value instanceof DateTime) { - $dateType = $dateTypeAttr->newInstance()->type; - $value = ($dateType === Date::TYPE_DATE) - ? JsonSerializer::serializeDate($value) - : JsonSerializer::serializeDateTime($value); - } - - // Handle Union annotations - $unionTypeAttr = $property->getAttributes(Union::class)[0] ?? null; - if ($unionTypeAttr) { - $unionType = $unionTypeAttr->newInstance(); - $value = JsonSerializer::serializeUnion($value, $unionType); - } - - // Handle arrays with type annotations - $arrayTypeAttr = $property->getAttributes(ArrayType::class)[0] ?? null; - if ($arrayTypeAttr && is_array($value)) { - $arrayType = $arrayTypeAttr->newInstance()->type; - $value = JsonSerializer::serializeArray($value, $arrayType); - } - - // Handle object - if (is_object($value)) { - $value = JsonSerializer::serializeObject($value); - } - - if ($value !== null) { - $result[$jsonKey] = $value; - } - } - - return $result; - } - - /** - * Deserializes a JSON string into an instance of the calling class. - * - * @param string $json JSON string to deserialize. - * @return static Deserialized object. - * @throws JsonException If decoding fails or the result is not an array. - * @throws Exception If deserialization fails. - */ - public static function fromJson(string $json): static - { - $decodedJson = JsonDecoder::decode($json); - if (!is_array($decodedJson)) { - throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); - } - return self::jsonDeserialize($decodedJson); - } - - /** - * Deserializes an array into an instance of the calling class. - * - * @param array $data Array data to deserialize. - * @return static Deserialized object. - * @throws JsonException If deserialization fails. - */ - public static function jsonDeserialize(array $data): static - { - $reflectionClass = new \ReflectionClass(static::class); - $constructor = $reflectionClass->getConstructor(); - - if ($constructor === null) { - throw new JsonException("No constructor found."); - } - - $args = []; - foreach ($reflectionClass->getProperties() as $property) { - $jsonKey = self::getJsonKey($property) ?? $property->getName(); - - if (array_key_exists($jsonKey, $data)) { - $value = $data[$jsonKey]; - - // Handle Date annotation - $dateTypeAttr = $property->getAttributes(Date::class)[0] ?? null; - if ($dateTypeAttr) { - $dateType = $dateTypeAttr->newInstance()->type; - if (!is_string($value)) { - throw new JsonException("Unexpected non-string type for date."); - } - $value = ($dateType === Date::TYPE_DATE) - ? JsonDeserializer::deserializeDate($value) - : JsonDeserializer::deserializeDateTime($value); - } - - // Handle Array annotation - $arrayTypeAttr = $property->getAttributes(ArrayType::class)[0] ?? null; - if (is_array($value) && $arrayTypeAttr) { - $arrayType = $arrayTypeAttr->newInstance()->type; - $value = JsonDeserializer::deserializeArray($value, $arrayType); - } - - // Handle Union annotations - $unionTypeAttr = $property->getAttributes(Union::class)[0] ?? null; - if ($unionTypeAttr) { - $unionType = $unionTypeAttr->newInstance(); - $value = JsonDeserializer::deserializeUnion($value, $unionType); - } - - // Handle object - $type = $property->getType(); - if (is_array($value) && $type instanceof ReflectionNamedType && !$type->isBuiltin()) { - $value = JsonDeserializer::deserializeObject($value, $type->getName()); - } - - $args[$property->getName()] = $value; - } else { - $defaultValue = $property->getDefaultValue() ?? null; - $args[$property->getName()] = $defaultValue; - } - } - // @phpstan-ignore-next-line - return new static($args); - } - - /** - * Retrieves the JSON key associated with a property. - * - * @param ReflectionProperty $property The reflection property. - * @return ?string The JSON key, or null if not available. - */ - private static function getJsonKey(ReflectionProperty $property): ?string - { - $jsonPropertyAttr = $property->getAttributes(JsonProperty::class)[0] ?? null; - return $jsonPropertyAttr?->newInstance()?->name; - } -} diff --git a/seed/php-sdk/inline-types/src/Core/Json/JsonSerializer.php b/seed/php-sdk/inline-types/src/Core/Json/JsonSerializer.php deleted file mode 100644 index 7dd6fe517af..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Json/JsonSerializer.php +++ /dev/null @@ -1,192 +0,0 @@ -format(Constant::DateFormat); - } - - /** - * Serializes a DateTime object into a string using the date-time format. - * - * @param DateTime $date The DateTime object to serialize. - * @return string The serialized date-time string. - */ - public static function serializeDateTime(DateTime $date): string - { - return $date->format(Constant::DateTimeFormat); - } - - /** - * Serializes an array based on type annotations (either a list or map). - * - * @param mixed[]|array $data The array to be serialized. - * @param mixed[]|array $type The type definition from the annotation. - * @return mixed[]|array The serialized array. - * @throws JsonException If serialization fails. - */ - public static function serializeArray(array $data, array $type): array - { - return Utils::isMapType($type) - ? self::serializeMap($data, $type) - : self::serializeList($data, $type); - } - - /** - * Serializes a value based on its type definition. - * - * @param mixed $data The value to serialize. - * @param mixed $type The type definition. - * @return mixed The serialized value. - * @throws JsonException If serialization fails. - */ - private static function serializeValue(mixed $data, mixed $type): mixed - { - if ($type instanceof Union) { - return self::serializeUnion($data, $type); - } - - if (is_array($type)) { - return self::serializeArray((array)$data, $type); - } - - if (gettype($type) != "string") { - throw new JsonException("Unexpected non-string type."); - } - - return self::serializeSingleValue($data, $type); - } - - /** - * Serializes a value for a union type definition. - * - * @param mixed $data The value to serialize. - * @param Union $unionType The union type definition. - * @return mixed The serialized value. - * @throws JsonException If serialization fails for all union types. - */ - public static function serializeUnion(mixed $data, Union $unionType): mixed - { - foreach ($unionType->types as $type) { - try { - return self::serializeValue($data, $type); - } catch (Exception) { - // Try the next type in the union - continue; - } - } - $readableType = Utils::getReadableType($data); - throw new JsonException( - "Cannot serialize value of type $readableType with any of the union types: " . $unionType - ); - } - - /** - * Serializes a single value based on its type. - * - * @param mixed $data The value to serialize. - * @param string $type The expected type. - * @return mixed The serialized value. - * @throws JsonException If serialization fails. - */ - private static function serializeSingleValue(mixed $data, string $type): mixed - { - if ($type === 'null' && $data === null) { - return null; - } - - if (($type === 'date' || $type === 'datetime') && $data instanceof DateTime) { - return $type === 'date' ? self::serializeDate($data) : self::serializeDateTime($data); - } - - if ($type === 'mixed') { - return $data; - } - - if (class_exists($type) && $data instanceof $type) { - return self::serializeObject($data); - } - - // Handle floats as a special case since gettype($data) returns "double" for float values in PHP. - if ($type === 'float' && is_float($data)) { - return $data; - } - - if (gettype($data) === $type) { - return $data; - } - - throw new JsonException("Unable to serialize value of type '" . gettype($data) . "' as '$type'."); - } - - /** - * Serializes an object to a JSON-serializable format. - * - * @param object $data The object to serialize. - * @return mixed The serialized data. - * @throws JsonException If the object does not implement JsonSerializable. - */ - public static function serializeObject(object $data): mixed - { - if (!is_subclass_of($data, JsonSerializable::class)) { - $type = get_class($data); - throw new JsonException("Class $type must implement JsonSerializable."); - } - return $data->jsonSerialize(); - } - - /** - * Serializes a map (associative array) with defined key and value types. - * - * @param array $data The associative array to serialize. - * @param array $type The type definition for the map. - * @return array The serialized map. - * @throws JsonException If serialization fails. - */ - private static function serializeMap(array $data, array $type): array - { - $keyType = array_key_first($type); - if ($keyType === null) { - throw new JsonException("Unexpected no key in ArrayType."); - } - $valueType = $type[$keyType]; - $result = []; - - foreach ($data as $key => $item) { - $key = Utils::castKey($key, $keyType); - $result[$key] = self::serializeValue($item, $valueType); - } - - return $result; - } - - /** - * Serializes a list (indexed array) where only the value type is defined. - * - * @param array $data The list to serialize. - * @param array $type The type definition for the list. - * @return array The serialized list. - * @throws JsonException If serialization fails. - */ - private static function serializeList(array $data, array $type): array - { - $valueType = $type[0]; - return array_map(fn ($item) => self::serializeValue($item, $valueType), $data); - } -} diff --git a/seed/php-sdk/inline-types/src/Core/Json/Utils.php b/seed/php-sdk/inline-types/src/Core/Json/Utils.php deleted file mode 100644 index 7577c058916..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Json/Utils.php +++ /dev/null @@ -1,61 +0,0 @@ - $type The type definition from the annotation. - * @return bool True if the type is a map, false if it's a list. - */ - public static function isMapType(array $type): bool - { - return count($type) === 1 && !array_is_list($type); - } - - /** - * Casts the key to the appropriate type based on the key type. - * - * @param mixed $key The key to be cast. - * @param string $keyType The type to cast the key to ('string', 'integer', 'float'). - * @return mixed The casted key. - * @throws JsonException - */ - public static function castKey(mixed $key, string $keyType): mixed - { - if (!is_scalar($key)) { - throw new JsonException("Key must be a scalar type."); - } - return match ($keyType) { - 'integer' => (int)$key, - 'float' => (float)$key, - 'string' => (string)$key, - default => $key, - }; - } - - /** - * Returns a human-readable representation of the input's type. - * - * @param mixed $input The input value to determine the type of. - * @return string A readable description of the input type. - */ - public static function getReadableType(mixed $input): string - { - if (is_object($input)) { - return get_class($input); - } elseif (is_array($input)) { - return 'array(' . count($input) . ' items)'; - } elseif (is_null($input)) { - return 'null'; - } else { - return gettype($input); - } - } -} diff --git a/seed/php-sdk/inline-types/src/Core/Multipart/MultipartApiRequest.php b/seed/php-sdk/inline-types/src/Core/Multipart/MultipartApiRequest.php deleted file mode 100644 index 7760366456c..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Multipart/MultipartApiRequest.php +++ /dev/null @@ -1,28 +0,0 @@ - $headers Additional headers for the request (optional) - * @param array $query Query parameters for the request (optional) - * @param ?MultipartFormData $body The multipart form data for the request (optional) - */ - public function __construct( - string $baseUrl, - string $path, - HttpMethod $method, - array $headers = [], - array $query = [], - public readonly ?MultipartFormData $body = null - ) { - parent::__construct($baseUrl, $path, $method, $headers, $query); - } -} diff --git a/seed/php-sdk/inline-types/src/Core/Multipart/MultipartFormData.php b/seed/php-sdk/inline-types/src/Core/Multipart/MultipartFormData.php deleted file mode 100644 index 33bb67b05bd..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Multipart/MultipartFormData.php +++ /dev/null @@ -1,61 +0,0 @@ - - */ - private array $parts = []; - - /** - * Adds a new part to the multipart form data. - * - * @param string $name - * @param string|int|bool|float|StreamInterface $value - * @param ?string $contentType - */ - public function add( - string $name, - string|int|bool|float|StreamInterface $value, - ?string $contentType = null, - ): void { - $headers = $contentType != null ? ['Content-Type' => $contentType] : null; - self::addPart( - new MultipartFormDataPart( - name: $name, - value: $value, - headers: $headers, - ) - ); - } - - /** - * Adds a new part to the multipart form data. - * - * @param MultipartFormDataPart $part - */ - public function addPart(MultipartFormDataPart $part): void - { - $this->parts[] = $part; - } - - /** - * Converts the multipart form data into an array suitable - * for Guzzle's multipart form data. - * - * @return array - * }> - */ - public function toArray(): array - { - return array_map(fn ($part) => $part->toArray(), $this->parts); - } -} diff --git a/seed/php-sdk/inline-types/src/Core/Multipart/MultipartFormDataPart.php b/seed/php-sdk/inline-types/src/Core/Multipart/MultipartFormDataPart.php deleted file mode 100644 index c158903d84f..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Multipart/MultipartFormDataPart.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ - private ?array $headers; - - /** - * @param string $name - * @param string|bool|float|int|StreamInterface $value - * @param ?string $filename - * @param ?array $headers - */ - public function __construct( - string $name, - string|bool|float|int|StreamInterface $value, - ?string $filename = null, - ?array $headers = null - ) { - $this->name = $name; - $this->contents = Utils::streamFor($value); - $this->filename = $filename; - $this->headers = $headers; - } - - /** - * Converts the multipart form data part into an array suitable - * for Guzzle's multipart form data. - * - * @return array{ - * name: string, - * contents: StreamInterface, - * filename?: string, - * headers?: array - * } - */ - public function toArray(): array - { - $formData = [ - 'name' => $this->name, - 'contents' => $this->contents, - ]; - - if ($this->filename != null) { - $formData['filename'] = $this->filename; - } - - if ($this->headers != null) { - $formData['headers'] = $this->headers; - } - - return $formData; - } -} diff --git a/seed/php-sdk/inline-types/src/Core/Types/ArrayType.php b/seed/php-sdk/inline-types/src/Core/Types/ArrayType.php deleted file mode 100644 index a26d29008ec..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Types/ArrayType.php +++ /dev/null @@ -1,16 +0,0 @@ - 'valueType'] for maps, or ['valueType'] for lists - */ - public function __construct(public array $type) - { - } -} diff --git a/seed/php-sdk/inline-types/src/Core/Types/Constant.php b/seed/php-sdk/inline-types/src/Core/Types/Constant.php deleted file mode 100644 index 5ac4518cc6d..00000000000 --- a/seed/php-sdk/inline-types/src/Core/Types/Constant.php +++ /dev/null @@ -1,12 +0,0 @@ -> The types allowed for this property, which can be strings, arrays, or nested Union types. - */ - public array $types; - - /** - * Constructor for the Union attribute. - * - * @param string|Union|array ...$types The list of types that the property can accept. - * This can include primitive types (e.g., 'string', 'int'), arrays, or other Union instances. - * - * Example: - * ```php - * #[Union('string', 'null', 'date', new Union('boolean', 'int'))] - * ``` - */ - public function __construct(string|Union|array ...$types) - { - $this->types = $types; - } - - /** - * Converts the Union type to a string representation. - * - * @return string A string representation of the union types. - */ - public function __toString(): string - { - return implode(' | ', array_map(function ($type) { - if (is_string($type)) { - return $type; - } elseif ($type instanceof Union) { - return (string) $type; // Recursively handle nested unions - } elseif (is_array($type)) { - return 'array'; // Handle arrays - } - }, $this->types)); - } -} diff --git a/seed/php-sdk/inline-types/src/Exceptions/SeedApiException.php b/seed/php-sdk/inline-types/src/Exceptions/SeedApiException.php deleted file mode 100644 index 41a85392b70..00000000000 --- a/seed/php-sdk/inline-types/src/Exceptions/SeedApiException.php +++ /dev/null @@ -1,53 +0,0 @@ -body = $body; - parent::__construct($message, $statusCode, $previous); - } - - /** - * Returns the body of the response that triggered the exception. - * - * @return mixed - */ - public function getBody(): mixed - { - return $this->body; - } - - /** - * @return string - */ - public function __toString(): string - { - if (empty($this->body)) { - return "$this->message; Status Code: $this->code\n"; - } - return "$this->message; Status Code: $this->code; Body: " . $this->body . "\n"; - } -} diff --git a/seed/php-sdk/inline-types/src/Exceptions/SeedException.php b/seed/php-sdk/inline-types/src/Exceptions/SeedException.php deleted file mode 100644 index 45703527673..00000000000 --- a/seed/php-sdk/inline-types/src/Exceptions/SeedException.php +++ /dev/null @@ -1,12 +0,0 @@ -bar = $values['bar']; - $this->foo = $values['foo']; - } -} diff --git a/seed/php-sdk/inline-types/src/SeedClient.php b/seed/php-sdk/inline-types/src/SeedClient.php deleted file mode 100644 index 44d26d3aa50..00000000000 --- a/seed/php-sdk/inline-types/src/SeedClient.php +++ /dev/null @@ -1,95 +0,0 @@ -, - * } $options - */ - private ?array $options; - - /** - * @var RawClient $client - */ - private RawClient $client; - - /** - * @param ?array{ - * baseUrl?: string, - * client?: ClientInterface, - * headers?: array, - * } $options - */ - public function __construct( - ?array $options = null, - ) { - $defaultHeaders = [ - 'X-Fern-Language' => 'PHP', - 'X-Fern-SDK-Name' => 'Seed', - 'X-Fern-SDK-Version' => '0.0.1', - ]; - - $this->options = $options ?? []; - $this->options['headers'] = array_merge( - $defaultHeaders, - $this->options['headers'] ?? [], - ); - - $this->client = new RawClient( - options: $this->options, - ); - } - - /** - * @param PostRootRequest $request - * @param ?array{ - * baseUrl?: string, - * } $options - * @return RootType1 - * @throws SeedException - * @throws SeedApiException - */ - public function getRoot(PostRootRequest $request, ?array $options = null): RootType1 - { - try { - $response = $this->client->sendRequest( - new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "/root/root", - method: HttpMethod::POST, - body: $request, - ), - ); - $statusCode = $response->getStatusCode(); - if ($statusCode >= 200 && $statusCode < 400) { - $json = $response->getBody()->getContents(); - return RootType1::fromJson($json); - } - } catch (JsonException $e) { - throw new SeedException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); - } catch (ClientExceptionInterface $e) { - throw new SeedException(message: $e->getMessage(), previous: $e); - } - throw new SeedApiException( - message: 'API request failed', - statusCode: $statusCode, - body: $response->getBody()->getContents(), - ); - } -} diff --git a/seed/php-sdk/inline-types/src/Types/InlineEnum.php b/seed/php-sdk/inline-types/src/Types/InlineEnum.php deleted file mode 100644 index 53a2a5b26a0..00000000000 --- a/seed/php-sdk/inline-types/src/Types/InlineEnum.php +++ /dev/null @@ -1,11 +0,0 @@ -foo = $values['foo']; - $this->bar = $values['bar']; - } -} diff --git a/seed/php-sdk/inline-types/src/Types/InlineType2.php b/seed/php-sdk/inline-types/src/Types/InlineType2.php deleted file mode 100644 index b731042a72a..00000000000 --- a/seed/php-sdk/inline-types/src/Types/InlineType2.php +++ /dev/null @@ -1,26 +0,0 @@ -baz = $values['baz']; - } -} diff --git a/seed/php-sdk/inline-types/src/Types/NestedInlineType1.php b/seed/php-sdk/inline-types/src/Types/NestedInlineType1.php deleted file mode 100644 index 87166a44664..00000000000 --- a/seed/php-sdk/inline-types/src/Types/NestedInlineType1.php +++ /dev/null @@ -1,42 +0,0 @@ - $myEnum - */ - #[JsonProperty('myEnum')] - public string $myEnum; - - /** - * @param array{ - * foo: string, - * bar: string, - * myEnum: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->foo = $values['foo']; - $this->bar = $values['bar']; - $this->myEnum = $values['myEnum']; - } -} diff --git a/seed/php-sdk/inline-types/src/Types/RootType1.php b/seed/php-sdk/inline-types/src/Types/RootType1.php deleted file mode 100644 index d4531d4a1cd..00000000000 --- a/seed/php-sdk/inline-types/src/Types/RootType1.php +++ /dev/null @@ -1,34 +0,0 @@ -foo = $values['foo']; - $this->bar = $values['bar']; - } -} diff --git a/seed/php-sdk/inline-types/src/Utils/File.php b/seed/php-sdk/inline-types/src/Utils/File.php deleted file mode 100644 index 753748138d4..00000000000 --- a/seed/php-sdk/inline-types/src/Utils/File.php +++ /dev/null @@ -1,125 +0,0 @@ -filename = $filename; - $this->contentType = $contentType; - $this->stream = $stream; - } - - /** - * Creates a File instance from a filepath. - * - * @param string $filepath - * @param ?string $filename - * @param ?string $contentType - * @return File - * @throws Exception - */ - public static function createFromFilepath( - string $filepath, - ?string $filename = null, - ?string $contentType = null, - ): File { - $resource = fopen($filepath, 'r'); - if (!$resource) { - throw new Exception("Unable to open file $filepath"); - } - $stream = Utils::streamFor($resource); - if (!$stream->isReadable()) { - throw new Exception("File $filepath is not readable"); - } - return new self( - stream: $stream, - filename: $filename ?? basename($filepath), - contentType: $contentType, - ); - } - - /** - * Creates a File instance from a string. - * - * @param string $content - * @param ?string $filename - * @param ?string $contentType - * @return File - */ - public static function createFromString( - string $content, - ?string $filename, - ?string $contentType = null, - ): File { - return new self( - stream: Utils::streamFor($content), - filename: $filename, - contentType: $contentType, - ); - } - - /** - * Maps this File into a multipart form data part. - * - * @param string $name The name of the mutlipart form data part. - * @param ?string $contentType Overrides the Content-Type associated with the file, if any. - * @return MultipartFormDataPart - */ - public function toMultipartFormDataPart(string $name, ?string $contentType = null): MultipartFormDataPart - { - $contentType ??= $this->contentType; - $headers = $contentType != null - ? ['Content-Type' => $contentType] - : null; - - return new MultipartFormDataPart( - name: $name, - value: $this->stream, - filename: $this->filename, - headers: $headers, - ); - } - - /** - * Closes the file stream. - */ - public function close(): void - { - $this->stream->close(); - } - - /** - * Destructor to ensure stream is closed. - */ - public function __destruct() - { - $this->close(); - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Client/RawClientTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Client/RawClientTest.php deleted file mode 100644 index a1052cff3a5..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Client/RawClientTest.php +++ /dev/null @@ -1,101 +0,0 @@ -mockHandler = new MockHandler(); - $handlerStack = HandlerStack::create($this->mockHandler); - $client = new Client(['handler' => $handlerStack]); - $this->rawClient = new RawClient(['client' => $client]); - } - - public function testHeaders(): void - { - $this->mockHandler->append(new Response(200)); - - $request = new JsonApiRequest( - $this->baseUrl, - '/test', - HttpMethod::GET, - ['X-Custom-Header' => 'TestValue'] - ); - - $this->sendRequest($request); - - $lastRequest = $this->mockHandler->getLastRequest(); - assert($lastRequest instanceof RequestInterface); - $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); - $this->assertEquals('TestValue', $lastRequest->getHeaderLine('X-Custom-Header')); - } - - public function testQueryParameters(): void - { - $this->mockHandler->append(new Response(200)); - - $request = new JsonApiRequest( - $this->baseUrl, - '/test', - HttpMethod::GET, - [], - ['param1' => 'value1', 'param2' => ['a', 'b'], 'param3' => 'true'] - ); - - $this->sendRequest($request); - - $lastRequest = $this->mockHandler->getLastRequest(); - assert($lastRequest instanceof RequestInterface); - $this->assertEquals( - 'https://api.example.com/test?param1=value1¶m2=a¶m2=b¶m3=true', - (string)$lastRequest->getUri() - ); - } - - public function testJsonBody(): void - { - $this->mockHandler->append(new Response(200)); - - $body = ['key' => 'value']; - $request = new JsonApiRequest( - $this->baseUrl, - '/test', - HttpMethod::POST, - [], - [], - $body - ); - - $this->sendRequest($request); - - $lastRequest = $this->mockHandler->getLastRequest(); - assert($lastRequest instanceof RequestInterface); - $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); - $this->assertEquals(json_encode($body), (string)$lastRequest->getBody()); - } - - private function sendRequest(BaseApiRequest $request): void - { - try { - $this->rawClient->sendRequest($request); - } catch (\Throwable $e) { - $this->fail('An exception was thrown: ' . $e->getMessage()); - } - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Json/DateArrayTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Json/DateArrayTest.php deleted file mode 100644 index a72cfdbdd22..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Json/DateArrayTest.php +++ /dev/null @@ -1,54 +0,0 @@ -dates = $values['dates']; - } -} - -class DateArrayTest extends TestCase -{ - public function testDateTimeInArrays(): void - { - $expectedJson = json_encode( - [ - 'dates' => ['2023-01-01', '2023-02-01', '2023-03-01'] - ], - JSON_THROW_ON_ERROR - ); - - $object = DateArray::fromJson($expectedJson); - $this->assertInstanceOf(DateTime::class, $object->dates[0], 'dates[0] should be a DateTime instance.'); - $this->assertEquals('2023-01-01', $object->dates[0]->format('Y-m-d'), 'dates[0] should have the correct date.'); - $this->assertInstanceOf(DateTime::class, $object->dates[1], 'dates[1] should be a DateTime instance.'); - $this->assertEquals('2023-02-01', $object->dates[1]->format('Y-m-d'), 'dates[1] should have the correct date.'); - $this->assertInstanceOf(DateTime::class, $object->dates[2], 'dates[2] should be a DateTime instance.'); - $this->assertEquals('2023-03-01', $object->dates[2]->format('Y-m-d'), 'dates[2] should have the correct date.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for dates array.'); - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Json/EmptyArrayTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Json/EmptyArrayTest.php deleted file mode 100644 index d243a08916d..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Json/EmptyArrayTest.php +++ /dev/null @@ -1,71 +0,0 @@ - $emptyMapArray - */ - #[JsonProperty('empty_map_array')] - #[ArrayType(['integer' => new Union('string', 'null')])] - public array $emptyMapArray; - - /** - * @var array $emptyDatesArray - */ - #[ArrayType([new Union('date', 'null')])] - #[JsonProperty('empty_dates_array')] - public array $emptyDatesArray; - - /** - * @param array{ - * emptyStringArray: string[], - * emptyMapArray: array, - * emptyDatesArray: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->emptyStringArray = $values['emptyStringArray']; - $this->emptyMapArray = $values['emptyMapArray']; - $this->emptyDatesArray = $values['emptyDatesArray']; - } -} - -class EmptyArrayTest extends TestCase -{ - public function testEmptyArray(): void - { - $expectedJson = json_encode( - [ - 'empty_string_array' => [], - 'empty_map_array' => [], - 'empty_dates_array' => [] - ], - JSON_THROW_ON_ERROR - ); - - $object = EmptyArray::fromJson($expectedJson); - $this->assertEmpty($object->emptyStringArray, 'empty_string_array should be empty.'); - $this->assertEmpty($object->emptyMapArray, 'empty_map_array should be empty.'); - $this->assertEmpty($object->emptyDatesArray, 'empty_dates_array should be empty.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for EmptyArraysType.'); - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Json/EnumTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Json/EnumTest.php deleted file mode 100644 index bf83d5b8ab0..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Json/EnumTest.php +++ /dev/null @@ -1,76 +0,0 @@ -value; - } -} - -class ShapeType extends JsonSerializableType -{ - /** - * @var Shape $shape - */ - #[JsonProperty('shape')] - public Shape $shape; - - /** - * @var Shape[] $shapes - */ - #[ArrayType([Shape::class])] - #[JsonProperty('shapes')] - public array $shapes; - - /** - * @param Shape $shape - * @param Shape[] $shapes - */ - public function __construct( - Shape $shape, - array $shapes, - ) { - $this->shape = $shape; - $this->shapes = $shapes; - } -} - -class EnumTest extends TestCase -{ - public function testEnumSerialization(): void - { - $object = new ShapeType( - Shape::Circle, - [Shape::Square, Shape::Circle, Shape::Triangle] - ); - - $expectedJson = json_encode([ - 'shape' => 'CIRCLE', - 'shapes' => ['SQUARE', 'CIRCLE', 'TRIANGLE'] - ], JSON_THROW_ON_ERROR); - - $actualJson = $object->toJson(); - - $this->assertJsonStringEqualsJsonString( - $expectedJson, - $actualJson, - 'Serialized JSON does not match expected JSON for shape and shapes properties.' - ); - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Json/ExhaustiveTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Json/ExhaustiveTest.php deleted file mode 100644 index f542d6a535d..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Json/ExhaustiveTest.php +++ /dev/null @@ -1,197 +0,0 @@ -nestedProperty = $values['nestedProperty']; - } -} - -class Type extends JsonSerializableType -{ - /** - * @var Nested nestedType - */ - #[JsonProperty('nested_type')] - public Nested $nestedType; /** - - * @var string $simpleProperty - */ - #[JsonProperty('simple_property')] - public string $simpleProperty; - - /** - * @var DateTime $dateProperty - */ - #[Date(Date::TYPE_DATE)] - #[JsonProperty('date_property')] - public DateTime $dateProperty; - - /** - * @var DateTime $datetimeProperty - */ - #[Date(Date::TYPE_DATETIME)] - #[JsonProperty('datetime_property')] - public DateTime $datetimeProperty; - - /** - * @var array $stringArray - */ - #[ArrayType(['string'])] - #[JsonProperty('string_array')] - public array $stringArray; - - /** - * @var array $mapProperty - */ - #[ArrayType(['string' => 'integer'])] - #[JsonProperty('map_property')] - public array $mapProperty; - - /** - * @var array $objectArray - */ - #[ArrayType(['integer' => new Union(Nested::class, 'null')])] - #[JsonProperty('object_array')] - public array $objectArray; - - /** - * @var array> $nestedArray - */ - #[ArrayType(['integer' => ['integer' => new Union('string', 'null')]])] - #[JsonProperty('nested_array')] - public array $nestedArray; - - /** - * @var array $datesArray - */ - #[ArrayType([new Union('date', 'null')])] - #[JsonProperty('dates_array')] - public array $datesArray; - - /** - * @var string|null $nullableProperty - */ - #[JsonProperty('nullable_property')] - public ?string $nullableProperty; - - /** - * @param array{ - * nestedType: Nested, - * simpleProperty: string, - * dateProperty: DateTime, - * datetimeProperty: DateTime, - * stringArray: array, - * mapProperty: array, - * objectArray: array, - * nestedArray: array>, - * datesArray: array, - * nullableProperty?: string|null, - * } $values - */ - public function __construct( - array $values, - ) { - $this->nestedType = $values['nestedType']; - $this->simpleProperty = $values['simpleProperty']; - $this->dateProperty = $values['dateProperty']; - $this->datetimeProperty = $values['datetimeProperty']; - $this->stringArray = $values['stringArray']; - $this->mapProperty = $values['mapProperty']; - $this->objectArray = $values['objectArray']; - $this->nestedArray = $values['nestedArray']; - $this->datesArray = $values['datesArray']; - $this->nullableProperty = $values['nullableProperty'] ?? null; - } -} - -class ExhaustiveTest extends TestCase -{ - /** - * Test serialization and deserialization of all types in Type. - */ - public function testExhaustive(): void - { - $expectedJson = json_encode( - [ - 'nested_type' => ['nested_property' => '1995-07-20'], - 'simple_property' => 'Test String', - // Omit 'nullable_property' to test null serialization - 'date_property' => '2023-01-01', - 'datetime_property' => '2023-01-01T12:34:56+00:00', - 'string_array' => ['one', 'two', 'three'], - 'map_property' => ['key1' => 1, 'key2' => 2], - 'object_array' => [ - 1 => ['nested_property' => '2021-07-20'], - 2 => null, // Testing nullable objects in array - ], - 'nested_array' => [ - 1 => [1 => 'value1', 2 => null], // Testing nullable strings in nested array - 2 => [3 => 'value3', 4 => 'value4'] - ], - 'dates_array' => ['2023-01-01', null, '2023-03-01'] // Testing nullable dates in array> - ], - JSON_THROW_ON_ERROR - ); - - $object = Type::fromJson($expectedJson); - - // Check that nullable property is null and not included in JSON - $this->assertNull($object->nullableProperty, 'Nullable property should be null.'); - - // Check date properties - $this->assertInstanceOf(DateTime::class, $object->dateProperty, 'date_property should be a DateTime instance.'); - $this->assertEquals('2023-01-01', $object->dateProperty->format('Y-m-d'), 'date_property should have the correct date.'); - $this->assertInstanceOf(DateTime::class, $object->datetimeProperty, 'datetime_property should be a DateTime instance.'); - $this->assertEquals('2023-01-01 12:34:56', $object->datetimeProperty->format('Y-m-d H:i:s'), 'datetime_property should have the correct datetime.'); - - // Check scalar arrays - $this->assertEquals(['one', 'two', 'three'], $object->stringArray, 'string_array should match the original data.'); - $this->assertEquals(['key1' => 1, 'key2' => 2], $object->mapProperty, 'map_property should match the original data.'); - - // Check object array with nullable elements - $this->assertInstanceOf(Nested::class, $object->objectArray[1], 'object_array[1] should be an instance of TestNestedType1.'); - $this->assertEquals('2021-07-20', $object->objectArray[1]->nestedProperty->format('Y-m-d'), 'object_array[1]->nestedProperty should match the original data.'); - $this->assertNull($object->objectArray[2], 'object_array[2] should be null.'); - - // Check nested array with nullable strings - $this->assertEquals('value1', $object->nestedArray[1][1], 'nested_array[1][1] should match the original data.'); - $this->assertNull($object->nestedArray[1][2], 'nested_array[1][2] should be null.'); - $this->assertEquals('value3', $object->nestedArray[2][3], 'nested_array[2][3] should match the original data.'); - $this->assertEquals('value4', $object->nestedArray[2][4], 'nested_array[2][4] should match the original data.'); - - // Check dates array with nullable DateTime objects - $this->assertInstanceOf(DateTime::class, $object->datesArray[0], 'dates_array[0] should be a DateTime instance.'); - $this->assertEquals('2023-01-01', $object->datesArray[0]->format('Y-m-d'), 'dates_array[0] should have the correct date.'); - $this->assertNull($object->datesArray[1], 'dates_array[1] should be null.'); - $this->assertInstanceOf(DateTime::class, $object->datesArray[2], 'dates_array[2] should be a DateTime instance.'); - $this->assertEquals('2023-03-01', $object->datesArray[2]->format('Y-m-d'), 'dates_array[2] should have the correct date.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'The serialized JSON does not match the original JSON.'); - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Json/InvalidTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Json/InvalidTest.php deleted file mode 100644 index 7d1d79406a5..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Json/InvalidTest.php +++ /dev/null @@ -1,42 +0,0 @@ -integerProperty = $values['integerProperty']; - } -} - -class InvalidTest extends TestCase -{ - public function testInvalidJsonThrowsException(): void - { - $this->expectException(\TypeError::class); - $json = json_encode( - [ - 'integer_property' => 'not_an_integer' - ], - JSON_THROW_ON_ERROR - ); - Invalid::fromJson($json); - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Json/NestedUnionArrayTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Json/NestedUnionArrayTest.php deleted file mode 100644 index 0fcdd06667e..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Json/NestedUnionArrayTest.php +++ /dev/null @@ -1,89 +0,0 @@ -nestedProperty = $values['nestedProperty']; - } -} - -class NestedUnionArray extends JsonSerializableType -{ - /** - * @var array> $nestedArray - */ - #[ArrayType(['integer' => ['integer' => new Union(UnionObject::class, 'null', 'date')]])] - #[JsonProperty('nested_array')] - public array $nestedArray; - - /** - * @param array{ - * nestedArray: array>, - * } $values - */ - public function __construct( - array $values, - ) { - $this->nestedArray = $values['nestedArray']; - } -} - -class NestedUnionArrayTest extends TestCase -{ - public function testNestedUnionArray(): void - { - $expectedJson = json_encode( - [ - 'nested_array' => [ - 1 => [ - 1 => ['nested_property' => 'Nested One'], - 2 => null, - 4 => '2023-01-02' - ], - 2 => [ - 5 => ['nested_property' => 'Nested Two'], - 7 => '2023-02-02' - ] - ] - ], - JSON_THROW_ON_ERROR - ); - - $object = NestedUnionArray::fromJson($expectedJson); - $this->assertInstanceOf(UnionObject::class, $object->nestedArray[1][1], 'nested_array[1][1] should be an instance of Object.'); - $this->assertEquals('Nested One', $object->nestedArray[1][1]->nestedProperty, 'nested_array[1][1]->nestedProperty should match the original data.'); - $this->assertNull($object->nestedArray[1][2], 'nested_array[1][2] should be null.'); - $this->assertInstanceOf(DateTime::class, $object->nestedArray[1][4], 'nested_array[1][4] should be a DateTime instance.'); - $this->assertEquals('2023-01-02T00:00:00+00:00', $object->nestedArray[1][4]->format(Constant::DateTimeFormat), 'nested_array[1][4] should have the correct datetime.'); - $this->assertInstanceOf(UnionObject::class, $object->nestedArray[2][5], 'nested_array[2][5] should be an instance of Object.'); - $this->assertEquals('Nested Two', $object->nestedArray[2][5]->nestedProperty, 'nested_array[2][5]->nestedProperty should match the original data.'); - $this->assertInstanceOf(DateTime::class, $object->nestedArray[2][7], 'nested_array[1][4] should be a DateTime instance.'); - $this->assertEquals('2023-02-02', $object->nestedArray[2][7]->format('Y-m-d'), 'nested_array[1][4] should have the correct date.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for nested_array.'); - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Json/NullPropertyTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Json/NullPropertyTest.php deleted file mode 100644 index ce20a244282..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Json/NullPropertyTest.php +++ /dev/null @@ -1,53 +0,0 @@ -nonNullProperty = $values['nonNullProperty']; - $this->nullProperty = $values['nullProperty'] ?? null; - } -} - -class NullPropertyTest extends TestCase -{ - public function testNullPropertiesAreOmitted(): void - { - $object = new NullProperty( - [ - "nonNullProperty" => "Test String", - "nullProperty" => null - ] - ); - - $serialized = $object->jsonSerialize(); - $this->assertArrayHasKey('non_null_property', $serialized, 'non_null_property should be present in the serialized JSON.'); - $this->assertArrayNotHasKey('null_property', $serialized, 'null_property should be omitted from the serialized JSON.'); - $this->assertEquals('Test String', $serialized['non_null_property'], 'non_null_property should have the correct value.'); - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Json/NullableArrayTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Json/NullableArrayTest.php deleted file mode 100644 index fe0f19de6b1..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Json/NullableArrayTest.php +++ /dev/null @@ -1,49 +0,0 @@ - $nullableStringArray - */ - #[ArrayType([new Union('string', 'null')])] - #[JsonProperty('nullable_string_array')] - public array $nullableStringArray; - - /** - * @param array{ - * nullableStringArray: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->nullableStringArray = $values['nullableStringArray']; - } -} - -class NullableArrayTest extends TestCase -{ - public function testNullableArray(): void - { - $expectedJson = json_encode( - [ - 'nullable_string_array' => ['one', null, 'three'] - ], - JSON_THROW_ON_ERROR - ); - - $object = NullableArray::fromJson($expectedJson); - $this->assertEquals(['one', null, 'three'], $object->nullableStringArray, 'nullable_string_array should match the original data.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for nullable_string_array.'); - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Json/ScalarTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Json/ScalarTest.php deleted file mode 100644 index 604b7c0b959..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Json/ScalarTest.php +++ /dev/null @@ -1,116 +0,0 @@ - $intFloatArray - */ - #[ArrayType([new Union('integer', 'float')])] - #[JsonProperty('int_float_array')] - public array $intFloatArray; - - /** - * @var array $floatArray - */ - #[ArrayType(['float'])] - #[JsonProperty('float_array')] - public array $floatArray; - - /** - * @var bool|null $nullableBooleanProperty - */ - #[JsonProperty('nullable_boolean_property')] - public ?bool $nullableBooleanProperty; - - /** - * @param array{ - * integerProperty: int, - * floatProperty: float, - * otherFloatProperty: float, - * booleanProperty: bool, - * stringProperty: string, - * intFloatArray: array, - * floatArray: array, - * nullableBooleanProperty?: bool|null, - * } $values - */ - public function __construct( - array $values, - ) { - $this->integerProperty = $values['integerProperty']; - $this->floatProperty = $values['floatProperty']; - $this->otherFloatProperty = $values['otherFloatProperty']; - $this->booleanProperty = $values['booleanProperty']; - $this->stringProperty = $values['stringProperty']; - $this->intFloatArray = $values['intFloatArray']; - $this->floatArray = $values['floatArray']; - $this->nullableBooleanProperty = $values['nullableBooleanProperty'] ?? null; - } -} - -class ScalarTest extends TestCase -{ - public function testAllScalarTypesIncludingFloat(): void - { - $expectedJson = json_encode( - [ - 'integer_property' => 42, - 'float_property' => 3.14159, - 'other_float_property' => 3, - 'boolean_property' => true, - 'string_property' => 'Hello, World!', - 'int_float_array' => [1, 2.5, 3, 4.75], - 'float_array' => [1, 2, 3, 4] // Ensure we handle "integer-looking" floats - ], - JSON_THROW_ON_ERROR - ); - - $object = Scalar::fromJson($expectedJson); - $this->assertEquals(42, $object->integerProperty, 'integer_property should be 42.'); - $this->assertEquals(3.14159, $object->floatProperty, 'float_property should be 3.14159.'); - $this->assertTrue($object->booleanProperty, 'boolean_property should be true.'); - $this->assertEquals('Hello, World!', $object->stringProperty, 'string_property should be "Hello, World!".'); - $this->assertNull($object->nullableBooleanProperty, 'nullable_boolean_property should be null.'); - $this->assertEquals([1, 2.5, 3, 4.75], $object->intFloatArray, 'int_float_array should match the original data.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for ScalarTypesTest.'); - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Json/TraitTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Json/TraitTest.php deleted file mode 100644 index 837f239115f..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Json/TraitTest.php +++ /dev/null @@ -1,60 +0,0 @@ -integerProperty = $values['integerProperty']; - $this->stringProperty = $values['stringProperty']; - } -} - -class TraitTest extends TestCase -{ - public function testTraitPropertyAndString(): void - { - $expectedJson = json_encode( - [ - 'integer_property' => 42, - 'string_property' => 'Hello, World!', - ], - JSON_THROW_ON_ERROR - ); - - $object = TypeWithTrait::fromJson($expectedJson); - $this->assertEquals(42, $object->integerProperty, 'integer_property should be 42.'); - $this->assertEquals('Hello, World!', $object->stringProperty, 'string_property should be "Hello, World!".'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for ScalarTypesTestWithTrait.'); - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Json/UnionArrayTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Json/UnionArrayTest.php deleted file mode 100644 index 09933d2321d..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Json/UnionArrayTest.php +++ /dev/null @@ -1,57 +0,0 @@ - $mixedDates - */ - #[ArrayType(['integer' => new Union('datetime', 'string', 'null')])] - #[JsonProperty('mixed_dates')] - public array $mixedDates; - - /** - * @param array{ - * mixedDates: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->mixedDates = $values['mixedDates']; - } -} - -class UnionArrayTest extends TestCase -{ - public function testUnionArray(): void - { - $expectedJson = json_encode( - [ - 'mixed_dates' => [ - 1 => '2023-01-01T12:00:00+00:00', - 2 => null, - 3 => 'Some String' - ] - ], - JSON_THROW_ON_ERROR - ); - - $object = UnionArray::fromJson($expectedJson); - $this->assertInstanceOf(DateTime::class, $object->mixedDates[1], 'mixed_dates[1] should be a DateTime instance.'); - $this->assertEquals('2023-01-01 12:00:00', $object->mixedDates[1]->format('Y-m-d H:i:s'), 'mixed_dates[1] should have the correct datetime.'); - $this->assertNull($object->mixedDates[2], 'mixed_dates[2] should be null.'); - $this->assertEquals('Some String', $object->mixedDates[3], 'mixed_dates[3] should be "Some String".'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for mixed_dates.'); - } -} diff --git a/seed/php-sdk/inline-types/tests/Seed/Core/Json/UnionPropertyTest.php b/seed/php-sdk/inline-types/tests/Seed/Core/Json/UnionPropertyTest.php deleted file mode 100644 index 3119baace62..00000000000 --- a/seed/php-sdk/inline-types/tests/Seed/Core/Json/UnionPropertyTest.php +++ /dev/null @@ -1,115 +0,0 @@ - 'integer'], UnionProperty::class)] - #[JsonProperty('complexUnion')] - public mixed $complexUnion; - - /** - * @param array{ - * complexUnion: string|int|null|array|UnionProperty - * } $values - */ - public function __construct( - array $values, - ) { - $this->complexUnion = $values['complexUnion']; - } -} - -class UnionPropertyTest extends TestCase -{ - public function testWithMapOfIntToInt(): void - { - $expectedJson = json_encode( - [ - 'complexUnion' => [1 => 100, 2 => 200] - ], - JSON_THROW_ON_ERROR - ); - - $object = UnionProperty::fromJson($expectedJson); - $this->assertIsArray($object->complexUnion, 'complexUnion should be an array.'); - $this->assertEquals([1 => 100, 2 => 200], $object->complexUnion, 'complexUnion should match the original map of int => int.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); - } - - public function testWithNestedUnionPropertyType(): void - { - $expectedJson = json_encode( - [ - 'complexUnion' => new UnionProperty( - [ - 'complexUnion' => 'Nested String' - ] - ) - ], - JSON_THROW_ON_ERROR - ); - - $object = UnionProperty::fromJson($expectedJson); - $this->assertInstanceOf(UnionProperty::class, $object->complexUnion, 'complexUnion should be an instance of UnionPropertyType.'); - $this->assertEquals('Nested String', $object->complexUnion->complexUnion, 'Nested complexUnion should match the original value.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); - } - - public function testWithNull(): void - { - $expectedJson = json_encode( - [], - JSON_THROW_ON_ERROR - ); - - $object = UnionProperty::fromJson($expectedJson); - $this->assertNull($object->complexUnion, 'complexUnion should be null.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); - } - - public function testWithInteger(): void - { - $expectedJson = json_encode( - [ - 'complexUnion' => 42 - ], - JSON_THROW_ON_ERROR - ); - - $object = UnionProperty::fromJson($expectedJson); - $this->assertIsInt($object->complexUnion, 'complexUnion should be an integer.'); - $this->assertEquals(42, $object->complexUnion, 'complexUnion should match the original integer.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); - } - - public function testWithString(): void - { - $expectedJson = json_encode( - [ - 'complexUnion' => 'Some String' - ], - JSON_THROW_ON_ERROR - ); - - $object = UnionProperty::fromJson($expectedJson); - $this->assertIsString($object->complexUnion, 'complexUnion should be a string.'); - $this->assertEquals('Some String', $object->complexUnion, 'complexUnion should match the original string.'); - - $actualJson = $object->toJson(); - $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); - } -} diff --git a/seed/postman/inline-types/.mock/definition/__package__.yml b/seed/postman/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/postman/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/postman/inline-types/.mock/definition/api.yml b/seed/postman/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/postman/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/postman/inline-types/.mock/fern.config.json b/seed/postman/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/postman/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/postman/inline-types/.mock/generators.yml b/seed/postman/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/postman/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/postman/inline-types/collection.json b/seed/postman/inline-types/collection.json deleted file mode 100644 index a64b1263525..00000000000 --- a/seed/postman/inline-types/collection.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "info": { - "name": "Object", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "description": null - }, - "variable": [ - { - "key": "baseUrl", - "value": "", - "type": "string" - } - ], - "auth": null, - "item": [ - { - "_type": "endpoint", - "name": "Get Root", - "request": { - "description": null, - "url": { - "raw": "{{baseUrl}}/root/root", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "root", - "root" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"bar\": {\n \"foo\": \"foo\",\n \"bar\": {\n \"foo\": \"foo\",\n \"bar\": \"bar\",\n \"myEnum\": \"SUNNY\"\n }\n },\n \"foo\": \"foo\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "response": [ - { - "name": "Success", - "status": "OK", - "code": 200, - "originalRequest": { - "description": null, - "url": { - "raw": "{{baseUrl}}/root/root", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "root", - "root" - ], - "query": [], - "variable": [] - }, - "header": [ - { - "type": "text", - "key": "Content-Type", - "value": "application/json" - } - ], - "method": "POST", - "auth": null, - "body": { - "mode": "raw", - "raw": "{\n \"bar\": {\n \"foo\": \"foo\",\n \"bar\": {\n \"foo\": \"foo\",\n \"bar\": \"bar\",\n \"myEnum\": \"SUNNY\"\n }\n },\n \"foo\": \"foo\"\n}", - "options": { - "raw": { - "language": "json" - } - } - } - }, - "description": null, - "body": "{\n \"foo\": \"foo\",\n \"bar\": {\n \"foo\": \"foo\",\n \"bar\": {\n \"foo\": \"foo\",\n \"bar\": \"bar\",\n \"myEnum\": \"SUNNY\"\n }\n }\n}", - "_postman_previewlanguage": "json" - } - ] - } - ] -} \ No newline at end of file diff --git a/seed/postman/inline-types/snippet-templates.json b/seed/postman/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/postman/inline-types/snippet.json b/seed/postman/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/pydantic/inline-types/.github/workflows/ci.yml b/seed/pydantic/inline-types/.github/workflows/ci.yml deleted file mode 100644 index b204fa604e2..00000000000 --- a/seed/pydantic/inline-types/.github/workflows/ci.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: ci - -on: [push] -jobs: - compile: - runs-on: ubuntu-20.04 - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - - name: Install dependencies - run: poetry install - - name: Compile - run: poetry run mypy . - test: - runs-on: ubuntu-20.04 - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - - name: Install dependencies - run: poetry install - - - name: Test - run: poetry run pytest -rP . - - publish: - needs: [compile, test] - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - runs-on: ubuntu-20.04 - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - - name: Install dependencies - run: poetry install - - name: Publish to pypi - run: | - poetry config repositories.remote - poetry --no-interaction -v publish --build --repository remote --username "$" --password "$" - env: - : ${{ secrets. }} - : ${{ secrets. }} diff --git a/seed/pydantic/inline-types/.gitignore b/seed/pydantic/inline-types/.gitignore deleted file mode 100644 index 0da665feeef..00000000000 --- a/seed/pydantic/inline-types/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -dist/ -.mypy_cache/ -__pycache__/ -poetry.toml -.ruff_cache/ diff --git a/seed/pydantic/inline-types/.mock/definition/__package__.yml b/seed/pydantic/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/pydantic/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/pydantic/inline-types/.mock/definition/api.yml b/seed/pydantic/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/pydantic/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/pydantic/inline-types/.mock/fern.config.json b/seed/pydantic/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/pydantic/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/pydantic/inline-types/.mock/generators.yml b/seed/pydantic/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/pydantic/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/pydantic/inline-types/README.md b/seed/pydantic/inline-types/README.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/pydantic/inline-types/pyproject.toml b/seed/pydantic/inline-types/pyproject.toml deleted file mode 100644 index 59c1ffa7302..00000000000 --- a/seed/pydantic/inline-types/pyproject.toml +++ /dev/null @@ -1,59 +0,0 @@ -[tool.poetry] -name = "fern_inline-types" -version = "0.0.1" -description = "" -readme = "README.md" -authors = [] -keywords = [] - -classifiers = [ - "Intended Audience :: Developers", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Operating System :: OS Independent", - "Operating System :: POSIX", - "Operating System :: MacOS", - "Operating System :: POSIX :: Linux", - "Operating System :: Microsoft :: Windows", - "Topic :: Software Development :: Libraries :: Python Modules", - "Typing :: Typed" -] -packages = [ - { include = "seed/object", from = "src"} -] - -[project.urls] -Repository = 'https://github.com/inline-types/fern' - -[tool.poetry.dependencies] -python = "^3.8" -pydantic = ">= 1.9.2" -pydantic-core = "^2.18.2" - -[tool.poetry.dev-dependencies] -mypy = "1.0.1" -pytest = "^7.4.0" -pytest-asyncio = "^0.23.5" -python-dateutil = "^2.9.0" -types-python-dateutil = "^2.9.0.20240316" -ruff = "^0.5.6" - -[tool.pytest.ini_options] -testpaths = [ "tests" ] -asyncio_mode = "auto" - -[tool.mypy] -plugins = ["pydantic.mypy"] - -[tool.ruff] -line-length = 120 - - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" diff --git a/seed/pydantic/inline-types/snippet-templates.json b/seed/pydantic/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/pydantic/inline-types/snippet.json b/seed/pydantic/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/pydantic/inline-types/src/seed/object/__init__.py b/seed/pydantic/inline-types/src/seed/object/__init__.py deleted file mode 100644 index 5646342ae20..00000000000 --- a/seed/pydantic/inline-types/src/seed/object/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .inline_enum import InlineEnum -from .inline_type_1 import InlineType1 -from .inline_type_2 import InlineType2 -from .inlined_discriminated_union_1 import ( - InlinedDiscriminatedUnion1, - InlinedDiscriminatedUnion1_Type1, - InlinedDiscriminatedUnion1_Type2, -) -from .inlined_undiscriminated_union_1 import InlinedUndiscriminatedUnion1 -from .nested_inline_type_1 import NestedInlineType1 -from .root_type_1 import RootType1 - -__all__ = [ - "InlineEnum", - "InlineType1", - "InlineType2", - "InlinedDiscriminatedUnion1", - "InlinedDiscriminatedUnion1_Type1", - "InlinedDiscriminatedUnion1_Type2", - "InlinedUndiscriminatedUnion1", - "NestedInlineType1", - "RootType1", -] diff --git a/seed/pydantic/inline-types/src/seed/object/core/__init__.py b/seed/pydantic/inline-types/src/seed/object/core/__init__.py deleted file mode 100644 index 9c7cd65aa25..00000000000 --- a/seed/pydantic/inline-types/src/seed/object/core/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .datetime_utils import serialize_datetime -from .pydantic_utilities import ( - IS_PYDANTIC_V2, - UniversalBaseModel, - UniversalRootModel, - parse_obj_as, - universal_field_validator, - universal_root_validator, - update_forward_refs, -) -from .serialization import FieldMetadata - -__all__ = [ - "FieldMetadata", - "IS_PYDANTIC_V2", - "UniversalBaseModel", - "UniversalRootModel", - "parse_obj_as", - "serialize_datetime", - "universal_field_validator", - "universal_root_validator", - "update_forward_refs", -] diff --git a/seed/pydantic/inline-types/src/seed/object/core/datetime_utils.py b/seed/pydantic/inline-types/src/seed/object/core/datetime_utils.py deleted file mode 100644 index 7c9864a944c..00000000000 --- a/seed/pydantic/inline-types/src/seed/object/core/datetime_utils.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt - - -def serialize_datetime(v: dt.datetime) -> str: - """ - Serialize a datetime including timezone info. - - Uses the timezone info provided if present, otherwise uses the current runtime's timezone info. - - UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00. - """ - - def _serialize_zoned_datetime(v: dt.datetime) -> str: - if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None): - # UTC is a special case where we use "Z" at the end instead of "+00:00" - return v.isoformat().replace("+00:00", "Z") - else: - # Delegate to the typical +/- offset format - return v.isoformat() - - if v.tzinfo is not None: - return _serialize_zoned_datetime(v) - else: - local_tz = dt.datetime.now().astimezone().tzinfo - localized_dt = v.replace(tzinfo=local_tz) - return _serialize_zoned_datetime(localized_dt) diff --git a/seed/pydantic/inline-types/src/seed/object/core/pydantic_utilities.py b/seed/pydantic/inline-types/src/seed/object/core/pydantic_utilities.py deleted file mode 100644 index bbe1de41431..00000000000 --- a/seed/pydantic/inline-types/src/seed/object/core/pydantic_utilities.py +++ /dev/null @@ -1,265 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# nopycln: file -import datetime as dt -import typing -from collections import defaultdict - -import typing_extensions - -import pydantic - -from .datetime_utils import serialize_datetime - -IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") - -if IS_PYDANTIC_V2: - # isort will try to reformat the comments on these imports, which breaks mypy - # isort: off - from pydantic.v1.datetime_parse import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 - parse_date as parse_date, - ) - from pydantic.v1.datetime_parse import ( # pyright: ignore[reportMissingImports] # Pydantic v2 - parse_datetime as parse_datetime, - ) - from pydantic.v1.json import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 - ENCODERS_BY_TYPE as encoders_by_type, - ) - from pydantic.v1.typing import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 - get_args as get_args, - ) - from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 - get_origin as get_origin, - ) - from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 - is_literal_type as is_literal_type, - ) - from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 - is_union as is_union, - ) - from pydantic.v1.fields import ModelField as ModelField # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 -else: - from pydantic.datetime_parse import parse_date as parse_date # type: ignore # Pydantic v1 - from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore # Pydantic v1 - from pydantic.fields import ModelField as ModelField # type: ignore # Pydantic v1 - from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore # Pydantic v1 - from pydantic.typing import get_args as get_args # type: ignore # Pydantic v1 - from pydantic.typing import get_origin as get_origin # type: ignore # Pydantic v1 - from pydantic.typing import is_literal_type as is_literal_type # type: ignore # Pydantic v1 - from pydantic.typing import is_union as is_union # type: ignore # Pydantic v1 - - # isort: on - - -T = typing.TypeVar("T") -Model = typing.TypeVar("Model", bound=pydantic.BaseModel) - - -def parse_obj_as(type_: typing.Type[T], object_: typing.Any) -> T: - if IS_PYDANTIC_V2: - adapter = pydantic.TypeAdapter(type_) # type: ignore # Pydantic v2 - return adapter.validate_python(object_) - else: - return pydantic.parse_obj_as(type_, object_) - - -def to_jsonable_with_fallback( - obj: typing.Any, fallback_serializer: typing.Callable[[typing.Any], typing.Any] -) -> typing.Any: - if IS_PYDANTIC_V2: - from pydantic_core import to_jsonable_python - - return to_jsonable_python(obj, fallback=fallback_serializer) - else: - return fallback_serializer(obj) - - -class UniversalBaseModel(pydantic.BaseModel): - class Config: - populate_by_name = True - smart_union = True - allow_population_by_field_name = True - json_encoders = {dt.datetime: serialize_datetime} - # Allow fields begining with `model_` to be used in the model - protected_namespaces = () - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - if IS_PYDANTIC_V2: - return super().model_dump_json(**kwargs_with_defaults) # type: ignore # Pydantic v2 - else: - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - """ - Override the default dict method to `exclude_unset` by default. This function patches - `exclude_unset` to work include fields within non-None default values. - """ - # Note: the logic here is multi-plexed given the levers exposed in Pydantic V1 vs V2 - # Pydantic V1's .dict can be extremely slow, so we do not want to call it twice. - # - # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models - # that we have less control over, and this is less intrusive than custom serializers for now. - if IS_PYDANTIC_V2: - kwargs_with_defaults_exclude_unset: typing.Any = { - **kwargs, - "by_alias": True, - "exclude_unset": True, - "exclude_none": False, - } - kwargs_with_defaults_exclude_none: typing.Any = { - **kwargs, - "by_alias": True, - "exclude_none": True, - "exclude_unset": False, - } - return deep_union_pydantic_dicts( - super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore # Pydantic v2 - super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore # Pydantic v2 - ) - - else: - _fields_set = self.__fields_set__.copy() - - fields = _get_model_fields(self.__class__) - for name, field in fields.items(): - if name not in _fields_set: - default = _get_field_default(field) - - # If the default values are non-null act like they've been set - # This effectively allows exclude_unset to work like exclude_none where - # the latter passes through intentionally set none values. - if default is not None or ("exclude_unset" in kwargs and not kwargs["exclude_unset"]): - _fields_set.add(name) - - if default is not None: - self.__fields_set__.add(name) - - kwargs_with_defaults_exclude_unset_include_fields: typing.Any = { - "by_alias": True, - "exclude_unset": True, - "include": _fields_set, - **kwargs, - } - - return super().dict(**kwargs_with_defaults_exclude_unset_include_fields) - - -def _union_list_of_pydantic_dicts( - source: typing.List[typing.Any], destination: typing.List[typing.Any] -) -> typing.List[typing.Any]: - converted_list: typing.List[typing.Any] = [] - for i, item in enumerate(source): - destination_value = destination[i] # type: ignore - if isinstance(item, dict): - converted_list.append(deep_union_pydantic_dicts(item, destination_value)) - elif isinstance(item, list): - converted_list.append(_union_list_of_pydantic_dicts(item, destination_value)) - else: - converted_list.append(item) - return converted_list - - -def deep_union_pydantic_dicts( - source: typing.Dict[str, typing.Any], destination: typing.Dict[str, typing.Any] -) -> typing.Dict[str, typing.Any]: - for key, value in source.items(): - node = destination.setdefault(key, {}) - if isinstance(value, dict): - deep_union_pydantic_dicts(value, node) - # Note: we do not do this same processing for sets given we do not have sets of models - # and given the sets are unordered, the processing of the set and matching objects would - # be non-trivial. - elif isinstance(value, list): - destination[key] = _union_list_of_pydantic_dicts(value, node) - else: - destination[key] = value - - return destination - - -if IS_PYDANTIC_V2: - - class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore # Pydantic v2 - pass - - UniversalRootModel: typing_extensions.TypeAlias = V2RootModel # type: ignore -else: - UniversalRootModel: typing_extensions.TypeAlias = UniversalBaseModel # type: ignore - - -def encode_by_type(o: typing.Any) -> typing.Any: - encoders_by_class_tuples: typing.Dict[typing.Callable[[typing.Any], typing.Any], typing.Tuple[typing.Any, ...]] = ( - defaultdict(tuple) - ) - for type_, encoder in encoders_by_type.items(): - encoders_by_class_tuples[encoder] += (type_,) - - if type(o) in encoders_by_type: - return encoders_by_type[type(o)](o) - for encoder, classes_tuple in encoders_by_class_tuples.items(): - if isinstance(o, classes_tuple): - return encoder(o) - - -def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None: - if IS_PYDANTIC_V2: - model.model_rebuild(raise_errors=False) # type: ignore # Pydantic v2 - else: - model.update_forward_refs(**localns) - - -# Mirrors Pydantic's internal typing -AnyCallable = typing.Callable[..., typing.Any] - - -def universal_root_validator( - pre: bool = False, -) -> typing.Callable[[AnyCallable], AnyCallable]: - def decorator(func: AnyCallable) -> AnyCallable: - if IS_PYDANTIC_V2: - return pydantic.model_validator(mode="before" if pre else "after")(func) # type: ignore # Pydantic v2 - else: - return pydantic.root_validator(pre=pre)(func) # type: ignore # Pydantic v1 - - return decorator - - -def universal_field_validator(field_name: str, pre: bool = False) -> typing.Callable[[AnyCallable], AnyCallable]: - def decorator(func: AnyCallable) -> AnyCallable: - if IS_PYDANTIC_V2: - return pydantic.field_validator(field_name, mode="before" if pre else "after")(func) # type: ignore # Pydantic v2 - else: - return pydantic.validator(field_name, pre=pre)(func) # type: ignore # Pydantic v1 - - return decorator - - -PydanticField = typing.Union[ModelField, pydantic.fields.FieldInfo] - - -def _get_model_fields( - model: typing.Type["Model"], -) -> typing.Mapping[str, PydanticField]: - if IS_PYDANTIC_V2: - return model.model_fields # type: ignore # Pydantic v2 - else: - return model.__fields__ # type: ignore # Pydantic v1 - - -def _get_field_default(field: PydanticField) -> typing.Any: - try: - value = field.get_default() # type: ignore # Pydantic < v1.10.15 - except: - value = field.default - if IS_PYDANTIC_V2: - from pydantic_core import PydanticUndefined - - if value == PydanticUndefined: - return None - return value - return value diff --git a/seed/pydantic/inline-types/src/seed/object/core/serialization.py b/seed/pydantic/inline-types/src/seed/object/core/serialization.py deleted file mode 100644 index cb5dcbf93a9..00000000000 --- a/seed/pydantic/inline-types/src/seed/object/core/serialization.py +++ /dev/null @@ -1,272 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import collections -import inspect -import typing - -import typing_extensions - -import pydantic - - -class FieldMetadata: - """ - Metadata class used to annotate fields to provide additional information. - - Example: - class MyDict(TypedDict): - field: typing.Annotated[str, FieldMetadata(alias="field_name")] - - Will serialize: `{"field": "value"}` - To: `{"field_name": "value"}` - """ - - alias: str - - def __init__(self, *, alias: str) -> None: - self.alias = alias - - -def convert_and_respect_annotation_metadata( - *, - object_: typing.Any, - annotation: typing.Any, - inner_type: typing.Optional[typing.Any] = None, - direction: typing.Literal["read", "write"], -) -> typing.Any: - """ - Respect the metadata annotations on a field, such as aliasing. This function effectively - manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for - TypedDicts, which cannot support aliasing out of the box, and can be extended for additional - utilities, such as defaults. - - Parameters - ---------- - object_ : typing.Any - - annotation : type - The type we're looking to apply typing annotations from - - inner_type : typing.Optional[type] - - Returns - ------- - typing.Any - """ - - if object_ is None: - return None - if inner_type is None: - inner_type = annotation - - clean_type = _remove_annotations(inner_type) - # Pydantic models - if ( - inspect.isclass(clean_type) - and issubclass(clean_type, pydantic.BaseModel) - and isinstance(object_, typing.Mapping) - ): - return _convert_mapping(object_, clean_type, direction) - # TypedDicts - if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping): - return _convert_mapping(object_, clean_type, direction) - - if ( - typing_extensions.get_origin(clean_type) == typing.Dict - or typing_extensions.get_origin(clean_type) == dict - or clean_type == typing.Dict - ) and isinstance(object_, typing.Dict): - key_type = typing_extensions.get_args(clean_type)[0] - value_type = typing_extensions.get_args(clean_type)[1] - - return { - key: convert_and_respect_annotation_metadata( - object_=value, - annotation=annotation, - inner_type=value_type, - direction=direction, - ) - for key, value in object_.items() - } - - # If you're iterating on a string, do not bother to coerce it to a sequence. - if not isinstance(object_, str): - if ( - typing_extensions.get_origin(clean_type) == typing.Set - or typing_extensions.get_origin(clean_type) == set - or clean_type == typing.Set - ) and isinstance(object_, typing.Set): - inner_type = typing_extensions.get_args(clean_type)[0] - return { - convert_and_respect_annotation_metadata( - object_=item, - annotation=annotation, - inner_type=inner_type, - direction=direction, - ) - for item in object_ - } - elif ( - ( - typing_extensions.get_origin(clean_type) == typing.List - or typing_extensions.get_origin(clean_type) == list - or clean_type == typing.List - ) - and isinstance(object_, typing.List) - ) or ( - ( - typing_extensions.get_origin(clean_type) == typing.Sequence - or typing_extensions.get_origin(clean_type) == collections.abc.Sequence - or clean_type == typing.Sequence - ) - and isinstance(object_, typing.Sequence) - ): - inner_type = typing_extensions.get_args(clean_type)[0] - return [ - convert_and_respect_annotation_metadata( - object_=item, - annotation=annotation, - inner_type=inner_type, - direction=direction, - ) - for item in object_ - ] - - if typing_extensions.get_origin(clean_type) == typing.Union: - # We should be able to ~relatively~ safely try to convert keys against all - # member types in the union, the edge case here is if one member aliases a field - # of the same name to a different name from another member - # Or if another member aliases a field of the same name that another member does not. - for member in typing_extensions.get_args(clean_type): - object_ = convert_and_respect_annotation_metadata( - object_=object_, - annotation=annotation, - inner_type=member, - direction=direction, - ) - return object_ - - annotated_type = _get_annotation(annotation) - if annotated_type is None: - return object_ - - # If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.) - # Then we can safely call it on the recursive conversion. - return object_ - - -def _convert_mapping( - object_: typing.Mapping[str, object], - expected_type: typing.Any, - direction: typing.Literal["read", "write"], -) -> typing.Mapping[str, object]: - converted_object: typing.Dict[str, object] = {} - annotations = typing_extensions.get_type_hints(expected_type, include_extras=True) - aliases_to_field_names = _get_alias_to_field_name(annotations) - for key, value in object_.items(): - if direction == "read" and key in aliases_to_field_names: - dealiased_key = aliases_to_field_names.get(key) - if dealiased_key is not None: - type_ = annotations.get(dealiased_key) - else: - type_ = annotations.get(key) - # Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map - # - # So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias - # then we can just pass the value through as is - if type_ is None: - converted_object[key] = value - elif direction == "read" and key not in aliases_to_field_names: - converted_object[key] = convert_and_respect_annotation_metadata( - object_=value, annotation=type_, direction=direction - ) - else: - converted_object[_alias_key(key, type_, direction, aliases_to_field_names)] = ( - convert_and_respect_annotation_metadata(object_=value, annotation=type_, direction=direction) - ) - return converted_object - - -def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]: - maybe_annotated_type = typing_extensions.get_origin(type_) - if maybe_annotated_type is None: - return None - - if maybe_annotated_type == typing_extensions.NotRequired: - type_ = typing_extensions.get_args(type_)[0] - maybe_annotated_type = typing_extensions.get_origin(type_) - - if maybe_annotated_type == typing_extensions.Annotated: - return type_ - - return None - - -def _remove_annotations(type_: typing.Any) -> typing.Any: - maybe_annotated_type = typing_extensions.get_origin(type_) - if maybe_annotated_type is None: - return type_ - - if maybe_annotated_type == typing_extensions.NotRequired: - return _remove_annotations(typing_extensions.get_args(type_)[0]) - - if maybe_annotated_type == typing_extensions.Annotated: - return _remove_annotations(typing_extensions.get_args(type_)[0]) - - return type_ - - -def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]: - annotations = typing_extensions.get_type_hints(type_, include_extras=True) - return _get_alias_to_field_name(annotations) - - -def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]: - annotations = typing_extensions.get_type_hints(type_, include_extras=True) - return _get_field_to_alias_name(annotations) - - -def _get_alias_to_field_name( - field_to_hint: typing.Dict[str, typing.Any], -) -> typing.Dict[str, str]: - aliases = {} - for field, hint in field_to_hint.items(): - maybe_alias = _get_alias_from_type(hint) - if maybe_alias is not None: - aliases[maybe_alias] = field - return aliases - - -def _get_field_to_alias_name( - field_to_hint: typing.Dict[str, typing.Any], -) -> typing.Dict[str, str]: - aliases = {} - for field, hint in field_to_hint.items(): - maybe_alias = _get_alias_from_type(hint) - if maybe_alias is not None: - aliases[field] = maybe_alias - return aliases - - -def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]: - maybe_annotated_type = _get_annotation(type_) - - if maybe_annotated_type is not None: - # The actual annotations are 1 onward, the first is the annotated type - annotations = typing_extensions.get_args(maybe_annotated_type)[1:] - - for annotation in annotations: - if isinstance(annotation, FieldMetadata) and annotation.alias is not None: - return annotation.alias - return None - - -def _alias_key( - key: str, - type_: typing.Any, - direction: typing.Literal["read", "write"], - aliases_to_field_names: typing.Dict[str, str], -) -> str: - if direction == "read": - return aliases_to_field_names.get(key, key) - return _get_alias_from_type(type_=type_) or key diff --git a/seed/pydantic/inline-types/src/seed/object/inline_enum.py b/seed/pydantic/inline-types/src/seed/object/inline_enum.py deleted file mode 100644 index 1692aa9af84..00000000000 --- a/seed/pydantic/inline-types/src/seed/object/inline_enum.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -InlineEnum = typing.Union[typing.Literal["SUNNY", "CLOUDY", "RAINING", "SNOWING"], typing.Any] diff --git a/seed/pydantic/inline-types/src/seed/object/inline_type_1.py b/seed/pydantic/inline-types/src/seed/object/inline_type_1.py deleted file mode 100644 index c198d47e762..00000000000 --- a/seed/pydantic/inline-types/src/seed/object/inline_type_1.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .core.pydantic_utilities import UniversalBaseModel -from .nested_inline_type_1 import NestedInlineType1 -from .core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class InlineType1(UniversalBaseModel): - foo: str - bar: NestedInlineType1 - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow diff --git a/seed/pydantic/inline-types/src/seed/object/inline_type_2.py b/seed/pydantic/inline-types/src/seed/object/inline_type_2.py deleted file mode 100644 index 0080a451cb0..00000000000 --- a/seed/pydantic/inline-types/src/seed/object/inline_type_2.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .core.pydantic_utilities import UniversalBaseModel -from .core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class InlineType2(UniversalBaseModel): - baz: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow diff --git a/seed/pydantic/inline-types/src/seed/object/inlined_discriminated_union_1.py b/seed/pydantic/inline-types/src/seed/object/inlined_discriminated_union_1.py deleted file mode 100644 index 75e35b89f87..00000000000 --- a/seed/pydantic/inline-types/src/seed/object/inlined_discriminated_union_1.py +++ /dev/null @@ -1,36 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations -from .core.pydantic_utilities import UniversalBaseModel -import typing -from .nested_inline_type_1 import NestedInlineType1 -from .core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic - - -class InlinedDiscriminatedUnion1_Type1(UniversalBaseModel): - type: typing.Literal["type1"] = "type1" - foo: str - bar: NestedInlineType1 - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -class InlinedDiscriminatedUnion1_Type2(UniversalBaseModel): - type: typing.Literal["type2"] = "type2" - baz: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow - - -InlinedDiscriminatedUnion1 = typing.Union[InlinedDiscriminatedUnion1_Type1, InlinedDiscriminatedUnion1_Type2] diff --git a/seed/pydantic/inline-types/src/seed/object/inlined_undiscriminated_union_1.py b/seed/pydantic/inline-types/src/seed/object/inlined_undiscriminated_union_1.py deleted file mode 100644 index aaf1f02b5df..00000000000 --- a/seed/pydantic/inline-types/src/seed/object/inlined_undiscriminated_union_1.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from .inline_type_1 import InlineType1 -from .inline_type_2 import InlineType2 - -InlinedUndiscriminatedUnion1 = typing.Union[InlineType1, InlineType2] diff --git a/seed/pydantic/inline-types/src/seed/object/nested_inline_type_1.py b/seed/pydantic/inline-types/src/seed/object/nested_inline_type_1.py deleted file mode 100644 index dfc89353b41..00000000000 --- a/seed/pydantic/inline-types/src/seed/object/nested_inline_type_1.py +++ /dev/null @@ -1,20 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .core.pydantic_utilities import UniversalBaseModel -from .inline_enum import InlineEnum -import pydantic -from .core.pydantic_utilities import IS_PYDANTIC_V2 -import typing - - -class NestedInlineType1(UniversalBaseModel): - foo: str - bar: str - my_enum: InlineEnum = pydantic.Field(alias="myEnum") - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow diff --git a/seed/pydantic/inline-types/src/seed/object/py.typed b/seed/pydantic/inline-types/src/seed/object/py.typed deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/pydantic/inline-types/src/seed/object/root_type_1.py b/seed/pydantic/inline-types/src/seed/object/root_type_1.py deleted file mode 100644 index 8e739f0e59b..00000000000 --- a/seed/pydantic/inline-types/src/seed/object/root_type_1.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .core.pydantic_utilities import UniversalBaseModel -from .inline_type_1 import InlineType1 -from .core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class RootType1(UniversalBaseModel): - foo: str - bar: InlineType1 - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2 - else: - - class Config: - extra = pydantic.Extra.allow diff --git a/seed/pydantic/inline-types/tests/custom/test_client.py b/seed/pydantic/inline-types/tests/custom/test_client.py deleted file mode 100644 index 73f811f5ede..00000000000 --- a/seed/pydantic/inline-types/tests/custom/test_client.py +++ /dev/null @@ -1,7 +0,0 @@ -import pytest - - -# Get started with writing tests with pytest at https://docs.pytest.org -@pytest.mark.skip(reason="Unimplemented") -def test_client() -> None: - assert True == True diff --git a/seed/python-sdk/inline-types/.github/workflows/ci.yml b/seed/python-sdk/inline-types/.github/workflows/ci.yml deleted file mode 100644 index b7316b8cab7..00000000000 --- a/seed/python-sdk/inline-types/.github/workflows/ci.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: ci - -on: [push] -jobs: - compile: - runs-on: ubuntu-20.04 - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - - name: Install dependencies - run: poetry install - - name: Compile - run: poetry run mypy . - test: - runs-on: ubuntu-20.04 - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - - name: Install dependencies - run: poetry install - - - name: Install Fern - run: npm install -g fern-api - - name: Test - run: fern test --command "poetry run pytest -rP ." - - publish: - needs: [compile, test] - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - runs-on: ubuntu-20.04 - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - - name: Install dependencies - run: poetry install - - name: Publish to pypi - run: | - poetry config repositories.remote - poetry --no-interaction -v publish --build --repository remote --username "$" --password "$" - env: - : ${{ secrets. }} - : ${{ secrets. }} diff --git a/seed/python-sdk/inline-types/.gitignore b/seed/python-sdk/inline-types/.gitignore deleted file mode 100644 index 0da665feeef..00000000000 --- a/seed/python-sdk/inline-types/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -dist/ -.mypy_cache/ -__pycache__/ -poetry.toml -.ruff_cache/ diff --git a/seed/python-sdk/inline-types/.mock/definition/__package__.yml b/seed/python-sdk/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/python-sdk/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/python-sdk/inline-types/.mock/definition/api.yml b/seed/python-sdk/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/python-sdk/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/python-sdk/inline-types/.mock/fern.config.json b/seed/python-sdk/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/python-sdk/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/python-sdk/inline-types/.mock/generators.yml b/seed/python-sdk/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/python-sdk/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/python-sdk/inline-types/README.md b/seed/python-sdk/inline-types/README.md deleted file mode 100644 index ffc62102750..00000000000 --- a/seed/python-sdk/inline-types/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Seed Python 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%2FPython) -[![pypi](https://img.shields.io/pypi/v/fern_inline-types)](https://pypi.python.org/pypi/fern_inline-types) - -The Seed Python library provides convenient access to the Seed API from Python. - -## Installation - -```sh -pip install fern_inline-types -``` - -## Reference - -A full reference for this library is available [here](./reference.md). - -## Usage - -Instantiate and use the client with the following: - -```python -from seed import InlineType1, NestedInlineType1, SeedObject - -client = SeedObject( - base_url="https://yourhost.com/path/to/api", -) -client.get_root( - bar=InlineType1( - foo="foo", - bar=NestedInlineType1( - foo="foo", - bar="bar", - my_enum="SUNNY", - ), - ), - foo="foo", -) -``` - -## Async Client - -The SDK also exports an `async` client so that you can make non-blocking calls to our API. - -```python -import asyncio - -from seed import AsyncSeedObject, InlineType1, NestedInlineType1 - -client = AsyncSeedObject( - base_url="https://yourhost.com/path/to/api", -) - - -async def main() -> None: - await client.get_root( - bar=InlineType1( - foo="foo", - bar=NestedInlineType1( - foo="foo", - bar="bar", - my_enum="SUNNY", - ), - ), - foo="foo", - ) - - -asyncio.run(main()) -``` - -## Exception Handling - -When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error -will be thrown. - -```python -from seed.core.api_error import ApiError - -try: - client.get_root() -except ApiError as e: - print(e.status_code) - print(e.body) -``` - -## Advanced - -### Retries - -The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long -as the request is deemed retriable and the number of retry attempts has not grown larger than the configured -retry limit (default: 2). - -A request is deemed retriable 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 `max_retries` request option to configure this behavior. - -```python -client.get_root(request_options={ - "max_retries": 1 -}) -``` - -### Timeouts - -The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level. - -```python - -from seed import SeedObject - -client = SeedObject( - ..., - timeout=20.0, -) - - -# Override timeout for a specific method -client.get_root(request_options={ - "timeout_in_seconds": 1 -}) -``` - -### Custom Client - -You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies -and transports. -```python -import httpx -from seed import SeedObject - -client = SeedObject( - ..., - httpx_client=httpx.Client( - proxies="http://my.test.proxy.example.com", - transport=httpx.HTTPTransport(local_address="0.0.0.0"), - ), -) -``` - -## 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! diff --git a/seed/python-sdk/inline-types/pyproject.toml b/seed/python-sdk/inline-types/pyproject.toml deleted file mode 100644 index 7f8997f3abe..00000000000 --- a/seed/python-sdk/inline-types/pyproject.toml +++ /dev/null @@ -1,61 +0,0 @@ -[tool.poetry] -name = "fern_inline-types" -version = "0.0.1" -description = "" -readme = "README.md" -authors = [] -keywords = [] - -classifiers = [ - "Intended Audience :: Developers", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Operating System :: OS Independent", - "Operating System :: POSIX", - "Operating System :: MacOS", - "Operating System :: POSIX :: Linux", - "Operating System :: Microsoft :: Windows", - "Topic :: Software Development :: Libraries :: Python Modules", - "Typing :: Typed" -] -packages = [ - { include = "seed", from = "src"} -] - -[project.urls] -Repository = 'https://github.com/inline-types/fern' - -[tool.poetry.dependencies] -python = "^3.8" -httpx = ">=0.21.2" -pydantic = ">= 1.9.2" -pydantic-core = "^2.18.2" -typing_extensions = ">= 4.0.0" - -[tool.poetry.dev-dependencies] -mypy = "1.0.1" -pytest = "^7.4.0" -pytest-asyncio = "^0.23.5" -python-dateutil = "^2.9.0" -types-python-dateutil = "^2.9.0.20240316" -ruff = "^0.5.6" - -[tool.pytest.ini_options] -testpaths = [ "tests" ] -asyncio_mode = "auto" - -[tool.mypy] -plugins = ["pydantic.mypy"] - -[tool.ruff] -line-length = 120 - - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" diff --git a/seed/python-sdk/inline-types/reference.md b/seed/python-sdk/inline-types/reference.md deleted file mode 100644 index cab3ee56ef3..00000000000 --- a/seed/python-sdk/inline-types/reference.md +++ /dev/null @@ -1,73 +0,0 @@ -# Reference -
client.get_root(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import InlineType1, NestedInlineType1, SeedObject - -client = SeedObject( - base_url="https://yourhost.com/path/to/api", -) -client.get_root( - bar=InlineType1( - foo="foo", - bar=NestedInlineType1( - foo="foo", - bar="bar", - my_enum="SUNNY", - ), - ), - foo="foo", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**bar:** `InlineType1` - -
-
- -
-
- -**foo:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- diff --git a/seed/python-sdk/inline-types/resolved-snippet-templates.md b/seed/python-sdk/inline-types/resolved-snippet-templates.md deleted file mode 100644 index 7949e4a2c1c..00000000000 --- a/seed/python-sdk/inline-types/resolved-snippet-templates.md +++ /dev/null @@ -1,18 +0,0 @@ -```python -from seed import InlineType1 -from seed import NestedInlineType1 - -client = SeedObject(base_url="https://yourhost.com/path/to/api", ) -client.get_root( - bar=InlineType1( - foo="foo", - bar=NestedInlineType1( - foo="foo" - ) - ), - foo="foo" -) - -``` - - diff --git a/seed/python-sdk/inline-types/snippet-templates.json b/seed/python-sdk/inline-types/snippet-templates.json deleted file mode 100644 index 358d9bb086f..00000000000 --- a/seed/python-sdk/inline-types/snippet-templates.json +++ /dev/null @@ -1,282 +0,0 @@ -[ - { - "sdk": { - "package": "fern_inline-types", - "version": "0.0.1", - "type": "python" - }, - "endpointId": { - "path": "/root/root", - "method": "POST", - "identifierOverride": "endpoint_.getRoot" - }, - "snippetTemplate": { - "clientInstantiation": { - "imports": [ - "from seed import SeedObject" - ], - "isOptional": true, - "templateString": "client = SeedObject(base_url=\"https://yourhost.com/path/to/api\", )", - "templateInputs": [], - "inputDelimiter": ",", - "type": "generic" - }, - "functionInvocation": { - "imports": [], - "isOptional": true, - "templateString": "client.get_root(\n\t$FERN_INPUT\n)", - "templateInputs": [ - { - "type": "template", - "value": { - "imports": [ - "from seed import InlineType1" - ], - "isOptional": true, - "templateString": "bar=InlineType1(\n\t\t$FERN_INPUT\n\t)", - "templateInputs": [ - { - "type": "template", - "value": { - "imports": [], - "isOptional": true, - "templateString": "foo=$FERN_INPUT", - "templateInputs": [ - { - "location": "BODY", - "path": "bar.foo", - "type": "payload" - } - ], - "type": "generic" - } - }, - { - "type": "template", - "value": { - "imports": [ - "from seed import NestedInlineType1" - ], - "isOptional": true, - "templateString": "bar=NestedInlineType1(\n\t\t\t$FERN_INPUT\n\t\t)", - "templateInputs": [ - { - "type": "template", - "value": { - "imports": [], - "isOptional": true, - "templateString": "foo=$FERN_INPUT", - "templateInputs": [ - { - "location": "BODY", - "path": "bar.bar.foo", - "type": "payload" - } - ], - "type": "generic" - } - }, - { - "type": "template", - "value": { - "imports": [], - "isOptional": true, - "templateString": "bar=$FERN_INPUT", - "templateInputs": [ - { - "location": "BODY", - "path": "bar.bar.foo.bar.bar", - "type": "payload" - } - ], - "type": "generic" - } - }, - { - "type": "template", - "value": { - "imports": [], - "isOptional": true, - "templateString": "my_enum=$FERN_INPUT", - "values": { - "SUNNY": "\"SUNNY\"", - "CLOUDY": "\"CLOUDY\"", - "RAINING": "\"RAINING\"", - "SNOWING": "\"SNOWING\"" - }, - "templateInput": { - "location": "BODY", - "path": "bar.bar.foo.bar.bar.bar.myEnum" - }, - "type": "enum" - } - } - ], - "inputDelimiter": ",\n\t\t\t", - "type": "generic" - } - } - ], - "inputDelimiter": ",\n\t\t", - "type": "generic" - } - }, - { - "type": "template", - "value": { - "imports": [], - "isOptional": true, - "templateString": "foo=$FERN_INPUT", - "templateInputs": [ - { - "location": "BODY", - "path": "foo", - "type": "payload" - } - ], - "type": "generic" - } - } - ], - "inputDelimiter": ",\n\t", - "type": "generic" - }, - "type": "v1" - }, - "additionalTemplates": { - "async": { - "clientInstantiation": { - "imports": [ - "from seed import AsyncSeedObject" - ], - "isOptional": true, - "templateString": "client = AsyncSeedObject(base_url=\"https://yourhost.com/path/to/api\", )", - "templateInputs": [], - "inputDelimiter": ",", - "type": "generic" - }, - "functionInvocation": { - "imports": [], - "isOptional": true, - "templateString": "await client.get_root(\n\t$FERN_INPUT\n)", - "templateInputs": [ - { - "type": "template", - "value": { - "imports": [ - "from seed import InlineType1" - ], - "isOptional": true, - "templateString": "bar=InlineType1(\n\t\t$FERN_INPUT\n\t)", - "templateInputs": [ - { - "type": "template", - "value": { - "imports": [], - "isOptional": true, - "templateString": "foo=$FERN_INPUT", - "templateInputs": [ - { - "location": "BODY", - "path": "bar.foo", - "type": "payload" - } - ], - "type": "generic" - } - }, - { - "type": "template", - "value": { - "imports": [ - "from seed import NestedInlineType1" - ], - "isOptional": true, - "templateString": "bar=NestedInlineType1(\n\t\t\t$FERN_INPUT\n\t\t)", - "templateInputs": [ - { - "type": "template", - "value": { - "imports": [], - "isOptional": true, - "templateString": "foo=$FERN_INPUT", - "templateInputs": [ - { - "location": "BODY", - "path": "bar.bar.foo", - "type": "payload" - } - ], - "type": "generic" - } - }, - { - "type": "template", - "value": { - "imports": [], - "isOptional": true, - "templateString": "bar=$FERN_INPUT", - "templateInputs": [ - { - "location": "BODY", - "path": "bar.bar.foo.bar.bar", - "type": "payload" - } - ], - "type": "generic" - } - }, - { - "type": "template", - "value": { - "imports": [], - "isOptional": true, - "templateString": "my_enum=$FERN_INPUT", - "values": { - "SUNNY": "\"SUNNY\"", - "CLOUDY": "\"CLOUDY\"", - "RAINING": "\"RAINING\"", - "SNOWING": "\"SNOWING\"" - }, - "templateInput": { - "location": "BODY", - "path": "bar.bar.foo.bar.bar.bar.myEnum" - }, - "type": "enum" - } - } - ], - "inputDelimiter": ",\n\t\t\t", - "type": "generic" - } - } - ], - "inputDelimiter": ",\n\t\t", - "type": "generic" - } - }, - { - "type": "template", - "value": { - "imports": [], - "isOptional": true, - "templateString": "foo=$FERN_INPUT", - "templateInputs": [ - { - "location": "BODY", - "path": "foo", - "type": "payload" - } - ], - "type": "generic" - } - } - ], - "inputDelimiter": ",\n\t", - "type": "generic" - }, - "type": "v1" - } - } - } -] \ No newline at end of file diff --git a/seed/python-sdk/inline-types/snippet.json b/seed/python-sdk/inline-types/snippet.json deleted file mode 100644 index 8923dc7cfa7..00000000000 --- a/seed/python-sdk/inline-types/snippet.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "types": {}, - "endpoints": [ - { - "example_identifier": "default", - "id": { - "path": "/root/root", - "method": "POST", - "identifier_override": "endpoint_.getRoot" - }, - "snippet": { - "sync_client": "from seed import InlineType1, NestedInlineType1, SeedObject\n\nclient = SeedObject(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.get_root(\n bar=InlineType1(\n foo=\"foo\",\n bar=NestedInlineType1(\n foo=\"foo\",\n bar=\"bar\",\n my_enum=\"SUNNY\",\n ),\n ),\n foo=\"foo\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedObject, InlineType1, NestedInlineType1\n\nclient = AsyncSeedObject(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.get_root(\n bar=InlineType1(\n foo=\"foo\",\n bar=NestedInlineType1(\n foo=\"foo\",\n bar=\"bar\",\n my_enum=\"SUNNY\",\n ),\n ),\n foo=\"foo\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - } - ] -} \ No newline at end of file diff --git a/seed/python-sdk/inline-types/src/seed/__init__.py b/seed/python-sdk/inline-types/src/seed/__init__.py deleted file mode 100644 index 8f8ec3e978f..00000000000 --- a/seed/python-sdk/inline-types/src/seed/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .types import ( - InlineEnum, - InlineType1, - InlineType2, - InlinedDiscriminatedUnion1, - InlinedDiscriminatedUnion1_Type1, - InlinedDiscriminatedUnion1_Type2, - InlinedUndiscriminatedUnion1, - NestedInlineType1, - RootType1, -) -from .client import AsyncSeedObject, SeedObject -from .version import __version__ - -__all__ = [ - "AsyncSeedObject", - "InlineEnum", - "InlineType1", - "InlineType2", - "InlinedDiscriminatedUnion1", - "InlinedDiscriminatedUnion1_Type1", - "InlinedDiscriminatedUnion1_Type2", - "InlinedUndiscriminatedUnion1", - "NestedInlineType1", - "RootType1", - "SeedObject", - "__version__", -] diff --git a/seed/python-sdk/inline-types/src/seed/client.py b/seed/python-sdk/inline-types/src/seed/client.py deleted file mode 100644 index e1a24da7fe9..00000000000 --- a/seed/python-sdk/inline-types/src/seed/client.py +++ /dev/null @@ -1,244 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -import httpx -from .core.client_wrapper import SyncClientWrapper -from .types.inline_type_1 import InlineType1 -from .core.request_options import RequestOptions -from .types.root_type_1 import RootType1 -from .core.serialization import convert_and_respect_annotation_metadata -from .core.pydantic_utilities import parse_obj_as -from json.decoder import JSONDecodeError -from .core.api_error import ApiError -from .core.client_wrapper import AsyncClientWrapper - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class SeedObject: - """ - Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. - - Parameters - ---------- - base_url : str - The base url to use for requests from the client. - - timeout : typing.Optional[float] - The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. - - follow_redirects : typing.Optional[bool] - Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. - - httpx_client : typing.Optional[httpx.Client] - The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. - - Examples - -------- - from seed import SeedObject - - client = SeedObject( - base_url="https://yourhost.com/path/to/api", - ) - """ - - def __init__( - self, - *, - base_url: str, - timeout: typing.Optional[float] = None, - follow_redirects: typing.Optional[bool] = True, - httpx_client: typing.Optional[httpx.Client] = None, - ): - _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None - self._client_wrapper = SyncClientWrapper( - base_url=base_url, - httpx_client=httpx_client - if httpx_client is not None - else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) - if follow_redirects is not None - else httpx.Client(timeout=_defaulted_timeout), - timeout=_defaulted_timeout, - ) - - def get_root( - self, *, bar: InlineType1, foo: str, request_options: typing.Optional[RequestOptions] = None - ) -> RootType1: - """ - Parameters - ---------- - bar : InlineType1 - - foo : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - RootType1 - - Examples - -------- - from seed import InlineType1, NestedInlineType1, SeedObject - - client = SeedObject( - base_url="https://yourhost.com/path/to/api", - ) - client.get_root( - bar=InlineType1( - foo="foo", - bar=NestedInlineType1( - foo="foo", - bar="bar", - my_enum="SUNNY", - ), - ), - foo="foo", - ) - """ - _response = self._client_wrapper.httpx_client.request( - "root/root", - method="POST", - json={ - "bar": convert_and_respect_annotation_metadata(object_=bar, annotation=InlineType1, direction="write"), - "foo": foo, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - RootType1, - parse_obj_as( - type_=RootType1, # type: ignore - object_=_response.json(), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) - - -class AsyncSeedObject: - """ - Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. - - Parameters - ---------- - base_url : str - The base url to use for requests from the client. - - timeout : typing.Optional[float] - The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. - - follow_redirects : typing.Optional[bool] - Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. - - httpx_client : typing.Optional[httpx.AsyncClient] - The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. - - Examples - -------- - from seed import AsyncSeedObject - - client = AsyncSeedObject( - base_url="https://yourhost.com/path/to/api", - ) - """ - - def __init__( - self, - *, - base_url: str, - timeout: typing.Optional[float] = None, - follow_redirects: typing.Optional[bool] = True, - httpx_client: typing.Optional[httpx.AsyncClient] = None, - ): - _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None - self._client_wrapper = AsyncClientWrapper( - base_url=base_url, - httpx_client=httpx_client - if httpx_client is not None - else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) - if follow_redirects is not None - else httpx.AsyncClient(timeout=_defaulted_timeout), - timeout=_defaulted_timeout, - ) - - async def get_root( - self, *, bar: InlineType1, foo: str, request_options: typing.Optional[RequestOptions] = None - ) -> RootType1: - """ - Parameters - ---------- - bar : InlineType1 - - foo : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - RootType1 - - Examples - -------- - import asyncio - - from seed import AsyncSeedObject, InlineType1, NestedInlineType1 - - client = AsyncSeedObject( - base_url="https://yourhost.com/path/to/api", - ) - - - async def main() -> None: - await client.get_root( - bar=InlineType1( - foo="foo", - bar=NestedInlineType1( - foo="foo", - bar="bar", - my_enum="SUNNY", - ), - ), - foo="foo", - ) - - - asyncio.run(main()) - """ - _response = await self._client_wrapper.httpx_client.request( - "root/root", - method="POST", - json={ - "bar": convert_and_respect_annotation_metadata(object_=bar, annotation=InlineType1, direction="write"), - "foo": foo, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - return typing.cast( - RootType1, - parse_obj_as( - type_=RootType1, # type: ignore - object_=_response.json(), - ), - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, body=_response.text) - raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/inline-types/src/seed/core/__init__.py b/seed/python-sdk/inline-types/src/seed/core/__init__.py deleted file mode 100644 index f03aecbfe18..00000000000 --- a/seed/python-sdk/inline-types/src/seed/core/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .api_error import ApiError -from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper -from .datetime_utils import serialize_datetime -from .file import File, convert_file_dict_to_httpx_tuples, with_content_type -from .http_client import AsyncHttpClient, HttpClient -from .jsonable_encoder import jsonable_encoder -from .pydantic_utilities import ( - IS_PYDANTIC_V2, - UniversalBaseModel, - UniversalRootModel, - parse_obj_as, - universal_field_validator, - universal_root_validator, - update_forward_refs, -) -from .query_encoder import encode_query -from .remove_none_from_dict import remove_none_from_dict -from .request_options import RequestOptions -from .serialization import FieldMetadata, convert_and_respect_annotation_metadata - -__all__ = [ - "ApiError", - "AsyncClientWrapper", - "AsyncHttpClient", - "BaseClientWrapper", - "FieldMetadata", - "File", - "HttpClient", - "IS_PYDANTIC_V2", - "RequestOptions", - "SyncClientWrapper", - "UniversalBaseModel", - "UniversalRootModel", - "convert_and_respect_annotation_metadata", - "convert_file_dict_to_httpx_tuples", - "encode_query", - "jsonable_encoder", - "parse_obj_as", - "remove_none_from_dict", - "serialize_datetime", - "universal_field_validator", - "universal_root_validator", - "update_forward_refs", - "with_content_type", -] diff --git a/seed/python-sdk/inline-types/src/seed/core/api_error.py b/seed/python-sdk/inline-types/src/seed/core/api_error.py deleted file mode 100644 index 2e9fc5431cd..00000000000 --- a/seed/python-sdk/inline-types/src/seed/core/api_error.py +++ /dev/null @@ -1,15 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - - -class ApiError(Exception): - status_code: typing.Optional[int] - body: typing.Any - - def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None): - self.status_code = status_code - self.body = body - - def __str__(self) -> str: - return f"status_code: {self.status_code}, body: {self.body}" diff --git a/seed/python-sdk/inline-types/src/seed/core/client_wrapper.py b/seed/python-sdk/inline-types/src/seed/core/client_wrapper.py deleted file mode 100644 index 95d27752c65..00000000000 --- a/seed/python-sdk/inline-types/src/seed/core/client_wrapper.py +++ /dev/null @@ -1,48 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -import httpx -from .http_client import HttpClient -from .http_client import AsyncHttpClient - - -class BaseClientWrapper: - def __init__(self, *, base_url: str, timeout: typing.Optional[float] = None): - self._base_url = base_url - self._timeout = timeout - - def get_headers(self) -> typing.Dict[str, str]: - headers: typing.Dict[str, str] = { - "X-Fern-Language": "Python", - "X-Fern-SDK-Name": "fern_inline-types", - "X-Fern-SDK-Version": "0.0.1", - } - return headers - - def get_base_url(self) -> str: - return self._base_url - - def get_timeout(self) -> typing.Optional[float]: - return self._timeout - - -class SyncClientWrapper(BaseClientWrapper): - def __init__(self, *, base_url: str, timeout: typing.Optional[float] = None, httpx_client: httpx.Client): - super().__init__(base_url=base_url, timeout=timeout) - self.httpx_client = HttpClient( - httpx_client=httpx_client, - base_headers=self.get_headers, - base_timeout=self.get_timeout, - base_url=self.get_base_url, - ) - - -class AsyncClientWrapper(BaseClientWrapper): - def __init__(self, *, base_url: str, timeout: typing.Optional[float] = None, httpx_client: httpx.AsyncClient): - super().__init__(base_url=base_url, timeout=timeout) - self.httpx_client = AsyncHttpClient( - httpx_client=httpx_client, - base_headers=self.get_headers, - base_timeout=self.get_timeout, - base_url=self.get_base_url, - ) diff --git a/seed/python-sdk/inline-types/src/seed/core/datetime_utils.py b/seed/python-sdk/inline-types/src/seed/core/datetime_utils.py deleted file mode 100644 index 7c9864a944c..00000000000 --- a/seed/python-sdk/inline-types/src/seed/core/datetime_utils.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt - - -def serialize_datetime(v: dt.datetime) -> str: - """ - Serialize a datetime including timezone info. - - Uses the timezone info provided if present, otherwise uses the current runtime's timezone info. - - UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00. - """ - - def _serialize_zoned_datetime(v: dt.datetime) -> str: - if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None): - # UTC is a special case where we use "Z" at the end instead of "+00:00" - return v.isoformat().replace("+00:00", "Z") - else: - # Delegate to the typical +/- offset format - return v.isoformat() - - if v.tzinfo is not None: - return _serialize_zoned_datetime(v) - else: - local_tz = dt.datetime.now().astimezone().tzinfo - localized_dt = v.replace(tzinfo=local_tz) - return _serialize_zoned_datetime(localized_dt) diff --git a/seed/python-sdk/inline-types/src/seed/core/file.py b/seed/python-sdk/inline-types/src/seed/core/file.py deleted file mode 100644 index 44b0d27c089..00000000000 --- a/seed/python-sdk/inline-types/src/seed/core/file.py +++ /dev/null @@ -1,67 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import IO, Dict, List, Mapping, Optional, Tuple, Union, cast - -# File typing inspired by the flexibility of types within the httpx library -# https://github.com/encode/httpx/blob/master/httpx/_types.py -FileContent = Union[IO[bytes], bytes, str] -File = Union[ - # file (or bytes) - FileContent, - # (filename, file (or bytes)) - Tuple[Optional[str], FileContent], - # (filename, file (or bytes), content_type) - Tuple[Optional[str], FileContent, Optional[str]], - # (filename, file (or bytes), content_type, headers) - Tuple[ - Optional[str], - FileContent, - Optional[str], - Mapping[str, str], - ], -] - - -def convert_file_dict_to_httpx_tuples( - d: Dict[str, Union[File, List[File]]], -) -> List[Tuple[str, File]]: - """ - The format we use is a list of tuples, where the first element is the - name of the file and the second is the file object. Typically HTTPX wants - a dict, but to be able to send lists of files, you have to use the list - approach (which also works for non-lists) - https://github.com/encode/httpx/pull/1032 - """ - - httpx_tuples = [] - for key, file_like in d.items(): - if isinstance(file_like, list): - for file_like_item in file_like: - httpx_tuples.append((key, file_like_item)) - else: - httpx_tuples.append((key, file_like)) - return httpx_tuples - - -def with_content_type(*, file: File, default_content_type: str) -> File: - """ - This function resolves to the file's content type, if provided, and defaults - to the default_content_type value if not. - """ - if isinstance(file, tuple): - if len(file) == 2: - filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore - return (filename, content, default_content_type) - elif len(file) == 3: - filename, content, file_content_type = cast(Tuple[Optional[str], FileContent, Optional[str]], file) # type: ignore - out_content_type = file_content_type or default_content_type - return (filename, content, out_content_type) - elif len(file) == 4: - filename, content, file_content_type, headers = cast( # type: ignore - Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], file - ) - out_content_type = file_content_type or default_content_type - return (filename, content, out_content_type, headers) - else: - raise ValueError(f"Unexpected tuple length: {len(file)}") - return (None, file, default_content_type) diff --git a/seed/python-sdk/inline-types/src/seed/core/http_client.py b/seed/python-sdk/inline-types/src/seed/core/http_client.py deleted file mode 100644 index 1a1a1311a66..00000000000 --- a/seed/python-sdk/inline-types/src/seed/core/http_client.py +++ /dev/null @@ -1,499 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import asyncio -import email.utils -import json -import re -import time -import typing -import urllib.parse -from contextlib import asynccontextmanager, contextmanager -from random import random - -import httpx - -from .file import File, convert_file_dict_to_httpx_tuples -from .jsonable_encoder import jsonable_encoder -from .query_encoder import encode_query -from .remove_none_from_dict import remove_none_from_dict -from .request_options import RequestOptions - -INITIAL_RETRY_DELAY_SECONDS = 0.5 -MAX_RETRY_DELAY_SECONDS = 10 -MAX_RETRY_DELAY_SECONDS_FROM_HEADER = 30 - - -def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]: - """ - This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait. - - Inspired by the urllib3 retry implementation. - """ - retry_after_ms = response_headers.get("retry-after-ms") - if retry_after_ms is not None: - try: - return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0 - except Exception: - pass - - retry_after = response_headers.get("retry-after") - if retry_after is None: - return None - - # Attempt to parse the header as an int. - if re.match(r"^\s*[0-9]+\s*$", retry_after): - seconds = float(retry_after) - # Fallback to parsing it as a date. - else: - retry_date_tuple = email.utils.parsedate_tz(retry_after) - if retry_date_tuple is None: - return None - if retry_date_tuple[9] is None: # Python 2 - # Assume UTC if no timezone was specified - # On Python2.7, parsedate_tz returns None for a timezone offset - # instead of 0 if no timezone is given, where mktime_tz treats - # a None timezone offset as local time. - retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:] - - retry_date = email.utils.mktime_tz(retry_date_tuple) - seconds = retry_date - time.time() - - if seconds < 0: - seconds = 0 - - return seconds - - -def _retry_timeout(response: httpx.Response, retries: int) -> float: - """ - Determine the amount of time to wait before retrying a request. - This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff - with a jitter to determine the number of seconds to wait. - """ - - # If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says. - retry_after = _parse_retry_after(response.headers) - if retry_after is not None and retry_after <= MAX_RETRY_DELAY_SECONDS_FROM_HEADER: - return retry_after - - # Apply exponential backoff, capped at MAX_RETRY_DELAY_SECONDS. - retry_delay = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS) - - # Add a randomness / jitter to the retry delay to avoid overwhelming the server with retries. - timeout = retry_delay * (1 - 0.25 * random()) - return timeout if timeout >= 0 else 0 - - -def _should_retry(response: httpx.Response) -> bool: - retriable_400s = [429, 408, 409] - return response.status_code >= 500 or response.status_code in retriable_400s - - -def remove_omit_from_dict( - original: typing.Dict[str, typing.Optional[typing.Any]], - omit: typing.Optional[typing.Any], -) -> typing.Dict[str, typing.Any]: - if omit is None: - return original - new: typing.Dict[str, typing.Any] = {} - for key, value in original.items(): - if value is not omit: - new[key] = value - return new - - -def maybe_filter_request_body( - data: typing.Optional[typing.Any], - request_options: typing.Optional[RequestOptions], - omit: typing.Optional[typing.Any], -) -> typing.Optional[typing.Any]: - if data is None: - return ( - jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} - if request_options is not None - else None - ) - elif not isinstance(data, typing.Mapping): - data_content = jsonable_encoder(data) - else: - data_content = { - **(jsonable_encoder(remove_omit_from_dict(data, omit))), # type: ignore - **( - jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} - if request_options is not None - else {} - ), - } - return data_content - - -# Abstracted out for testing purposes -def get_request_body( - *, - json: typing.Optional[typing.Any], - data: typing.Optional[typing.Any], - request_options: typing.Optional[RequestOptions], - omit: typing.Optional[typing.Any], -) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Any]]: - json_body = None - data_body = None - if data is not None: - data_body = maybe_filter_request_body(data, request_options, omit) - else: - # If both data and json are None, we send json data in the event extra properties are specified - json_body = maybe_filter_request_body(json, request_options, omit) - - # If you have an empty JSON body, you should just send None - return (json_body if json_body != {} else None), data_body if data_body != {} else None - - -class HttpClient: - def __init__( - self, - *, - httpx_client: httpx.Client, - base_timeout: typing.Callable[[], typing.Optional[float]], - base_headers: typing.Callable[[], typing.Dict[str, str]], - base_url: typing.Optional[typing.Callable[[], str]] = None, - ): - self.base_url = base_url - self.base_timeout = base_timeout - self.base_headers = base_headers - self.httpx_client = httpx_client - - def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: - base_url = maybe_base_url - if self.base_url is not None and base_url is None: - base_url = self.base_url() - - if base_url is None: - raise ValueError("A base_url is required to make this request, please provide one and try again.") - return base_url - - def request( - self, - path: typing.Optional[str] = None, - *, - method: str, - base_url: typing.Optional[str] = None, - params: typing.Optional[typing.Dict[str, typing.Any]] = None, - json: typing.Optional[typing.Any] = None, - data: typing.Optional[typing.Any] = None, - content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, - headers: typing.Optional[typing.Dict[str, typing.Any]] = None, - request_options: typing.Optional[RequestOptions] = None, - retries: int = 0, - omit: typing.Optional[typing.Any] = None, - ) -> httpx.Response: - base_url = self.get_base_url(base_url) - timeout = ( - request_options.get("timeout_in_seconds") - if request_options is not None and request_options.get("timeout_in_seconds") is not None - else self.base_timeout() - ) - - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - - response = self.httpx_client.request( - method=method, - url=urllib.parse.urljoin(f"{base_url}/", path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **self.base_headers(), - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), - } - ) - ), - params=encode_query( - jsonable_encoder( - remove_none_from_dict( - remove_omit_from_dict( - { - **(params if params is not None else {}), - **( - request_options.get("additional_query_parameters", {}) or {} - if request_options is not None - else {} - ), - }, - omit, - ) - ) - ) - ), - json=json_body, - data=data_body, - content=content, - files=( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit) - else None - ), - timeout=timeout, - ) - - max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 - if _should_retry(response=response): - if max_retries > retries: - time.sleep(_retry_timeout(response=response, retries=retries)) - return self.request( - path=path, - method=method, - base_url=base_url, - params=params, - json=json, - content=content, - files=files, - headers=headers, - request_options=request_options, - retries=retries + 1, - omit=omit, - ) - - return response - - @contextmanager - def stream( - self, - path: typing.Optional[str] = None, - *, - method: str, - base_url: typing.Optional[str] = None, - params: typing.Optional[typing.Dict[str, typing.Any]] = None, - json: typing.Optional[typing.Any] = None, - data: typing.Optional[typing.Any] = None, - content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, - headers: typing.Optional[typing.Dict[str, typing.Any]] = None, - request_options: typing.Optional[RequestOptions] = None, - retries: int = 0, - omit: typing.Optional[typing.Any] = None, - ) -> typing.Iterator[httpx.Response]: - base_url = self.get_base_url(base_url) - timeout = ( - request_options.get("timeout_in_seconds") - if request_options is not None and request_options.get("timeout_in_seconds") is not None - else self.base_timeout() - ) - - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - - with self.httpx_client.stream( - method=method, - url=urllib.parse.urljoin(f"{base_url}/", path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **self.base_headers(), - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) if request_options is not None else {}), - } - ) - ), - params=encode_query( - jsonable_encoder( - remove_none_from_dict( - remove_omit_from_dict( - { - **(params if params is not None else {}), - **( - request_options.get("additional_query_parameters", {}) - if request_options is not None - else {} - ), - }, - omit, - ) - ) - ) - ), - json=json_body, - data=data_body, - content=content, - files=( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit) - else None - ), - timeout=timeout, - ) as stream: - yield stream - - -class AsyncHttpClient: - def __init__( - self, - *, - httpx_client: httpx.AsyncClient, - base_timeout: typing.Callable[[], typing.Optional[float]], - base_headers: typing.Callable[[], typing.Dict[str, str]], - base_url: typing.Optional[typing.Callable[[], str]] = None, - ): - self.base_url = base_url - self.base_timeout = base_timeout - self.base_headers = base_headers - self.httpx_client = httpx_client - - def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: - base_url = maybe_base_url - if self.base_url is not None and base_url is None: - base_url = self.base_url() - - if base_url is None: - raise ValueError("A base_url is required to make this request, please provide one and try again.") - return base_url - - async def request( - self, - path: typing.Optional[str] = None, - *, - method: str, - base_url: typing.Optional[str] = None, - params: typing.Optional[typing.Dict[str, typing.Any]] = None, - json: typing.Optional[typing.Any] = None, - data: typing.Optional[typing.Any] = None, - content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, - headers: typing.Optional[typing.Dict[str, typing.Any]] = None, - request_options: typing.Optional[RequestOptions] = None, - retries: int = 0, - omit: typing.Optional[typing.Any] = None, - ) -> httpx.Response: - base_url = self.get_base_url(base_url) - timeout = ( - request_options.get("timeout_in_seconds") - if request_options is not None and request_options.get("timeout_in_seconds") is not None - else self.base_timeout() - ) - - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - - # Add the input to each of these and do None-safety checks - response = await self.httpx_client.request( - method=method, - url=urllib.parse.urljoin(f"{base_url}/", path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **self.base_headers(), - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), - } - ) - ), - params=encode_query( - jsonable_encoder( - remove_none_from_dict( - remove_omit_from_dict( - { - **(params if params is not None else {}), - **( - request_options.get("additional_query_parameters", {}) or {} - if request_options is not None - else {} - ), - }, - omit, - ) - ) - ) - ), - json=json_body, - data=data_body, - content=content, - files=( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if files is not None - else None - ), - timeout=timeout, - ) - - max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 - if _should_retry(response=response): - if max_retries > retries: - await asyncio.sleep(_retry_timeout(response=response, retries=retries)) - return await self.request( - path=path, - method=method, - base_url=base_url, - params=params, - json=json, - content=content, - files=files, - headers=headers, - request_options=request_options, - retries=retries + 1, - omit=omit, - ) - return response - - @asynccontextmanager - async def stream( - self, - path: typing.Optional[str] = None, - *, - method: str, - base_url: typing.Optional[str] = None, - params: typing.Optional[typing.Dict[str, typing.Any]] = None, - json: typing.Optional[typing.Any] = None, - data: typing.Optional[typing.Any] = None, - content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, - headers: typing.Optional[typing.Dict[str, typing.Any]] = None, - request_options: typing.Optional[RequestOptions] = None, - retries: int = 0, - omit: typing.Optional[typing.Any] = None, - ) -> typing.AsyncIterator[httpx.Response]: - base_url = self.get_base_url(base_url) - timeout = ( - request_options.get("timeout_in_seconds") - if request_options is not None and request_options.get("timeout_in_seconds") is not None - else self.base_timeout() - ) - - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - - async with self.httpx_client.stream( - method=method, - url=urllib.parse.urljoin(f"{base_url}/", path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **self.base_headers(), - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) if request_options is not None else {}), - } - ) - ), - params=encode_query( - jsonable_encoder( - remove_none_from_dict( - remove_omit_from_dict( - { - **(params if params is not None else {}), - **( - request_options.get("additional_query_parameters", {}) - if request_options is not None - else {} - ), - }, - omit=omit, - ) - ) - ) - ), - json=json_body, - data=data_body, - content=content, - files=( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if files is not None - else None - ), - timeout=timeout, - ) as stream: - yield stream diff --git a/seed/python-sdk/inline-types/src/seed/core/jsonable_encoder.py b/seed/python-sdk/inline-types/src/seed/core/jsonable_encoder.py deleted file mode 100644 index 1b631e9017c..00000000000 --- a/seed/python-sdk/inline-types/src/seed/core/jsonable_encoder.py +++ /dev/null @@ -1,101 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -""" -jsonable_encoder converts a Python object to a JSON-friendly dict -(e.g. datetimes to strings, Pydantic models to dicts). - -Taken from FastAPI, and made a bit simpler -https://github.com/tiangolo/fastapi/blob/master/fastapi/encoders.py -""" - -import base64 -import dataclasses -import datetime as dt -from enum import Enum -from pathlib import PurePath -from types import GeneratorType -from typing import Any, Callable, Dict, List, Optional, Set, Union - -import pydantic - -from .datetime_utils import serialize_datetime -from .pydantic_utilities import ( - IS_PYDANTIC_V2, - encode_by_type, - to_jsonable_with_fallback, -) - -SetIntStr = Set[Union[int, str]] -DictIntStrAny = Dict[Union[int, str], Any] - - -def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any: - custom_encoder = custom_encoder or {} - if custom_encoder: - if type(obj) in custom_encoder: - return custom_encoder[type(obj)](obj) - else: - for encoder_type, encoder_instance in custom_encoder.items(): - if isinstance(obj, encoder_type): - return encoder_instance(obj) - if isinstance(obj, pydantic.BaseModel): - if IS_PYDANTIC_V2: - encoder = getattr(obj.model_config, "json_encoders", {}) # type: ignore # Pydantic v2 - else: - encoder = getattr(obj.__config__, "json_encoders", {}) # type: ignore # Pydantic v1 - if custom_encoder: - encoder.update(custom_encoder) - obj_dict = obj.dict(by_alias=True) - if "__root__" in obj_dict: - obj_dict = obj_dict["__root__"] - if "root" in obj_dict: - obj_dict = obj_dict["root"] - return jsonable_encoder(obj_dict, custom_encoder=encoder) - if dataclasses.is_dataclass(obj): - obj_dict = dataclasses.asdict(obj) # type: ignore - return jsonable_encoder(obj_dict, custom_encoder=custom_encoder) - if isinstance(obj, bytes): - return base64.b64encode(obj).decode("utf-8") - if isinstance(obj, Enum): - return obj.value - if isinstance(obj, PurePath): - return str(obj) - if isinstance(obj, (str, int, float, type(None))): - return obj - if isinstance(obj, dt.datetime): - return serialize_datetime(obj) - if isinstance(obj, dt.date): - return str(obj) - if isinstance(obj, dict): - encoded_dict = {} - allowed_keys = set(obj.keys()) - for key, value in obj.items(): - if key in allowed_keys: - encoded_key = jsonable_encoder(key, custom_encoder=custom_encoder) - encoded_value = jsonable_encoder(value, custom_encoder=custom_encoder) - encoded_dict[encoded_key] = encoded_value - return encoded_dict - if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)): - encoded_list = [] - for item in obj: - encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder)) - return encoded_list - - def fallback_serializer(o: Any) -> Any: - attempt_encode = encode_by_type(o) - if attempt_encode is not None: - return attempt_encode - - try: - data = dict(o) - except Exception as e: - errors: List[Exception] = [] - errors.append(e) - try: - data = vars(o) - except Exception as e: - errors.append(e) - raise ValueError(errors) from e - return jsonable_encoder(data, custom_encoder=custom_encoder) - - return to_jsonable_with_fallback(obj, fallback_serializer) diff --git a/seed/python-sdk/inline-types/src/seed/core/pydantic_utilities.py b/seed/python-sdk/inline-types/src/seed/core/pydantic_utilities.py deleted file mode 100644 index ee8f0e4105f..00000000000 --- a/seed/python-sdk/inline-types/src/seed/core/pydantic_utilities.py +++ /dev/null @@ -1,296 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# nopycln: file -import datetime as dt -import typing -from collections import defaultdict - -import typing_extensions - -import pydantic - -from .datetime_utils import serialize_datetime -from .serialization import convert_and_respect_annotation_metadata - -IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") - -if IS_PYDANTIC_V2: - # isort will try to reformat the comments on these imports, which breaks mypy - # isort: off - from pydantic.v1.datetime_parse import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 - parse_date as parse_date, - ) - from pydantic.v1.datetime_parse import ( # pyright: ignore[reportMissingImports] # Pydantic v2 - parse_datetime as parse_datetime, - ) - from pydantic.v1.json import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 - ENCODERS_BY_TYPE as encoders_by_type, - ) - from pydantic.v1.typing import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 - get_args as get_args, - ) - from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 - get_origin as get_origin, - ) - from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 - is_literal_type as is_literal_type, - ) - from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 - is_union as is_union, - ) - from pydantic.v1.fields import ModelField as ModelField # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 -else: - from pydantic.datetime_parse import parse_date as parse_date # type: ignore # Pydantic v1 - from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore # Pydantic v1 - from pydantic.fields import ModelField as ModelField # type: ignore # Pydantic v1 - from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore # Pydantic v1 - from pydantic.typing import get_args as get_args # type: ignore # Pydantic v1 - from pydantic.typing import get_origin as get_origin # type: ignore # Pydantic v1 - from pydantic.typing import is_literal_type as is_literal_type # type: ignore # Pydantic v1 - from pydantic.typing import is_union as is_union # type: ignore # Pydantic v1 - - # isort: on - - -T = typing.TypeVar("T") -Model = typing.TypeVar("Model", bound=pydantic.BaseModel) - - -def parse_obj_as(type_: typing.Type[T], object_: typing.Any) -> T: - dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read") - if IS_PYDANTIC_V2: - adapter = pydantic.TypeAdapter(type_) # type: ignore # Pydantic v2 - return adapter.validate_python(dealiased_object) - else: - return pydantic.parse_obj_as(type_, dealiased_object) - - -def to_jsonable_with_fallback( - obj: typing.Any, fallback_serializer: typing.Callable[[typing.Any], typing.Any] -) -> typing.Any: - if IS_PYDANTIC_V2: - from pydantic_core import to_jsonable_python - - return to_jsonable_python(obj, fallback=fallback_serializer) - else: - return fallback_serializer(obj) - - -class UniversalBaseModel(pydantic.BaseModel): - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( - # Allow fields begining with `model_` to be used in the model - protected_namespaces=(), - ) # type: ignore # Pydantic v2 - - @pydantic.model_serializer(mode="wrap", when_used="json") # type: ignore # Pydantic v2 - def serialize_model(self, handler: pydantic.SerializerFunctionWrapHandler) -> typing.Any: # type: ignore # Pydantic v2 - serialized = handler(self) - data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()} - return data - - else: - - class Config: - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} - - @classmethod - def model_construct( - cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> "Model": - dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") - return cls.construct(_fields_set, **dealiased_object) - - @classmethod - def construct( - cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> "Model": - dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") - if IS_PYDANTIC_V2: - return super().model_construct(_fields_set, **dealiased_object) # type: ignore # Pydantic v2 - else: - return super().construct(_fields_set, **dealiased_object) - - def json(self, **kwargs: typing.Any) -> str: - kwargs_with_defaults: typing.Any = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - if IS_PYDANTIC_V2: - return super().model_dump_json(**kwargs_with_defaults) # type: ignore # Pydantic v2 - else: - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: - """ - Override the default dict method to `exclude_unset` by default. This function patches - `exclude_unset` to work include fields within non-None default values. - """ - # Note: the logic here is multi-plexed given the levers exposed in Pydantic V1 vs V2 - # Pydantic V1's .dict can be extremely slow, so we do not want to call it twice. - # - # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models - # that we have less control over, and this is less intrusive than custom serializers for now. - if IS_PYDANTIC_V2: - kwargs_with_defaults_exclude_unset: typing.Any = { - **kwargs, - "by_alias": True, - "exclude_unset": True, - "exclude_none": False, - } - kwargs_with_defaults_exclude_none: typing.Any = { - **kwargs, - "by_alias": True, - "exclude_none": True, - "exclude_unset": False, - } - dict_dump = deep_union_pydantic_dicts( - super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore # Pydantic v2 - super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore # Pydantic v2 - ) - - else: - _fields_set = self.__fields_set__.copy() - - fields = _get_model_fields(self.__class__) - for name, field in fields.items(): - if name not in _fields_set: - default = _get_field_default(field) - - # If the default values are non-null act like they've been set - # This effectively allows exclude_unset to work like exclude_none where - # the latter passes through intentionally set none values. - if default is not None or ("exclude_unset" in kwargs and not kwargs["exclude_unset"]): - _fields_set.add(name) - - if default is not None: - self.__fields_set__.add(name) - - kwargs_with_defaults_exclude_unset_include_fields: typing.Any = { - "by_alias": True, - "exclude_unset": True, - "include": _fields_set, - **kwargs, - } - - dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields) - - return convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write") - - -def _union_list_of_pydantic_dicts( - source: typing.List[typing.Any], destination: typing.List[typing.Any] -) -> typing.List[typing.Any]: - converted_list: typing.List[typing.Any] = [] - for i, item in enumerate(source): - destination_value = destination[i] # type: ignore - if isinstance(item, dict): - converted_list.append(deep_union_pydantic_dicts(item, destination_value)) - elif isinstance(item, list): - converted_list.append(_union_list_of_pydantic_dicts(item, destination_value)) - else: - converted_list.append(item) - return converted_list - - -def deep_union_pydantic_dicts( - source: typing.Dict[str, typing.Any], destination: typing.Dict[str, typing.Any] -) -> typing.Dict[str, typing.Any]: - for key, value in source.items(): - node = destination.setdefault(key, {}) - if isinstance(value, dict): - deep_union_pydantic_dicts(value, node) - # Note: we do not do this same processing for sets given we do not have sets of models - # and given the sets are unordered, the processing of the set and matching objects would - # be non-trivial. - elif isinstance(value, list): - destination[key] = _union_list_of_pydantic_dicts(value, node) - else: - destination[key] = value - - return destination - - -if IS_PYDANTIC_V2: - - class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore # Pydantic v2 - pass - - UniversalRootModel: typing_extensions.TypeAlias = V2RootModel # type: ignore -else: - UniversalRootModel: typing_extensions.TypeAlias = UniversalBaseModel # type: ignore - - -def encode_by_type(o: typing.Any) -> typing.Any: - encoders_by_class_tuples: typing.Dict[typing.Callable[[typing.Any], typing.Any], typing.Tuple[typing.Any, ...]] = ( - defaultdict(tuple) - ) - for type_, encoder in encoders_by_type.items(): - encoders_by_class_tuples[encoder] += (type_,) - - if type(o) in encoders_by_type: - return encoders_by_type[type(o)](o) - for encoder, classes_tuple in encoders_by_class_tuples.items(): - if isinstance(o, classes_tuple): - return encoder(o) - - -def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None: - if IS_PYDANTIC_V2: - model.model_rebuild(raise_errors=False) # type: ignore # Pydantic v2 - else: - model.update_forward_refs(**localns) - - -# Mirrors Pydantic's internal typing -AnyCallable = typing.Callable[..., typing.Any] - - -def universal_root_validator( - pre: bool = False, -) -> typing.Callable[[AnyCallable], AnyCallable]: - def decorator(func: AnyCallable) -> AnyCallable: - if IS_PYDANTIC_V2: - return pydantic.model_validator(mode="before" if pre else "after")(func) # type: ignore # Pydantic v2 - else: - return pydantic.root_validator(pre=pre)(func) # type: ignore # Pydantic v1 - - return decorator - - -def universal_field_validator(field_name: str, pre: bool = False) -> typing.Callable[[AnyCallable], AnyCallable]: - def decorator(func: AnyCallable) -> AnyCallable: - if IS_PYDANTIC_V2: - return pydantic.field_validator(field_name, mode="before" if pre else "after")(func) # type: ignore # Pydantic v2 - else: - return pydantic.validator(field_name, pre=pre)(func) # type: ignore # Pydantic v1 - - return decorator - - -PydanticField = typing.Union[ModelField, pydantic.fields.FieldInfo] - - -def _get_model_fields( - model: typing.Type["Model"], -) -> typing.Mapping[str, PydanticField]: - if IS_PYDANTIC_V2: - return model.model_fields # type: ignore # Pydantic v2 - else: - return model.__fields__ # type: ignore # Pydantic v1 - - -def _get_field_default(field: PydanticField) -> typing.Any: - try: - value = field.get_default() # type: ignore # Pydantic < v1.10.15 - except: - value = field.default - if IS_PYDANTIC_V2: - from pydantic_core import PydanticUndefined - - if value == PydanticUndefined: - return None - return value - return value diff --git a/seed/python-sdk/inline-types/src/seed/core/query_encoder.py b/seed/python-sdk/inline-types/src/seed/core/query_encoder.py deleted file mode 100644 index 3183001d404..00000000000 --- a/seed/python-sdk/inline-types/src/seed/core/query_encoder.py +++ /dev/null @@ -1,58 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict, List, Optional, Tuple - -import pydantic - - -# Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict -def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]: - result = [] - for k, v in dict_flat.items(): - key = f"{key_prefix}[{k}]" if key_prefix is not None else k - if isinstance(v, dict): - result.extend(traverse_query_dict(v, key)) - elif isinstance(v, list): - for arr_v in v: - if isinstance(arr_v, dict): - result.extend(traverse_query_dict(arr_v, key)) - else: - result.append((key, arr_v)) - else: - result.append((key, v)) - return result - - -def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, Any]]: - if isinstance(query_value, pydantic.BaseModel) or isinstance(query_value, dict): - if isinstance(query_value, pydantic.BaseModel): - obj_dict = query_value.dict(by_alias=True) - else: - obj_dict = query_value - return traverse_query_dict(obj_dict, query_key) - elif isinstance(query_value, list): - encoded_values: List[Tuple[str, Any]] = [] - for value in query_value: - if isinstance(value, pydantic.BaseModel) or isinstance(value, dict): - if isinstance(value, pydantic.BaseModel): - obj_dict = value.dict(by_alias=True) - elif isinstance(value, dict): - obj_dict = value - - encoded_values.extend(single_query_encoder(query_key, obj_dict)) - else: - encoded_values.append((query_key, value)) - - return encoded_values - - return [(query_key, query_value)] - - -def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]: - if query is None: - return None - - encoded_query = [] - for k, v in query.items(): - encoded_query.extend(single_query_encoder(k, v)) - return encoded_query diff --git a/seed/python-sdk/inline-types/src/seed/core/remove_none_from_dict.py b/seed/python-sdk/inline-types/src/seed/core/remove_none_from_dict.py deleted file mode 100644 index c2298143f14..00000000000 --- a/seed/python-sdk/inline-types/src/seed/core/remove_none_from_dict.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict, Mapping, Optional - - -def remove_none_from_dict(original: Mapping[str, Optional[Any]]) -> Dict[str, Any]: - new: Dict[str, Any] = {} - for key, value in original.items(): - if value is not None: - new[key] = value - return new diff --git a/seed/python-sdk/inline-types/src/seed/core/request_options.py b/seed/python-sdk/inline-types/src/seed/core/request_options.py deleted file mode 100644 index 1b38804432b..00000000000 --- a/seed/python-sdk/inline-types/src/seed/core/request_options.py +++ /dev/null @@ -1,35 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -try: - from typing import NotRequired # type: ignore -except ImportError: - from typing_extensions import NotRequired - - -class RequestOptions(typing.TypedDict, total=False): - """ - Additional options for request-specific configuration when calling APIs via the SDK. - This is used primarily as an optional final parameter for service functions. - - Attributes: - - timeout_in_seconds: int. The number of seconds to await an API call before timing out. - - - max_retries: int. The max number of retries to attempt if the API call fails. - - - additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict - - - additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict - - - additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict - - - chunk_size: int. The size, in bytes, to process each chunk of data being streamed back within the response. This equates to leveraging `chunk_size` within `requests` or `httpx`, and is only leveraged for file downloads. - """ - - timeout_in_seconds: NotRequired[int] - max_retries: NotRequired[int] - additional_headers: NotRequired[typing.Dict[str, typing.Any]] - additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]] - additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]] - chunk_size: NotRequired[int] diff --git a/seed/python-sdk/inline-types/src/seed/core/serialization.py b/seed/python-sdk/inline-types/src/seed/core/serialization.py deleted file mode 100644 index cb5dcbf93a9..00000000000 --- a/seed/python-sdk/inline-types/src/seed/core/serialization.py +++ /dev/null @@ -1,272 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import collections -import inspect -import typing - -import typing_extensions - -import pydantic - - -class FieldMetadata: - """ - Metadata class used to annotate fields to provide additional information. - - Example: - class MyDict(TypedDict): - field: typing.Annotated[str, FieldMetadata(alias="field_name")] - - Will serialize: `{"field": "value"}` - To: `{"field_name": "value"}` - """ - - alias: str - - def __init__(self, *, alias: str) -> None: - self.alias = alias - - -def convert_and_respect_annotation_metadata( - *, - object_: typing.Any, - annotation: typing.Any, - inner_type: typing.Optional[typing.Any] = None, - direction: typing.Literal["read", "write"], -) -> typing.Any: - """ - Respect the metadata annotations on a field, such as aliasing. This function effectively - manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for - TypedDicts, which cannot support aliasing out of the box, and can be extended for additional - utilities, such as defaults. - - Parameters - ---------- - object_ : typing.Any - - annotation : type - The type we're looking to apply typing annotations from - - inner_type : typing.Optional[type] - - Returns - ------- - typing.Any - """ - - if object_ is None: - return None - if inner_type is None: - inner_type = annotation - - clean_type = _remove_annotations(inner_type) - # Pydantic models - if ( - inspect.isclass(clean_type) - and issubclass(clean_type, pydantic.BaseModel) - and isinstance(object_, typing.Mapping) - ): - return _convert_mapping(object_, clean_type, direction) - # TypedDicts - if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping): - return _convert_mapping(object_, clean_type, direction) - - if ( - typing_extensions.get_origin(clean_type) == typing.Dict - or typing_extensions.get_origin(clean_type) == dict - or clean_type == typing.Dict - ) and isinstance(object_, typing.Dict): - key_type = typing_extensions.get_args(clean_type)[0] - value_type = typing_extensions.get_args(clean_type)[1] - - return { - key: convert_and_respect_annotation_metadata( - object_=value, - annotation=annotation, - inner_type=value_type, - direction=direction, - ) - for key, value in object_.items() - } - - # If you're iterating on a string, do not bother to coerce it to a sequence. - if not isinstance(object_, str): - if ( - typing_extensions.get_origin(clean_type) == typing.Set - or typing_extensions.get_origin(clean_type) == set - or clean_type == typing.Set - ) and isinstance(object_, typing.Set): - inner_type = typing_extensions.get_args(clean_type)[0] - return { - convert_and_respect_annotation_metadata( - object_=item, - annotation=annotation, - inner_type=inner_type, - direction=direction, - ) - for item in object_ - } - elif ( - ( - typing_extensions.get_origin(clean_type) == typing.List - or typing_extensions.get_origin(clean_type) == list - or clean_type == typing.List - ) - and isinstance(object_, typing.List) - ) or ( - ( - typing_extensions.get_origin(clean_type) == typing.Sequence - or typing_extensions.get_origin(clean_type) == collections.abc.Sequence - or clean_type == typing.Sequence - ) - and isinstance(object_, typing.Sequence) - ): - inner_type = typing_extensions.get_args(clean_type)[0] - return [ - convert_and_respect_annotation_metadata( - object_=item, - annotation=annotation, - inner_type=inner_type, - direction=direction, - ) - for item in object_ - ] - - if typing_extensions.get_origin(clean_type) == typing.Union: - # We should be able to ~relatively~ safely try to convert keys against all - # member types in the union, the edge case here is if one member aliases a field - # of the same name to a different name from another member - # Or if another member aliases a field of the same name that another member does not. - for member in typing_extensions.get_args(clean_type): - object_ = convert_and_respect_annotation_metadata( - object_=object_, - annotation=annotation, - inner_type=member, - direction=direction, - ) - return object_ - - annotated_type = _get_annotation(annotation) - if annotated_type is None: - return object_ - - # If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.) - # Then we can safely call it on the recursive conversion. - return object_ - - -def _convert_mapping( - object_: typing.Mapping[str, object], - expected_type: typing.Any, - direction: typing.Literal["read", "write"], -) -> typing.Mapping[str, object]: - converted_object: typing.Dict[str, object] = {} - annotations = typing_extensions.get_type_hints(expected_type, include_extras=True) - aliases_to_field_names = _get_alias_to_field_name(annotations) - for key, value in object_.items(): - if direction == "read" and key in aliases_to_field_names: - dealiased_key = aliases_to_field_names.get(key) - if dealiased_key is not None: - type_ = annotations.get(dealiased_key) - else: - type_ = annotations.get(key) - # Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map - # - # So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias - # then we can just pass the value through as is - if type_ is None: - converted_object[key] = value - elif direction == "read" and key not in aliases_to_field_names: - converted_object[key] = convert_and_respect_annotation_metadata( - object_=value, annotation=type_, direction=direction - ) - else: - converted_object[_alias_key(key, type_, direction, aliases_to_field_names)] = ( - convert_and_respect_annotation_metadata(object_=value, annotation=type_, direction=direction) - ) - return converted_object - - -def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]: - maybe_annotated_type = typing_extensions.get_origin(type_) - if maybe_annotated_type is None: - return None - - if maybe_annotated_type == typing_extensions.NotRequired: - type_ = typing_extensions.get_args(type_)[0] - maybe_annotated_type = typing_extensions.get_origin(type_) - - if maybe_annotated_type == typing_extensions.Annotated: - return type_ - - return None - - -def _remove_annotations(type_: typing.Any) -> typing.Any: - maybe_annotated_type = typing_extensions.get_origin(type_) - if maybe_annotated_type is None: - return type_ - - if maybe_annotated_type == typing_extensions.NotRequired: - return _remove_annotations(typing_extensions.get_args(type_)[0]) - - if maybe_annotated_type == typing_extensions.Annotated: - return _remove_annotations(typing_extensions.get_args(type_)[0]) - - return type_ - - -def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]: - annotations = typing_extensions.get_type_hints(type_, include_extras=True) - return _get_alias_to_field_name(annotations) - - -def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]: - annotations = typing_extensions.get_type_hints(type_, include_extras=True) - return _get_field_to_alias_name(annotations) - - -def _get_alias_to_field_name( - field_to_hint: typing.Dict[str, typing.Any], -) -> typing.Dict[str, str]: - aliases = {} - for field, hint in field_to_hint.items(): - maybe_alias = _get_alias_from_type(hint) - if maybe_alias is not None: - aliases[maybe_alias] = field - return aliases - - -def _get_field_to_alias_name( - field_to_hint: typing.Dict[str, typing.Any], -) -> typing.Dict[str, str]: - aliases = {} - for field, hint in field_to_hint.items(): - maybe_alias = _get_alias_from_type(hint) - if maybe_alias is not None: - aliases[field] = maybe_alias - return aliases - - -def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]: - maybe_annotated_type = _get_annotation(type_) - - if maybe_annotated_type is not None: - # The actual annotations are 1 onward, the first is the annotated type - annotations = typing_extensions.get_args(maybe_annotated_type)[1:] - - for annotation in annotations: - if isinstance(annotation, FieldMetadata) and annotation.alias is not None: - return annotation.alias - return None - - -def _alias_key( - key: str, - type_: typing.Any, - direction: typing.Literal["read", "write"], - aliases_to_field_names: typing.Dict[str, str], -) -> str: - if direction == "read": - return aliases_to_field_names.get(key, key) - return _get_alias_from_type(type_=type_) or key diff --git a/seed/python-sdk/inline-types/src/seed/py.typed b/seed/python-sdk/inline-types/src/seed/py.typed deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/python-sdk/inline-types/src/seed/types/__init__.py b/seed/python-sdk/inline-types/src/seed/types/__init__.py deleted file mode 100644 index 5646342ae20..00000000000 --- a/seed/python-sdk/inline-types/src/seed/types/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from .inline_enum import InlineEnum -from .inline_type_1 import InlineType1 -from .inline_type_2 import InlineType2 -from .inlined_discriminated_union_1 import ( - InlinedDiscriminatedUnion1, - InlinedDiscriminatedUnion1_Type1, - InlinedDiscriminatedUnion1_Type2, -) -from .inlined_undiscriminated_union_1 import InlinedUndiscriminatedUnion1 -from .nested_inline_type_1 import NestedInlineType1 -from .root_type_1 import RootType1 - -__all__ = [ - "InlineEnum", - "InlineType1", - "InlineType2", - "InlinedDiscriminatedUnion1", - "InlinedDiscriminatedUnion1_Type1", - "InlinedDiscriminatedUnion1_Type2", - "InlinedUndiscriminatedUnion1", - "NestedInlineType1", - "RootType1", -] diff --git a/seed/python-sdk/inline-types/src/seed/types/inline_enum.py b/seed/python-sdk/inline-types/src/seed/types/inline_enum.py deleted file mode 100644 index 1692aa9af84..00000000000 --- a/seed/python-sdk/inline-types/src/seed/types/inline_enum.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -InlineEnum = typing.Union[typing.Literal["SUNNY", "CLOUDY", "RAINING", "SNOWING"], typing.Any] diff --git a/seed/python-sdk/inline-types/src/seed/types/inline_type_1.py b/seed/python-sdk/inline-types/src/seed/types/inline_type_1.py deleted file mode 100644 index 4ca2993183e..00000000000 --- a/seed/python-sdk/inline-types/src/seed/types/inline_type_1.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.pydantic_utilities import UniversalBaseModel -from .nested_inline_type_1 import NestedInlineType1 -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class InlineType1(UniversalBaseModel): - foo: str - bar: NestedInlineType1 - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/inline-types/src/seed/types/inline_type_2.py b/seed/python-sdk/inline-types/src/seed/types/inline_type_2.py deleted file mode 100644 index d865dc4db3c..00000000000 --- a/seed/python-sdk/inline-types/src/seed/types/inline_type_2.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.pydantic_utilities import UniversalBaseModel -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class InlineType2(UniversalBaseModel): - baz: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/inline-types/src/seed/types/inlined_discriminated_union_1.py b/seed/python-sdk/inline-types/src/seed/types/inlined_discriminated_union_1.py deleted file mode 100644 index 0cac47b71da..00000000000 --- a/seed/python-sdk/inline-types/src/seed/types/inlined_discriminated_union_1.py +++ /dev/null @@ -1,40 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations -from ..core.pydantic_utilities import UniversalBaseModel -import typing -from .nested_inline_type_1 import NestedInlineType1 -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic - - -class InlinedDiscriminatedUnion1_Type1(UniversalBaseModel): - type: typing.Literal["type1"] = "type1" - foo: str - bar: NestedInlineType1 - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -class InlinedDiscriminatedUnion1_Type2(UniversalBaseModel): - type: typing.Literal["type2"] = "type2" - baz: str - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow - - -InlinedDiscriminatedUnion1 = typing.Union[InlinedDiscriminatedUnion1_Type1, InlinedDiscriminatedUnion1_Type2] diff --git a/seed/python-sdk/inline-types/src/seed/types/inlined_undiscriminated_union_1.py b/seed/python-sdk/inline-types/src/seed/types/inlined_undiscriminated_union_1.py deleted file mode 100644 index aaf1f02b5df..00000000000 --- a/seed/python-sdk/inline-types/src/seed/types/inlined_undiscriminated_union_1.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from .inline_type_1 import InlineType1 -from .inline_type_2 import InlineType2 - -InlinedUndiscriminatedUnion1 = typing.Union[InlineType1, InlineType2] diff --git a/seed/python-sdk/inline-types/src/seed/types/nested_inline_type_1.py b/seed/python-sdk/inline-types/src/seed/types/nested_inline_type_1.py deleted file mode 100644 index 144be43eaa3..00000000000 --- a/seed/python-sdk/inline-types/src/seed/types/nested_inline_type_1.py +++ /dev/null @@ -1,24 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.pydantic_utilities import UniversalBaseModel -import typing_extensions -from .inline_enum import InlineEnum -from ..core.serialization import FieldMetadata -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class NestedInlineType1(UniversalBaseModel): - foo: str - bar: str - my_enum: typing_extensions.Annotated[InlineEnum, FieldMetadata(alias="myEnum")] - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/inline-types/src/seed/types/root_type_1.py b/seed/python-sdk/inline-types/src/seed/types/root_type_1.py deleted file mode 100644 index e24e9d2237e..00000000000 --- a/seed/python-sdk/inline-types/src/seed/types/root_type_1.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.pydantic_utilities import UniversalBaseModel -from .inline_type_1 import InlineType1 -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -import typing -import pydantic - - -class RootType1(UniversalBaseModel): - foo: str - bar: InlineType1 - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/inline-types/src/seed/version.py b/seed/python-sdk/inline-types/src/seed/version.py deleted file mode 100644 index 31ee46c0461..00000000000 --- a/seed/python-sdk/inline-types/src/seed/version.py +++ /dev/null @@ -1,3 +0,0 @@ -from importlib import metadata - -__version__ = metadata.version("fern_inline-types") diff --git a/seed/python-sdk/inline-types/tests/__init__.py b/seed/python-sdk/inline-types/tests/__init__.py deleted file mode 100644 index f3ea2659bb1..00000000000 --- a/seed/python-sdk/inline-types/tests/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - diff --git a/seed/python-sdk/inline-types/tests/conftest.py b/seed/python-sdk/inline-types/tests/conftest.py deleted file mode 100644 index bd27e8b59c3..00000000000 --- a/seed/python-sdk/inline-types/tests/conftest.py +++ /dev/null @@ -1,16 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from seed import SeedObject -import os -import pytest -from seed import AsyncSeedObject - - -@pytest.fixture -def client() -> SeedObject: - return SeedObject(base_url=os.getenv("TESTS_BASE_URL", "base_url")) - - -@pytest.fixture -def async_client() -> AsyncSeedObject: - return AsyncSeedObject(base_url=os.getenv("TESTS_BASE_URL", "base_url")) diff --git a/seed/python-sdk/inline-types/tests/custom/test_client.py b/seed/python-sdk/inline-types/tests/custom/test_client.py deleted file mode 100644 index 73f811f5ede..00000000000 --- a/seed/python-sdk/inline-types/tests/custom/test_client.py +++ /dev/null @@ -1,7 +0,0 @@ -import pytest - - -# Get started with writing tests with pytest at https://docs.pytest.org -@pytest.mark.skip(reason="Unimplemented") -def test_client() -> None: - assert True == True diff --git a/seed/python-sdk/inline-types/tests/test_root.py b/seed/python-sdk/inline-types/tests/test_root.py deleted file mode 100644 index 2730cff73c4..00000000000 --- a/seed/python-sdk/inline-types/tests/test_root.py +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from seed import SeedObject -from seed import AsyncSeedObject -import typing -from seed import InlineType1 -from seed import NestedInlineType1 -from .utilities import validate_response - - -async def test_get_root(client: SeedObject, async_client: AsyncSeedObject) -> None: - expected_response: typing.Any = { - "foo": "foo", - "bar": {"foo": "foo", "bar": {"foo": "foo", "bar": "bar", "myEnum": "SUNNY"}}, - } - expected_types: typing.Any = {"foo": None, "bar": {"foo": None, "bar": {"foo": None, "bar": None, "myEnum": None}}} - response = client.get_root( - bar=InlineType1(foo="foo", bar=NestedInlineType1(foo="foo", bar="bar", my_enum="SUNNY")), foo="foo" - ) - validate_response(response, expected_response, expected_types) - - async_response = await async_client.get_root( - bar=InlineType1(foo="foo", bar=NestedInlineType1(foo="foo", bar="bar", my_enum="SUNNY")), foo="foo" - ) - validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/inline-types/tests/utilities.py b/seed/python-sdk/inline-types/tests/utilities.py deleted file mode 100644 index 3d228806a9c..00000000000 --- a/seed/python-sdk/inline-types/tests/utilities.py +++ /dev/null @@ -1,162 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -import uuid - -from dateutil import parser - -import pydantic - - -def cast_field(json_expectation: typing.Any, type_expectation: typing.Any) -> typing.Any: - # Cast these specific types which come through as string and expect our - # models to cast to the correct type. - if type_expectation == "uuid": - return uuid.UUID(json_expectation) - elif type_expectation == "date": - return parser.parse(json_expectation).date() - elif type_expectation == "datetime": - return parser.parse(json_expectation) - elif type_expectation == "set": - return set(json_expectation) - elif type_expectation == "integer": - # Necessary as we allow numeric keys, but JSON makes them strings - return int(json_expectation) - - return json_expectation - - -def validate_field(response: typing.Any, json_expectation: typing.Any, type_expectation: typing.Any) -> None: - # Allow for an escape hatch if the object cannot be validated - if type_expectation == "no_validate": - return - - is_container_of_complex_type = False - # Parse types in containers, note that dicts are handled within `validate_response` - if isinstance(json_expectation, list): - if isinstance(type_expectation, tuple): - container_expectation = type_expectation[0] - contents_expectation = type_expectation[1] - - cast_json_expectation = [] - for idx, ex in enumerate(json_expectation): - if isinstance(contents_expectation, dict): - entry_expectation = contents_expectation.get(idx) - if isinstance(entry_expectation, dict): - is_container_of_complex_type = True - validate_response( - response=response[idx], - json_expectation=ex, - type_expectations=entry_expectation, - ) - else: - cast_json_expectation.append(cast_field(ex, entry_expectation)) - else: - cast_json_expectation.append(ex) - json_expectation = cast_json_expectation - - # Note that we explicitly do not allow for sets of pydantic models as they are not hashable, so - # if any of the values of the set have a type_expectation of a dict, we're assuming it's a pydantic - # model and keeping it a list. - if container_expectation != "set" or not any( - map( - lambda value: isinstance(value, dict), - list(contents_expectation.values()), - ) - ): - json_expectation = cast_field(json_expectation, container_expectation) - elif isinstance(type_expectation, tuple): - container_expectation = type_expectation[0] - contents_expectation = type_expectation[1] - if isinstance(contents_expectation, dict): - json_expectation = { - cast_field( - key, - contents_expectation.get(idx)[0] # type: ignore - if contents_expectation.get(idx) is not None - else None, - ): cast_field( - value, - contents_expectation.get(idx)[1] # type: ignore - if contents_expectation.get(idx) is not None - else None, - ) - for idx, (key, value) in enumerate(json_expectation.items()) - } - else: - json_expectation = cast_field(json_expectation, container_expectation) - elif type_expectation is not None: - json_expectation = cast_field(json_expectation, type_expectation) - - # When dealing with containers of models, etc. we're validating them implicitly, so no need to check the resultant list - if not is_container_of_complex_type: - assert ( - json_expectation == response - ), "Primitives found, expected: {0} (type: {1}), Actual: {2} (type: {3})".format( - json_expectation, type(json_expectation), response, type(response) - ) - - -# Arg type_expectations is a deeply nested structure that matches the response, but with the values replaced with the expected types -def validate_response(response: typing.Any, json_expectation: typing.Any, type_expectations: typing.Any) -> None: - # Allow for an escape hatch if the object cannot be validated - if type_expectations == "no_validate": - return - - if ( - not isinstance(response, list) - and not isinstance(response, dict) - and not issubclass(type(response), pydantic.BaseModel) - ): - validate_field( - response=response, - json_expectation=json_expectation, - type_expectation=type_expectations, - ) - return - - if isinstance(response, list): - assert len(response) == len(json_expectation), "Length mismatch, expected: {0}, Actual: {1}".format( - len(response), len(json_expectation) - ) - content_expectation = type_expectations - if isinstance(type_expectations, tuple): - content_expectation = type_expectations[1] - for idx, item in enumerate(response): - validate_response( - response=item, - json_expectation=json_expectation[idx], - type_expectations=content_expectation[idx], - ) - else: - response_json = response - if issubclass(type(response), pydantic.BaseModel): - response_json = response.dict(by_alias=True) - - for key, value in json_expectation.items(): - assert key in response_json, "Field {0} not found within the response object: {1}".format( - key, response_json - ) - - type_expectation = None - if type_expectations is not None and isinstance(type_expectations, dict): - type_expectation = type_expectations.get(key) - - # If your type_expectation is a tuple then you have a container field, process it as such - # Otherwise, we're just validating a single field that's a pydantic model. - if isinstance(value, dict) and not isinstance(type_expectation, tuple): - validate_response( - response=response_json[key], - json_expectation=value, - type_expectations=type_expectation, - ) - else: - validate_field( - response=response_json[key], - json_expectation=value, - type_expectation=type_expectation, - ) - - # Ensure there are no additional fields here either - del response_json[key] - assert len(response_json) == 0, "Additional fields found, expected None: {0}".format(response_json) diff --git a/seed/python-sdk/inline-types/tests/utils/__init__.py b/seed/python-sdk/inline-types/tests/utils/__init__.py deleted file mode 100644 index f3ea2659bb1..00000000000 --- a/seed/python-sdk/inline-types/tests/utils/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - diff --git a/seed/python-sdk/inline-types/tests/utils/assets/models/__init__.py b/seed/python-sdk/inline-types/tests/utils/assets/models/__init__.py deleted file mode 100644 index 3a1c852e71e..00000000000 --- a/seed/python-sdk/inline-types/tests/utils/assets/models/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -from .circle import CircleParams -from .object_with_defaults import ObjectWithDefaultsParams -from .object_with_optional_field import ObjectWithOptionalFieldParams -from .shape import ShapeParams, Shape_CircleParams, Shape_SquareParams -from .square import SquareParams -from .undiscriminated_shape import UndiscriminatedShapeParams - -__all__ = [ - "CircleParams", - "ObjectWithDefaultsParams", - "ObjectWithOptionalFieldParams", - "ShapeParams", - "Shape_CircleParams", - "Shape_SquareParams", - "SquareParams", - "UndiscriminatedShapeParams", -] diff --git a/seed/python-sdk/inline-types/tests/utils/assets/models/circle.py b/seed/python-sdk/inline-types/tests/utils/assets/models/circle.py deleted file mode 100644 index 6522dc58c5a..00000000000 --- a/seed/python-sdk/inline-types/tests/utils/assets/models/circle.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions -import typing_extensions -from seed.core.serialization import FieldMetadata - - -class CircleParams(typing_extensions.TypedDict): - radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] diff --git a/seed/python-sdk/inline-types/tests/utils/assets/models/color.py b/seed/python-sdk/inline-types/tests/utils/assets/models/color.py deleted file mode 100644 index 2aa2c4c52f0..00000000000 --- a/seed/python-sdk/inline-types/tests/utils/assets/models/color.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing - -Color = typing.Union[typing.Literal["red", "blue"], typing.Any] diff --git a/seed/python-sdk/inline-types/tests/utils/assets/models/object_with_defaults.py b/seed/python-sdk/inline-types/tests/utils/assets/models/object_with_defaults.py deleted file mode 100644 index ef14f7b2c9d..00000000000 --- a/seed/python-sdk/inline-types/tests/utils/assets/models/object_with_defaults.py +++ /dev/null @@ -1,16 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions -import typing_extensions - - -class ObjectWithDefaultsParams(typing_extensions.TypedDict): - """ - Defines properties with default values and validation rules. - """ - - decimal: typing_extensions.NotRequired[float] - string: typing_extensions.NotRequired[str] - required_string: str diff --git a/seed/python-sdk/inline-types/tests/utils/assets/models/object_with_optional_field.py b/seed/python-sdk/inline-types/tests/utils/assets/models/object_with_optional_field.py deleted file mode 100644 index fc5a379b967..00000000000 --- a/seed/python-sdk/inline-types/tests/utils/assets/models/object_with_optional_field.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions -import typing -import typing_extensions -from seed.core.serialization import FieldMetadata -import datetime as dt -import uuid -from .color import Color -from .shape import ShapeParams -from .undiscriminated_shape import UndiscriminatedShapeParams - - -class ObjectWithOptionalFieldParams(typing_extensions.TypedDict): - literal: typing.Literal["lit_one"] - string: typing_extensions.NotRequired[str] - integer: typing_extensions.NotRequired[int] - long_: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="long")]] - double: typing_extensions.NotRequired[float] - bool_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="bool")]] - datetime: typing_extensions.NotRequired[dt.datetime] - date: typing_extensions.NotRequired[dt.date] - uuid_: typing_extensions.NotRequired[typing_extensions.Annotated[uuid.UUID, FieldMetadata(alias="uuid")]] - base_64: typing_extensions.NotRequired[typing_extensions.Annotated[str, FieldMetadata(alias="base64")]] - list_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Sequence[str], FieldMetadata(alias="list")]] - set_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Set[str], FieldMetadata(alias="set")]] - map_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Dict[int, str], FieldMetadata(alias="map")]] - enum: typing_extensions.NotRequired[Color] - union: typing_extensions.NotRequired[ShapeParams] - second_union: typing_extensions.NotRequired[ShapeParams] - undiscriminated_union: typing_extensions.NotRequired[UndiscriminatedShapeParams] - any: typing.Optional[typing.Any] diff --git a/seed/python-sdk/inline-types/tests/utils/assets/models/shape.py b/seed/python-sdk/inline-types/tests/utils/assets/models/shape.py deleted file mode 100644 index ae113ae0609..00000000000 --- a/seed/python-sdk/inline-types/tests/utils/assets/models/shape.py +++ /dev/null @@ -1,26 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations -import typing_extensions -import typing_extensions -import typing -from seed.core.serialization import FieldMetadata - - -class Base(typing_extensions.TypedDict): - id: str - - -class Shape_CircleParams(Base): - shape_type: typing_extensions.Annotated[typing.Literal["circle"], FieldMetadata(alias="shapeType")] - radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] - - -class Shape_SquareParams(Base): - shape_type: typing_extensions.Annotated[typing.Literal["square"], FieldMetadata(alias="shapeType")] - length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] - - -ShapeParams = typing.Union[Shape_CircleParams, Shape_SquareParams] diff --git a/seed/python-sdk/inline-types/tests/utils/assets/models/square.py b/seed/python-sdk/inline-types/tests/utils/assets/models/square.py deleted file mode 100644 index 7f6f79a3ddc..00000000000 --- a/seed/python-sdk/inline-types/tests/utils/assets/models/square.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions -import typing_extensions -from seed.core.serialization import FieldMetadata - - -class SquareParams(typing_extensions.TypedDict): - length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] diff --git a/seed/python-sdk/inline-types/tests/utils/assets/models/undiscriminated_shape.py b/seed/python-sdk/inline-types/tests/utils/assets/models/undiscriminated_shape.py deleted file mode 100644 index 68876a23c38..00000000000 --- a/seed/python-sdk/inline-types/tests/utils/assets/models/undiscriminated_shape.py +++ /dev/null @@ -1,9 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing -from .circle import CircleParams -from .square import SquareParams - -UndiscriminatedShapeParams = typing.Union[CircleParams, SquareParams] diff --git a/seed/python-sdk/inline-types/tests/utils/test_http_client.py b/seed/python-sdk/inline-types/tests/utils/test_http_client.py deleted file mode 100644 index a541bae6531..00000000000 --- a/seed/python-sdk/inline-types/tests/utils/test_http_client.py +++ /dev/null @@ -1,61 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from seed.core.http_client import get_request_body -from seed.core.request_options import RequestOptions - - -def get_request_options() -> RequestOptions: - return {"additional_body_parameters": {"see you": "later"}} - - -def test_get_json_request_body() -> None: - json_body, data_body = get_request_body(json={"hello": "world"}, data=None, request_options=None, omit=None) - assert json_body == {"hello": "world"} - assert data_body is None - - json_body_extras, data_body_extras = get_request_body( - json={"goodbye": "world"}, data=None, request_options=get_request_options(), omit=None - ) - - assert json_body_extras == {"goodbye": "world", "see you": "later"} - assert data_body_extras is None - - -def test_get_files_request_body() -> None: - json_body, data_body = get_request_body(json=None, data={"hello": "world"}, request_options=None, omit=None) - assert data_body == {"hello": "world"} - assert json_body is None - - json_body_extras, data_body_extras = get_request_body( - json=None, data={"goodbye": "world"}, request_options=get_request_options(), omit=None - ) - - assert data_body_extras == {"goodbye": "world", "see you": "later"} - assert json_body_extras is None - - -def test_get_none_request_body() -> None: - json_body, data_body = get_request_body(json=None, data=None, request_options=None, omit=None) - assert data_body is None - assert json_body is None - - json_body_extras, data_body_extras = get_request_body( - json=None, data=None, request_options=get_request_options(), omit=None - ) - - assert json_body_extras == {"see you": "later"} - assert data_body_extras is None - - -def test_get_empty_json_request_body() -> None: - unrelated_request_options: RequestOptions = {"max_retries": 3} - json_body, data_body = get_request_body(json=None, data=None, request_options=unrelated_request_options, omit=None) - assert json_body is None - assert data_body is None - - json_body_extras, data_body_extras = get_request_body( - json={}, data=None, request_options=unrelated_request_options, omit=None - ) - - assert json_body_extras is None - assert data_body_extras is None diff --git a/seed/python-sdk/inline-types/tests/utils/test_query_encoding.py b/seed/python-sdk/inline-types/tests/utils/test_query_encoding.py deleted file mode 100644 index e075394a502..00000000000 --- a/seed/python-sdk/inline-types/tests/utils/test_query_encoding.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - - -from seed.core.query_encoder import encode_query - - -def test_query_encoding_deep_objects() -> None: - assert encode_query({"hello world": "hello world"}) == [("hello world", "hello world")] - assert encode_query({"hello_world": {"hello": "world"}}) == [("hello_world[hello]", "world")] - assert encode_query({"hello_world": {"hello": {"world": "today"}, "test": "this"}, "hi": "there"}) == [ - ("hello_world[hello][world]", "today"), - ("hello_world[test]", "this"), - ("hi", "there"), - ] - - -def test_query_encoding_deep_object_arrays() -> None: - assert encode_query({"objects": [{"key": "hello", "value": "world"}, {"key": "foo", "value": "bar"}]}) == [ - ("objects[key]", "hello"), - ("objects[value]", "world"), - ("objects[key]", "foo"), - ("objects[value]", "bar"), - ] - assert encode_query( - {"users": [{"name": "string", "tags": ["string"]}, {"name": "string2", "tags": ["string2", "string3"]}]} - ) == [ - ("users[name]", "string"), - ("users[tags]", "string"), - ("users[name]", "string2"), - ("users[tags]", "string2"), - ("users[tags]", "string3"), - ] - - -def test_encode_query_with_none() -> None: - encoded = encode_query(None) - assert encoded == None diff --git a/seed/python-sdk/inline-types/tests/utils/test_serialization.py b/seed/python-sdk/inline-types/tests/utils/test_serialization.py deleted file mode 100644 index dd74836366c..00000000000 --- a/seed/python-sdk/inline-types/tests/utils/test_serialization.py +++ /dev/null @@ -1,72 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import List, Any - -from seed.core.serialization import convert_and_respect_annotation_metadata -from .assets.models import ShapeParams, ObjectWithOptionalFieldParams - - -UNION_TEST: ShapeParams = {"radius_measurement": 1.0, "shape_type": "circle", "id": "1"} -UNION_TEST_CONVERTED = {"shapeType": "circle", "radiusMeasurement": 1.0, "id": "1"} - - -def test_convert_and_respect_annotation_metadata() -> None: - data: ObjectWithOptionalFieldParams = { - "string": "string", - "long_": 12345, - "bool_": True, - "literal": "lit_one", - "any": "any", - } - converted = convert_and_respect_annotation_metadata( - object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" - ) - assert converted == {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"} - - -def test_convert_and_respect_annotation_metadata_in_list() -> None: - data: List[ObjectWithOptionalFieldParams] = [ - {"string": "string", "long_": 12345, "bool_": True, "literal": "lit_one", "any": "any"}, - {"string": "another string", "long_": 67890, "list_": [], "literal": "lit_one", "any": "any"}, - ] - converted = convert_and_respect_annotation_metadata( - object_=data, annotation=List[ObjectWithOptionalFieldParams], direction="write" - ) - - assert converted == [ - {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"}, - {"string": "another string", "long": 67890, "list": [], "literal": "lit_one", "any": "any"}, - ] - - -def test_convert_and_respect_annotation_metadata_in_nested_object() -> None: - data: ObjectWithOptionalFieldParams = { - "string": "string", - "long_": 12345, - "union": UNION_TEST, - "literal": "lit_one", - "any": "any", - } - converted = convert_and_respect_annotation_metadata( - object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" - ) - - assert converted == { - "string": "string", - "long": 12345, - "union": UNION_TEST_CONVERTED, - "literal": "lit_one", - "any": "any", - } - - -def test_convert_and_respect_annotation_metadata_in_union() -> None: - converted = convert_and_respect_annotation_metadata(object_=UNION_TEST, annotation=ShapeParams, direction="write") - - assert converted == UNION_TEST_CONVERTED - - -def test_convert_and_respect_annotation_metadata_with_empty_object() -> None: - data: Any = {} - converted = convert_and_respect_annotation_metadata(object_=data, annotation=ShapeParams, direction="write") - assert converted == data diff --git a/seed/ruby-model/inline-types/.mock/definition/__package__.yml b/seed/ruby-model/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/ruby-model/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/ruby-model/inline-types/.mock/definition/api.yml b/seed/ruby-model/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/ruby-model/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/ruby-model/inline-types/.mock/fern.config.json b/seed/ruby-model/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/ruby-model/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/ruby-model/inline-types/.mock/generators.yml b/seed/ruby-model/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/ruby-model/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/ruby-model/inline-types/.rubocop.yml b/seed/ruby-model/inline-types/.rubocop.yml deleted file mode 100644 index c1d2344d6e6..00000000000 --- a/seed/ruby-model/inline-types/.rubocop.yml +++ /dev/null @@ -1,36 +0,0 @@ -AllCops: - TargetRubyVersion: 2.7 - -Style/StringLiterals: - Enabled: true - EnforcedStyle: double_quotes - -Style/StringLiteralsInInterpolation: - Enabled: true - EnforcedStyle: double_quotes - -Layout/FirstHashElementLineBreak: - Enabled: true - -Layout/MultilineHashKeyLineBreaks: - Enabled: true - -# Generated files may be more complex than standard, disable -# these rules for now as a known limitation. -Metrics/ParameterLists: - Enabled: false - -Metrics/MethodLength: - Enabled: false - -Metrics/AbcSize: - Enabled: false - -Metrics/ClassLength: - Enabled: false - -Metrics/CyclomaticComplexity: - Enabled: false - -Metrics/PerceivedComplexity: - Enabled: false diff --git a/seed/ruby-model/inline-types/Gemfile b/seed/ruby-model/inline-types/Gemfile deleted file mode 100644 index 49bd9cd0173..00000000000 --- a/seed/ruby-model/inline-types/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -gemspec - -gem "minitest", "~> 5.0" -gem "rake", "~> 13.0" -gem "rubocop", "~> 1.21" diff --git a/seed/ruby-model/inline-types/Rakefile b/seed/ruby-model/inline-types/Rakefile deleted file mode 100644 index 2bdbce0cf2c..00000000000 --- a/seed/ruby-model/inline-types/Rakefile +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -require "rake/testtask" -require "rubocop/rake_task" - -task default: %i[test rubocop] - -Rake::TestTask.new do |t| - t.pattern = "./test/**/test_*.rb" -end - -RuboCop::RakeTask.new diff --git a/seed/ruby-model/inline-types/lib/gemconfig.rb b/seed/ruby-model/inline-types/lib/gemconfig.rb deleted file mode 100644 index d90831f0fcd..00000000000 --- a/seed/ruby-model/inline-types/lib/gemconfig.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module SeedObjectClient - module Gemconfig - VERSION = "" - AUTHORS = [""].freeze - EMAIL = "" - SUMMARY = "" - DESCRIPTION = "" - HOMEPAGE = "https://github.com/REPO/URL" - SOURCE_CODE_URI = "https://github.com/REPO/URL" - CHANGELOG_URI = "https://github.com/REPO/URL/blob/master/CHANGELOG.md" - end -end diff --git a/seed/ruby-model/inline-types/lib/seed_object_client.rb b/seed/ruby-model/inline-types/lib/seed_object_client.rb deleted file mode 100644 index 8ea9b99068b..00000000000 --- a/seed/ruby-model/inline-types/lib/seed_object_client.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -require_relative "seed_object_client/types/root_type_1" -require_relative "seed_object_client/types/inline_type_1" -require_relative "seed_object_client/types/inline_type_2" -require_relative "seed_object_client/types/nested_inline_type_1" -require_relative "seed_object_client/types/inlined_discriminated_union_1" -require_relative "seed_object_client/types/inlined_undiscriminated_union_1" -require_relative "seed_object_client/types/inline_enum" diff --git a/seed/ruby-model/inline-types/lib/seed_object_client/types/inline_enum.rb b/seed/ruby-model/inline-types/lib/seed_object_client/types/inline_enum.rb deleted file mode 100644 index c5cc415cac6..00000000000 --- a/seed/ruby-model/inline-types/lib/seed_object_client/types/inline_enum.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -module SeedObjectClient - class InlineEnum - SUNNY = "SUNNY" - CLOUDY = "CLOUDY" - RAINING = "RAINING" - SNOWING = "SNOWING" - end -end diff --git a/seed/ruby-model/inline-types/lib/seed_object_client/types/inline_type_1.rb b/seed/ruby-model/inline-types/lib/seed_object_client/types/inline_type_1.rb deleted file mode 100644 index b2f58248832..00000000000 --- a/seed/ruby-model/inline-types/lib/seed_object_client/types/inline_type_1.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -require_relative "nested_inline_type_1" -require "ostruct" -require "json" - -module SeedObjectClient - class InlineType1 - # @return [String] - attr_reader :foo - # @return [SeedObjectClient::NestedInlineType1] - attr_reader :bar - # @return [OpenStruct] Additional properties unmapped to the current class definition - attr_reader :additional_properties - # @return [Object] - attr_reader :_field_set - protected :_field_set - - OMIT = Object.new - - # @param foo [String] - # @param bar [SeedObjectClient::NestedInlineType1] - # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition - # @return [SeedObjectClient::InlineType1] - def initialize(foo:, bar:, additional_properties: nil) - @foo = foo - @bar = bar - @additional_properties = additional_properties - @_field_set = { "foo": foo, "bar": bar } - end - - # Deserialize a JSON object to an instance of InlineType1 - # - # @param json_object [String] - # @return [SeedObjectClient::InlineType1] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - parsed_json = JSON.parse(json_object) - foo = parsed_json["foo"] - if parsed_json["bar"].nil? - bar = nil - else - bar = parsed_json["bar"].to_json - bar = SeedObjectClient::NestedInlineType1.from_json(json_object: bar) - end - new( - foo: foo, - bar: bar, - additional_properties: struct - ) - end - - # Serialize an instance of InlineType1 to a JSON object - # - # @return [String] - def to_json(*_args) - @_field_set&.to_json - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given - # hash and check each fields type against the current object's property - # definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - obj.foo.is_a?(String) != false || raise("Passed value for field obj.foo is not the expected type, validation failed.") - SeedObjectClient::NestedInlineType1.validate_raw(obj: obj.bar) - end - end -end diff --git a/seed/ruby-model/inline-types/lib/seed_object_client/types/inline_type_2.rb b/seed/ruby-model/inline-types/lib/seed_object_client/types/inline_type_2.rb deleted file mode 100644 index 232e0e5f47f..00000000000 --- a/seed/ruby-model/inline-types/lib/seed_object_client/types/inline_type_2.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -require "ostruct" -require "json" - -module SeedObjectClient - class InlineType2 - # @return [String] - attr_reader :baz - # @return [OpenStruct] Additional properties unmapped to the current class definition - attr_reader :additional_properties - # @return [Object] - attr_reader :_field_set - protected :_field_set - - OMIT = Object.new - - # @param baz [String] - # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition - # @return [SeedObjectClient::InlineType2] - def initialize(baz:, additional_properties: nil) - @baz = baz - @additional_properties = additional_properties - @_field_set = { "baz": baz } - end - - # Deserialize a JSON object to an instance of InlineType2 - # - # @param json_object [String] - # @return [SeedObjectClient::InlineType2] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - parsed_json = JSON.parse(json_object) - baz = parsed_json["baz"] - new(baz: baz, additional_properties: struct) - end - - # Serialize an instance of InlineType2 to a JSON object - # - # @return [String] - def to_json(*_args) - @_field_set&.to_json - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given - # hash and check each fields type against the current object's property - # definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - obj.baz.is_a?(String) != false || raise("Passed value for field obj.baz is not the expected type, validation failed.") - end - end -end diff --git a/seed/ruby-model/inline-types/lib/seed_object_client/types/inlined_discriminated_union_1.rb b/seed/ruby-model/inline-types/lib/seed_object_client/types/inlined_discriminated_union_1.rb deleted file mode 100644 index 8efbcfeb3bf..00000000000 --- a/seed/ruby-model/inline-types/lib/seed_object_client/types/inlined_discriminated_union_1.rb +++ /dev/null @@ -1,94 +0,0 @@ -# frozen_string_literal: true - -require "json" -require_relative "inline_type_1" -require_relative "inline_type_2" - -module SeedObjectClient - class InlinedDiscriminatedUnion1 - # @return [Object] - attr_reader :member - # @return [String] - attr_reader :discriminant - - private_class_method :new - alias kind_of? is_a? - - # @param member [Object] - # @param discriminant [String] - # @return [SeedObjectClient::InlinedDiscriminatedUnion1] - def initialize(member:, discriminant:) - @member = member - @discriminant = discriminant - end - - # Deserialize a JSON object to an instance of InlinedDiscriminatedUnion1 - # - # @param json_object [String] - # @return [SeedObjectClient::InlinedDiscriminatedUnion1] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - member = case struct.type - when "type1" - SeedObjectClient::InlineType1.from_json(json_object: json_object) - when "type2" - SeedObjectClient::InlineType2.from_json(json_object: json_object) - else - SeedObjectClient::InlineType1.from_json(json_object: json_object) - end - new(member: member, discriminant: struct.type) - end - - # For Union Types, to_json functionality is delegated to the wrapped member. - # - # @return [String] - def to_json(*_args) - case @discriminant - when "type1" - { **@member.to_json, type: @discriminant }.to_json - when "type2" - { **@member.to_json, type: @discriminant }.to_json - else - { "type": @discriminant, value: @member }.to_json - end - @member.to_json - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given - # hash and check each fields type against the current object's property - # definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - case obj.type - when "type1" - SeedObjectClient::InlineType1.validate_raw(obj: obj) - when "type2" - SeedObjectClient::InlineType2.validate_raw(obj: obj) - else - raise("Passed value matched no type within the union, validation failed.") - end - end - - # For Union Types, is_a? functionality is delegated to the wrapped member. - # - # @param obj [Object] - # @return [Boolean] - def is_a?(obj) - @member.is_a?(obj) - end - - # @param member [SeedObjectClient::InlineType1] - # @return [SeedObjectClient::InlinedDiscriminatedUnion1] - def self.type_1(member:) - new(member: member, discriminant: "type1") - end - - # @param member [SeedObjectClient::InlineType2] - # @return [SeedObjectClient::InlinedDiscriminatedUnion1] - def self.type_2(member:) - new(member: member, discriminant: "type2") - end - end -end diff --git a/seed/ruby-model/inline-types/lib/seed_object_client/types/inlined_undiscriminated_union_1.rb b/seed/ruby-model/inline-types/lib/seed_object_client/types/inlined_undiscriminated_union_1.rb deleted file mode 100644 index ec4ef8064b6..00000000000 --- a/seed/ruby-model/inline-types/lib/seed_object_client/types/inlined_undiscriminated_union_1.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -require "json" -require_relative "inline_type_1" -require_relative "inline_type_2" - -module SeedObjectClient - class InlinedUndiscriminatedUnion1 - # Deserialize a JSON object to an instance of InlinedUndiscriminatedUnion1 - # - # @param json_object [String] - # @return [SeedObjectClient::InlinedUndiscriminatedUnion1] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - begin - SeedObjectClient::InlineType1.validate_raw(obj: struct) - return SeedObjectClient::InlineType1.from_json(json_object: struct) unless struct.nil? - - return nil - rescue StandardError - # noop - end - begin - SeedObjectClient::InlineType2.validate_raw(obj: struct) - return SeedObjectClient::InlineType2.from_json(json_object: struct) unless struct.nil? - - return nil - rescue StandardError - # noop - end - struct - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given - # hash and check each fields type against the current object's property - # definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - begin - return SeedObjectClient::InlineType1.validate_raw(obj: obj) - rescue StandardError - # noop - end - begin - return SeedObjectClient::InlineType2.validate_raw(obj: obj) - rescue StandardError - # noop - end - raise("Passed value matched no type within the union, validation failed.") - end - end -end diff --git a/seed/ruby-model/inline-types/lib/seed_object_client/types/nested_inline_type_1.rb b/seed/ruby-model/inline-types/lib/seed_object_client/types/nested_inline_type_1.rb deleted file mode 100644 index 863971a0fa7..00000000000 --- a/seed/ruby-model/inline-types/lib/seed_object_client/types/nested_inline_type_1.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -require_relative "inline_enum" -require "ostruct" -require "json" - -module SeedObjectClient - class NestedInlineType1 - # @return [String] - attr_reader :foo - # @return [String] - attr_reader :bar - # @return [SeedObjectClient::InlineEnum] - attr_reader :my_enum - # @return [OpenStruct] Additional properties unmapped to the current class definition - attr_reader :additional_properties - # @return [Object] - attr_reader :_field_set - protected :_field_set - - OMIT = Object.new - - # @param foo [String] - # @param bar [String] - # @param my_enum [SeedObjectClient::InlineEnum] - # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition - # @return [SeedObjectClient::NestedInlineType1] - def initialize(foo:, bar:, my_enum:, additional_properties: nil) - @foo = foo - @bar = bar - @my_enum = my_enum - @additional_properties = additional_properties - @_field_set = { "foo": foo, "bar": bar, "myEnum": my_enum } - end - - # Deserialize a JSON object to an instance of NestedInlineType1 - # - # @param json_object [String] - # @return [SeedObjectClient::NestedInlineType1] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - parsed_json = JSON.parse(json_object) - foo = parsed_json["foo"] - bar = parsed_json["bar"] - my_enum = parsed_json["myEnum"] - new( - foo: foo, - bar: bar, - my_enum: my_enum, - additional_properties: struct - ) - end - - # Serialize an instance of NestedInlineType1 to a JSON object - # - # @return [String] - def to_json(*_args) - @_field_set&.to_json - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given - # hash and check each fields type against the current object's property - # definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - obj.foo.is_a?(String) != false || raise("Passed value for field obj.foo is not the expected type, validation failed.") - obj.bar.is_a?(String) != false || raise("Passed value for field obj.bar is not the expected type, validation failed.") - obj.my_enum.is_a?(SeedObjectClient::InlineEnum) != false || raise("Passed value for field obj.my_enum is not the expected type, validation failed.") - end - end -end diff --git a/seed/ruby-model/inline-types/lib/seed_object_client/types/root_type_1.rb b/seed/ruby-model/inline-types/lib/seed_object_client/types/root_type_1.rb deleted file mode 100644 index a17734f2980..00000000000 --- a/seed/ruby-model/inline-types/lib/seed_object_client/types/root_type_1.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -require_relative "inline_type_1" -require "ostruct" -require "json" - -module SeedObjectClient - class RootType1 - # @return [String] - attr_reader :foo - # @return [SeedObjectClient::InlineType1] - attr_reader :bar - # @return [OpenStruct] Additional properties unmapped to the current class definition - attr_reader :additional_properties - # @return [Object] - attr_reader :_field_set - protected :_field_set - - OMIT = Object.new - - # @param foo [String] - # @param bar [SeedObjectClient::InlineType1] - # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition - # @return [SeedObjectClient::RootType1] - def initialize(foo:, bar:, additional_properties: nil) - @foo = foo - @bar = bar - @additional_properties = additional_properties - @_field_set = { "foo": foo, "bar": bar } - end - - # Deserialize a JSON object to an instance of RootType1 - # - # @param json_object [String] - # @return [SeedObjectClient::RootType1] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - parsed_json = JSON.parse(json_object) - foo = parsed_json["foo"] - if parsed_json["bar"].nil? - bar = nil - else - bar = parsed_json["bar"].to_json - bar = SeedObjectClient::InlineType1.from_json(json_object: bar) - end - new( - foo: foo, - bar: bar, - additional_properties: struct - ) - end - - # Serialize an instance of RootType1 to a JSON object - # - # @return [String] - def to_json(*_args) - @_field_set&.to_json - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given - # hash and check each fields type against the current object's property - # definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - obj.foo.is_a?(String) != false || raise("Passed value for field obj.foo is not the expected type, validation failed.") - SeedObjectClient::InlineType1.validate_raw(obj: obj.bar) - end - end -end diff --git a/seed/ruby-model/inline-types/seed_object_client.gemspec b/seed/ruby-model/inline-types/seed_object_client.gemspec deleted file mode 100644 index d3b0d2a70a4..00000000000 --- a/seed/ruby-model/inline-types/seed_object_client.gemspec +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -require_relative "lib/gemconfig" - -Gem::Specification.new do |spec| - spec.name = "seed_object_client" - spec.version = SeedObjectClient::Gemconfig::VERSION - spec.authors = SeedObjectClient::Gemconfig::AUTHORS - spec.email = SeedObjectClient::Gemconfig::EMAIL - spec.summary = SeedObjectClient::Gemconfig::SUMMARY - spec.description = SeedObjectClient::Gemconfig::DESCRIPTION - spec.homepage = SeedObjectClient::Gemconfig::HOMEPAGE - spec.required_ruby_version = ">= 2.7.0" - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = SeedObjectClient::Gemconfig::SOURCE_CODE_URI - spec.metadata["changelog_uri"] = SeedObjectClient::Gemconfig::CHANGELOG_URI - spec.files = Dir.glob("lib/**/*") - spec.bindir = "exe" - spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] -end diff --git a/seed/ruby-model/inline-types/snippet-templates.json b/seed/ruby-model/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/ruby-model/inline-types/snippet.json b/seed/ruby-model/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/ruby-model/inline-types/test/test_helper.rb b/seed/ruby-model/inline-types/test/test_helper.rb deleted file mode 100644 index 30691efbd9e..00000000000 --- a/seed/ruby-model/inline-types/test/test_helper.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -$LOAD_PATH.unshift File.expand_path("../lib", __dir__) - -require "minitest/autorun" -require "seed_object_client" diff --git a/seed/ruby-model/inline-types/test/test_seed_object_client.rb b/seed/ruby-model/inline-types/test/test_seed_object_client.rb deleted file mode 100644 index d44f9b1e8ec..00000000000 --- a/seed/ruby-model/inline-types/test/test_seed_object_client.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -require_relative "test_helper" -require "seed_object_client" - -# Basic SeedObjectClient tests -class TestSeedObjectClient < Minitest::Test - def test_function - # SeedObjectClient::Client.new - end -end diff --git a/seed/ruby-sdk/inline-types/.github/workflows/publish.yml b/seed/ruby-sdk/inline-types/.github/workflows/publish.yml deleted file mode 100644 index ba4ed2d9e2d..00000000000 --- a/seed/ruby-sdk/inline-types/.github/workflows/publish.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Publish - -on: [push] -jobs: - publish: - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - bundler-cache: true - - - name: Test gem - run: bundle install && bundle exec rake test - - - name: Build and Push Gem - env: - GEM_HOST_API_KEY: ${{ secrets. }} - run: | - gem build fern_inline_types.gemspec - - gem push fern_inline_types-*.gem --host diff --git a/seed/ruby-sdk/inline-types/.gitignore b/seed/ruby-sdk/inline-types/.gitignore deleted file mode 100644 index a97c182a2e1..00000000000 --- a/seed/ruby-sdk/inline-types/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -/.bundle/ -/.yardoc -/_yardoc/ -/coverage/ -/doc/ -/pkg/ -/spec/reports/ -/tmp/ -*.gem -.env diff --git a/seed/ruby-sdk/inline-types/.mock/definition/__package__.yml b/seed/ruby-sdk/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/ruby-sdk/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/ruby-sdk/inline-types/.mock/definition/api.yml b/seed/ruby-sdk/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/ruby-sdk/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/ruby-sdk/inline-types/.mock/fern.config.json b/seed/ruby-sdk/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/ruby-sdk/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/ruby-sdk/inline-types/.mock/generators.yml b/seed/ruby-sdk/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/ruby-sdk/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/ruby-sdk/inline-types/.rubocop.yml b/seed/ruby-sdk/inline-types/.rubocop.yml deleted file mode 100644 index c1d2344d6e6..00000000000 --- a/seed/ruby-sdk/inline-types/.rubocop.yml +++ /dev/null @@ -1,36 +0,0 @@ -AllCops: - TargetRubyVersion: 2.7 - -Style/StringLiterals: - Enabled: true - EnforcedStyle: double_quotes - -Style/StringLiteralsInInterpolation: - Enabled: true - EnforcedStyle: double_quotes - -Layout/FirstHashElementLineBreak: - Enabled: true - -Layout/MultilineHashKeyLineBreaks: - Enabled: true - -# Generated files may be more complex than standard, disable -# these rules for now as a known limitation. -Metrics/ParameterLists: - Enabled: false - -Metrics/MethodLength: - Enabled: false - -Metrics/AbcSize: - Enabled: false - -Metrics/ClassLength: - Enabled: false - -Metrics/CyclomaticComplexity: - Enabled: false - -Metrics/PerceivedComplexity: - Enabled: false diff --git a/seed/ruby-sdk/inline-types/Gemfile b/seed/ruby-sdk/inline-types/Gemfile deleted file mode 100644 index 49bd9cd0173..00000000000 --- a/seed/ruby-sdk/inline-types/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -gemspec - -gem "minitest", "~> 5.0" -gem "rake", "~> 13.0" -gem "rubocop", "~> 1.21" diff --git a/seed/ruby-sdk/inline-types/README.md b/seed/ruby-sdk/inline-types/README.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/ruby-sdk/inline-types/Rakefile b/seed/ruby-sdk/inline-types/Rakefile deleted file mode 100644 index 2bdbce0cf2c..00000000000 --- a/seed/ruby-sdk/inline-types/Rakefile +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -require "rake/testtask" -require "rubocop/rake_task" - -task default: %i[test rubocop] - -Rake::TestTask.new do |t| - t.pattern = "./test/**/test_*.rb" -end - -RuboCop::RakeTask.new diff --git a/seed/ruby-sdk/inline-types/fern_inline_types.gemspec b/seed/ruby-sdk/inline-types/fern_inline_types.gemspec deleted file mode 100644 index c1801fe45db..00000000000 --- a/seed/ruby-sdk/inline-types/fern_inline_types.gemspec +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -require_relative "lib/gemconfig" - -Gem::Specification.new do |spec| - spec.name = "fern_inline_types" - spec.version = "0.0.1" - spec.authors = SeedObjectClient::Gemconfig::AUTHORS - spec.email = SeedObjectClient::Gemconfig::EMAIL - spec.summary = SeedObjectClient::Gemconfig::SUMMARY - spec.description = SeedObjectClient::Gemconfig::DESCRIPTION - spec.homepage = SeedObjectClient::Gemconfig::HOMEPAGE - spec.required_ruby_version = ">= 2.7.0" - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = SeedObjectClient::Gemconfig::SOURCE_CODE_URI - spec.metadata["changelog_uri"] = SeedObjectClient::Gemconfig::CHANGELOG_URI - spec.files = Dir.glob("lib/**/*") - spec.bindir = "exe" - spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] - spec.add_dependency "async-http-faraday", ">= 0.0", "< 1.0" - spec.add_dependency "faraday", ">= 1.10", "< 3.0" - spec.add_dependency "faraday-net_http", ">= 1.0", "< 4.0" - spec.add_dependency "faraday-retry", ">= 1.0", "< 3.0" -end diff --git a/seed/ruby-sdk/inline-types/lib/fern_inline_types.rb b/seed/ruby-sdk/inline-types/lib/fern_inline_types.rb deleted file mode 100644 index 7e89860cb66..00000000000 --- a/seed/ruby-sdk/inline-types/lib/fern_inline_types.rb +++ /dev/null @@ -1,94 +0,0 @@ -# frozen_string_literal: true - -require_relative "types_export" -require_relative "requests" -require_relative "fern_inline_types/types/inline_type_1" -require_relative "fern_inline_types/types/root_type_1" - -module SeedObjectClient - class Client - # @param base_url [String] - # @param max_retries [Long] The number of times to retry a failed request, defaults to 2. - # @param timeout_in_seconds [Long] - # @return [SeedObjectClient::Client] - def initialize(base_url: nil, max_retries: nil, timeout_in_seconds: nil) - @request_client = SeedObjectClient::RequestClient.new( - base_url: base_url, - max_retries: max_retries, - timeout_in_seconds: timeout_in_seconds - ) - end - - # @param bar [Hash] Request of type SeedObjectClient::InlineType1, as a Hash - # * :foo (String) - # * :bar (Hash) - # * :foo (String) - # * :bar (String) - # * :my_enum (SeedObjectClient::InlineEnum) - # @param foo [String] - # @param request_options [SeedObjectClient::RequestOptions] - # @return [SeedObjectClient::RootType1] - # @example - # object = SeedObjectClient::Client.new(base_url: "https://api.example.com") - # object.get_root(bar: { foo: "foo", bar: { foo: "foo", bar: "bar", my_enum: SUNNY } }, foo: "foo") - def get_root(bar:, foo:, request_options: nil) - response = @request_client.conn.post do |req| - req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? - req.headers = { - **(req.headers || {}), - **@request_client.get_headers, - **(request_options&.additional_headers || {}) - }.compact - unless request_options.nil? || request_options&.additional_query_parameters.nil? - req.params = { **(request_options&.additional_query_parameters || {}) }.compact - end - req.body = { **(request_options&.additional_body_parameters || {}), bar: bar, foo: foo }.compact - req.url "#{@request_client.get_url(request_options: request_options)}/root/root" - end - SeedObjectClient::RootType1.from_json(json_object: response.body) - end - end - - class AsyncClient - # @param base_url [String] - # @param max_retries [Long] The number of times to retry a failed request, defaults to 2. - # @param timeout_in_seconds [Long] - # @return [SeedObjectClient::AsyncClient] - def initialize(base_url: nil, max_retries: nil, timeout_in_seconds: nil) - @async_request_client = SeedObjectClient::AsyncRequestClient.new( - base_url: base_url, - max_retries: max_retries, - timeout_in_seconds: timeout_in_seconds - ) - end - - # @param bar [Hash] Request of type SeedObjectClient::InlineType1, as a Hash - # * :foo (String) - # * :bar (Hash) - # * :foo (String) - # * :bar (String) - # * :my_enum (SeedObjectClient::InlineEnum) - # @param foo [String] - # @param request_options [SeedObjectClient::RequestOptions] - # @return [SeedObjectClient::RootType1] - # @example - # object = SeedObjectClient::Client.new(base_url: "https://api.example.com") - # object.get_root(bar: { foo: "foo", bar: { foo: "foo", bar: "bar", my_enum: SUNNY } }, foo: "foo") - def get_root(bar:, foo:, request_options: nil) - response = @async_request_client.conn.post do |req| - req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? - req.headers = { - **(req.headers || {}), - **@async_request_client.get_headers, - **(request_options&.additional_headers || {}) - }.compact - unless request_options.nil? || request_options&.additional_query_parameters.nil? - req.params = { **(request_options&.additional_query_parameters || {}) }.compact - end - req.body = { **(request_options&.additional_body_parameters || {}), bar: bar, foo: foo }.compact - req.url "#{@async_request_client.get_url(request_options: request_options)}/root/root" - end - SeedObjectClient::RootType1.from_json(json_object: response.body) - end - end -end diff --git a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inline_enum.rb b/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inline_enum.rb deleted file mode 100644 index c5cc415cac6..00000000000 --- a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inline_enum.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -module SeedObjectClient - class InlineEnum - SUNNY = "SUNNY" - CLOUDY = "CLOUDY" - RAINING = "RAINING" - SNOWING = "SNOWING" - end -end diff --git a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inline_type_1.rb b/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inline_type_1.rb deleted file mode 100644 index b2f58248832..00000000000 --- a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inline_type_1.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -require_relative "nested_inline_type_1" -require "ostruct" -require "json" - -module SeedObjectClient - class InlineType1 - # @return [String] - attr_reader :foo - # @return [SeedObjectClient::NestedInlineType1] - attr_reader :bar - # @return [OpenStruct] Additional properties unmapped to the current class definition - attr_reader :additional_properties - # @return [Object] - attr_reader :_field_set - protected :_field_set - - OMIT = Object.new - - # @param foo [String] - # @param bar [SeedObjectClient::NestedInlineType1] - # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition - # @return [SeedObjectClient::InlineType1] - def initialize(foo:, bar:, additional_properties: nil) - @foo = foo - @bar = bar - @additional_properties = additional_properties - @_field_set = { "foo": foo, "bar": bar } - end - - # Deserialize a JSON object to an instance of InlineType1 - # - # @param json_object [String] - # @return [SeedObjectClient::InlineType1] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - parsed_json = JSON.parse(json_object) - foo = parsed_json["foo"] - if parsed_json["bar"].nil? - bar = nil - else - bar = parsed_json["bar"].to_json - bar = SeedObjectClient::NestedInlineType1.from_json(json_object: bar) - end - new( - foo: foo, - bar: bar, - additional_properties: struct - ) - end - - # Serialize an instance of InlineType1 to a JSON object - # - # @return [String] - def to_json(*_args) - @_field_set&.to_json - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given - # hash and check each fields type against the current object's property - # definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - obj.foo.is_a?(String) != false || raise("Passed value for field obj.foo is not the expected type, validation failed.") - SeedObjectClient::NestedInlineType1.validate_raw(obj: obj.bar) - end - end -end diff --git a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inline_type_2.rb b/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inline_type_2.rb deleted file mode 100644 index 232e0e5f47f..00000000000 --- a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inline_type_2.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -require "ostruct" -require "json" - -module SeedObjectClient - class InlineType2 - # @return [String] - attr_reader :baz - # @return [OpenStruct] Additional properties unmapped to the current class definition - attr_reader :additional_properties - # @return [Object] - attr_reader :_field_set - protected :_field_set - - OMIT = Object.new - - # @param baz [String] - # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition - # @return [SeedObjectClient::InlineType2] - def initialize(baz:, additional_properties: nil) - @baz = baz - @additional_properties = additional_properties - @_field_set = { "baz": baz } - end - - # Deserialize a JSON object to an instance of InlineType2 - # - # @param json_object [String] - # @return [SeedObjectClient::InlineType2] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - parsed_json = JSON.parse(json_object) - baz = parsed_json["baz"] - new(baz: baz, additional_properties: struct) - end - - # Serialize an instance of InlineType2 to a JSON object - # - # @return [String] - def to_json(*_args) - @_field_set&.to_json - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given - # hash and check each fields type against the current object's property - # definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - obj.baz.is_a?(String) != false || raise("Passed value for field obj.baz is not the expected type, validation failed.") - end - end -end diff --git a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inlined_discriminated_union_1.rb b/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inlined_discriminated_union_1.rb deleted file mode 100644 index 8efbcfeb3bf..00000000000 --- a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inlined_discriminated_union_1.rb +++ /dev/null @@ -1,94 +0,0 @@ -# frozen_string_literal: true - -require "json" -require_relative "inline_type_1" -require_relative "inline_type_2" - -module SeedObjectClient - class InlinedDiscriminatedUnion1 - # @return [Object] - attr_reader :member - # @return [String] - attr_reader :discriminant - - private_class_method :new - alias kind_of? is_a? - - # @param member [Object] - # @param discriminant [String] - # @return [SeedObjectClient::InlinedDiscriminatedUnion1] - def initialize(member:, discriminant:) - @member = member - @discriminant = discriminant - end - - # Deserialize a JSON object to an instance of InlinedDiscriminatedUnion1 - # - # @param json_object [String] - # @return [SeedObjectClient::InlinedDiscriminatedUnion1] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - member = case struct.type - when "type1" - SeedObjectClient::InlineType1.from_json(json_object: json_object) - when "type2" - SeedObjectClient::InlineType2.from_json(json_object: json_object) - else - SeedObjectClient::InlineType1.from_json(json_object: json_object) - end - new(member: member, discriminant: struct.type) - end - - # For Union Types, to_json functionality is delegated to the wrapped member. - # - # @return [String] - def to_json(*_args) - case @discriminant - when "type1" - { **@member.to_json, type: @discriminant }.to_json - when "type2" - { **@member.to_json, type: @discriminant }.to_json - else - { "type": @discriminant, value: @member }.to_json - end - @member.to_json - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given - # hash and check each fields type against the current object's property - # definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - case obj.type - when "type1" - SeedObjectClient::InlineType1.validate_raw(obj: obj) - when "type2" - SeedObjectClient::InlineType2.validate_raw(obj: obj) - else - raise("Passed value matched no type within the union, validation failed.") - end - end - - # For Union Types, is_a? functionality is delegated to the wrapped member. - # - # @param obj [Object] - # @return [Boolean] - def is_a?(obj) - @member.is_a?(obj) - end - - # @param member [SeedObjectClient::InlineType1] - # @return [SeedObjectClient::InlinedDiscriminatedUnion1] - def self.type_1(member:) - new(member: member, discriminant: "type1") - end - - # @param member [SeedObjectClient::InlineType2] - # @return [SeedObjectClient::InlinedDiscriminatedUnion1] - def self.type_2(member:) - new(member: member, discriminant: "type2") - end - end -end diff --git a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inlined_undiscriminated_union_1.rb b/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inlined_undiscriminated_union_1.rb deleted file mode 100644 index ec4ef8064b6..00000000000 --- a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/inlined_undiscriminated_union_1.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -require "json" -require_relative "inline_type_1" -require_relative "inline_type_2" - -module SeedObjectClient - class InlinedUndiscriminatedUnion1 - # Deserialize a JSON object to an instance of InlinedUndiscriminatedUnion1 - # - # @param json_object [String] - # @return [SeedObjectClient::InlinedUndiscriminatedUnion1] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - begin - SeedObjectClient::InlineType1.validate_raw(obj: struct) - return SeedObjectClient::InlineType1.from_json(json_object: struct) unless struct.nil? - - return nil - rescue StandardError - # noop - end - begin - SeedObjectClient::InlineType2.validate_raw(obj: struct) - return SeedObjectClient::InlineType2.from_json(json_object: struct) unless struct.nil? - - return nil - rescue StandardError - # noop - end - struct - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given - # hash and check each fields type against the current object's property - # definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - begin - return SeedObjectClient::InlineType1.validate_raw(obj: obj) - rescue StandardError - # noop - end - begin - return SeedObjectClient::InlineType2.validate_raw(obj: obj) - rescue StandardError - # noop - end - raise("Passed value matched no type within the union, validation failed.") - end - end -end diff --git a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/nested_inline_type_1.rb b/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/nested_inline_type_1.rb deleted file mode 100644 index 863971a0fa7..00000000000 --- a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/nested_inline_type_1.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -require_relative "inline_enum" -require "ostruct" -require "json" - -module SeedObjectClient - class NestedInlineType1 - # @return [String] - attr_reader :foo - # @return [String] - attr_reader :bar - # @return [SeedObjectClient::InlineEnum] - attr_reader :my_enum - # @return [OpenStruct] Additional properties unmapped to the current class definition - attr_reader :additional_properties - # @return [Object] - attr_reader :_field_set - protected :_field_set - - OMIT = Object.new - - # @param foo [String] - # @param bar [String] - # @param my_enum [SeedObjectClient::InlineEnum] - # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition - # @return [SeedObjectClient::NestedInlineType1] - def initialize(foo:, bar:, my_enum:, additional_properties: nil) - @foo = foo - @bar = bar - @my_enum = my_enum - @additional_properties = additional_properties - @_field_set = { "foo": foo, "bar": bar, "myEnum": my_enum } - end - - # Deserialize a JSON object to an instance of NestedInlineType1 - # - # @param json_object [String] - # @return [SeedObjectClient::NestedInlineType1] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - parsed_json = JSON.parse(json_object) - foo = parsed_json["foo"] - bar = parsed_json["bar"] - my_enum = parsed_json["myEnum"] - new( - foo: foo, - bar: bar, - my_enum: my_enum, - additional_properties: struct - ) - end - - # Serialize an instance of NestedInlineType1 to a JSON object - # - # @return [String] - def to_json(*_args) - @_field_set&.to_json - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given - # hash and check each fields type against the current object's property - # definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - obj.foo.is_a?(String) != false || raise("Passed value for field obj.foo is not the expected type, validation failed.") - obj.bar.is_a?(String) != false || raise("Passed value for field obj.bar is not the expected type, validation failed.") - obj.my_enum.is_a?(SeedObjectClient::InlineEnum) != false || raise("Passed value for field obj.my_enum is not the expected type, validation failed.") - end - end -end diff --git a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/root_type_1.rb b/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/root_type_1.rb deleted file mode 100644 index a17734f2980..00000000000 --- a/seed/ruby-sdk/inline-types/lib/fern_inline_types/types/root_type_1.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -require_relative "inline_type_1" -require "ostruct" -require "json" - -module SeedObjectClient - class RootType1 - # @return [String] - attr_reader :foo - # @return [SeedObjectClient::InlineType1] - attr_reader :bar - # @return [OpenStruct] Additional properties unmapped to the current class definition - attr_reader :additional_properties - # @return [Object] - attr_reader :_field_set - protected :_field_set - - OMIT = Object.new - - # @param foo [String] - # @param bar [SeedObjectClient::InlineType1] - # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition - # @return [SeedObjectClient::RootType1] - def initialize(foo:, bar:, additional_properties: nil) - @foo = foo - @bar = bar - @additional_properties = additional_properties - @_field_set = { "foo": foo, "bar": bar } - end - - # Deserialize a JSON object to an instance of RootType1 - # - # @param json_object [String] - # @return [SeedObjectClient::RootType1] - def self.from_json(json_object:) - struct = JSON.parse(json_object, object_class: OpenStruct) - parsed_json = JSON.parse(json_object) - foo = parsed_json["foo"] - if parsed_json["bar"].nil? - bar = nil - else - bar = parsed_json["bar"].to_json - bar = SeedObjectClient::InlineType1.from_json(json_object: bar) - end - new( - foo: foo, - bar: bar, - additional_properties: struct - ) - end - - # Serialize an instance of RootType1 to a JSON object - # - # @return [String] - def to_json(*_args) - @_field_set&.to_json - end - - # Leveraged for Union-type generation, validate_raw attempts to parse the given - # hash and check each fields type against the current object's property - # definitions. - # - # @param obj [Object] - # @return [Void] - def self.validate_raw(obj:) - obj.foo.is_a?(String) != false || raise("Passed value for field obj.foo is not the expected type, validation failed.") - SeedObjectClient::InlineType1.validate_raw(obj: obj.bar) - end - end -end diff --git a/seed/ruby-sdk/inline-types/lib/gemconfig.rb b/seed/ruby-sdk/inline-types/lib/gemconfig.rb deleted file mode 100644 index 87100746b48..00000000000 --- a/seed/ruby-sdk/inline-types/lib/gemconfig.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module SeedObjectClient - module Gemconfig - VERSION = "" - AUTHORS = [""].freeze - EMAIL = "" - SUMMARY = "" - DESCRIPTION = "" - HOMEPAGE = "https://github.com/inline-types/fern" - SOURCE_CODE_URI = "https://github.com/inline-types/fern" - CHANGELOG_URI = "https://github.com/inline-types/fern/blob/master/CHANGELOG.md" - end -end diff --git a/seed/ruby-sdk/inline-types/lib/requests.rb b/seed/ruby-sdk/inline-types/lib/requests.rb deleted file mode 100644 index 3510d05bf7b..00000000000 --- a/seed/ruby-sdk/inline-types/lib/requests.rb +++ /dev/null @@ -1,132 +0,0 @@ -# frozen_string_literal: true - -require "faraday" -require "faraday/retry" -require "async/http/faraday" - -module SeedObjectClient - class RequestClient - # @return [Faraday] - attr_reader :conn - # @return [String] - attr_reader :base_url - - # @param base_url [String] - # @param max_retries [Long] The number of times to retry a failed request, defaults to 2. - # @param timeout_in_seconds [Long] - # @return [SeedObjectClient::RequestClient] - def initialize(base_url: nil, max_retries: nil, timeout_in_seconds: nil) - @base_url = base_url - @conn = Faraday.new do |faraday| - faraday.request :json - faraday.response :raise_error, include_request: true - faraday.request :retry, { max: max_retries } unless max_retries.nil? - faraday.options.timeout = timeout_in_seconds unless timeout_in_seconds.nil? - end - end - - # @param request_options [SeedObjectClient::RequestOptions] - # @return [String] - def get_url(request_options: nil) - request_options&.base_url || @base_url - end - - # @return [Hash{String => String}] - def get_headers - { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "fern_inline_types", "X-Fern-SDK-Version": "0.0.1" } - end - end - - class AsyncRequestClient - # @return [Faraday] - attr_reader :conn - # @return [String] - attr_reader :base_url - - # @param base_url [String] - # @param max_retries [Long] The number of times to retry a failed request, defaults to 2. - # @param timeout_in_seconds [Long] - # @return [SeedObjectClient::AsyncRequestClient] - def initialize(base_url: nil, max_retries: nil, timeout_in_seconds: nil) - @base_url = base_url - @conn = Faraday.new do |faraday| - faraday.request :json - faraday.response :raise_error, include_request: true - faraday.adapter :async_http - faraday.request :retry, { max: max_retries } unless max_retries.nil? - faraday.options.timeout = timeout_in_seconds unless timeout_in_seconds.nil? - end - end - - # @param request_options [SeedObjectClient::RequestOptions] - # @return [String] - def get_url(request_options: nil) - request_options&.base_url || @base_url - end - - # @return [Hash{String => String}] - def get_headers - { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "fern_inline_types", "X-Fern-SDK-Version": "0.0.1" } - end - end - - # Additional options for request-specific configuration when calling APIs via the - # SDK. - class RequestOptions - # @return [String] - attr_reader :base_url - # @return [Hash{String => Object}] - attr_reader :additional_headers - # @return [Hash{String => Object}] - attr_reader :additional_query_parameters - # @return [Hash{String => Object}] - attr_reader :additional_body_parameters - # @return [Long] - attr_reader :timeout_in_seconds - - # @param base_url [String] - # @param additional_headers [Hash{String => Object}] - # @param additional_query_parameters [Hash{String => Object}] - # @param additional_body_parameters [Hash{String => Object}] - # @param timeout_in_seconds [Long] - # @return [SeedObjectClient::RequestOptions] - def initialize(base_url: nil, additional_headers: nil, additional_query_parameters: nil, - additional_body_parameters: nil, timeout_in_seconds: nil) - @base_url = base_url - @additional_headers = additional_headers - @additional_query_parameters = additional_query_parameters - @additional_body_parameters = additional_body_parameters - @timeout_in_seconds = timeout_in_seconds - end - end - - # Additional options for request-specific configuration when calling APIs via the - # SDK. - class IdempotencyRequestOptions - # @return [String] - attr_reader :base_url - # @return [Hash{String => Object}] - attr_reader :additional_headers - # @return [Hash{String => Object}] - attr_reader :additional_query_parameters - # @return [Hash{String => Object}] - attr_reader :additional_body_parameters - # @return [Long] - attr_reader :timeout_in_seconds - - # @param base_url [String] - # @param additional_headers [Hash{String => Object}] - # @param additional_query_parameters [Hash{String => Object}] - # @param additional_body_parameters [Hash{String => Object}] - # @param timeout_in_seconds [Long] - # @return [SeedObjectClient::IdempotencyRequestOptions] - def initialize(base_url: nil, additional_headers: nil, additional_query_parameters: nil, - additional_body_parameters: nil, timeout_in_seconds: nil) - @base_url = base_url - @additional_headers = additional_headers - @additional_query_parameters = additional_query_parameters - @additional_body_parameters = additional_body_parameters - @timeout_in_seconds = timeout_in_seconds - end - end -end diff --git a/seed/ruby-sdk/inline-types/lib/types_export.rb b/seed/ruby-sdk/inline-types/lib/types_export.rb deleted file mode 100644 index adae273e434..00000000000 --- a/seed/ruby-sdk/inline-types/lib/types_export.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -require_relative "fern_inline_types/types/root_type_1" -require_relative "fern_inline_types/types/inline_type_1" -require_relative "fern_inline_types/types/inline_type_2" -require_relative "fern_inline_types/types/nested_inline_type_1" -require_relative "fern_inline_types/types/inlined_discriminated_union_1" -require_relative "fern_inline_types/types/inlined_undiscriminated_union_1" -require_relative "fern_inline_types/types/inline_enum" diff --git a/seed/ruby-sdk/inline-types/snippet-templates.json b/seed/ruby-sdk/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/ruby-sdk/inline-types/snippet.json b/seed/ruby-sdk/inline-types/snippet.json deleted file mode 100644 index ef341eb4337..00000000000 --- a/seed/ruby-sdk/inline-types/snippet.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "endpoints": [ - { - "id": { - "path": "/root/root", - "method": "POST", - "identifierOverride": "endpoint_.getRoot" - }, - "snippet": { - "client": "require \"fern_inline_types\"\n\nobject = SeedObjectClient::Client.new(base_url: \"https://api.example.com\")\nobject.get_root(bar: { foo: \"foo\", bar: { foo: \"foo\", bar: \"bar\", my_enum: SUNNY } }, foo: \"foo\")", - "type": "ruby" - } - }, - { - "id": { - "path": "/root/root", - "method": "POST", - "identifierOverride": "endpoint_.getRoot" - }, - "snippet": { - "client": "require \"fern_inline_types\"\n\nobject = SeedObjectClient::Client.new(base_url: \"https://api.example.com\")\nobject.get_root(bar: { foo: \"foo\", bar: { foo: \"foo\", bar: \"bar\", my_enum: SUNNY } }, foo: \"foo\")", - "type": "ruby" - } - } - ], - "types": {} -} \ No newline at end of file diff --git a/seed/ruby-sdk/inline-types/test/test_fern_inline_types.rb b/seed/ruby-sdk/inline-types/test/test_fern_inline_types.rb deleted file mode 100644 index c4ac74a66e3..00000000000 --- a/seed/ruby-sdk/inline-types/test/test_fern_inline_types.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -require_relative "test_helper" -require "fern_inline_types" - -# Basic SeedObjectClient tests -class TestSeedObjectClient < Minitest::Test - def test_function - # SeedObjectClient::Client.new - end -end diff --git a/seed/ruby-sdk/inline-types/test/test_helper.rb b/seed/ruby-sdk/inline-types/test/test_helper.rb deleted file mode 100644 index c49fbd539bd..00000000000 --- a/seed/ruby-sdk/inline-types/test/test_helper.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -$LOAD_PATH.unshift File.expand_path("../lib", __dir__) - -require "minitest/autorun" -require "fern_inline_types" diff --git a/seed/ts-express/inline-types/.mock/definition/api.yml b/seed/ts-express/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/ts-express/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/ts-express/inline-types/.mock/fern.config.json b/seed/ts-express/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/ts-express/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/ts-express/inline-types/.mock/generators.yml b/seed/ts-express/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/ts-express/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/ts-express/inline-types/.mock/ir.json b/seed/ts-express/inline-types/.mock/ir.json deleted file mode 100644 index 00d22b232be..00000000000 --- a/seed/ts-express/inline-types/.mock/ir.json +++ /dev/null @@ -1,4159 +0,0 @@ -{ - "fdrApiDefinitionId": null, - "apiVersion": null, - "apiName": { - "originalName": "object", - "camelCase": { - "unsafeName": "object", - "safeName": "object" - }, - "snakeCase": { - "unsafeName": "object", - "safeName": "object" - }, - "screamingSnakeCase": { - "unsafeName": "OBJECT", - "safeName": "OBJECT" - }, - "pascalCase": { - "unsafeName": "Object", - "safeName": "Object" - } - }, - "apiDisplayName": null, - "apiDocs": null, - "auth": { - "requirement": "ALL", - "schemes": [], - "docs": null - }, - "headers": [], - "idempotencyHeaders": [], - "types": { - "type_:RequestTypeInlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RequestTypeInlineType1" - }, - "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_:RootType1": { - "inline": null, - "name": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - }, - "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 - }, - { - "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": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1", - "default": null, - "inline": null - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:RootType1InlineType1", - "type_:RootType1InlineType1NestedInlineType1", - "type_:InlineEnum" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:RootType1InlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1" - }, - "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 - }, - { - "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": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1", - "default": null, - "inline": null - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:RootType1InlineType1NestedInlineType1", - "type_:InlineEnum" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:RootType1InlineType1NestedInlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - }, - "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 - }, - { - "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": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "valueType": { - "_type": "named", - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum", - "default": null, - "inline": null - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:InlineEnum" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:DiscriminatedUnion1": { - "inline": true, - "name": { - "name": { - "originalName": "DiscriminatedUnion1", - "camelCase": { - "unsafeName": "discriminatedUnion1", - "safeName": "discriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1", - "safeName": "discriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1", - "safeName": "DISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1", - "safeName": "DiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1" - }, - "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": "type1", - "camelCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "snakeCase": { - "unsafeName": "type_1", - "safeName": "type_1" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_1", - "safeName": "TYPE_1" - }, - "pascalCase": { - "unsafeName": "Type1", - "safeName": "Type1" - } - }, - "wireValue": "type1" - }, - "shape": { - "_type": "samePropertiesAsObject", - "name": { - "originalName": "DiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType1", - "safeName": "discriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_1", - "safeName": "discriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType1", - "safeName": "DiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType1" - }, - "displayName": null, - "availability": null, - "docs": null - }, - { - "discriminantValue": { - "name": { - "originalName": "type2", - "camelCase": { - "unsafeName": "type2", - "safeName": "type2" - }, - "snakeCase": { - "unsafeName": "type_2", - "safeName": "type_2" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_2", - "safeName": "TYPE_2" - }, - "pascalCase": { - "unsafeName": "Type2", - "safeName": "Type2" - } - }, - "wireValue": "type2" - }, - "shape": { - "_type": "samePropertiesAsObject", - "name": { - "originalName": "DiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType2", - "safeName": "discriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_2", - "safeName": "discriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType2", - "safeName": "DiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType2" - }, - "displayName": null, - "availability": null, - "docs": null - } - ] - }, - "referencedTypes": [ - "type_:DiscriminatedUnion1InlineType1", - "type_:DiscriminatedUnion1InlineType2" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:DiscriminatedUnion1InlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "DiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType1", - "safeName": "discriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_1", - "safeName": "discriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType1", - "safeName": "DiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType1" - }, - "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_:DiscriminatedUnion1InlineType2": { - "inline": true, - "name": { - "name": { - "originalName": "DiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType2", - "safeName": "discriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_2", - "safeName": "discriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType2", - "safeName": "DiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType2" - }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "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_:UndiscriminatedUnion1": { - "inline": true, - "name": { - "name": { - "originalName": "UndiscriminatedUnion1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1", - "safeName": "undiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1", - "safeName": "undiscriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1", - "safeName": "UNDISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1", - "safeName": "UndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1" - }, - "shape": { - "_type": "undiscriminatedUnion", - "members": [ - { - "type": { - "_type": "named", - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType1", - "default": null, - "inline": null - }, - "docs": null - }, - { - "type": { - "_type": "named", - "name": { - "originalName": "UndiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType2", - "safeName": "undiscriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_2", - "safeName": "undiscriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType2", - "safeName": "UndiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType2", - "default": null, - "inline": null - }, - "docs": null - } - ] - }, - "referencedTypes": [ - "type_:UndiscriminatedUnion1InlineType1", - "type_:UndiscriminatedUnion1InlineType2" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:UndiscriminatedUnion1InlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType1" - }, - "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_:UndiscriminatedUnion1InlineType2": { - "inline": true, - "name": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType2", - "safeName": "undiscriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_2", - "safeName": "undiscriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType2", - "safeName": "UndiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType2" - }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "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_:InlineEnum": { - "inline": true, - "name": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum" - }, - "shape": { - "_type": "enum", - "default": null, - "values": [ - { - "name": { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "CLOUDY", - "camelCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "snakeCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "screamingSnakeCase": { - "unsafeName": "CLOUDY", - "safeName": "CLOUDY" - }, - "pascalCase": { - "unsafeName": "Cloudy", - "safeName": "Cloudy" - } - }, - "wireValue": "CLOUDY" - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "RAINING", - "camelCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "snakeCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "screamingSnakeCase": { - "unsafeName": "RAINING", - "safeName": "RAINING" - }, - "pascalCase": { - "unsafeName": "Raining", - "safeName": "Raining" - } - }, - "wireValue": "RAINING" - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "SNOWING", - "camelCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "snakeCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "screamingSnakeCase": { - "unsafeName": "SNOWING", - "safeName": "SNOWING" - }, - "pascalCase": { - "unsafeName": "Snowing", - "safeName": "Snowing" - } - }, - "wireValue": "SNOWING" - }, - "availability": null, - "docs": null - } - ] - }, - "referencedTypes": [], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - } - }, - "errors": {}, - "services": { - "service_": { - "availability": null, - "name": { - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "displayName": null, - "basePath": { - "head": "/root", - "parts": [] - }, - "headers": [], - "pathParameters": [], - "encoding": { - "json": {}, - "proto": null - }, - "transport": { - "type": "http" - }, - "endpoints": [ - { - "id": "endpoint_.getRoot", - "name": { - "originalName": "getRoot", - "camelCase": { - "unsafeName": "getRoot", - "safeName": "getRoot" - }, - "snakeCase": { - "unsafeName": "get_root", - "safeName": "get_root" - }, - "screamingSnakeCase": { - "unsafeName": "GET_ROOT", - "safeName": "GET_ROOT" - }, - "pascalCase": { - "unsafeName": "GetRoot", - "safeName": "GetRoot" - } - }, - "displayName": null, - "auth": false, - "idempotent": false, - "baseUrl": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/root", - "parts": [] - }, - "fullPath": { - "head": "/root/root", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "inlinedRequestBody", - "name": { - "originalName": "PostRootRequest", - "camelCase": { - "unsafeName": "postRootRequest", - "safeName": "postRootRequest" - }, - "snakeCase": { - "unsafeName": "post_root_request", - "safeName": "post_root_request" - }, - "screamingSnakeCase": { - "unsafeName": "POST_ROOT_REQUEST", - "safeName": "POST_ROOT_REQUEST" - }, - "pascalCase": { - "unsafeName": "PostRootRequest", - "safeName": "PostRootRequest" - } - }, - "extends": [], - "contentType": "application/json", - "properties": [ - { - "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": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RequestTypeInlineType1", - "default": null, - "inline": null - }, - "availability": null, - "docs": 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 - } - ], - "extra-properties": false, - "extendedProperties": [], - "docs": null - }, - "sdkRequest": { - "shape": { - "type": "wrapper", - "wrapperName": { - "originalName": "PostRootRequest", - "camelCase": { - "unsafeName": "postRootRequest", - "safeName": "postRootRequest" - }, - "snakeCase": { - "unsafeName": "post_root_request", - "safeName": "post_root_request" - }, - "screamingSnakeCase": { - "unsafeName": "POST_ROOT_REQUEST", - "safeName": "POST_ROOT_REQUEST" - }, - "pascalCase": { - "unsafeName": "PostRootRequest", - "safeName": "PostRootRequest" - } - }, - "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": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1", - "default": null, - "inline": null - }, - "docs": null - } - }, - "status-code": null - }, - "errors": [], - "userSpecifiedExamples": [], - "autogeneratedExamples": [ - { - "example": { - "id": "cc979ed415b4638d8e170df64556fbd1154268c5", - "url": "/root/root", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "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" - }, - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RequestTypeInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RequestTypeInlineType1" - } - }, - "jsonExample": { - "foo": "foo" - } - } - }, - { - "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" - }, - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ], - "jsonExample": { - "bar": { - "foo": "foo" - }, - "foo": "foo" - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "bar" - } - } - }, - "jsonExample": "bar" - } - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "enum", - "value": { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - } - }, - "typeName": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum" - } - }, - "jsonExample": "SUNNY" - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - } - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "availability": null, - "docs": null - }, - { - "id": "endpoint_.getDiscriminatedUnion", - "name": { - "originalName": "getDiscriminatedUnion", - "camelCase": { - "unsafeName": "getDiscriminatedUnion", - "safeName": "getDiscriminatedUnion" - }, - "snakeCase": { - "unsafeName": "get_discriminated_union", - "safeName": "get_discriminated_union" - }, - "screamingSnakeCase": { - "unsafeName": "GET_DISCRIMINATED_UNION", - "safeName": "GET_DISCRIMINATED_UNION" - }, - "pascalCase": { - "unsafeName": "GetDiscriminatedUnion", - "safeName": "GetDiscriminatedUnion" - } - }, - "displayName": null, - "auth": false, - "idempotent": false, - "baseUrl": null, - "method": "GET", - "basePath": null, - "path": { - "head": "/discriminated-union", - "parts": [] - }, - "fullPath": { - "head": "/root/discriminated-union", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": null, - "sdkRequest": null, - "response": { - "body": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": { - "originalName": "DiscriminatedUnion1", - "camelCase": { - "unsafeName": "discriminatedUnion1", - "safeName": "discriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1", - "safeName": "discriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1", - "safeName": "DISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1", - "safeName": "DiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1", - "default": null, - "inline": null - }, - "docs": null - } - }, - "status-code": null - }, - "errors": [], - "userSpecifiedExamples": [], - "autogeneratedExamples": [ - { - "example": { - "id": "66b0f09d479437029bc19bcd824ec0242f8f71e8", - "url": "/root/discriminated-union", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "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": "type1", - "camelCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "snakeCase": { - "unsafeName": "type_1", - "safeName": "type_1" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_1", - "safeName": "TYPE_1" - }, - "pascalCase": { - "unsafeName": "Type1", - "safeName": "Type1" - } - }, - "wireValue": "type1" - }, - "shape": { - "type": "samePropertiesAsObject", - "typeId": "type_:DiscriminatedUnion1InlineType1", - "object": { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "DiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType1", - "safeName": "discriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_1", - "safeName": "discriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType1", - "safeName": "DiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ] - } - } - } - }, - "typeName": { - "name": { - "originalName": "DiscriminatedUnion1", - "camelCase": { - "unsafeName": "discriminatedUnion1", - "safeName": "discriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1", - "safeName": "discriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1", - "safeName": "DISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1", - "safeName": "DiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1" - } - }, - "jsonExample": { - "type": "type1", - "foo": "foo" - } - } - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "availability": null, - "docs": null - }, - { - "id": "endpoint_.getUndiscriminatedUnion", - "name": { - "originalName": "getUndiscriminatedUnion", - "camelCase": { - "unsafeName": "getUndiscriminatedUnion", - "safeName": "getUndiscriminatedUnion" - }, - "snakeCase": { - "unsafeName": "get_undiscriminated_union", - "safeName": "get_undiscriminated_union" - }, - "screamingSnakeCase": { - "unsafeName": "GET_UNDISCRIMINATED_UNION", - "safeName": "GET_UNDISCRIMINATED_UNION" - }, - "pascalCase": { - "unsafeName": "GetUndiscriminatedUnion", - "safeName": "GetUndiscriminatedUnion" - } - }, - "displayName": null, - "auth": false, - "idempotent": false, - "baseUrl": null, - "method": "GET", - "basePath": null, - "path": { - "head": "/undiscriminated-union", - "parts": [] - }, - "fullPath": { - "head": "/root/undiscriminated-union", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": null, - "sdkRequest": null, - "response": { - "body": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": { - "originalName": "UndiscriminatedUnion1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1", - "safeName": "undiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1", - "safeName": "undiscriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1", - "safeName": "UNDISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1", - "safeName": "UndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1", - "default": null, - "inline": null - }, - "docs": null - } - }, - "status-code": null - }, - "errors": [], - "userSpecifiedExamples": [], - "autogeneratedExamples": [ - { - "example": { - "id": "4e32aff3299d7769cc9e184747382c076b82c724", - "url": "/root/undiscriminated-union", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": null, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "undiscriminatedUnion", - "index": 0, - "singleUnionType": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ] - }, - "typeName": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType1" - } - }, - "jsonExample": { - "foo": "foo" - } - } - }, - "typeName": { - "name": { - "originalName": "UndiscriminatedUnion1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1", - "safeName": "undiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1", - "safeName": "undiscriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1", - "safeName": "UNDISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1", - "safeName": "UndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1" - } - }, - "jsonExample": { - "foo": "foo" - } - } - } - }, - "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_": [ - "type_:RequestTypeInlineType1", - "type_:RootType1", - "type_:RootType1InlineType1", - "type_:RootType1InlineType1NestedInlineType1", - "type_:DiscriminatedUnion1", - "type_:DiscriminatedUnion1InlineType1", - "type_:DiscriminatedUnion1InlineType2", - "type_:UndiscriminatedUnion1", - "type_:UndiscriminatedUnion1InlineType1", - "type_:UndiscriminatedUnion1InlineType2", - "type_:InlineEnum" - ] - }, - "sharedTypes": [] - }, - "webhookGroups": {}, - "websocketChannels": {}, - "readmeConfig": null, - "sourceConfig": null, - "publishConfig": null, - "dynamic": { - "version": "1.0.0", - "types": { - "type_:RequestTypeInlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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_:RootType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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" - } - }, - { - "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_:RootType1InlineType1" - } - } - ] - }, - "type_:RootType1InlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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" - } - }, - { - "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_:RootType1InlineType1NestedInlineType1" - } - } - ] - }, - "type_:RootType1InlineType1NestedInlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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" - } - }, - { - "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": "primitive", - "value": "STRING" - } - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "typeReference": { - "_type": "named", - "value": "type_:InlineEnum" - } - } - ] - }, - "type_:DiscriminatedUnion1": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "DiscriminatedUnion1", - "camelCase": { - "unsafeName": "discriminatedUnion1", - "safeName": "discriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1", - "safeName": "discriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1", - "safeName": "DISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1", - "safeName": "DiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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": { - "type1": { - "type": "samePropertiesAsObject", - "typeId": "type_:DiscriminatedUnion1InlineType1", - "discriminantValue": { - "name": { - "originalName": "type1", - "camelCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "snakeCase": { - "unsafeName": "type_1", - "safeName": "type_1" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_1", - "safeName": "TYPE_1" - }, - "pascalCase": { - "unsafeName": "Type1", - "safeName": "Type1" - } - }, - "wireValue": "type1" - }, - "properties": [] - }, - "type2": { - "type": "samePropertiesAsObject", - "typeId": "type_:DiscriminatedUnion1InlineType2", - "discriminantValue": { - "name": { - "originalName": "type2", - "camelCase": { - "unsafeName": "type2", - "safeName": "type2" - }, - "snakeCase": { - "unsafeName": "type_2", - "safeName": "type_2" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_2", - "safeName": "TYPE_2" - }, - "pascalCase": { - "unsafeName": "Type2", - "safeName": "Type2" - } - }, - "wireValue": "type2" - }, - "properties": [] - } - } - }, - "type_:DiscriminatedUnion1InlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "DiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType1", - "safeName": "discriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_1", - "safeName": "discriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType1", - "safeName": "DiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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_:DiscriminatedUnion1InlineType2": { - "type": "object", - "declaration": { - "name": { - "originalName": "DiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType2", - "safeName": "discriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_2", - "safeName": "discriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType2", - "safeName": "DiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "typeReference": { - "_type": "primitive", - "value": "STRING" - } - } - ] - }, - "type_:UndiscriminatedUnion1": { - "type": "undiscriminatedUnion", - "declaration": { - "name": { - "originalName": "UndiscriminatedUnion1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1", - "safeName": "undiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1", - "safeName": "undiscriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1", - "safeName": "UNDISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1", - "safeName": "UndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "types": [ - { - "_type": "named", - "value": "type_:UndiscriminatedUnion1InlineType1" - }, - { - "_type": "named", - "value": "type_:UndiscriminatedUnion1InlineType2" - } - ] - }, - "type_:UndiscriminatedUnion1InlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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_:UndiscriminatedUnion1InlineType2": { - "type": "object", - "declaration": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType2", - "safeName": "undiscriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_2", - "safeName": "undiscriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType2", - "safeName": "UndiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "typeReference": { - "_type": "primitive", - "value": "STRING" - } - } - ] - }, - "type_:InlineEnum": { - "type": "enum", - "declaration": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "values": [ - { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - }, - { - "name": { - "originalName": "CLOUDY", - "camelCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "snakeCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "screamingSnakeCase": { - "unsafeName": "CLOUDY", - "safeName": "CLOUDY" - }, - "pascalCase": { - "unsafeName": "Cloudy", - "safeName": "Cloudy" - } - }, - "wireValue": "CLOUDY" - }, - { - "name": { - "originalName": "RAINING", - "camelCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "snakeCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "screamingSnakeCase": { - "unsafeName": "RAINING", - "safeName": "RAINING" - }, - "pascalCase": { - "unsafeName": "Raining", - "safeName": "Raining" - } - }, - "wireValue": "RAINING" - }, - { - "name": { - "originalName": "SNOWING", - "camelCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "snakeCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "screamingSnakeCase": { - "unsafeName": "SNOWING", - "safeName": "SNOWING" - }, - "pascalCase": { - "unsafeName": "Snowing", - "safeName": "Snowing" - } - }, - "wireValue": "SNOWING" - } - ] - } - }, - "headers": [], - "endpoints": { - "endpoint_.getRoot": { - "auth": null, - "declaration": { - "name": { - "originalName": "getRoot", - "camelCase": { - "unsafeName": "getRoot", - "safeName": "getRoot" - }, - "snakeCase": { - "unsafeName": "get_root", - "safeName": "get_root" - }, - "screamingSnakeCase": { - "unsafeName": "GET_ROOT", - "safeName": "GET_ROOT" - }, - "pascalCase": { - "unsafeName": "GetRoot", - "safeName": "GetRoot" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/root/root" - }, - "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "PostRootRequest", - "camelCase": { - "unsafeName": "postRootRequest", - "safeName": "postRootRequest" - }, - "snakeCase": { - "unsafeName": "post_root_request", - "safeName": "post_root_request" - }, - "screamingSnakeCase": { - "unsafeName": "POST_ROOT_REQUEST", - "safeName": "POST_ROOT_REQUEST" - }, - "pascalCase": { - "unsafeName": "PostRootRequest", - "safeName": "PostRootRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "pathParameters": [], - "queryParameters": [], - "headers": [], - "body": { - "type": "properties", - "value": [ - { - "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_:RequestTypeInlineType1" - } - }, - { - "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" - } - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false - } - }, - "response": { - "type": "json" - } - }, - "endpoint_.getDiscriminatedUnion": { - "auth": null, - "declaration": { - "name": { - "originalName": "getDiscriminatedUnion", - "camelCase": { - "unsafeName": "getDiscriminatedUnion", - "safeName": "getDiscriminatedUnion" - }, - "snakeCase": { - "unsafeName": "get_discriminated_union", - "safeName": "get_discriminated_union" - }, - "screamingSnakeCase": { - "unsafeName": "GET_DISCRIMINATED_UNION", - "safeName": "GET_DISCRIMINATED_UNION" - }, - "pascalCase": { - "unsafeName": "GetDiscriminatedUnion", - "safeName": "GetDiscriminatedUnion" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "GET", - "path": "/root/discriminated-union" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": null - }, - "response": { - "type": "json" - } - }, - "endpoint_.getUndiscriminatedUnion": { - "auth": null, - "declaration": { - "name": { - "originalName": "getUndiscriminatedUnion", - "camelCase": { - "unsafeName": "getUndiscriminatedUnion", - "safeName": "getUndiscriminatedUnion" - }, - "snakeCase": { - "unsafeName": "get_undiscriminated_union", - "safeName": "get_undiscriminated_union" - }, - "screamingSnakeCase": { - "unsafeName": "GET_UNDISCRIMINATED_UNION", - "safeName": "GET_UNDISCRIMINATED_UNION" - }, - "pascalCase": { - "unsafeName": "GetUndiscriminatedUnion", - "safeName": "GetUndiscriminatedUnion" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "GET", - "path": "/root/undiscriminated-union" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": null - }, - "response": { - "type": "json" - } - } - } - }, - "subpackages": {}, - "rootPackage": { - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "websocket": null, - "service": "service_", - "types": [ - "type_:RequestTypeInlineType1", - "type_:RootType1", - "type_:RootType1InlineType1", - "type_:RootType1InlineType1NestedInlineType1", - "type_:DiscriminatedUnion1", - "type_:DiscriminatedUnion1InlineType1", - "type_:DiscriminatedUnion1InlineType2", - "type_:UndiscriminatedUnion1", - "type_:UndiscriminatedUnion1InlineType1", - "type_:UndiscriminatedUnion1InlineType2", - "type_:InlineEnum" - ], - "errors": [], - "subpackages": [], - "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/ts-express/inline-types/api/index.ts b/seed/ts-express/inline-types/api/index.ts deleted file mode 100644 index fcc81debec4..00000000000 --- a/seed/ts-express/inline-types/api/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./types"; -export * from "./service"; diff --git a/seed/ts-express/inline-types/api/service/RootService.ts b/seed/ts-express/inline-types/api/service/RootService.ts deleted file mode 100644 index 978c55feb0d..00000000000 --- a/seed/ts-express/inline-types/api/service/RootService.ts +++ /dev/null @@ -1,179 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; -import express from "express"; -import * as serializers from "../../serialization/index"; -import * as errors from "../../errors/index"; - -export interface RootServiceMethods { - getRoot( - req: express.Request, - res: { - send: (responseBody: SeedObject.RootType1) => Promise; - cookie: (cookie: string, value: string, options?: express.CookieOptions) => void; - locals: any; - }, - next: express.NextFunction - ): void | Promise; - getDiscriminatedUnion( - req: express.Request, - res: { - send: () => Promise; - cookie: (cookie: string, value: string, options?: express.CookieOptions) => void; - locals: any; - }, - next: express.NextFunction - ): void | Promise; - getUndiscriminatedUnion( - req: express.Request, - res: { - send: () => Promise; - cookie: (cookie: string, value: string, options?: express.CookieOptions) => void; - locals: any; - }, - next: express.NextFunction - ): void | Promise; -} - -export class RootService { - private router; - - constructor(private readonly methods: RootServiceMethods, middleware: express.RequestHandler[] = []) { - this.router = express.Router({ mergeParams: true }).use( - express.json({ - strict: false, - }), - ...middleware - ); - } - - public addMiddleware(handler: express.RequestHandler): this { - this.router.use(handler); - return this; - } - - public toRouter(): express.Router { - this.router.post("/root", async (req, res, next) => { - const request = serializers.PostRootRequest.parse(req.body); - if (request.ok) { - req.body = request.value; - try { - await this.methods.getRoot( - req as any, - { - send: async (responseBody) => { - res.json( - serializers.RootType1.jsonOrThrow(responseBody, { unrecognizedObjectKeys: "strip" }) - ); - }, - cookie: res.cookie.bind(res), - locals: res.locals, - }, - next - ); - next(); - } catch (error) { - if (error instanceof errors.SeedObjectError) { - console.warn( - `Endpoint 'getRoot' unexpectedly threw ${error.constructor.name}.` + - ` If this was intentional, please add ${error.constructor.name} to` + - " the endpoint's errors list in your Fern Definition." - ); - await error.send(res); - } else { - res.status(500).json("Internal Server Error"); - } - next(error); - } - } else { - res.status(422).json({ - errors: request.errors.map( - (error) => ["request", ...error.path].join(" -> ") + ": " + error.message - ), - }); - next(request.errors); - } - }); - this.router.post("/discriminated-union", async (req, res, next) => { - const request = serializers.GetDiscriminatedUnionRequest.parse(req.body); - if (request.ok) { - req.body = request.value; - try { - await this.methods.getDiscriminatedUnion( - req as any, - { - send: async () => { - res.sendStatus(204); - }, - cookie: res.cookie.bind(res), - locals: res.locals, - }, - next - ); - next(); - } catch (error) { - if (error instanceof errors.SeedObjectError) { - console.warn( - `Endpoint 'getDiscriminatedUnion' unexpectedly threw ${error.constructor.name}.` + - ` If this was intentional, please add ${error.constructor.name} to` + - " the endpoint's errors list in your Fern Definition." - ); - await error.send(res); - } else { - res.status(500).json("Internal Server Error"); - } - next(error); - } - } else { - res.status(422).json({ - errors: request.errors.map( - (error) => ["request", ...error.path].join(" -> ") + ": " + error.message - ), - }); - next(request.errors); - } - }); - this.router.post("/undiscriminated-union", async (req, res, next) => { - const request = serializers.GetUndiscriminatedUnionRequest.parse(req.body); - if (request.ok) { - req.body = request.value; - try { - await this.methods.getUndiscriminatedUnion( - req as any, - { - send: async () => { - res.sendStatus(204); - }, - cookie: res.cookie.bind(res), - locals: res.locals, - }, - next - ); - next(); - } catch (error) { - if (error instanceof errors.SeedObjectError) { - console.warn( - `Endpoint 'getUndiscriminatedUnion' unexpectedly threw ${error.constructor.name}.` + - ` If this was intentional, please add ${error.constructor.name} to` + - " the endpoint's errors list in your Fern Definition." - ); - await error.send(res); - } else { - res.status(500).json("Internal Server Error"); - } - next(error); - } - } else { - res.status(422).json({ - errors: request.errors.map( - (error) => ["request", ...error.path].join(" -> ") + ": " + error.message - ), - }); - next(request.errors); - } - }); - return this.router; - } -} diff --git a/seed/ts-express/inline-types/api/service/requests/GetDiscriminatedUnionRequest.ts b/seed/ts-express/inline-types/api/service/requests/GetDiscriminatedUnionRequest.ts deleted file mode 100644 index 4fa358e7598..00000000000 --- a/seed/ts-express/inline-types/api/service/requests/GetDiscriminatedUnionRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../../index"; - -export interface GetDiscriminatedUnionRequest { - bar: SeedObject.DiscriminatedUnion1; - foo: string; -} diff --git a/seed/ts-express/inline-types/api/service/requests/GetUndiscriminatedUnionRequest.ts b/seed/ts-express/inline-types/api/service/requests/GetUndiscriminatedUnionRequest.ts deleted file mode 100644 index c260e9a3f11..00000000000 --- a/seed/ts-express/inline-types/api/service/requests/GetUndiscriminatedUnionRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../../index"; - -export interface GetUndiscriminatedUnionRequest { - bar: SeedObject.UndiscriminatedUnion1; - foo: string; -} diff --git a/seed/ts-express/inline-types/api/service/requests/PostRootRequest.ts b/seed/ts-express/inline-types/api/service/requests/PostRootRequest.ts deleted file mode 100644 index ef25c95411c..00000000000 --- a/seed/ts-express/inline-types/api/service/requests/PostRootRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../../index"; - -export interface PostRootRequest { - bar: SeedObject.RequestTypeInlineType1; - foo: string; -} diff --git a/seed/ts-express/inline-types/api/service/requests/index.ts b/seed/ts-express/inline-types/api/service/requests/index.ts deleted file mode 100644 index 1e2ed00361c..00000000000 --- a/seed/ts-express/inline-types/api/service/requests/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { PostRootRequest } from "./PostRootRequest"; -export { GetDiscriminatedUnionRequest } from "./GetDiscriminatedUnionRequest"; -export { GetUndiscriminatedUnionRequest } from "./GetUndiscriminatedUnionRequest"; diff --git a/seed/ts-express/inline-types/core/index.ts b/seed/ts-express/inline-types/core/index.ts deleted file mode 100644 index 3ae53c06d38..00000000000 --- a/seed/ts-express/inline-types/core/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * as serialization from "./schemas"; diff --git a/seed/ts-express/inline-types/core/schemas/Schema.ts b/seed/ts-express/inline-types/core/schemas/Schema.ts deleted file mode 100644 index 2a72eacec99..00000000000 --- a/seed/ts-express/inline-types/core/schemas/Schema.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { SchemaUtils } from "./builders"; - -export type Schema = BaseSchema & SchemaUtils; - -export type inferRaw = S extends Schema ? Raw : never; -export type inferParsed = S extends Schema ? Parsed : never; - -export interface BaseSchema { - parse: (raw: unknown, opts?: SchemaOptions) => MaybeValid; - json: (parsed: unknown, opts?: SchemaOptions) => MaybeValid; - getType: () => SchemaType | SchemaType; -} - -export const SchemaType = { - BIGINT: "bigint", - DATE: "date", - ENUM: "enum", - LIST: "list", - STRING_LITERAL: "stringLiteral", - BOOLEAN_LITERAL: "booleanLiteral", - OBJECT: "object", - ANY: "any", - BOOLEAN: "boolean", - NUMBER: "number", - STRING: "string", - UNKNOWN: "unknown", - RECORD: "record", - SET: "set", - UNION: "union", - UNDISCRIMINATED_UNION: "undiscriminatedUnion", - OPTIONAL: "optional", -} as const; -export type SchemaType = typeof SchemaType[keyof typeof SchemaType]; - -export type MaybeValid = Valid | Invalid; - -export interface Valid { - ok: true; - value: T; -} - -export interface Invalid { - ok: false; - errors: ValidationError[]; -} - -export interface ValidationError { - path: string[]; - message: string; -} - -export interface SchemaOptions { - /** - * how to handle unrecognized keys in objects - * - * @default "fail" - */ - unrecognizedObjectKeys?: "fail" | "passthrough" | "strip"; - - /** - * whether to fail when an unrecognized discriminant value is - * encountered in a union - * - * @default false - */ - allowUnrecognizedUnionMembers?: boolean; - - /** - * whether to fail when an unrecognized enum value is encountered - * - * @default false - */ - allowUnrecognizedEnumValues?: boolean; - - /** - * whether to allow data that doesn't conform to the schema. - * invalid data is passed through without transformation. - * - * when this is enabled, .parse() and .json() will always - * return `ok: true`. `.parseOrThrow()` and `.jsonOrThrow()` - * will never fail. - * - * @default false - */ - skipValidation?: boolean; - - /** - * each validation failure contains a "path" property, which is - * the breadcrumbs to the offending node in the JSON. you can supply - * a prefix that is prepended to all the errors' paths. this can be - * helpful for zurg's internal debug logging. - */ - breadcrumbsPrefix?: string[]; - - /** - * whether to send 'null' for optional properties explicitly set to 'undefined'. - */ - omitUndefined?: boolean; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/bigint/bigint.ts b/seed/ts-express/inline-types/core/schemas/builders/bigint/bigint.ts deleted file mode 100644 index dc9c742e007..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/bigint/bigint.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; - -export function bigint(): Schema { - const baseSchema: BaseSchema = { - parse: (raw, { breadcrumbsPrefix = [] } = {}) => { - if (typeof raw !== "string") { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(raw, "string"), - }, - ], - }; - } - return { - ok: true, - value: BigInt(raw), - }; - }, - json: (bigint, { breadcrumbsPrefix = [] } = {}) => { - if (typeof bigint === "bigint") { - return { - ok: true, - value: bigint.toString(), - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(bigint, "bigint"), - }, - ], - }; - } - }, - getType: () => SchemaType.BIGINT, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/bigint/index.ts b/seed/ts-express/inline-types/core/schemas/builders/bigint/index.ts deleted file mode 100644 index e5843043fcb..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/bigint/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { bigint } from "./bigint"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/date/date.ts b/seed/ts-express/inline-types/core/schemas/builders/date/date.ts deleted file mode 100644 index b70f24b045a..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/date/date.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; - -// https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime -const ISO_8601_REGEX = - /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/; - -export function date(): Schema { - const baseSchema: BaseSchema = { - parse: (raw, { breadcrumbsPrefix = [] } = {}) => { - if (typeof raw !== "string") { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(raw, "string"), - }, - ], - }; - } - if (!ISO_8601_REGEX.test(raw)) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(raw, "ISO 8601 date string"), - }, - ], - }; - } - return { - ok: true, - value: new Date(raw), - }; - }, - json: (date, { breadcrumbsPrefix = [] } = {}) => { - if (date instanceof Date) { - return { - ok: true, - value: date.toISOString(), - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(date, "Date object"), - }, - ], - }; - } - }, - getType: () => SchemaType.DATE, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/date/index.ts b/seed/ts-express/inline-types/core/schemas/builders/date/index.ts deleted file mode 100644 index 187b29040f6..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/date/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { date } from "./date"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/enum/enum.ts b/seed/ts-express/inline-types/core/schemas/builders/enum/enum.ts deleted file mode 100644 index c1e24d69dec..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/enum/enum.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Schema, SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; - -export function enum_(values: E): Schema { - const validValues = new Set(values); - - const schemaCreator = createIdentitySchemaCreator( - SchemaType.ENUM, - (value, { allowUnrecognizedEnumValues, breadcrumbsPrefix = [] } = {}) => { - if (typeof value !== "string") { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "string"), - }, - ], - }; - } - - if (!validValues.has(value) && !allowUnrecognizedEnumValues) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "enum"), - }, - ], - }; - } - - return { - ok: true, - value: value as U, - }; - } - ); - - return schemaCreator(); -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/enum/index.ts b/seed/ts-express/inline-types/core/schemas/builders/enum/index.ts deleted file mode 100644 index fe6faed93e3..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/enum/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { enum_ } from "./enum"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/index.ts b/seed/ts-express/inline-types/core/schemas/builders/index.ts deleted file mode 100644 index 65211f92522..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -export * from "./bigint"; -export * from "./date"; -export * from "./enum"; -export * from "./lazy"; -export * from "./list"; -export * from "./literals"; -export * from "./object"; -export * from "./object-like"; -export * from "./primitives"; -export * from "./record"; -export * from "./schema-utils"; -export * from "./set"; -export * from "./undiscriminated-union"; -export * from "./union"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/lazy/index.ts b/seed/ts-express/inline-types/core/schemas/builders/lazy/index.ts deleted file mode 100644 index 77420fb031c..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/lazy/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { lazy } from "./lazy"; -export type { SchemaGetter } from "./lazy"; -export { lazyObject } from "./lazyObject"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/lazy/lazy.ts b/seed/ts-express/inline-types/core/schemas/builders/lazy/lazy.ts deleted file mode 100644 index 835c61f8a56..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/lazy/lazy.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { BaseSchema, Schema } from "../../Schema"; -import { getSchemaUtils } from "../schema-utils"; - -export type SchemaGetter> = () => SchemaType; - -export function lazy(getter: SchemaGetter>): Schema { - const baseSchema = constructLazyBaseSchema(getter); - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - }; -} - -export function constructLazyBaseSchema( - getter: SchemaGetter> -): BaseSchema { - return { - parse: (raw, opts) => getMemoizedSchema(getter).parse(raw, opts), - json: (parsed, opts) => getMemoizedSchema(getter).json(parsed, opts), - getType: () => getMemoizedSchema(getter).getType(), - }; -} - -type MemoizedGetter> = SchemaGetter & { __zurg_memoized?: SchemaType }; - -export function getMemoizedSchema>(getter: SchemaGetter): SchemaType { - const castedGetter = getter as MemoizedGetter; - if (castedGetter.__zurg_memoized == null) { - castedGetter.__zurg_memoized = getter(); - } - return castedGetter.__zurg_memoized; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/lazy/lazyObject.ts b/seed/ts-express/inline-types/core/schemas/builders/lazy/lazyObject.ts deleted file mode 100644 index 38c9e28404b..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/lazy/lazyObject.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { getObjectUtils } from "../object"; -import { getObjectLikeUtils } from "../object-like"; -import { BaseObjectSchema, ObjectSchema } from "../object/types"; -import { getSchemaUtils } from "../schema-utils"; -import { constructLazyBaseSchema, getMemoizedSchema, SchemaGetter } from "./lazy"; - -export function lazyObject(getter: SchemaGetter>): ObjectSchema { - const baseSchema: BaseObjectSchema = { - ...constructLazyBaseSchema(getter), - _getRawProperties: () => getMemoizedSchema(getter)._getRawProperties(), - _getParsedProperties: () => getMemoizedSchema(getter)._getParsedProperties(), - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - ...getObjectUtils(baseSchema), - }; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/list/index.ts b/seed/ts-express/inline-types/core/schemas/builders/list/index.ts deleted file mode 100644 index 25f4bcc1737..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/list/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { list } from "./list"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/list/list.ts b/seed/ts-express/inline-types/core/schemas/builders/list/list.ts deleted file mode 100644 index e4c5c4a4a99..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/list/list.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { BaseSchema, MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; - -export function list(schema: Schema): Schema { - const baseSchema: BaseSchema = { - parse: (raw, opts) => - validateAndTransformArray(raw, (item, index) => - schema.parse(item, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `[${index}]`], - }) - ), - json: (parsed, opts) => - validateAndTransformArray(parsed, (item, index) => - schema.json(item, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `[${index}]`], - }) - ), - getType: () => SchemaType.LIST, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} - -function validateAndTransformArray( - value: unknown, - transformItem: (item: Raw, index: number) => MaybeValid -): MaybeValid { - if (!Array.isArray(value)) { - return { - ok: false, - errors: [ - { - message: getErrorMessageForIncorrectType(value, "list"), - path: [], - }, - ], - }; - } - - const maybeValidItems = value.map((item, index) => transformItem(item, index)); - - return maybeValidItems.reduce>( - (acc, item) => { - if (acc.ok && item.ok) { - return { - ok: true, - value: [...acc.value, item.value], - }; - } - - const errors: ValidationError[] = []; - if (!acc.ok) { - errors.push(...acc.errors); - } - if (!item.ok) { - errors.push(...item.errors); - } - - return { - ok: false, - errors, - }; - }, - { ok: true, value: [] } - ); -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/literals/booleanLiteral.ts b/seed/ts-express/inline-types/core/schemas/builders/literals/booleanLiteral.ts deleted file mode 100644 index a83d22cd48a..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/literals/booleanLiteral.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Schema, SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; - -export function booleanLiteral(literal: V): Schema { - const schemaCreator = createIdentitySchemaCreator( - SchemaType.BOOLEAN_LITERAL, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (value === literal) { - return { - ok: true, - value: literal, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, `${literal.toString()}`), - }, - ], - }; - } - } - ); - - return schemaCreator(); -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/literals/index.ts b/seed/ts-express/inline-types/core/schemas/builders/literals/index.ts deleted file mode 100644 index d2bf08fc6ca..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/literals/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { stringLiteral } from "./stringLiteral"; -export { booleanLiteral } from "./booleanLiteral"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/literals/stringLiteral.ts b/seed/ts-express/inline-types/core/schemas/builders/literals/stringLiteral.ts deleted file mode 100644 index 3939b76b48d..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/literals/stringLiteral.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Schema, SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; - -export function stringLiteral(literal: V): Schema { - const schemaCreator = createIdentitySchemaCreator( - SchemaType.STRING_LITERAL, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (value === literal) { - return { - ok: true, - value: literal, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, `"${literal}"`), - }, - ], - }; - } - } - ); - - return schemaCreator(); -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/object-like/getObjectLikeUtils.ts b/seed/ts-express/inline-types/core/schemas/builders/object-like/getObjectLikeUtils.ts deleted file mode 100644 index 8331d08da89..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/object-like/getObjectLikeUtils.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { BaseSchema } from "../../Schema"; -import { filterObject } from "../../utils/filterObject"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { isPlainObject } from "../../utils/isPlainObject"; -import { getSchemaUtils } from "../schema-utils"; -import { ObjectLikeSchema, ObjectLikeUtils } from "./types"; - -export function getObjectLikeUtils(schema: BaseSchema): ObjectLikeUtils { - return { - withParsedProperties: (properties) => withParsedProperties(schema, properties), - }; -} - -/** - * object-like utils are defined in one file to resolve issues with circular imports - */ - -export function withParsedProperties( - objectLike: BaseSchema, - properties: { [K in keyof Properties]: Properties[K] | ((parsed: ParsedObjectShape) => Properties[K]) } -): ObjectLikeSchema { - const objectSchema: BaseSchema = { - parse: (raw, opts) => { - const parsedObject = objectLike.parse(raw, opts); - if (!parsedObject.ok) { - return parsedObject; - } - - const additionalProperties = Object.entries(properties).reduce>( - (processed, [key, value]) => { - return { - ...processed, - [key]: typeof value === "function" ? value(parsedObject.value) : value, - }; - }, - {} - ); - - return { - ok: true, - value: { - ...parsedObject.value, - ...(additionalProperties as Properties), - }, - }; - }, - - json: (parsed, opts) => { - if (!isPlainObject(parsed)) { - return { - ok: false, - errors: [ - { - path: opts?.breadcrumbsPrefix ?? [], - message: getErrorMessageForIncorrectType(parsed, "object"), - }, - ], - }; - } - - // strip out added properties - const addedPropertyKeys = new Set(Object.keys(properties)); - const parsedWithoutAddedProperties = filterObject( - parsed, - Object.keys(parsed).filter((key) => !addedPropertyKeys.has(key)) - ); - - return objectLike.json(parsedWithoutAddedProperties as ParsedObjectShape, opts); - }, - - getType: () => objectLike.getType(), - }; - - return { - ...objectSchema, - ...getSchemaUtils(objectSchema), - ...getObjectLikeUtils(objectSchema), - }; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/object-like/index.ts b/seed/ts-express/inline-types/core/schemas/builders/object-like/index.ts deleted file mode 100644 index c342e72cf9d..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/object-like/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { getObjectLikeUtils, withParsedProperties } from "./getObjectLikeUtils"; -export type { ObjectLikeSchema, ObjectLikeUtils } from "./types"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/object-like/types.ts b/seed/ts-express/inline-types/core/schemas/builders/object-like/types.ts deleted file mode 100644 index 75b3698729c..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/object-like/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BaseSchema, Schema } from "../../Schema"; - -export type ObjectLikeSchema = Schema & - BaseSchema & - ObjectLikeUtils; - -export interface ObjectLikeUtils { - withParsedProperties: >(properties: { - [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]); - }) => ObjectLikeSchema; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/object/index.ts b/seed/ts-express/inline-types/core/schemas/builders/object/index.ts deleted file mode 100644 index e3f4388db28..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/object/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -export { getObjectUtils, object } from "./object"; -export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties"; -export type { - inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas, - inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas, -} from "./objectWithoutOptionalProperties"; -export { isProperty, property } from "./property"; -export type { Property } from "./property"; -export type { - BaseObjectSchema, - inferObjectSchemaFromPropertySchemas, - inferParsedObject, - inferParsedObjectFromPropertySchemas, - inferParsedPropertySchema, - inferRawKey, - inferRawObject, - inferRawObjectFromPropertySchemas, - inferRawPropertySchema, - ObjectSchema, - ObjectUtils, - PropertySchemas, -} from "./types"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/object/object.ts b/seed/ts-express/inline-types/core/schemas/builders/object/object.ts deleted file mode 100644 index 8d40c33c80a..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/object/object.ts +++ /dev/null @@ -1,365 +0,0 @@ -import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; -import { entries } from "../../utils/entries"; -import { filterObject } from "../../utils/filterObject"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { isPlainObject } from "../../utils/isPlainObject"; -import { keys } from "../../utils/keys"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { partition } from "../../utils/partition"; -import { getObjectLikeUtils } from "../object-like"; -import { getSchemaUtils } from "../schema-utils"; -import { isProperty } from "./property"; -import { - BaseObjectSchema, - inferObjectSchemaFromPropertySchemas, - inferParsedObjectFromPropertySchemas, - inferRawObjectFromPropertySchemas, - ObjectSchema, - ObjectUtils, - PropertySchemas, -} from "./types"; - -interface ObjectPropertyWithRawKey { - rawKey: string; - parsedKey: string; - valueSchema: Schema; -} - -export function object>( - schemas: T -): inferObjectSchemaFromPropertySchemas { - const baseSchema: BaseObjectSchema< - inferRawObjectFromPropertySchemas, - inferParsedObjectFromPropertySchemas - > = { - _getRawProperties: () => - Object.entries(schemas).map(([parsedKey, propertySchema]) => - isProperty(propertySchema) ? propertySchema.rawKey : parsedKey - ) as unknown as (keyof inferRawObjectFromPropertySchemas)[], - _getParsedProperties: () => keys(schemas) as unknown as (keyof inferParsedObjectFromPropertySchemas)[], - - parse: (raw, opts) => { - const rawKeyToProperty: Record = {}; - const requiredKeys: string[] = []; - - for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { - const rawKey = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.rawKey : parsedKey; - const valueSchema: Schema = isProperty(schemaOrObjectProperty) - ? schemaOrObjectProperty.valueSchema - : schemaOrObjectProperty; - - const property: ObjectPropertyWithRawKey = { - rawKey, - parsedKey: parsedKey as string, - valueSchema, - }; - - rawKeyToProperty[rawKey] = property; - - if (isSchemaRequired(valueSchema)) { - requiredKeys.push(rawKey); - } - } - - return validateAndTransformObject({ - value: raw, - requiredKeys, - getProperty: (rawKey) => { - const property = rawKeyToProperty[rawKey]; - if (property == null) { - return undefined; - } - return { - transformedKey: property.parsedKey, - transform: (propertyValue) => - property.valueSchema.parse(propertyValue, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawKey], - }), - }; - }, - unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, - skipValidation: opts?.skipValidation, - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - omitUndefined: opts?.omitUndefined, - }); - }, - - json: (parsed, opts) => { - const requiredKeys: string[] = []; - - for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { - const valueSchema: Schema = isProperty(schemaOrObjectProperty) - ? schemaOrObjectProperty.valueSchema - : schemaOrObjectProperty; - - if (isSchemaRequired(valueSchema)) { - requiredKeys.push(parsedKey as string); - } - } - - return validateAndTransformObject({ - value: parsed, - requiredKeys, - getProperty: ( - parsedKey - ): { transformedKey: string; transform: (propertyValue: unknown) => MaybeValid } | undefined => { - const property = schemas[parsedKey as keyof T]; - - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (property == null) { - return undefined; - } - - if (isProperty(property)) { - return { - transformedKey: property.rawKey, - transform: (propertyValue) => - property.valueSchema.json(propertyValue, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], - }), - }; - } else { - return { - transformedKey: parsedKey, - transform: (propertyValue) => - property.json(propertyValue, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], - }), - }; - } - }, - unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, - skipValidation: opts?.skipValidation, - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - omitUndefined: opts?.omitUndefined, - }); - }, - - getType: () => SchemaType.OBJECT, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - ...getObjectUtils(baseSchema), - }; -} - -function validateAndTransformObject({ - value, - requiredKeys, - getProperty, - unrecognizedObjectKeys = "fail", - skipValidation = false, - breadcrumbsPrefix = [], -}: { - value: unknown; - requiredKeys: string[]; - getProperty: ( - preTransformedKey: string - ) => { transformedKey: string; transform: (propertyValue: unknown) => MaybeValid } | undefined; - unrecognizedObjectKeys: "fail" | "passthrough" | "strip" | undefined; - skipValidation: boolean | undefined; - breadcrumbsPrefix: string[] | undefined; - omitUndefined: boolean | undefined; -}): MaybeValid { - if (!isPlainObject(value)) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "object"), - }, - ], - }; - } - - const missingRequiredKeys = new Set(requiredKeys); - const errors: ValidationError[] = []; - const transformed: Record = {}; - - for (const [preTransformedKey, preTransformedItemValue] of Object.entries(value)) { - const property = getProperty(preTransformedKey); - - if (property != null) { - missingRequiredKeys.delete(preTransformedKey); - - const value = property.transform(preTransformedItemValue); - if (value.ok) { - transformed[property.transformedKey] = value.value; - } else { - transformed[preTransformedKey] = preTransformedItemValue; - errors.push(...value.errors); - } - } else { - switch (unrecognizedObjectKeys) { - case "fail": - errors.push({ - path: [...breadcrumbsPrefix, preTransformedKey], - message: `Unexpected key "${preTransformedKey}"`, - }); - break; - case "strip": - break; - case "passthrough": - transformed[preTransformedKey] = preTransformedItemValue; - break; - } - } - } - - errors.push( - ...requiredKeys - .filter((key) => missingRequiredKeys.has(key)) - .map((key) => ({ - path: breadcrumbsPrefix, - message: `Missing required key "${key}"`, - })) - ); - - if (errors.length === 0 || skipValidation) { - return { - ok: true, - value: transformed as Transformed, - }; - } else { - return { - ok: false, - errors, - }; - } -} - -export function getObjectUtils(schema: BaseObjectSchema): ObjectUtils { - return { - extend: (extension: ObjectSchema) => { - const baseSchema: BaseObjectSchema = { - _getParsedProperties: () => [...schema._getParsedProperties(), ...extension._getParsedProperties()], - _getRawProperties: () => [...schema._getRawProperties(), ...extension._getRawProperties()], - parse: (raw, opts) => { - return validateAndTransformExtendedObject({ - extensionKeys: extension._getRawProperties(), - value: raw, - transformBase: (rawBase) => schema.parse(rawBase, opts), - transformExtension: (rawExtension) => extension.parse(rawExtension, opts), - }); - }, - json: (parsed, opts) => { - return validateAndTransformExtendedObject({ - extensionKeys: extension._getParsedProperties(), - value: parsed, - transformBase: (parsedBase) => schema.json(parsedBase, opts), - transformExtension: (parsedExtension) => extension.json(parsedExtension, opts), - }); - }, - getType: () => SchemaType.OBJECT, - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - ...getObjectUtils(baseSchema), - }; - }, - passthrough: () => { - const baseSchema: BaseObjectSchema = - { - _getParsedProperties: () => schema._getParsedProperties(), - _getRawProperties: () => schema._getRawProperties(), - parse: (raw, opts) => { - const transformed = schema.parse(raw, { ...opts, unrecognizedObjectKeys: "passthrough" }); - if (!transformed.ok) { - return transformed; - } - return { - ok: true, - value: { - ...(raw as any), - ...transformed.value, - }, - }; - }, - json: (parsed, opts) => { - const transformed = schema.json(parsed, { ...opts, unrecognizedObjectKeys: "passthrough" }); - if (!transformed.ok) { - return transformed; - } - return { - ok: true, - value: { - ...(parsed as any), - ...transformed.value, - }, - }; - }, - getType: () => SchemaType.OBJECT, - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - ...getObjectUtils(baseSchema), - }; - }, - }; -} - -function validateAndTransformExtendedObject({ - extensionKeys, - value, - transformBase, - transformExtension, -}: { - extensionKeys: (keyof PreTransformedExtension)[]; - value: unknown; - transformBase: (value: unknown) => MaybeValid; - transformExtension: (value: unknown) => MaybeValid; -}): MaybeValid { - const extensionPropertiesSet = new Set(extensionKeys); - const [extensionProperties, baseProperties] = partition(keys(value), (key) => - extensionPropertiesSet.has(key as keyof PreTransformedExtension) - ); - - const transformedBase = transformBase(filterObject(value, baseProperties)); - const transformedExtension = transformExtension(filterObject(value, extensionProperties)); - - if (transformedBase.ok && transformedExtension.ok) { - return { - ok: true, - value: { - ...transformedBase.value, - ...transformedExtension.value, - }, - }; - } else { - return { - ok: false, - errors: [ - ...(transformedBase.ok ? [] : transformedBase.errors), - ...(transformedExtension.ok ? [] : transformedExtension.errors), - ], - }; - } -} - -function isSchemaRequired(schema: Schema): boolean { - return !isSchemaOptional(schema); -} - -function isSchemaOptional(schema: Schema): boolean { - switch (schema.getType()) { - case SchemaType.ANY: - case SchemaType.UNKNOWN: - case SchemaType.OPTIONAL: - return true; - default: - return false; - } -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/object/objectWithoutOptionalProperties.ts b/seed/ts-express/inline-types/core/schemas/builders/object/objectWithoutOptionalProperties.ts deleted file mode 100644 index a0951f48efc..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/object/objectWithoutOptionalProperties.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { object } from "./object"; -import { inferParsedPropertySchema, inferRawObjectFromPropertySchemas, ObjectSchema, PropertySchemas } from "./types"; - -export function objectWithoutOptionalProperties>( - schemas: T -): inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas { - return object(schemas) as unknown as inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas; -} - -export type inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas> = - ObjectSchema< - inferRawObjectFromPropertySchemas, - inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas - >; - -export type inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas> = { - [K in keyof T]: inferParsedPropertySchema; -}; diff --git a/seed/ts-express/inline-types/core/schemas/builders/object/property.ts b/seed/ts-express/inline-types/core/schemas/builders/object/property.ts deleted file mode 100644 index d245c4b193a..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/object/property.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Schema } from "../../Schema"; - -export function property( - rawKey: RawKey, - valueSchema: Schema -): Property { - return { - rawKey, - valueSchema, - isProperty: true, - }; -} - -export interface Property { - rawKey: RawKey; - valueSchema: Schema; - isProperty: true; -} - -export function isProperty>(maybeProperty: unknown): maybeProperty is O { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - return (maybeProperty as O).isProperty; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/object/types.ts b/seed/ts-express/inline-types/core/schemas/builders/object/types.ts deleted file mode 100644 index 9f87cbb787b..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/object/types.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { BaseSchema, inferParsed, inferRaw, Schema } from "../../Schema"; -import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties"; -import { ObjectLikeUtils } from "../object-like"; -import { SchemaUtils } from "../schema-utils"; -import { Property } from "./property"; - -export type ObjectSchema = BaseObjectSchema & - ObjectLikeUtils & - ObjectUtils & - SchemaUtils; - -export interface BaseObjectSchema extends BaseSchema { - _getRawProperties: () => (keyof Raw)[]; - _getParsedProperties: () => (keyof Parsed)[]; -} - -export interface ObjectUtils { - extend: ( - schemas: ObjectSchema - ) => ObjectSchema; - passthrough: () => ObjectSchema; -} - -export type inferRawObject> = O extends ObjectSchema ? Raw : never; - -export type inferParsedObject> = O extends ObjectSchema - ? Parsed - : never; - -export type inferObjectSchemaFromPropertySchemas> = ObjectSchema< - inferRawObjectFromPropertySchemas, - inferParsedObjectFromPropertySchemas ->; - -export type inferRawObjectFromPropertySchemas> = - addQuestionMarksToNullableProperties<{ - [ParsedKey in keyof T as inferRawKey]: inferRawPropertySchema; - }>; - -export type inferParsedObjectFromPropertySchemas> = - addQuestionMarksToNullableProperties<{ - [K in keyof T]: inferParsedPropertySchema; - }>; - -export type PropertySchemas = Record< - ParsedKeys, - Property | Schema ->; - -export type inferRawPropertySchema

| Schema> = P extends Property< - any, - infer Raw, - any -> - ? Raw - : P extends Schema - ? inferRaw

- : never; - -export type inferParsedPropertySchema

| Schema> = P extends Property< - any, - any, - infer Parsed -> - ? Parsed - : P extends Schema - ? inferParsed

- : never; - -export type inferRawKey< - ParsedKey extends string | number | symbol, - P extends Property | Schema -> = P extends Property ? Raw : ParsedKey; diff --git a/seed/ts-express/inline-types/core/schemas/builders/primitives/any.ts b/seed/ts-express/inline-types/core/schemas/builders/primitives/any.ts deleted file mode 100644 index fcaeb04255a..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/primitives/any.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; - -export const any = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ ok: true, value })); diff --git a/seed/ts-express/inline-types/core/schemas/builders/primitives/boolean.ts b/seed/ts-express/inline-types/core/schemas/builders/primitives/boolean.ts deleted file mode 100644 index fad60562120..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/primitives/boolean.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; - -export const boolean = createIdentitySchemaCreator( - SchemaType.BOOLEAN, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (typeof value === "boolean") { - return { - ok: true, - value, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "boolean"), - }, - ], - }; - } - } -); diff --git a/seed/ts-express/inline-types/core/schemas/builders/primitives/index.ts b/seed/ts-express/inline-types/core/schemas/builders/primitives/index.ts deleted file mode 100644 index 788f9416bfe..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/primitives/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { any } from "./any"; -export { boolean } from "./boolean"; -export { number } from "./number"; -export { string } from "./string"; -export { unknown } from "./unknown"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/primitives/number.ts b/seed/ts-express/inline-types/core/schemas/builders/primitives/number.ts deleted file mode 100644 index c2689456936..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/primitives/number.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; - -export const number = createIdentitySchemaCreator( - SchemaType.NUMBER, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (typeof value === "number") { - return { - ok: true, - value, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "number"), - }, - ], - }; - } - } -); diff --git a/seed/ts-express/inline-types/core/schemas/builders/primitives/string.ts b/seed/ts-express/inline-types/core/schemas/builders/primitives/string.ts deleted file mode 100644 index 949f1f2a630..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/primitives/string.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; - -export const string = createIdentitySchemaCreator( - SchemaType.STRING, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (typeof value === "string") { - return { - ok: true, - value, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "string"), - }, - ], - }; - } - } -); diff --git a/seed/ts-express/inline-types/core/schemas/builders/primitives/unknown.ts b/seed/ts-express/inline-types/core/schemas/builders/primitives/unknown.ts deleted file mode 100644 index 4d5249571f5..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/primitives/unknown.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; - -export const unknown = createIdentitySchemaCreator(SchemaType.UNKNOWN, (value) => ({ ok: true, value })); diff --git a/seed/ts-express/inline-types/core/schemas/builders/record/index.ts b/seed/ts-express/inline-types/core/schemas/builders/record/index.ts deleted file mode 100644 index 82e25c5c2af..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/record/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { record } from "./record"; -export type { BaseRecordSchema, RecordSchema } from "./types"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/record/record.ts b/seed/ts-express/inline-types/core/schemas/builders/record/record.ts deleted file mode 100644 index 6683ac3609f..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/record/record.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; -import { entries } from "../../utils/entries"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { isPlainObject } from "../../utils/isPlainObject"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; -import { BaseRecordSchema, RecordSchema } from "./types"; - -export function record( - keySchema: Schema, - valueSchema: Schema -): RecordSchema { - const baseSchema: BaseRecordSchema = { - parse: (raw, opts) => { - return validateAndTransformRecord({ - value: raw, - isKeyNumeric: keySchema.getType() === SchemaType.NUMBER, - transformKey: (key) => - keySchema.parse(key, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], - }), - transformValue: (value, key) => - valueSchema.parse(value, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], - }), - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - }); - }, - json: (parsed, opts) => { - return validateAndTransformRecord({ - value: parsed, - isKeyNumeric: keySchema.getType() === SchemaType.NUMBER, - transformKey: (key) => - keySchema.json(key, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], - }), - transformValue: (value, key) => - valueSchema.json(value, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], - }), - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - }); - }, - getType: () => SchemaType.RECORD, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} - -function validateAndTransformRecord({ - value, - isKeyNumeric, - transformKey, - transformValue, - breadcrumbsPrefix = [], -}: { - value: unknown; - isKeyNumeric: boolean; - transformKey: (key: string | number) => MaybeValid; - transformValue: (value: unknown, key: string | number) => MaybeValid; - breadcrumbsPrefix: string[] | undefined; -}): MaybeValid> { - if (!isPlainObject(value)) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "object"), - }, - ], - }; - } - - return entries(value).reduce>>( - (accPromise, [stringKey, value]) => { - // skip nullish keys - if (value == null) { - return accPromise; - } - - const acc = accPromise; - - let key: string | number = stringKey; - if (isKeyNumeric) { - const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN; - if (!isNaN(numberKey)) { - key = numberKey; - } - } - const transformedKey = transformKey(key); - - const transformedValue = transformValue(value, key); - - if (acc.ok && transformedKey.ok && transformedValue.ok) { - return { - ok: true, - value: { - ...acc.value, - [transformedKey.value]: transformedValue.value, - }, - }; - } - - const errors: ValidationError[] = []; - if (!acc.ok) { - errors.push(...acc.errors); - } - if (!transformedKey.ok) { - errors.push(...transformedKey.errors); - } - if (!transformedValue.ok) { - errors.push(...transformedValue.errors); - } - - return { - ok: false, - errors, - }; - }, - { ok: true, value: {} as Record } - ); -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/record/types.ts b/seed/ts-express/inline-types/core/schemas/builders/record/types.ts deleted file mode 100644 index eb82cc7f65c..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/record/types.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { BaseSchema } from "../../Schema"; -import { SchemaUtils } from "../schema-utils"; - -export type RecordSchema< - RawKey extends string | number, - RawValue, - ParsedKey extends string | number, - ParsedValue -> = BaseRecordSchema & - SchemaUtils, Record>; - -export type BaseRecordSchema< - RawKey extends string | number, - RawValue, - ParsedKey extends string | number, - ParsedValue -> = BaseSchema, Record>; diff --git a/seed/ts-express/inline-types/core/schemas/builders/schema-utils/JsonError.ts b/seed/ts-express/inline-types/core/schemas/builders/schema-utils/JsonError.ts deleted file mode 100644 index 2b89ca0e7ad..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/schema-utils/JsonError.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ValidationError } from "../../Schema"; -import { stringifyValidationError } from "./stringifyValidationErrors"; - -export class JsonError extends Error { - constructor(public readonly errors: ValidationError[]) { - super(errors.map(stringifyValidationError).join("; ")); - Object.setPrototypeOf(this, JsonError.prototype); - } -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/schema-utils/ParseError.ts b/seed/ts-express/inline-types/core/schemas/builders/schema-utils/ParseError.ts deleted file mode 100644 index d056eb45cf7..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/schema-utils/ParseError.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ValidationError } from "../../Schema"; -import { stringifyValidationError } from "./stringifyValidationErrors"; - -export class ParseError extends Error { - constructor(public readonly errors: ValidationError[]) { - super(errors.map(stringifyValidationError).join("; ")); - Object.setPrototypeOf(this, ParseError.prototype); - } -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/schema-utils/getSchemaUtils.ts b/seed/ts-express/inline-types/core/schemas/builders/schema-utils/getSchemaUtils.ts deleted file mode 100644 index 79ecad92132..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/schema-utils/getSchemaUtils.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { BaseSchema, Schema, SchemaOptions, SchemaType } from "../../Schema"; -import { JsonError } from "./JsonError"; -import { ParseError } from "./ParseError"; - -export interface SchemaUtils { - optional: () => Schema; - transform: (transformer: SchemaTransformer) => Schema; - parseOrThrow: (raw: unknown, opts?: SchemaOptions) => Parsed; - jsonOrThrow: (raw: unknown, opts?: SchemaOptions) => Raw; -} - -export interface SchemaTransformer { - transform: (parsed: Parsed) => Transformed; - untransform: (transformed: any) => Parsed; -} - -export function getSchemaUtils(schema: BaseSchema): SchemaUtils { - return { - optional: () => optional(schema), - transform: (transformer) => transform(schema, transformer), - parseOrThrow: (raw, opts) => { - const parsed = schema.parse(raw, opts); - if (parsed.ok) { - return parsed.value; - } - throw new ParseError(parsed.errors); - }, - jsonOrThrow: (parsed, opts) => { - const raw = schema.json(parsed, opts); - if (raw.ok) { - return raw.value; - } - throw new JsonError(raw.errors); - }, - }; -} - -/** - * schema utils are defined in one file to resolve issues with circular imports - */ - -export function optional( - schema: BaseSchema -): Schema { - const baseSchema: BaseSchema = { - parse: (raw, opts) => { - if (raw == null) { - return { - ok: true, - value: undefined, - }; - } - return schema.parse(raw, opts); - }, - json: (parsed, opts) => { - if (opts?.omitUndefined && parsed === undefined) { - return { - ok: true, - value: undefined, - }; - } - if (parsed == null) { - return { - ok: true, - value: null, - }; - } - return schema.json(parsed, opts); - }, - getType: () => SchemaType.OPTIONAL, - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - }; -} - -export function transform( - schema: BaseSchema, - transformer: SchemaTransformer -): Schema { - const baseSchema: BaseSchema = { - parse: (raw, opts) => { - const parsed = schema.parse(raw, opts); - if (!parsed.ok) { - return parsed; - } - return { - ok: true, - value: transformer.transform(parsed.value), - }; - }, - json: (transformed, opts) => { - const parsed = transformer.untransform(transformed); - return schema.json(parsed, opts); - }, - getType: () => schema.getType(), - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - }; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/schema-utils/index.ts b/seed/ts-express/inline-types/core/schemas/builders/schema-utils/index.ts deleted file mode 100644 index aa04e051dfa..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/schema-utils/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { getSchemaUtils, optional, transform } from "./getSchemaUtils"; -export type { SchemaUtils } from "./getSchemaUtils"; -export { JsonError } from "./JsonError"; -export { ParseError } from "./ParseError"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/schema-utils/stringifyValidationErrors.ts b/seed/ts-express/inline-types/core/schemas/builders/schema-utils/stringifyValidationErrors.ts deleted file mode 100644 index 4160f0a2617..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/schema-utils/stringifyValidationErrors.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ValidationError } from "../../Schema"; - -export function stringifyValidationError(error: ValidationError): string { - if (error.path.length === 0) { - return error.message; - } - return `${error.path.join(" -> ")}: ${error.message}`; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/set/index.ts b/seed/ts-express/inline-types/core/schemas/builders/set/index.ts deleted file mode 100644 index f3310e8bdad..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/set/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { set } from "./set"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/set/set.ts b/seed/ts-express/inline-types/core/schemas/builders/set/set.ts deleted file mode 100644 index e9e6bb7e539..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/set/set.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { list } from "../list"; -import { getSchemaUtils } from "../schema-utils"; - -export function set(schema: Schema): Schema> { - const listSchema = list(schema); - const baseSchema: BaseSchema> = { - parse: (raw, opts) => { - const parsedList = listSchema.parse(raw, opts); - if (parsedList.ok) { - return { - ok: true, - value: new Set(parsedList.value), - }; - } else { - return parsedList; - } - }, - json: (parsed, opts) => { - if (!(parsed instanceof Set)) { - return { - ok: false, - errors: [ - { - path: opts?.breadcrumbsPrefix ?? [], - message: getErrorMessageForIncorrectType(parsed, "Set"), - }, - ], - }; - } - const jsonList = listSchema.json([...parsed], opts); - return jsonList; - }, - getType: () => SchemaType.SET, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/undiscriminated-union/index.ts b/seed/ts-express/inline-types/core/schemas/builders/undiscriminated-union/index.ts deleted file mode 100644 index 75b71cb3565..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/undiscriminated-union/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type { - inferParsedUnidiscriminatedUnionSchema, - inferRawUnidiscriminatedUnionSchema, - UndiscriminatedUnionSchema, -} from "./types"; -export { undiscriminatedUnion } from "./undiscriminatedUnion"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/undiscriminated-union/types.ts b/seed/ts-express/inline-types/core/schemas/builders/undiscriminated-union/types.ts deleted file mode 100644 index 43e7108a060..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/undiscriminated-union/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { inferParsed, inferRaw, Schema } from "../../Schema"; - -export type UndiscriminatedUnionSchema = Schema< - inferRawUnidiscriminatedUnionSchema, - inferParsedUnidiscriminatedUnionSchema ->; - -export type inferRawUnidiscriminatedUnionSchema = inferRaw; - -export type inferParsedUnidiscriminatedUnionSchema = inferParsed; diff --git a/seed/ts-express/inline-types/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts b/seed/ts-express/inline-types/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts deleted file mode 100644 index 21ed3df0f40..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType, ValidationError } from "../../Schema"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; -import { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types"; - -export function undiscriminatedUnion, ...Schema[]]>( - schemas: Schemas -): Schema, inferParsedUnidiscriminatedUnionSchema> { - const baseSchema: BaseSchema< - inferRawUnidiscriminatedUnionSchema, - inferParsedUnidiscriminatedUnionSchema - > = { - parse: (raw, opts) => { - return validateAndTransformUndiscriminatedUnion>( - (schema, opts) => schema.parse(raw, opts), - schemas, - opts - ); - }, - json: (parsed, opts) => { - return validateAndTransformUndiscriminatedUnion>( - (schema, opts) => schema.json(parsed, opts), - schemas, - opts - ); - }, - getType: () => SchemaType.UNDISCRIMINATED_UNION, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} - -function validateAndTransformUndiscriminatedUnion( - transform: (schema: Schema, opts: SchemaOptions) => MaybeValid, - schemas: Schema[], - opts: SchemaOptions | undefined -): MaybeValid { - const errors: ValidationError[] = []; - for (const [index, schema] of schemas.entries()) { - const transformed = transform(schema, { ...opts, skipValidation: false }); - if (transformed.ok) { - return transformed; - } else { - for (const error of transformed.errors) { - errors.push({ - path: error.path, - message: `[Variant ${index}] ${error.message}`, - }); - } - } - } - - return { - ok: false, - errors, - }; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/union/discriminant.ts b/seed/ts-express/inline-types/core/schemas/builders/union/discriminant.ts deleted file mode 100644 index 55065bc8946..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/union/discriminant.ts +++ /dev/null @@ -1,14 +0,0 @@ -export function discriminant( - parsedDiscriminant: ParsedDiscriminant, - rawDiscriminant: RawDiscriminant -): Discriminant { - return { - parsedDiscriminant, - rawDiscriminant, - }; -} - -export interface Discriminant { - parsedDiscriminant: ParsedDiscriminant; - rawDiscriminant: RawDiscriminant; -} diff --git a/seed/ts-express/inline-types/core/schemas/builders/union/index.ts b/seed/ts-express/inline-types/core/schemas/builders/union/index.ts deleted file mode 100644 index 85fc008a2d8..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/union/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -export { discriminant } from "./discriminant"; -export type { Discriminant } from "./discriminant"; -export type { - inferParsedDiscriminant, - inferParsedUnion, - inferRawDiscriminant, - inferRawUnion, - UnionSubtypes, -} from "./types"; -export { union } from "./union"; diff --git a/seed/ts-express/inline-types/core/schemas/builders/union/types.ts b/seed/ts-express/inline-types/core/schemas/builders/union/types.ts deleted file mode 100644 index 6f82c868b2d..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/union/types.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { inferParsedObject, inferRawObject, ObjectSchema } from "../object"; -import { Discriminant } from "./discriminant"; - -export type UnionSubtypes = { - [K in DiscriminantValues]: ObjectSchema; -}; - -export type inferRawUnion, U extends UnionSubtypes> = { - [K in keyof U]: Record, K> & inferRawObject; -}[keyof U]; - -export type inferParsedUnion, U extends UnionSubtypes> = { - [K in keyof U]: Record, K> & inferParsedObject; -}[keyof U]; - -export type inferRawDiscriminant> = D extends string - ? D - : D extends Discriminant - ? Raw - : never; - -export type inferParsedDiscriminant> = D extends string - ? D - : D extends Discriminant - ? Parsed - : never; diff --git a/seed/ts-express/inline-types/core/schemas/builders/union/union.ts b/seed/ts-express/inline-types/core/schemas/builders/union/union.ts deleted file mode 100644 index ab61475a572..00000000000 --- a/seed/ts-express/inline-types/core/schemas/builders/union/union.ts +++ /dev/null @@ -1,170 +0,0 @@ -import { BaseSchema, MaybeValid, SchemaType } from "../../Schema"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { isPlainObject } from "../../utils/isPlainObject"; -import { keys } from "../../utils/keys"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { enum_ } from "../enum"; -import { ObjectSchema } from "../object"; -import { getObjectLikeUtils, ObjectLikeSchema } from "../object-like"; -import { getSchemaUtils } from "../schema-utils"; -import { Discriminant } from "./discriminant"; -import { inferParsedDiscriminant, inferParsedUnion, inferRawDiscriminant, inferRawUnion, UnionSubtypes } from "./types"; - -export function union, U extends UnionSubtypes>( - discriminant: D, - union: U -): ObjectLikeSchema, inferParsedUnion> { - const rawDiscriminant = - typeof discriminant === "string" ? discriminant : (discriminant.rawDiscriminant as inferRawDiscriminant); - const parsedDiscriminant = - typeof discriminant === "string" - ? discriminant - : (discriminant.parsedDiscriminant as inferParsedDiscriminant); - - const discriminantValueSchema = enum_(keys(union) as string[]); - - const baseSchema: BaseSchema, inferParsedUnion> = { - parse: (raw, opts) => { - return transformAndValidateUnion({ - value: raw, - discriminant: rawDiscriminant, - transformedDiscriminant: parsedDiscriminant, - transformDiscriminantValue: (discriminantValue) => - discriminantValueSchema.parse(discriminantValue, { - allowUnrecognizedEnumValues: opts?.allowUnrecognizedUnionMembers, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawDiscriminant], - }), - getAdditionalPropertiesSchema: (discriminantValue) => union[discriminantValue], - allowUnrecognizedUnionMembers: opts?.allowUnrecognizedUnionMembers, - transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => - additionalPropertiesSchema.parse(additionalProperties, opts), - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - }); - }, - json: (parsed, opts) => { - return transformAndValidateUnion({ - value: parsed, - discriminant: parsedDiscriminant, - transformedDiscriminant: rawDiscriminant, - transformDiscriminantValue: (discriminantValue) => - discriminantValueSchema.json(discriminantValue, { - allowUnrecognizedEnumValues: opts?.allowUnrecognizedUnionMembers, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedDiscriminant], - }), - getAdditionalPropertiesSchema: (discriminantValue) => union[discriminantValue], - allowUnrecognizedUnionMembers: opts?.allowUnrecognizedUnionMembers, - transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => - additionalPropertiesSchema.json(additionalProperties, opts), - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - }); - }, - getType: () => SchemaType.UNION, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - }; -} - -function transformAndValidateUnion< - TransformedDiscriminant extends string, - TransformedDiscriminantValue extends string, - TransformedAdditionalProperties ->({ - value, - discriminant, - transformedDiscriminant, - transformDiscriminantValue, - getAdditionalPropertiesSchema, - allowUnrecognizedUnionMembers = false, - transformAdditionalProperties, - breadcrumbsPrefix = [], -}: { - value: unknown; - discriminant: string; - transformedDiscriminant: TransformedDiscriminant; - transformDiscriminantValue: (discriminantValue: unknown) => MaybeValid; - getAdditionalPropertiesSchema: (discriminantValue: string) => ObjectSchema | undefined; - allowUnrecognizedUnionMembers: boolean | undefined; - transformAdditionalProperties: ( - additionalProperties: unknown, - additionalPropertiesSchema: ObjectSchema - ) => MaybeValid; - breadcrumbsPrefix: string[] | undefined; -}): MaybeValid & TransformedAdditionalProperties> { - if (!isPlainObject(value)) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "object"), - }, - ], - }; - } - - const { [discriminant]: discriminantValue, ...additionalProperties } = value; - - if (discriminantValue == null) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: `Missing discriminant ("${discriminant}")`, - }, - ], - }; - } - - const transformedDiscriminantValue = transformDiscriminantValue(discriminantValue); - if (!transformedDiscriminantValue.ok) { - return { - ok: false, - errors: transformedDiscriminantValue.errors, - }; - } - - const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value); - - if (additionalPropertiesSchema == null) { - if (allowUnrecognizedUnionMembers) { - return { - ok: true, - value: { - [transformedDiscriminant]: transformedDiscriminantValue.value, - ...additionalProperties, - } as Record & TransformedAdditionalProperties, - }; - } else { - return { - ok: false, - errors: [ - { - path: [...breadcrumbsPrefix, discriminant], - message: "Unexpected discriminant value", - }, - ], - }; - } - } - - const transformedAdditionalProperties = transformAdditionalProperties( - additionalProperties, - additionalPropertiesSchema - ); - if (!transformedAdditionalProperties.ok) { - return transformedAdditionalProperties; - } - - return { - ok: true, - value: { - [transformedDiscriminant]: discriminantValue, - ...transformedAdditionalProperties.value, - } as Record & TransformedAdditionalProperties, - }; -} diff --git a/seed/ts-express/inline-types/core/schemas/index.ts b/seed/ts-express/inline-types/core/schemas/index.ts deleted file mode 100644 index 5429d8b43eb..00000000000 --- a/seed/ts-express/inline-types/core/schemas/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./builders"; -export type { inferParsed, inferRaw, Schema, SchemaOptions } from "./Schema"; diff --git a/seed/ts-express/inline-types/core/schemas/utils/MaybePromise.ts b/seed/ts-express/inline-types/core/schemas/utils/MaybePromise.ts deleted file mode 100644 index 9cd354b3418..00000000000 --- a/seed/ts-express/inline-types/core/schemas/utils/MaybePromise.ts +++ /dev/null @@ -1 +0,0 @@ -export type MaybePromise = T | Promise; diff --git a/seed/ts-express/inline-types/core/schemas/utils/addQuestionMarksToNullableProperties.ts b/seed/ts-express/inline-types/core/schemas/utils/addQuestionMarksToNullableProperties.ts deleted file mode 100644 index 4111d703cd0..00000000000 --- a/seed/ts-express/inline-types/core/schemas/utils/addQuestionMarksToNullableProperties.ts +++ /dev/null @@ -1,15 +0,0 @@ -export type addQuestionMarksToNullableProperties = { - [K in OptionalKeys]?: T[K]; -} & Pick>; - -export type OptionalKeys = { - [K in keyof T]-?: undefined extends T[K] - ? K - : null extends T[K] - ? K - : 1 extends (any extends T[K] ? 0 : 1) - ? never - : K; -}[keyof T]; - -export type RequiredKeys = Exclude>; diff --git a/seed/ts-express/inline-types/core/schemas/utils/createIdentitySchemaCreator.ts b/seed/ts-express/inline-types/core/schemas/utils/createIdentitySchemaCreator.ts deleted file mode 100644 index de107cf5ee1..00000000000 --- a/seed/ts-express/inline-types/core/schemas/utils/createIdentitySchemaCreator.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { getSchemaUtils } from "../builders/schema-utils"; -import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema"; -import { maybeSkipValidation } from "./maybeSkipValidation"; - -export function createIdentitySchemaCreator( - schemaType: SchemaType, - validate: (value: unknown, opts?: SchemaOptions) => MaybeValid -): () => Schema { - return () => { - const baseSchema: BaseSchema = { - parse: validate, - json: validate, - getType: () => schemaType, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; - }; -} diff --git a/seed/ts-express/inline-types/core/schemas/utils/entries.ts b/seed/ts-express/inline-types/core/schemas/utils/entries.ts deleted file mode 100644 index e122952137d..00000000000 --- a/seed/ts-express/inline-types/core/schemas/utils/entries.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function entries(object: T): [keyof T, T[keyof T]][] { - return Object.entries(object) as [keyof T, T[keyof T]][]; -} diff --git a/seed/ts-express/inline-types/core/schemas/utils/filterObject.ts b/seed/ts-express/inline-types/core/schemas/utils/filterObject.ts deleted file mode 100644 index 2c25a3455bc..00000000000 --- a/seed/ts-express/inline-types/core/schemas/utils/filterObject.ts +++ /dev/null @@ -1,10 +0,0 @@ -export function filterObject(obj: T, keysToInclude: K[]): Pick { - const keysToIncludeSet = new Set(keysToInclude); - return Object.entries(obj).reduce((acc, [key, value]) => { - if (keysToIncludeSet.has(key as K)) { - acc[key as K] = value; - } - return acc; - // eslint-disable-next-line @typescript-eslint/prefer-reduce-type-parameter - }, {} as Pick); -} diff --git a/seed/ts-express/inline-types/core/schemas/utils/getErrorMessageForIncorrectType.ts b/seed/ts-express/inline-types/core/schemas/utils/getErrorMessageForIncorrectType.ts deleted file mode 100644 index 1a5c31027ce..00000000000 --- a/seed/ts-express/inline-types/core/schemas/utils/getErrorMessageForIncorrectType.ts +++ /dev/null @@ -1,25 +0,0 @@ -export function getErrorMessageForIncorrectType(value: unknown, expectedType: string): string { - return `Expected ${expectedType}. Received ${getTypeAsString(value)}.`; -} - -function getTypeAsString(value: unknown): string { - if (Array.isArray(value)) { - return "list"; - } - if (value === null) { - return "null"; - } - if (value instanceof BigInt) { - return "BigInt"; - } - switch (typeof value) { - case "string": - return `"${value}"`; - case "bigint": - case "number": - case "boolean": - case "undefined": - return `${value}`; - } - return typeof value; -} diff --git a/seed/ts-express/inline-types/core/schemas/utils/isPlainObject.ts b/seed/ts-express/inline-types/core/schemas/utils/isPlainObject.ts deleted file mode 100644 index db82a722c35..00000000000 --- a/seed/ts-express/inline-types/core/schemas/utils/isPlainObject.ts +++ /dev/null @@ -1,17 +0,0 @@ -// borrowed from https://github.com/lodash/lodash/blob/master/isPlainObject.js -export function isPlainObject(value: unknown): value is Record { - if (typeof value !== "object" || value === null) { - return false; - } - - if (Object.getPrototypeOf(value) === null) { - return true; - } - - let proto = value; - while (Object.getPrototypeOf(proto) !== null) { - proto = Object.getPrototypeOf(proto); - } - - return Object.getPrototypeOf(value) === proto; -} diff --git a/seed/ts-express/inline-types/core/schemas/utils/keys.ts b/seed/ts-express/inline-types/core/schemas/utils/keys.ts deleted file mode 100644 index 01867098287..00000000000 --- a/seed/ts-express/inline-types/core/schemas/utils/keys.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function keys(object: T): (keyof T)[] { - return Object.keys(object) as (keyof T)[]; -} diff --git a/seed/ts-express/inline-types/core/schemas/utils/maybeSkipValidation.ts b/seed/ts-express/inline-types/core/schemas/utils/maybeSkipValidation.ts deleted file mode 100644 index 86c07abf2b4..00000000000 --- a/seed/ts-express/inline-types/core/schemas/utils/maybeSkipValidation.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { BaseSchema, MaybeValid, SchemaOptions } from "../Schema"; - -export function maybeSkipValidation, Raw, Parsed>(schema: S): S { - return { - ...schema, - json: transformAndMaybeSkipValidation(schema.json), - parse: transformAndMaybeSkipValidation(schema.parse), - }; -} - -function transformAndMaybeSkipValidation( - transform: (value: unknown, opts?: SchemaOptions) => MaybeValid -): (value: unknown, opts?: SchemaOptions) => MaybeValid { - return (value, opts): MaybeValid => { - const transformed = transform(value, opts); - const { skipValidation = false } = opts ?? {}; - if (!transformed.ok && skipValidation) { - // eslint-disable-next-line no-console - console.warn( - [ - "Failed to validate.", - ...transformed.errors.map( - (error) => - " - " + - (error.path.length > 0 ? `${error.path.join(".")}: ${error.message}` : error.message) - ), - ].join("\n") - ); - - return { - ok: true, - value: value as T, - }; - } else { - return transformed; - } - }; -} diff --git a/seed/ts-express/inline-types/core/schemas/utils/partition.ts b/seed/ts-express/inline-types/core/schemas/utils/partition.ts deleted file mode 100644 index f58d6f3d35f..00000000000 --- a/seed/ts-express/inline-types/core/schemas/utils/partition.ts +++ /dev/null @@ -1,12 +0,0 @@ -export function partition(items: readonly T[], predicate: (item: T) => boolean): [T[], T[]] { - const trueItems: T[] = [], - falseItems: T[] = []; - for (const item of items) { - if (predicate(item)) { - trueItems.push(item); - } else { - falseItems.push(item); - } - } - return [trueItems, falseItems]; -} diff --git a/seed/ts-express/inline-types/errors/SeedObjectError.ts b/seed/ts-express/inline-types/errors/SeedObjectError.ts deleted file mode 100644 index 18591bb0774..00000000000 --- a/seed/ts-express/inline-types/errors/SeedObjectError.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import express from "express"; - -export abstract class SeedObjectError extends Error { - constructor(public readonly errorName?: string) { - super(); - Object.setPrototypeOf(this, SeedObjectError.prototype); - } - - public abstract send(res: express.Response): Promise; -} diff --git a/seed/ts-express/inline-types/errors/index.ts b/seed/ts-express/inline-types/errors/index.ts deleted file mode 100644 index 4092350d630..00000000000 --- a/seed/ts-express/inline-types/errors/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { SeedObjectError } from "./SeedObjectError"; diff --git a/seed/ts-express/inline-types/index.ts b/seed/ts-express/inline-types/index.ts deleted file mode 100644 index be26b5526a5..00000000000 --- a/seed/ts-express/inline-types/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * as SeedObject from "./api"; -export { register } from "./register"; -export { SeedObjectError } from "./errors"; diff --git a/seed/ts-express/inline-types/register.ts b/seed/ts-express/inline-types/register.ts deleted file mode 100644 index 0758a536615..00000000000 --- a/seed/ts-express/inline-types/register.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import express from "express"; -import { RootService } from "./api/service/RootService"; - -export function register( - expressApp: express.Express | express.Router, - services: { - _root: RootService; - } -): void { - (expressApp as any).use("/root", services._root.toRouter()); -} diff --git a/seed/ts-express/inline-types/serialization/index.ts b/seed/ts-express/inline-types/serialization/index.ts deleted file mode 100644 index fcc81debec4..00000000000 --- a/seed/ts-express/inline-types/serialization/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./types"; -export * from "./service"; diff --git a/seed/ts-express/inline-types/serialization/service/requests/GetDiscriminatedUnionRequest.ts b/seed/ts-express/inline-types/serialization/service/requests/GetDiscriminatedUnionRequest.ts deleted file mode 100644 index f31cff3b9ae..00000000000 --- a/seed/ts-express/inline-types/serialization/service/requests/GetDiscriminatedUnionRequest.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../index"; -import * as SeedObject from "../../../api/index"; -import * as core from "../../../core"; - -export const GetDiscriminatedUnionRequest: core.serialization.Schema< - serializers.GetDiscriminatedUnionRequest.Raw, - SeedObject.GetDiscriminatedUnionRequest -> = core.serialization.object({ - bar: core.serialization.lazy(() => serializers.DiscriminatedUnion1), - foo: core.serialization.string(), -}); - -export declare namespace GetDiscriminatedUnionRequest { - interface Raw { - bar: serializers.DiscriminatedUnion1.Raw; - foo: string; - } -} diff --git a/seed/ts-express/inline-types/serialization/service/requests/GetUndiscriminatedUnionRequest.ts b/seed/ts-express/inline-types/serialization/service/requests/GetUndiscriminatedUnionRequest.ts deleted file mode 100644 index 6718a23bff6..00000000000 --- a/seed/ts-express/inline-types/serialization/service/requests/GetUndiscriminatedUnionRequest.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../index"; -import * as SeedObject from "../../../api/index"; -import * as core from "../../../core"; - -export const GetUndiscriminatedUnionRequest: core.serialization.Schema< - serializers.GetUndiscriminatedUnionRequest.Raw, - SeedObject.GetUndiscriminatedUnionRequest -> = core.serialization.object({ - bar: core.serialization.lazy(() => serializers.UndiscriminatedUnion1), - foo: core.serialization.string(), -}); - -export declare namespace GetUndiscriminatedUnionRequest { - interface Raw { - bar: serializers.UndiscriminatedUnion1.Raw; - foo: string; - } -} diff --git a/seed/ts-express/inline-types/serialization/service/requests/PostRootRequest.ts b/seed/ts-express/inline-types/serialization/service/requests/PostRootRequest.ts deleted file mode 100644 index cee54c2feea..00000000000 --- a/seed/ts-express/inline-types/serialization/service/requests/PostRootRequest.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../index"; -import * as SeedObject from "../../../api/index"; -import * as core from "../../../core"; - -export const PostRootRequest: core.serialization.Schema = - core.serialization.object({ - bar: core.serialization.lazyObject(() => serializers.RequestTypeInlineType1), - foo: core.serialization.string(), - }); - -export declare namespace PostRootRequest { - interface Raw { - bar: serializers.RequestTypeInlineType1.Raw; - foo: string; - } -} diff --git a/seed/ts-express/inline-types/serialization/service/requests/index.ts b/seed/ts-express/inline-types/serialization/service/requests/index.ts deleted file mode 100644 index 1e2ed00361c..00000000000 --- a/seed/ts-express/inline-types/serialization/service/requests/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { PostRootRequest } from "./PostRootRequest"; -export { GetDiscriminatedUnionRequest } from "./GetDiscriminatedUnionRequest"; -export { GetUndiscriminatedUnionRequest } from "./GetUndiscriminatedUnionRequest"; diff --git a/seed/ts-express/inline-types/serialization/types/AliasInlineValue.ts b/seed/ts-express/inline-types/serialization/types/AliasInlineValue.ts deleted file mode 100644 index ad5f6437099..00000000000 --- a/seed/ts-express/inline-types/serialization/types/AliasInlineValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const AliasInlineValue: core.serialization.ObjectSchema< - serializers.AliasInlineValue.Raw, - SeedObject.AliasInlineValue -> = core.serialization.object({ - foo: core.serialization.string(), - bar: core.serialization.string(), -}); - -export declare namespace AliasInlineValue { - interface Raw { - foo: string; - bar: string; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/AliasListInline.ts b/seed/ts-express/inline-types/serialization/types/AliasListInline.ts deleted file mode 100644 index 0e9608b201e..00000000000 --- a/seed/ts-express/inline-types/serialization/types/AliasListInline.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const AliasListInline: core.serialization.Schema = - core.serialization.list(core.serialization.lazyObject(() => serializers.AliasInlineValue)); - -export declare namespace AliasListInline { - type Raw = serializers.AliasInlineValue.Raw[]; -} diff --git a/seed/ts-express/inline-types/serialization/types/AliasMapInline.ts b/seed/ts-express/inline-types/serialization/types/AliasMapInline.ts deleted file mode 100644 index e37388761e9..00000000000 --- a/seed/ts-express/inline-types/serialization/types/AliasMapInline.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const AliasMapInline: core.serialization.Schema = - core.serialization.record( - core.serialization.string(), - core.serialization.lazyObject(() => serializers.AliasInlineValue) - ); - -export declare namespace AliasMapInline { - type Raw = Record; -} diff --git a/seed/ts-express/inline-types/serialization/types/AliasSetInline.ts b/seed/ts-express/inline-types/serialization/types/AliasSetInline.ts deleted file mode 100644 index 0d931080074..00000000000 --- a/seed/ts-express/inline-types/serialization/types/AliasSetInline.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const AliasSetInline: core.serialization.Schema = - core.serialization.list(core.serialization.lazyObject(() => serializers.AliasInlineValue)); - -export declare namespace AliasSetInline { - type Raw = serializers.AliasInlineValue.Raw[]; -} diff --git a/seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1.ts b/seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1.ts deleted file mode 100644 index 38151ead239..00000000000 --- a/seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const DiscriminatedUnion1: core.serialization.Schema< - serializers.DiscriminatedUnion1.Raw, - SeedObject.DiscriminatedUnion1 -> = core.serialization - .union("type", { - type1: core.serialization.lazyObject(() => serializers.DiscriminatedUnion1InlineType1), - type2: core.serialization.lazyObject(() => serializers.DiscriminatedUnion1InlineType2), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), - }) - .transform({ - transform: (value) => value, - untransform: (value) => value, - }); - -export declare namespace DiscriminatedUnion1 { - type Raw = DiscriminatedUnion1.Type1 | DiscriminatedUnion1.Type2 | DiscriminatedUnion1.Ref; - - interface Type1 extends serializers.DiscriminatedUnion1InlineType1.Raw { - type: "type1"; - } - - interface Type2 extends serializers.DiscriminatedUnion1InlineType2.Raw { - type: "type2"; - } - - interface Ref extends serializers.ReferenceType.Raw { - type: "ref"; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1InlineType1.ts b/seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1InlineType1.ts deleted file mode 100644 index 92cd978767e..00000000000 --- a/seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1InlineType1.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const DiscriminatedUnion1InlineType1: core.serialization.ObjectSchema< - serializers.DiscriminatedUnion1InlineType1.Raw, - SeedObject.DiscriminatedUnion1InlineType1 -> = core.serialization.object({ - foo: core.serialization.string(), - bar: core.serialization.lazyObject(() => serializers.DiscriminatedUnion1InlineType1InlineType1), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace DiscriminatedUnion1InlineType1 { - interface Raw { - foo: string; - bar: serializers.DiscriminatedUnion1InlineType1InlineType1.Raw; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1InlineType1InlineType1.ts b/seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1InlineType1InlineType1.ts deleted file mode 100644 index 5eb65cea843..00000000000 --- a/seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1InlineType1InlineType1.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const DiscriminatedUnion1InlineType1InlineType1: core.serialization.ObjectSchema< - serializers.DiscriminatedUnion1InlineType1InlineType1.Raw, - SeedObject.DiscriminatedUnion1InlineType1InlineType1 -> = core.serialization.object({ - foo: core.serialization.string(), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace DiscriminatedUnion1InlineType1InlineType1 { - interface Raw { - foo: string; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1InlineType2.ts b/seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1InlineType2.ts deleted file mode 100644 index 9acf0a5c56e..00000000000 --- a/seed/ts-express/inline-types/serialization/types/DiscriminatedUnion1InlineType2.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const DiscriminatedUnion1InlineType2: core.serialization.ObjectSchema< - serializers.DiscriminatedUnion1InlineType2.Raw, - SeedObject.DiscriminatedUnion1InlineType2 -> = core.serialization.object({ - baz: core.serialization.string(), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace DiscriminatedUnion1InlineType2 { - interface Raw { - baz: string; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/InlineEnum1.ts b/seed/ts-express/inline-types/serialization/types/InlineEnum1.ts deleted file mode 100644 index ee1f6ab474a..00000000000 --- a/seed/ts-express/inline-types/serialization/types/InlineEnum1.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const InlineEnum1: core.serialization.Schema = - core.serialization.enum_(["SUNNY", "CLOUDY", "RAINING", "SNOWING"]); - -export declare namespace InlineEnum1 { - type Raw = "SUNNY" | "CLOUDY" | "RAINING" | "SNOWING"; -} diff --git a/seed/ts-express/inline-types/serialization/types/ReferenceType.ts b/seed/ts-express/inline-types/serialization/types/ReferenceType.ts deleted file mode 100644 index c90ea4b4a16..00000000000 --- a/seed/ts-express/inline-types/serialization/types/ReferenceType.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const ReferenceType: core.serialization.ObjectSchema = - core.serialization.object({ - foo: core.serialization.string(), - }); - -export declare namespace ReferenceType { - interface Raw { - foo: string; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/RequestTypeInlineType1.ts b/seed/ts-express/inline-types/serialization/types/RequestTypeInlineType1.ts deleted file mode 100644 index cc38d772dc8..00000000000 --- a/seed/ts-express/inline-types/serialization/types/RequestTypeInlineType1.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const RequestTypeInlineType1: core.serialization.ObjectSchema< - serializers.RequestTypeInlineType1.Raw, - SeedObject.RequestTypeInlineType1 -> = core.serialization.object({ - foo: core.serialization.string(), -}); - -export declare namespace RequestTypeInlineType1 { - interface Raw { - foo: string; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/RootType1.ts b/seed/ts-express/inline-types/serialization/types/RootType1.ts deleted file mode 100644 index 397c1eefa92..00000000000 --- a/seed/ts-express/inline-types/serialization/types/RootType1.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const RootType1: core.serialization.ObjectSchema = - core.serialization.object({ - foo: core.serialization.string(), - bar: core.serialization.lazyObject(() => serializers.RootType1InlineType1), - fooMap: core.serialization.record( - core.serialization.string(), - core.serialization.lazyObject(() => serializers.RootType1FooMapValue) - ), - fooList: core.serialization.list(core.serialization.lazyObject(() => serializers.RootType1FooListItem)), - fooSet: core.serialization.list(core.serialization.lazyObject(() => serializers.RootType1FooSetItem)), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), - }); - -export declare namespace RootType1 { - interface Raw { - foo: string; - bar: serializers.RootType1InlineType1.Raw; - fooMap: Record; - fooList: serializers.RootType1FooListItem.Raw[]; - fooSet: serializers.RootType1FooSetItem.Raw[]; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/RootType1FooListItem.ts b/seed/ts-express/inline-types/serialization/types/RootType1FooListItem.ts deleted file mode 100644 index 2b2652b46fb..00000000000 --- a/seed/ts-express/inline-types/serialization/types/RootType1FooListItem.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const RootType1FooListItem: core.serialization.ObjectSchema< - serializers.RootType1FooListItem.Raw, - SeedObject.RootType1FooListItem -> = core.serialization.object({ - foo: core.serialization.string(), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace RootType1FooListItem { - interface Raw { - foo: string; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/RootType1FooMapValue.ts b/seed/ts-express/inline-types/serialization/types/RootType1FooMapValue.ts deleted file mode 100644 index 7fc1a66c2dc..00000000000 --- a/seed/ts-express/inline-types/serialization/types/RootType1FooMapValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const RootType1FooMapValue: core.serialization.ObjectSchema< - serializers.RootType1FooMapValue.Raw, - SeedObject.RootType1FooMapValue -> = core.serialization.object({ - foo: core.serialization.string(), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace RootType1FooMapValue { - interface Raw { - foo: string; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/RootType1FooSetItem.ts b/seed/ts-express/inline-types/serialization/types/RootType1FooSetItem.ts deleted file mode 100644 index d7662b9aaac..00000000000 --- a/seed/ts-express/inline-types/serialization/types/RootType1FooSetItem.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const RootType1FooSetItem: core.serialization.ObjectSchema< - serializers.RootType1FooSetItem.Raw, - SeedObject.RootType1FooSetItem -> = core.serialization.object({ - foo: core.serialization.string(), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace RootType1FooSetItem { - interface Raw { - foo: string; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/RootType1InlineType1.ts b/seed/ts-express/inline-types/serialization/types/RootType1InlineType1.ts deleted file mode 100644 index e1c3dd7808e..00000000000 --- a/seed/ts-express/inline-types/serialization/types/RootType1InlineType1.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const RootType1InlineType1: core.serialization.ObjectSchema< - serializers.RootType1InlineType1.Raw, - SeedObject.RootType1InlineType1 -> = core.serialization.object({ - foo: core.serialization.string(), - bar: core.serialization.lazyObject(() => serializers.RootType1InlineType1NestedInlineType1), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace RootType1InlineType1 { - interface Raw { - foo: string; - bar: serializers.RootType1InlineType1NestedInlineType1.Raw; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/RootType1InlineType1NestedInlineType1.ts b/seed/ts-express/inline-types/serialization/types/RootType1InlineType1NestedInlineType1.ts deleted file mode 100644 index 03d5a36a505..00000000000 --- a/seed/ts-express/inline-types/serialization/types/RootType1InlineType1NestedInlineType1.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const RootType1InlineType1NestedInlineType1: core.serialization.ObjectSchema< - serializers.RootType1InlineType1NestedInlineType1.Raw, - SeedObject.RootType1InlineType1NestedInlineType1 -> = core.serialization.object({ - foo: core.serialization.string(), - bar: core.serialization.string(), - myEnum: core.serialization.lazy(() => serializers.InlineEnum1), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace RootType1InlineType1NestedInlineType1 { - interface Raw { - foo: string; - bar: string; - myEnum: serializers.InlineEnum1.Raw; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1.ts b/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1.ts deleted file mode 100644 index 44df84c435b..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UndiscriminatedUnion1: core.serialization.Schema< - serializers.UndiscriminatedUnion1.Raw, - SeedObject.UndiscriminatedUnion1 -> = core.serialization.undiscriminatedUnion([ - core.serialization.lazyObject(() => serializers.UndiscriminatedUnion1InlineType1), - core.serialization.lazyObject(() => serializers.UndiscriminatedUnion1InlineType2), - core.serialization.lazy(() => serializers.UndiscriminatedUnion1DiscriminatedUnion1), - core.serialization.lazy(() => serializers.UndiscriminatedUnion1DiscriminatedUnion1), - core.serialization.lazy(() => serializers.UndiscriminatedUnion1InlineEnum1), - core.serialization.lazy(() => serializers.UserId), - core.serialization.list(core.serialization.lazyObject(() => serializers.UndiscriminatedUnion1InlineListItem1)), - core.serialization.list(core.serialization.lazyObject(() => serializers.UndiscriminatedUnion1InlineSetItem1)), - core.serialization.record( - core.serialization.string(), - core.serialization.lazyObject(() => serializers.UndiscriminatedUnion1InlineMapItem1) - ), - core.serialization.lazyObject(() => serializers.ReferenceType), -]); - -export declare namespace UndiscriminatedUnion1 { - type Raw = - | serializers.UndiscriminatedUnion1InlineType1.Raw - | serializers.UndiscriminatedUnion1InlineType2.Raw - | serializers.UndiscriminatedUnion1DiscriminatedUnion1.Raw - | serializers.UndiscriminatedUnion1DiscriminatedUnion1.Raw - | serializers.UndiscriminatedUnion1InlineEnum1.Raw - | serializers.UserId.Raw - | serializers.UndiscriminatedUnion1InlineListItem1.Raw[] - | serializers.UndiscriminatedUnion1InlineSetItem1.Raw[] - | Record - | serializers.ReferenceType.Raw; -} diff --git a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1.ts b/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1.ts deleted file mode 100644 index d1ed9a31bf9..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UndiscriminatedUnion1DiscriminatedUnion1: core.serialization.Schema< - serializers.UndiscriminatedUnion1DiscriminatedUnion1.Raw, - SeedObject.UndiscriminatedUnion1DiscriminatedUnion1 -> = core.serialization - .union("type", { - type1: core.serialization.lazyObject(() => serializers.UndiscriminatedUnion1DiscriminatedUnion1InlineType1), - type2: core.serialization.lazyObject(() => serializers.UndiscriminatedUnion1DiscriminatedUnion1InlineType2), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), - }) - .transform({ - transform: (value) => value, - untransform: (value) => value, - }); - -export declare namespace UndiscriminatedUnion1DiscriminatedUnion1 { - type Raw = - | UndiscriminatedUnion1DiscriminatedUnion1.Type1 - | UndiscriminatedUnion1DiscriminatedUnion1.Type2 - | UndiscriminatedUnion1DiscriminatedUnion1.Ref; - - interface Type1 extends serializers.UndiscriminatedUnion1DiscriminatedUnion1InlineType1.Raw { - type: "type1"; - } - - interface Type2 extends serializers.UndiscriminatedUnion1DiscriminatedUnion1InlineType2.Raw { - type: "type2"; - } - - interface Ref extends serializers.ReferenceType.Raw { - type: "ref"; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts b/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts deleted file mode 100644 index e424b6dc2ca..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UndiscriminatedUnion1DiscriminatedUnion1InlineType1: core.serialization.ObjectSchema< - serializers.UndiscriminatedUnion1DiscriminatedUnion1InlineType1.Raw, - SeedObject.UndiscriminatedUnion1DiscriminatedUnion1InlineType1 -> = core.serialization.object({ - foo: core.serialization.string(), - bar: core.serialization.lazyObject( - () => serializers.UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1 - ), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace UndiscriminatedUnion1DiscriminatedUnion1InlineType1 { - interface Raw { - foo: string; - bar: serializers.UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.Raw; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts b/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts deleted file mode 100644 index 6f54c38f225..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1: core.serialization.ObjectSchema< - serializers.UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.Raw, - SeedObject.UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1 -> = core.serialization.object({ - foo: core.serialization.string(), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1 { - interface Raw { - foo: string; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts b/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts deleted file mode 100644 index 676d1857453..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UndiscriminatedUnion1DiscriminatedUnion1InlineType2: core.serialization.ObjectSchema< - serializers.UndiscriminatedUnion1DiscriminatedUnion1InlineType2.Raw, - SeedObject.UndiscriminatedUnion1DiscriminatedUnion1InlineType2 -> = core.serialization.object({ - baz: core.serialization.string(), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace UndiscriminatedUnion1DiscriminatedUnion1InlineType2 { - interface Raw { - baz: string; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineEnum1.ts b/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineEnum1.ts deleted file mode 100644 index b6d7aa2e67e..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineEnum1.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UndiscriminatedUnion1InlineEnum1: core.serialization.Schema< - serializers.UndiscriminatedUnion1InlineEnum1.Raw, - SeedObject.UndiscriminatedUnion1InlineEnum1 -> = core.serialization.enum_(["SUNNY", "CLOUDY", "RAINING", "SNOWING"]); - -export declare namespace UndiscriminatedUnion1InlineEnum1 { - type Raw = "SUNNY" | "CLOUDY" | "RAINING" | "SNOWING"; -} diff --git a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineListItem1.ts b/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineListItem1.ts deleted file mode 100644 index dbef4677983..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineListItem1.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UndiscriminatedUnion1InlineListItem1: core.serialization.ObjectSchema< - serializers.UndiscriminatedUnion1InlineListItem1.Raw, - SeedObject.UndiscriminatedUnion1InlineListItem1 -> = core.serialization.object({ - foo: core.serialization.string(), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace UndiscriminatedUnion1InlineListItem1 { - interface Raw { - foo: string; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineMapItem1.ts b/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineMapItem1.ts deleted file mode 100644 index 10d8a7a151f..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineMapItem1.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UndiscriminatedUnion1InlineMapItem1: core.serialization.ObjectSchema< - serializers.UndiscriminatedUnion1InlineMapItem1.Raw, - SeedObject.UndiscriminatedUnion1InlineMapItem1 -> = core.serialization.object({ - foo: core.serialization.string(), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace UndiscriminatedUnion1InlineMapItem1 { - interface Raw { - foo: string; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineSetItem1.ts b/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineSetItem1.ts deleted file mode 100644 index b96ca054986..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineSetItem1.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UndiscriminatedUnion1InlineSetItem1: core.serialization.ObjectSchema< - serializers.UndiscriminatedUnion1InlineSetItem1.Raw, - SeedObject.UndiscriminatedUnion1InlineSetItem1 -> = core.serialization.object({ - foo: core.serialization.string(), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace UndiscriminatedUnion1InlineSetItem1 { - interface Raw { - foo: string; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineType1.ts b/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineType1.ts deleted file mode 100644 index a43be21e8b6..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineType1.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UndiscriminatedUnion1InlineType1: core.serialization.ObjectSchema< - serializers.UndiscriminatedUnion1InlineType1.Raw, - SeedObject.UndiscriminatedUnion1InlineType1 -> = core.serialization.object({ - foo: core.serialization.string(), - bar: core.serialization.lazyObject(() => serializers.UndiscriminatedUnion1InlineType1InlineType1), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace UndiscriminatedUnion1InlineType1 { - interface Raw { - foo: string; - bar: serializers.UndiscriminatedUnion1InlineType1InlineType1.Raw; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineType1InlineType1.ts b/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineType1InlineType1.ts deleted file mode 100644 index 4fcddd84d91..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineType1InlineType1.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UndiscriminatedUnion1InlineType1InlineType1: core.serialization.ObjectSchema< - serializers.UndiscriminatedUnion1InlineType1InlineType1.Raw, - SeedObject.UndiscriminatedUnion1InlineType1InlineType1 -> = core.serialization.object({ - foo: core.serialization.string(), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace UndiscriminatedUnion1InlineType1InlineType1 { - interface Raw { - foo: string; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineType2.ts b/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineType2.ts deleted file mode 100644 index 7ea5bec5896..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UndiscriminatedUnion1InlineType2.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UndiscriminatedUnion1InlineType2: core.serialization.ObjectSchema< - serializers.UndiscriminatedUnion1InlineType2.Raw, - SeedObject.UndiscriminatedUnion1InlineType2 -> = core.serialization.object({ - baz: core.serialization.string(), - ref: core.serialization.lazyObject(() => serializers.ReferenceType), -}); - -export declare namespace UndiscriminatedUnion1InlineType2 { - interface Raw { - baz: string; - ref: serializers.ReferenceType.Raw; - } -} diff --git a/seed/ts-express/inline-types/serialization/types/UserId.ts b/seed/ts-express/inline-types/serialization/types/UserId.ts deleted file mode 100644 index 1ad9c4920f0..00000000000 --- a/seed/ts-express/inline-types/serialization/types/UserId.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const UserId: core.serialization.Schema = core.serialization.string(); - -export declare namespace UserId { - type Raw = string; -} diff --git a/seed/ts-express/inline-types/serialization/types/index.ts b/seed/ts-express/inline-types/serialization/types/index.ts deleted file mode 100644 index 57d21ed5261..00000000000 --- a/seed/ts-express/inline-types/serialization/types/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -export * from "./AliasMapInline"; -export * from "./AliasSetInline"; -export * from "./AliasListInline"; -export * from "./AliasInlineValue"; -export * from "./RequestTypeInlineType1"; -export * from "./RootType1"; -export * from "./RootType1FooMapValue"; -export * from "./RootType1FooListItem"; -export * from "./RootType1FooSetItem"; -export * from "./RootType1InlineType1"; -export * from "./RootType1InlineType1NestedInlineType1"; -export * from "./DiscriminatedUnion1"; -export * from "./DiscriminatedUnion1InlineType1"; -export * from "./DiscriminatedUnion1InlineType1InlineType1"; -export * from "./DiscriminatedUnion1InlineType2"; -export * from "./UndiscriminatedUnion1"; -export * from "./UndiscriminatedUnion1InlineType1"; -export * from "./UndiscriminatedUnion1InlineType1InlineType1"; -export * from "./UndiscriminatedUnion1InlineType2"; -export * from "./InlineEnum1"; -export * from "./UndiscriminatedUnion1DiscriminatedUnion1"; -export * from "./UndiscriminatedUnion1DiscriminatedUnion1InlineType1"; -export * from "./UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1"; -export * from "./UndiscriminatedUnion1DiscriminatedUnion1InlineType2"; -export * from "./UndiscriminatedUnion1InlineEnum1"; -export * from "./UserId"; -export * from "./UndiscriminatedUnion1InlineListItem1"; -export * from "./UndiscriminatedUnion1InlineSetItem1"; -export * from "./UndiscriminatedUnion1InlineMapItem1"; -export * from "./ReferenceType"; diff --git a/seed/ts-express/inline-types/snippet-templates.json b/seed/ts-express/inline-types/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/ts-express/inline-types/snippet.json b/seed/ts-express/inline-types/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/ts-sdk/inline-types/.mock/definition/__package__.yml b/seed/ts-sdk/inline-types/.mock/definition/__package__.yml deleted file mode 100644 index a2a0cbfac7c..00000000000 --- a/seed/ts-sdk/inline-types/.mock/definition/__package__.yml +++ /dev/null @@ -1,61 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: InlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - -types: - RootType1: - properties: - foo: string - bar: InlineType1 - - InlineType1: - inline: true - properties: - foo: string - bar: - type: NestedInlineType1 - - InlineType2: - inline: true - properties: - baz: string - - NestedInlineType1: - inline: true - properties: - foo: string - bar: string - myEnum: InlineEnum - - InlinedDiscriminatedUnion1: - inline: true - union: - type1: InlineType1 - type2: InlineType2 - - InlinedUndiscriminatedUnion1: - inline: true - discriminated: false - union: - - type: InlineType1 - - type: InlineType2 - - InlineEnum: - inline: true - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING diff --git a/seed/ts-sdk/inline-types/.mock/definition/api.yml b/seed/ts-sdk/inline-types/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/ts-sdk/inline-types/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/ts-sdk/inline-types/.mock/fern.config.json b/seed/ts-sdk/inline-types/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/ts-sdk/inline-types/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/ts-sdk/inline-types/.mock/generators.yml b/seed/ts-sdk/inline-types/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/ts-sdk/inline-types/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/ts-sdk/inline-types/README.md b/seed/ts-sdk/inline-types/README.md deleted file mode 100644 index f4e7bca0156..00000000000 --- a/seed/ts-sdk/inline-types/README.md +++ /dev/null @@ -1,161 +0,0 @@ -# Seed TypeScript 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%2FTypeScript) -[![npm shield](https://img.shields.io/npm/v/@fern/inline-types)](https://www.npmjs.com/package/@fern/inline-types) - -The Seed TypeScript library provides convenient access to the Seed API from TypeScript. - -## Installation - -```sh -npm i -s @fern/inline-types -``` - -## Reference - -A full reference for this library is available [here](./reference.md). - -## Usage - -Instantiate and use the client with the following: - -```typescript -import { SeedObjectClient } from "@fern/inline-types"; - -const client = new SeedObjectClient({ environment: "YOUR_BASE_URL" }); -await client.getRoot({ - bar: { - foo: "foo", - bar: { - foo: "foo", - bar: "bar", - myEnum: "SUNNY", - }, - }, - foo: "foo", -}); -``` - -## Request And Response Types - -The SDK exports all request and response types as TypeScript interfaces. Simply import them with the -following namespace: - -```typescript -import { SeedObject } from "@fern/inline-types"; - -const request: SeedObject.PostRootRequest = { - ... -}; -``` - -## Exception Handling - -When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error -will be thrown. - -```typescript -import { SeedObjectError } from "@fern/inline-types"; - -try { - await client.getRoot(...); -} catch (err) { - if (err instanceof SeedObjectError) { - console.log(err.statusCode); - console.log(err.message); - console.log(err.body); - } -} -``` - -## Advanced - -### Additional Headers - -If you would like to send additional headers as part of the request, use the `headers` request option. - -```typescript -const response = await client.getRoot(..., { - headers: { - 'X-Custom-Header': 'custom value' - } -}); -``` - -### Retries - -The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long -as the request is deemed retriable and the number of retry attempts has not grown larger than the configured -retry limit (default: 2). - -A request is deemed retriable 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. - -```typescript -const response = await client.getRoot(..., { - maxRetries: 0 // override maxRetries at the request level -}); -``` - -### Timeouts - -The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior. - -```typescript -const response = await client.getRoot(..., { - timeoutInSeconds: 30 // override timeout to 30s -}); -``` - -### Aborting Requests - -The SDK allows users to abort requests at any point by passing in an abort signal. - -```typescript -const controller = new AbortController(); -const response = await client.getRoot(..., { - abortSignal: controller.signal -}); -controller.abort(); // aborts the request -``` - -### Runtime Compatibility - -The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following -runtimes: - -- Node.js 18+ -- Vercel -- Cloudflare Workers -- Deno v1.25+ -- Bun 1.0+ -- React Native - -### Customizing Fetch Client - -The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an -unsupported environment, this provides a way for you to break glass and ensure the SDK works. - -```typescript -import { SeedObjectClient } from "@fern/inline-types"; - -const client = new SeedObjectClient({ - ... - fetcher: // provide your implementation here -}); -``` - -## 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! diff --git a/seed/ts-sdk/inline-types/inline/.mock/definition/api.yml b/seed/ts-sdk/inline-types/inline/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/ts-sdk/inline-types/inline/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/ts-sdk/inline-types/inline/.mock/fern.config.json b/seed/ts-sdk/inline-types/inline/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/ts-sdk/inline-types/inline/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/ts-sdk/inline-types/inline/.mock/generators.yml b/seed/ts-sdk/inline-types/inline/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/ts-sdk/inline-types/inline/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/ts-sdk/inline-types/inline/.mock/ir.json b/seed/ts-sdk/inline-types/inline/.mock/ir.json deleted file mode 100644 index 00d22b232be..00000000000 --- a/seed/ts-sdk/inline-types/inline/.mock/ir.json +++ /dev/null @@ -1,4159 +0,0 @@ -{ - "fdrApiDefinitionId": null, - "apiVersion": null, - "apiName": { - "originalName": "object", - "camelCase": { - "unsafeName": "object", - "safeName": "object" - }, - "snakeCase": { - "unsafeName": "object", - "safeName": "object" - }, - "screamingSnakeCase": { - "unsafeName": "OBJECT", - "safeName": "OBJECT" - }, - "pascalCase": { - "unsafeName": "Object", - "safeName": "Object" - } - }, - "apiDisplayName": null, - "apiDocs": null, - "auth": { - "requirement": "ALL", - "schemes": [], - "docs": null - }, - "headers": [], - "idempotencyHeaders": [], - "types": { - "type_:RequestTypeInlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RequestTypeInlineType1" - }, - "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_:RootType1": { - "inline": null, - "name": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - }, - "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 - }, - { - "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": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1", - "default": null, - "inline": null - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:RootType1InlineType1", - "type_:RootType1InlineType1NestedInlineType1", - "type_:InlineEnum" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:RootType1InlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1" - }, - "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 - }, - { - "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": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1", - "default": null, - "inline": null - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:RootType1InlineType1NestedInlineType1", - "type_:InlineEnum" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:RootType1InlineType1NestedInlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - }, - "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 - }, - { - "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": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "valueType": { - "_type": "named", - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum", - "default": null, - "inline": null - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:InlineEnum" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:DiscriminatedUnion1": { - "inline": true, - "name": { - "name": { - "originalName": "DiscriminatedUnion1", - "camelCase": { - "unsafeName": "discriminatedUnion1", - "safeName": "discriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1", - "safeName": "discriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1", - "safeName": "DISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1", - "safeName": "DiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1" - }, - "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": "type1", - "camelCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "snakeCase": { - "unsafeName": "type_1", - "safeName": "type_1" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_1", - "safeName": "TYPE_1" - }, - "pascalCase": { - "unsafeName": "Type1", - "safeName": "Type1" - } - }, - "wireValue": "type1" - }, - "shape": { - "_type": "samePropertiesAsObject", - "name": { - "originalName": "DiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType1", - "safeName": "discriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_1", - "safeName": "discriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType1", - "safeName": "DiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType1" - }, - "displayName": null, - "availability": null, - "docs": null - }, - { - "discriminantValue": { - "name": { - "originalName": "type2", - "camelCase": { - "unsafeName": "type2", - "safeName": "type2" - }, - "snakeCase": { - "unsafeName": "type_2", - "safeName": "type_2" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_2", - "safeName": "TYPE_2" - }, - "pascalCase": { - "unsafeName": "Type2", - "safeName": "Type2" - } - }, - "wireValue": "type2" - }, - "shape": { - "_type": "samePropertiesAsObject", - "name": { - "originalName": "DiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType2", - "safeName": "discriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_2", - "safeName": "discriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType2", - "safeName": "DiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType2" - }, - "displayName": null, - "availability": null, - "docs": null - } - ] - }, - "referencedTypes": [ - "type_:DiscriminatedUnion1InlineType1", - "type_:DiscriminatedUnion1InlineType2" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:DiscriminatedUnion1InlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "DiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType1", - "safeName": "discriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_1", - "safeName": "discriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType1", - "safeName": "DiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType1" - }, - "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_:DiscriminatedUnion1InlineType2": { - "inline": true, - "name": { - "name": { - "originalName": "DiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType2", - "safeName": "discriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_2", - "safeName": "discriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType2", - "safeName": "DiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType2" - }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "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_:UndiscriminatedUnion1": { - "inline": true, - "name": { - "name": { - "originalName": "UndiscriminatedUnion1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1", - "safeName": "undiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1", - "safeName": "undiscriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1", - "safeName": "UNDISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1", - "safeName": "UndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1" - }, - "shape": { - "_type": "undiscriminatedUnion", - "members": [ - { - "type": { - "_type": "named", - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType1", - "default": null, - "inline": null - }, - "docs": null - }, - { - "type": { - "_type": "named", - "name": { - "originalName": "UndiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType2", - "safeName": "undiscriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_2", - "safeName": "undiscriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType2", - "safeName": "UndiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType2", - "default": null, - "inline": null - }, - "docs": null - } - ] - }, - "referencedTypes": [ - "type_:UndiscriminatedUnion1InlineType1", - "type_:UndiscriminatedUnion1InlineType2" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:UndiscriminatedUnion1InlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType1" - }, - "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_:UndiscriminatedUnion1InlineType2": { - "inline": true, - "name": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType2", - "safeName": "undiscriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_2", - "safeName": "undiscriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType2", - "safeName": "UndiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType2" - }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "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_:InlineEnum": { - "inline": true, - "name": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum" - }, - "shape": { - "_type": "enum", - "default": null, - "values": [ - { - "name": { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "CLOUDY", - "camelCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "snakeCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "screamingSnakeCase": { - "unsafeName": "CLOUDY", - "safeName": "CLOUDY" - }, - "pascalCase": { - "unsafeName": "Cloudy", - "safeName": "Cloudy" - } - }, - "wireValue": "CLOUDY" - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "RAINING", - "camelCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "snakeCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "screamingSnakeCase": { - "unsafeName": "RAINING", - "safeName": "RAINING" - }, - "pascalCase": { - "unsafeName": "Raining", - "safeName": "Raining" - } - }, - "wireValue": "RAINING" - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "SNOWING", - "camelCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "snakeCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "screamingSnakeCase": { - "unsafeName": "SNOWING", - "safeName": "SNOWING" - }, - "pascalCase": { - "unsafeName": "Snowing", - "safeName": "Snowing" - } - }, - "wireValue": "SNOWING" - }, - "availability": null, - "docs": null - } - ] - }, - "referencedTypes": [], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - } - }, - "errors": {}, - "services": { - "service_": { - "availability": null, - "name": { - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "displayName": null, - "basePath": { - "head": "/root", - "parts": [] - }, - "headers": [], - "pathParameters": [], - "encoding": { - "json": {}, - "proto": null - }, - "transport": { - "type": "http" - }, - "endpoints": [ - { - "id": "endpoint_.getRoot", - "name": { - "originalName": "getRoot", - "camelCase": { - "unsafeName": "getRoot", - "safeName": "getRoot" - }, - "snakeCase": { - "unsafeName": "get_root", - "safeName": "get_root" - }, - "screamingSnakeCase": { - "unsafeName": "GET_ROOT", - "safeName": "GET_ROOT" - }, - "pascalCase": { - "unsafeName": "GetRoot", - "safeName": "GetRoot" - } - }, - "displayName": null, - "auth": false, - "idempotent": false, - "baseUrl": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/root", - "parts": [] - }, - "fullPath": { - "head": "/root/root", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "inlinedRequestBody", - "name": { - "originalName": "PostRootRequest", - "camelCase": { - "unsafeName": "postRootRequest", - "safeName": "postRootRequest" - }, - "snakeCase": { - "unsafeName": "post_root_request", - "safeName": "post_root_request" - }, - "screamingSnakeCase": { - "unsafeName": "POST_ROOT_REQUEST", - "safeName": "POST_ROOT_REQUEST" - }, - "pascalCase": { - "unsafeName": "PostRootRequest", - "safeName": "PostRootRequest" - } - }, - "extends": [], - "contentType": "application/json", - "properties": [ - { - "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": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RequestTypeInlineType1", - "default": null, - "inline": null - }, - "availability": null, - "docs": 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 - } - ], - "extra-properties": false, - "extendedProperties": [], - "docs": null - }, - "sdkRequest": { - "shape": { - "type": "wrapper", - "wrapperName": { - "originalName": "PostRootRequest", - "camelCase": { - "unsafeName": "postRootRequest", - "safeName": "postRootRequest" - }, - "snakeCase": { - "unsafeName": "post_root_request", - "safeName": "post_root_request" - }, - "screamingSnakeCase": { - "unsafeName": "POST_ROOT_REQUEST", - "safeName": "POST_ROOT_REQUEST" - }, - "pascalCase": { - "unsafeName": "PostRootRequest", - "safeName": "PostRootRequest" - } - }, - "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": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1", - "default": null, - "inline": null - }, - "docs": null - } - }, - "status-code": null - }, - "errors": [], - "userSpecifiedExamples": [], - "autogeneratedExamples": [ - { - "example": { - "id": "cc979ed415b4638d8e170df64556fbd1154268c5", - "url": "/root/root", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "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" - }, - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RequestTypeInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RequestTypeInlineType1" - } - }, - "jsonExample": { - "foo": "foo" - } - } - }, - { - "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" - }, - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ], - "jsonExample": { - "bar": { - "foo": "foo" - }, - "foo": "foo" - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "bar" - } - } - }, - "jsonExample": "bar" - } - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "enum", - "value": { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - } - }, - "typeName": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum" - } - }, - "jsonExample": "SUNNY" - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - } - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "availability": null, - "docs": null - }, - { - "id": "endpoint_.getDiscriminatedUnion", - "name": { - "originalName": "getDiscriminatedUnion", - "camelCase": { - "unsafeName": "getDiscriminatedUnion", - "safeName": "getDiscriminatedUnion" - }, - "snakeCase": { - "unsafeName": "get_discriminated_union", - "safeName": "get_discriminated_union" - }, - "screamingSnakeCase": { - "unsafeName": "GET_DISCRIMINATED_UNION", - "safeName": "GET_DISCRIMINATED_UNION" - }, - "pascalCase": { - "unsafeName": "GetDiscriminatedUnion", - "safeName": "GetDiscriminatedUnion" - } - }, - "displayName": null, - "auth": false, - "idempotent": false, - "baseUrl": null, - "method": "GET", - "basePath": null, - "path": { - "head": "/discriminated-union", - "parts": [] - }, - "fullPath": { - "head": "/root/discriminated-union", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": null, - "sdkRequest": null, - "response": { - "body": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": { - "originalName": "DiscriminatedUnion1", - "camelCase": { - "unsafeName": "discriminatedUnion1", - "safeName": "discriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1", - "safeName": "discriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1", - "safeName": "DISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1", - "safeName": "DiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1", - "default": null, - "inline": null - }, - "docs": null - } - }, - "status-code": null - }, - "errors": [], - "userSpecifiedExamples": [], - "autogeneratedExamples": [ - { - "example": { - "id": "66b0f09d479437029bc19bcd824ec0242f8f71e8", - "url": "/root/discriminated-union", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "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": "type1", - "camelCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "snakeCase": { - "unsafeName": "type_1", - "safeName": "type_1" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_1", - "safeName": "TYPE_1" - }, - "pascalCase": { - "unsafeName": "Type1", - "safeName": "Type1" - } - }, - "wireValue": "type1" - }, - "shape": { - "type": "samePropertiesAsObject", - "typeId": "type_:DiscriminatedUnion1InlineType1", - "object": { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "DiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType1", - "safeName": "discriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_1", - "safeName": "discriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType1", - "safeName": "DiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ] - } - } - } - }, - "typeName": { - "name": { - "originalName": "DiscriminatedUnion1", - "camelCase": { - "unsafeName": "discriminatedUnion1", - "safeName": "discriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1", - "safeName": "discriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1", - "safeName": "DISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1", - "safeName": "DiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1" - } - }, - "jsonExample": { - "type": "type1", - "foo": "foo" - } - } - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "availability": null, - "docs": null - }, - { - "id": "endpoint_.getUndiscriminatedUnion", - "name": { - "originalName": "getUndiscriminatedUnion", - "camelCase": { - "unsafeName": "getUndiscriminatedUnion", - "safeName": "getUndiscriminatedUnion" - }, - "snakeCase": { - "unsafeName": "get_undiscriminated_union", - "safeName": "get_undiscriminated_union" - }, - "screamingSnakeCase": { - "unsafeName": "GET_UNDISCRIMINATED_UNION", - "safeName": "GET_UNDISCRIMINATED_UNION" - }, - "pascalCase": { - "unsafeName": "GetUndiscriminatedUnion", - "safeName": "GetUndiscriminatedUnion" - } - }, - "displayName": null, - "auth": false, - "idempotent": false, - "baseUrl": null, - "method": "GET", - "basePath": null, - "path": { - "head": "/undiscriminated-union", - "parts": [] - }, - "fullPath": { - "head": "/root/undiscriminated-union", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": null, - "sdkRequest": null, - "response": { - "body": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": { - "originalName": "UndiscriminatedUnion1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1", - "safeName": "undiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1", - "safeName": "undiscriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1", - "safeName": "UNDISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1", - "safeName": "UndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1", - "default": null, - "inline": null - }, - "docs": null - } - }, - "status-code": null - }, - "errors": [], - "userSpecifiedExamples": [], - "autogeneratedExamples": [ - { - "example": { - "id": "4e32aff3299d7769cc9e184747382c076b82c724", - "url": "/root/undiscriminated-union", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": null, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "undiscriminatedUnion", - "index": 0, - "singleUnionType": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ] - }, - "typeName": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType1" - } - }, - "jsonExample": { - "foo": "foo" - } - } - }, - "typeName": { - "name": { - "originalName": "UndiscriminatedUnion1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1", - "safeName": "undiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1", - "safeName": "undiscriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1", - "safeName": "UNDISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1", - "safeName": "UndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1" - } - }, - "jsonExample": { - "foo": "foo" - } - } - } - }, - "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_": [ - "type_:RequestTypeInlineType1", - "type_:RootType1", - "type_:RootType1InlineType1", - "type_:RootType1InlineType1NestedInlineType1", - "type_:DiscriminatedUnion1", - "type_:DiscriminatedUnion1InlineType1", - "type_:DiscriminatedUnion1InlineType2", - "type_:UndiscriminatedUnion1", - "type_:UndiscriminatedUnion1InlineType1", - "type_:UndiscriminatedUnion1InlineType2", - "type_:InlineEnum" - ] - }, - "sharedTypes": [] - }, - "webhookGroups": {}, - "websocketChannels": {}, - "readmeConfig": null, - "sourceConfig": null, - "publishConfig": null, - "dynamic": { - "version": "1.0.0", - "types": { - "type_:RequestTypeInlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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_:RootType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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" - } - }, - { - "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_:RootType1InlineType1" - } - } - ] - }, - "type_:RootType1InlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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" - } - }, - { - "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_:RootType1InlineType1NestedInlineType1" - } - } - ] - }, - "type_:RootType1InlineType1NestedInlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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" - } - }, - { - "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": "primitive", - "value": "STRING" - } - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "typeReference": { - "_type": "named", - "value": "type_:InlineEnum" - } - } - ] - }, - "type_:DiscriminatedUnion1": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "DiscriminatedUnion1", - "camelCase": { - "unsafeName": "discriminatedUnion1", - "safeName": "discriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1", - "safeName": "discriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1", - "safeName": "DISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1", - "safeName": "DiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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": { - "type1": { - "type": "samePropertiesAsObject", - "typeId": "type_:DiscriminatedUnion1InlineType1", - "discriminantValue": { - "name": { - "originalName": "type1", - "camelCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "snakeCase": { - "unsafeName": "type_1", - "safeName": "type_1" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_1", - "safeName": "TYPE_1" - }, - "pascalCase": { - "unsafeName": "Type1", - "safeName": "Type1" - } - }, - "wireValue": "type1" - }, - "properties": [] - }, - "type2": { - "type": "samePropertiesAsObject", - "typeId": "type_:DiscriminatedUnion1InlineType2", - "discriminantValue": { - "name": { - "originalName": "type2", - "camelCase": { - "unsafeName": "type2", - "safeName": "type2" - }, - "snakeCase": { - "unsafeName": "type_2", - "safeName": "type_2" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_2", - "safeName": "TYPE_2" - }, - "pascalCase": { - "unsafeName": "Type2", - "safeName": "Type2" - } - }, - "wireValue": "type2" - }, - "properties": [] - } - } - }, - "type_:DiscriminatedUnion1InlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "DiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType1", - "safeName": "discriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_1", - "safeName": "discriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType1", - "safeName": "DiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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_:DiscriminatedUnion1InlineType2": { - "type": "object", - "declaration": { - "name": { - "originalName": "DiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType2", - "safeName": "discriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_2", - "safeName": "discriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType2", - "safeName": "DiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "typeReference": { - "_type": "primitive", - "value": "STRING" - } - } - ] - }, - "type_:UndiscriminatedUnion1": { - "type": "undiscriminatedUnion", - "declaration": { - "name": { - "originalName": "UndiscriminatedUnion1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1", - "safeName": "undiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1", - "safeName": "undiscriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1", - "safeName": "UNDISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1", - "safeName": "UndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "types": [ - { - "_type": "named", - "value": "type_:UndiscriminatedUnion1InlineType1" - }, - { - "_type": "named", - "value": "type_:UndiscriminatedUnion1InlineType2" - } - ] - }, - "type_:UndiscriminatedUnion1InlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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_:UndiscriminatedUnion1InlineType2": { - "type": "object", - "declaration": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType2", - "safeName": "undiscriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_2", - "safeName": "undiscriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType2", - "safeName": "UndiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "typeReference": { - "_type": "primitive", - "value": "STRING" - } - } - ] - }, - "type_:InlineEnum": { - "type": "enum", - "declaration": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "values": [ - { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - }, - { - "name": { - "originalName": "CLOUDY", - "camelCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "snakeCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "screamingSnakeCase": { - "unsafeName": "CLOUDY", - "safeName": "CLOUDY" - }, - "pascalCase": { - "unsafeName": "Cloudy", - "safeName": "Cloudy" - } - }, - "wireValue": "CLOUDY" - }, - { - "name": { - "originalName": "RAINING", - "camelCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "snakeCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "screamingSnakeCase": { - "unsafeName": "RAINING", - "safeName": "RAINING" - }, - "pascalCase": { - "unsafeName": "Raining", - "safeName": "Raining" - } - }, - "wireValue": "RAINING" - }, - { - "name": { - "originalName": "SNOWING", - "camelCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "snakeCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "screamingSnakeCase": { - "unsafeName": "SNOWING", - "safeName": "SNOWING" - }, - "pascalCase": { - "unsafeName": "Snowing", - "safeName": "Snowing" - } - }, - "wireValue": "SNOWING" - } - ] - } - }, - "headers": [], - "endpoints": { - "endpoint_.getRoot": { - "auth": null, - "declaration": { - "name": { - "originalName": "getRoot", - "camelCase": { - "unsafeName": "getRoot", - "safeName": "getRoot" - }, - "snakeCase": { - "unsafeName": "get_root", - "safeName": "get_root" - }, - "screamingSnakeCase": { - "unsafeName": "GET_ROOT", - "safeName": "GET_ROOT" - }, - "pascalCase": { - "unsafeName": "GetRoot", - "safeName": "GetRoot" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/root/root" - }, - "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "PostRootRequest", - "camelCase": { - "unsafeName": "postRootRequest", - "safeName": "postRootRequest" - }, - "snakeCase": { - "unsafeName": "post_root_request", - "safeName": "post_root_request" - }, - "screamingSnakeCase": { - "unsafeName": "POST_ROOT_REQUEST", - "safeName": "POST_ROOT_REQUEST" - }, - "pascalCase": { - "unsafeName": "PostRootRequest", - "safeName": "PostRootRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "pathParameters": [], - "queryParameters": [], - "headers": [], - "body": { - "type": "properties", - "value": [ - { - "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_:RequestTypeInlineType1" - } - }, - { - "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" - } - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false - } - }, - "response": { - "type": "json" - } - }, - "endpoint_.getDiscriminatedUnion": { - "auth": null, - "declaration": { - "name": { - "originalName": "getDiscriminatedUnion", - "camelCase": { - "unsafeName": "getDiscriminatedUnion", - "safeName": "getDiscriminatedUnion" - }, - "snakeCase": { - "unsafeName": "get_discriminated_union", - "safeName": "get_discriminated_union" - }, - "screamingSnakeCase": { - "unsafeName": "GET_DISCRIMINATED_UNION", - "safeName": "GET_DISCRIMINATED_UNION" - }, - "pascalCase": { - "unsafeName": "GetDiscriminatedUnion", - "safeName": "GetDiscriminatedUnion" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "GET", - "path": "/root/discriminated-union" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": null - }, - "response": { - "type": "json" - } - }, - "endpoint_.getUndiscriminatedUnion": { - "auth": null, - "declaration": { - "name": { - "originalName": "getUndiscriminatedUnion", - "camelCase": { - "unsafeName": "getUndiscriminatedUnion", - "safeName": "getUndiscriminatedUnion" - }, - "snakeCase": { - "unsafeName": "get_undiscriminated_union", - "safeName": "get_undiscriminated_union" - }, - "screamingSnakeCase": { - "unsafeName": "GET_UNDISCRIMINATED_UNION", - "safeName": "GET_UNDISCRIMINATED_UNION" - }, - "pascalCase": { - "unsafeName": "GetUndiscriminatedUnion", - "safeName": "GetUndiscriminatedUnion" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "GET", - "path": "/root/undiscriminated-union" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": null - }, - "response": { - "type": "json" - } - } - } - }, - "subpackages": {}, - "rootPackage": { - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "websocket": null, - "service": "service_", - "types": [ - "type_:RequestTypeInlineType1", - "type_:RootType1", - "type_:RootType1InlineType1", - "type_:RootType1InlineType1NestedInlineType1", - "type_:DiscriminatedUnion1", - "type_:DiscriminatedUnion1InlineType1", - "type_:DiscriminatedUnion1InlineType2", - "type_:UndiscriminatedUnion1", - "type_:UndiscriminatedUnion1InlineType1", - "type_:UndiscriminatedUnion1InlineType2", - "type_:InlineEnum" - ], - "errors": [], - "subpackages": [], - "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/ts-sdk/inline-types/inline/package.json b/seed/ts-sdk/inline-types/inline/package.json deleted file mode 100644 index c62c4aac8d7..00000000000 --- a/seed/ts-sdk/inline-types/inline/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "@fern/inline-types", - "version": "0.0.1", - "private": false, - "repository": "https://github.com/inline-types/fern", - "main": "./index.js", - "types": "./index.d.ts", - "scripts": { - "format": "prettier . --write --ignore-unknown", - "build": "tsc", - "prepack": "cp -rv dist/. .", - "test": "jest" - }, - "dependencies": { - "url-join": "4.0.1", - "form-data": "^4.0.0", - "formdata-node": "^6.0.3", - "node-fetch": "2.7.0", - "qs": "6.11.2", - "readable-stream": "^4.5.2" - }, - "devDependencies": { - "@types/url-join": "4.0.1", - "@types/qs": "6.9.8", - "@types/node-fetch": "2.6.9", - "@types/readable-stream": "^4.0.15", - "webpack": "^5.94.0", - "ts-loader": "^9.3.1", - "jest": "29.7.0", - "@types/jest": "29.5.5", - "ts-jest": "29.1.1", - "jest-environment-jsdom": "29.7.0", - "@types/node": "17.0.33", - "prettier": "2.7.1", - "typescript": "4.6.4" - }, - "browser": { - "fs": false, - "os": false, - "path": false - } -} diff --git a/seed/ts-sdk/inline-types/inline/src/api/client/index.ts b/seed/ts-sdk/inline-types/inline/src/api/client/index.ts deleted file mode 100644 index 415726b7fea..00000000000 --- a/seed/ts-sdk/inline-types/inline/src/api/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests"; diff --git a/seed/ts-sdk/inline-types/no-inline/.github/workflows/ci.yml b/seed/ts-sdk/inline-types/no-inline/.github/workflows/ci.yml deleted file mode 100644 index b64a6cbbb4a..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/.github/workflows/ci.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: ci - -on: [push] - -jobs: - compile: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up node - uses: actions/setup-node@v3 - - - name: Compile - run: yarn && yarn build - - test: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - - name: Set up node - uses: actions/setup-node@v3 - - - name: Compile - run: yarn && yarn test - - publish: - needs: [ compile, test ] - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Set up node - uses: actions/setup-node@v3 - - name: Install dependencies - run: yarn install - - name: Build - run: yarn build - - - name: Publish to npm - run: | - npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} - if [[ ${GITHUB_REF} == *alpha* ]]; then - npm publish --access public --tag alpha - elif [[ ${GITHUB_REF} == *beta* ]]; then - npm publish --access public --tag beta - else - npm publish --access public - fi - env: - NPM_TOKEN: ${{ secrets. }} \ No newline at end of file diff --git a/seed/ts-sdk/inline-types/no-inline/.gitignore b/seed/ts-sdk/inline-types/no-inline/.gitignore deleted file mode 100644 index 72271e049c0..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -.DS_Store -/dist \ No newline at end of file diff --git a/seed/ts-sdk/inline-types/no-inline/.mock/definition/api.yml b/seed/ts-sdk/inline-types/no-inline/.mock/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/.mock/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/seed/ts-sdk/inline-types/no-inline/.mock/fern.config.json b/seed/ts-sdk/inline-types/no-inline/.mock/fern.config.json deleted file mode 100644 index 4c8e54ac313..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/.mock/fern.config.json +++ /dev/null @@ -1 +0,0 @@ -{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/ts-sdk/inline-types/no-inline/.mock/generators.yml b/seed/ts-sdk/inline-types/no-inline/.mock/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/.mock/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/ts-sdk/inline-types/no-inline/.mock/ir.json b/seed/ts-sdk/inline-types/no-inline/.mock/ir.json deleted file mode 100644 index 00d22b232be..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/.mock/ir.json +++ /dev/null @@ -1,4159 +0,0 @@ -{ - "fdrApiDefinitionId": null, - "apiVersion": null, - "apiName": { - "originalName": "object", - "camelCase": { - "unsafeName": "object", - "safeName": "object" - }, - "snakeCase": { - "unsafeName": "object", - "safeName": "object" - }, - "screamingSnakeCase": { - "unsafeName": "OBJECT", - "safeName": "OBJECT" - }, - "pascalCase": { - "unsafeName": "Object", - "safeName": "Object" - } - }, - "apiDisplayName": null, - "apiDocs": null, - "auth": { - "requirement": "ALL", - "schemes": [], - "docs": null - }, - "headers": [], - "idempotencyHeaders": [], - "types": { - "type_:RequestTypeInlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RequestTypeInlineType1" - }, - "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_:RootType1": { - "inline": null, - "name": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - }, - "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 - }, - { - "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": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1", - "default": null, - "inline": null - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:RootType1InlineType1", - "type_:RootType1InlineType1NestedInlineType1", - "type_:InlineEnum" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:RootType1InlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1" - }, - "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 - }, - { - "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": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1", - "default": null, - "inline": null - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:RootType1InlineType1NestedInlineType1", - "type_:InlineEnum" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:RootType1InlineType1NestedInlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - }, - "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 - }, - { - "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": "primitive", - "primitive": { - "v1": "STRING", - "v2": { - "type": "string", - "default": null, - "validation": null - } - } - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "valueType": { - "_type": "named", - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum", - "default": null, - "inline": null - }, - "availability": null, - "docs": null - } - ], - "extra-properties": false, - "extendedProperties": [] - }, - "referencedTypes": [ - "type_:InlineEnum" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:DiscriminatedUnion1": { - "inline": true, - "name": { - "name": { - "originalName": "DiscriminatedUnion1", - "camelCase": { - "unsafeName": "discriminatedUnion1", - "safeName": "discriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1", - "safeName": "discriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1", - "safeName": "DISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1", - "safeName": "DiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1" - }, - "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": "type1", - "camelCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "snakeCase": { - "unsafeName": "type_1", - "safeName": "type_1" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_1", - "safeName": "TYPE_1" - }, - "pascalCase": { - "unsafeName": "Type1", - "safeName": "Type1" - } - }, - "wireValue": "type1" - }, - "shape": { - "_type": "samePropertiesAsObject", - "name": { - "originalName": "DiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType1", - "safeName": "discriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_1", - "safeName": "discriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType1", - "safeName": "DiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType1" - }, - "displayName": null, - "availability": null, - "docs": null - }, - { - "discriminantValue": { - "name": { - "originalName": "type2", - "camelCase": { - "unsafeName": "type2", - "safeName": "type2" - }, - "snakeCase": { - "unsafeName": "type_2", - "safeName": "type_2" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_2", - "safeName": "TYPE_2" - }, - "pascalCase": { - "unsafeName": "Type2", - "safeName": "Type2" - } - }, - "wireValue": "type2" - }, - "shape": { - "_type": "samePropertiesAsObject", - "name": { - "originalName": "DiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType2", - "safeName": "discriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_2", - "safeName": "discriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType2", - "safeName": "DiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType2" - }, - "displayName": null, - "availability": null, - "docs": null - } - ] - }, - "referencedTypes": [ - "type_:DiscriminatedUnion1InlineType1", - "type_:DiscriminatedUnion1InlineType2" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:DiscriminatedUnion1InlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "DiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType1", - "safeName": "discriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_1", - "safeName": "discriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType1", - "safeName": "DiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType1" - }, - "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_:DiscriminatedUnion1InlineType2": { - "inline": true, - "name": { - "name": { - "originalName": "DiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType2", - "safeName": "discriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_2", - "safeName": "discriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType2", - "safeName": "DiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType2" - }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "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_:UndiscriminatedUnion1": { - "inline": true, - "name": { - "name": { - "originalName": "UndiscriminatedUnion1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1", - "safeName": "undiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1", - "safeName": "undiscriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1", - "safeName": "UNDISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1", - "safeName": "UndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1" - }, - "shape": { - "_type": "undiscriminatedUnion", - "members": [ - { - "type": { - "_type": "named", - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType1", - "default": null, - "inline": null - }, - "docs": null - }, - { - "type": { - "_type": "named", - "name": { - "originalName": "UndiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType2", - "safeName": "undiscriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_2", - "safeName": "undiscriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType2", - "safeName": "UndiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType2", - "default": null, - "inline": null - }, - "docs": null - } - ] - }, - "referencedTypes": [ - "type_:UndiscriminatedUnion1InlineType1", - "type_:UndiscriminatedUnion1InlineType2" - ], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - }, - "type_:UndiscriminatedUnion1InlineType1": { - "inline": true, - "name": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType1" - }, - "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_:UndiscriminatedUnion1InlineType2": { - "inline": true, - "name": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType2", - "safeName": "undiscriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_2", - "safeName": "undiscriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType2", - "safeName": "UndiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType2" - }, - "shape": { - "_type": "object", - "extends": [], - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "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_:InlineEnum": { - "inline": true, - "name": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum" - }, - "shape": { - "_type": "enum", - "default": null, - "values": [ - { - "name": { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "CLOUDY", - "camelCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "snakeCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "screamingSnakeCase": { - "unsafeName": "CLOUDY", - "safeName": "CLOUDY" - }, - "pascalCase": { - "unsafeName": "Cloudy", - "safeName": "Cloudy" - } - }, - "wireValue": "CLOUDY" - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "RAINING", - "camelCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "snakeCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "screamingSnakeCase": { - "unsafeName": "RAINING", - "safeName": "RAINING" - }, - "pascalCase": { - "unsafeName": "Raining", - "safeName": "Raining" - } - }, - "wireValue": "RAINING" - }, - "availability": null, - "docs": null - }, - { - "name": { - "name": { - "originalName": "SNOWING", - "camelCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "snakeCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "screamingSnakeCase": { - "unsafeName": "SNOWING", - "safeName": "SNOWING" - }, - "pascalCase": { - "unsafeName": "Snowing", - "safeName": "Snowing" - } - }, - "wireValue": "SNOWING" - }, - "availability": null, - "docs": null - } - ] - }, - "referencedTypes": [], - "encoding": { - "json": {}, - "proto": null - }, - "source": null, - "userProvidedExamples": [], - "autogeneratedExamples": [], - "availability": null, - "docs": null - } - }, - "errors": {}, - "services": { - "service_": { - "availability": null, - "name": { - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "displayName": null, - "basePath": { - "head": "/root", - "parts": [] - }, - "headers": [], - "pathParameters": [], - "encoding": { - "json": {}, - "proto": null - }, - "transport": { - "type": "http" - }, - "endpoints": [ - { - "id": "endpoint_.getRoot", - "name": { - "originalName": "getRoot", - "camelCase": { - "unsafeName": "getRoot", - "safeName": "getRoot" - }, - "snakeCase": { - "unsafeName": "get_root", - "safeName": "get_root" - }, - "screamingSnakeCase": { - "unsafeName": "GET_ROOT", - "safeName": "GET_ROOT" - }, - "pascalCase": { - "unsafeName": "GetRoot", - "safeName": "GetRoot" - } - }, - "displayName": null, - "auth": false, - "idempotent": false, - "baseUrl": null, - "method": "POST", - "basePath": null, - "path": { - "head": "/root", - "parts": [] - }, - "fullPath": { - "head": "/root/root", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": { - "type": "inlinedRequestBody", - "name": { - "originalName": "PostRootRequest", - "camelCase": { - "unsafeName": "postRootRequest", - "safeName": "postRootRequest" - }, - "snakeCase": { - "unsafeName": "post_root_request", - "safeName": "post_root_request" - }, - "screamingSnakeCase": { - "unsafeName": "POST_ROOT_REQUEST", - "safeName": "POST_ROOT_REQUEST" - }, - "pascalCase": { - "unsafeName": "PostRootRequest", - "safeName": "PostRootRequest" - } - }, - "extends": [], - "contentType": "application/json", - "properties": [ - { - "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": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RequestTypeInlineType1", - "default": null, - "inline": null - }, - "availability": null, - "docs": 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 - } - ], - "extra-properties": false, - "extendedProperties": [], - "docs": null - }, - "sdkRequest": { - "shape": { - "type": "wrapper", - "wrapperName": { - "originalName": "PostRootRequest", - "camelCase": { - "unsafeName": "postRootRequest", - "safeName": "postRootRequest" - }, - "snakeCase": { - "unsafeName": "post_root_request", - "safeName": "post_root_request" - }, - "screamingSnakeCase": { - "unsafeName": "POST_ROOT_REQUEST", - "safeName": "POST_ROOT_REQUEST" - }, - "pascalCase": { - "unsafeName": "PostRootRequest", - "safeName": "PostRootRequest" - } - }, - "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": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1", - "default": null, - "inline": null - }, - "docs": null - } - }, - "status-code": null - }, - "errors": [], - "userSpecifiedExamples": [], - "autogeneratedExamples": [ - { - "example": { - "id": "cc979ed415b4638d8e170df64556fbd1154268c5", - "url": "/root/root", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": { - "type": "inlinedRequestBody", - "properties": [ - { - "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" - }, - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RequestTypeInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RequestTypeInlineType1" - } - }, - "jsonExample": { - "foo": "foo" - } - } - }, - { - "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" - }, - "originalTypeDeclaration": null, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ], - "jsonExample": { - "bar": { - "foo": "foo" - }, - "foo": "foo" - } - }, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - }, - { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "bar" - } - } - }, - "jsonExample": "bar" - } - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - }, - "value": { - "shape": { - "type": "named", - "shape": { - "type": "enum", - "value": { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - } - }, - "typeName": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:InlineEnum" - } - }, - "jsonExample": "SUNNY" - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1NestedInlineType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1InlineType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - } - ] - }, - "typeName": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:RootType1" - } - }, - "jsonExample": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": { - "foo": "foo", - "bar": "bar", - "myEnum": "SUNNY" - } - } - } - } - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "availability": null, - "docs": null - }, - { - "id": "endpoint_.getDiscriminatedUnion", - "name": { - "originalName": "getDiscriminatedUnion", - "camelCase": { - "unsafeName": "getDiscriminatedUnion", - "safeName": "getDiscriminatedUnion" - }, - "snakeCase": { - "unsafeName": "get_discriminated_union", - "safeName": "get_discriminated_union" - }, - "screamingSnakeCase": { - "unsafeName": "GET_DISCRIMINATED_UNION", - "safeName": "GET_DISCRIMINATED_UNION" - }, - "pascalCase": { - "unsafeName": "GetDiscriminatedUnion", - "safeName": "GetDiscriminatedUnion" - } - }, - "displayName": null, - "auth": false, - "idempotent": false, - "baseUrl": null, - "method": "GET", - "basePath": null, - "path": { - "head": "/discriminated-union", - "parts": [] - }, - "fullPath": { - "head": "/root/discriminated-union", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": null, - "sdkRequest": null, - "response": { - "body": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": { - "originalName": "DiscriminatedUnion1", - "camelCase": { - "unsafeName": "discriminatedUnion1", - "safeName": "discriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1", - "safeName": "discriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1", - "safeName": "DISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1", - "safeName": "DiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1", - "default": null, - "inline": null - }, - "docs": null - } - }, - "status-code": null - }, - "errors": [], - "userSpecifiedExamples": [], - "autogeneratedExamples": [ - { - "example": { - "id": "66b0f09d479437029bc19bcd824ec0242f8f71e8", - "url": "/root/discriminated-union", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "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": "type1", - "camelCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "snakeCase": { - "unsafeName": "type_1", - "safeName": "type_1" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_1", - "safeName": "TYPE_1" - }, - "pascalCase": { - "unsafeName": "Type1", - "safeName": "Type1" - } - }, - "wireValue": "type1" - }, - "shape": { - "type": "samePropertiesAsObject", - "typeId": "type_:DiscriminatedUnion1InlineType1", - "object": { - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "DiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType1", - "safeName": "discriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_1", - "safeName": "discriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType1", - "safeName": "DiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1InlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ] - } - } - } - }, - "typeName": { - "name": { - "originalName": "DiscriminatedUnion1", - "camelCase": { - "unsafeName": "discriminatedUnion1", - "safeName": "discriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1", - "safeName": "discriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1", - "safeName": "DISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1", - "safeName": "DiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:DiscriminatedUnion1" - } - }, - "jsonExample": { - "type": "type1", - "foo": "foo" - } - } - } - }, - "docs": null - } - } - ], - "pagination": null, - "transport": null, - "availability": null, - "docs": null - }, - { - "id": "endpoint_.getUndiscriminatedUnion", - "name": { - "originalName": "getUndiscriminatedUnion", - "camelCase": { - "unsafeName": "getUndiscriminatedUnion", - "safeName": "getUndiscriminatedUnion" - }, - "snakeCase": { - "unsafeName": "get_undiscriminated_union", - "safeName": "get_undiscriminated_union" - }, - "screamingSnakeCase": { - "unsafeName": "GET_UNDISCRIMINATED_UNION", - "safeName": "GET_UNDISCRIMINATED_UNION" - }, - "pascalCase": { - "unsafeName": "GetUndiscriminatedUnion", - "safeName": "GetUndiscriminatedUnion" - } - }, - "displayName": null, - "auth": false, - "idempotent": false, - "baseUrl": null, - "method": "GET", - "basePath": null, - "path": { - "head": "/undiscriminated-union", - "parts": [] - }, - "fullPath": { - "head": "/root/undiscriminated-union", - "parts": [] - }, - "pathParameters": [], - "allPathParameters": [], - "queryParameters": [], - "headers": [], - "requestBody": null, - "sdkRequest": null, - "response": { - "body": { - "type": "json", - "value": { - "type": "response", - "responseBodyType": { - "_type": "named", - "name": { - "originalName": "UndiscriminatedUnion1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1", - "safeName": "undiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1", - "safeName": "undiscriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1", - "safeName": "UNDISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1", - "safeName": "UndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1", - "default": null, - "inline": null - }, - "docs": null - } - }, - "status-code": null - }, - "errors": [], - "userSpecifiedExamples": [], - "autogeneratedExamples": [ - { - "example": { - "id": "4e32aff3299d7769cc9e184747382c076b82c724", - "url": "/root/undiscriminated-union", - "name": null, - "endpointHeaders": [], - "endpointPathParameters": [], - "queryParameters": [], - "servicePathParameters": [], - "serviceHeaders": [], - "rootPathParameters": [], - "request": null, - "response": { - "type": "ok", - "value": { - "type": "body", - "value": { - "shape": { - "type": "named", - "shape": { - "type": "undiscriminatedUnion", - "index": 0, - "singleUnionType": { - "shape": { - "type": "named", - "shape": { - "type": "object", - "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" - }, - "originalTypeDeclaration": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType1" - }, - "value": { - "shape": { - "type": "primitive", - "primitive": { - "type": "string", - "string": { - "original": "foo" - } - } - }, - "jsonExample": "foo" - } - } - ] - }, - "typeName": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1InlineType1" - } - }, - "jsonExample": { - "foo": "foo" - } - } - }, - "typeName": { - "name": { - "originalName": "UndiscriminatedUnion1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1", - "safeName": "undiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1", - "safeName": "undiscriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1", - "safeName": "UNDISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1", - "safeName": "UndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "typeId": "type_:UndiscriminatedUnion1" - } - }, - "jsonExample": { - "foo": "foo" - } - } - } - }, - "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_": [ - "type_:RequestTypeInlineType1", - "type_:RootType1", - "type_:RootType1InlineType1", - "type_:RootType1InlineType1NestedInlineType1", - "type_:DiscriminatedUnion1", - "type_:DiscriminatedUnion1InlineType1", - "type_:DiscriminatedUnion1InlineType2", - "type_:UndiscriminatedUnion1", - "type_:UndiscriminatedUnion1InlineType1", - "type_:UndiscriminatedUnion1InlineType2", - "type_:InlineEnum" - ] - }, - "sharedTypes": [] - }, - "webhookGroups": {}, - "websocketChannels": {}, - "readmeConfig": null, - "sourceConfig": null, - "publishConfig": null, - "dynamic": { - "version": "1.0.0", - "types": { - "type_:RequestTypeInlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RequestTypeInlineType1", - "camelCase": { - "unsafeName": "requestTypeInlineType1", - "safeName": "requestTypeInlineType1" - }, - "snakeCase": { - "unsafeName": "request_type_inline_type_1", - "safeName": "request_type_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "REQUEST_TYPE_INLINE_TYPE_1", - "safeName": "REQUEST_TYPE_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RequestTypeInlineType1", - "safeName": "RequestTypeInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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_:RootType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RootType1", - "camelCase": { - "unsafeName": "rootType1", - "safeName": "rootType1" - }, - "snakeCase": { - "unsafeName": "root_type_1", - "safeName": "root_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1", - "safeName": "ROOT_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1", - "safeName": "RootType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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" - } - }, - { - "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_:RootType1InlineType1" - } - } - ] - }, - "type_:RootType1InlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RootType1InlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1", - "safeName": "rootType1InlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1", - "safeName": "root_type_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1", - "safeName": "RootType1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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" - } - }, - { - "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_:RootType1InlineType1NestedInlineType1" - } - } - ] - }, - "type_:RootType1InlineType1NestedInlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "RootType1InlineType1NestedInlineType1", - "camelCase": { - "unsafeName": "rootType1InlineType1NestedInlineType1", - "safeName": "rootType1InlineType1NestedInlineType1" - }, - "snakeCase": { - "unsafeName": "root_type_1_inline_type_1_nested_inline_type_1", - "safeName": "root_type_1_inline_type_1_nested_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1", - "safeName": "ROOT_TYPE_1_INLINE_TYPE_1_NESTED_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "RootType1InlineType1NestedInlineType1", - "safeName": "RootType1InlineType1NestedInlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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" - } - }, - { - "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": "primitive", - "value": "STRING" - } - }, - { - "name": { - "name": { - "originalName": "myEnum", - "camelCase": { - "unsafeName": "myEnum", - "safeName": "myEnum" - }, - "snakeCase": { - "unsafeName": "my_enum", - "safeName": "my_enum" - }, - "screamingSnakeCase": { - "unsafeName": "MY_ENUM", - "safeName": "MY_ENUM" - }, - "pascalCase": { - "unsafeName": "MyEnum", - "safeName": "MyEnum" - } - }, - "wireValue": "myEnum" - }, - "typeReference": { - "_type": "named", - "value": "type_:InlineEnum" - } - } - ] - }, - "type_:DiscriminatedUnion1": { - "type": "discriminatedUnion", - "declaration": { - "name": { - "originalName": "DiscriminatedUnion1", - "camelCase": { - "unsafeName": "discriminatedUnion1", - "safeName": "discriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1", - "safeName": "discriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1", - "safeName": "DISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1", - "safeName": "DiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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": { - "type1": { - "type": "samePropertiesAsObject", - "typeId": "type_:DiscriminatedUnion1InlineType1", - "discriminantValue": { - "name": { - "originalName": "type1", - "camelCase": { - "unsafeName": "type1", - "safeName": "type1" - }, - "snakeCase": { - "unsafeName": "type_1", - "safeName": "type_1" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_1", - "safeName": "TYPE_1" - }, - "pascalCase": { - "unsafeName": "Type1", - "safeName": "Type1" - } - }, - "wireValue": "type1" - }, - "properties": [] - }, - "type2": { - "type": "samePropertiesAsObject", - "typeId": "type_:DiscriminatedUnion1InlineType2", - "discriminantValue": { - "name": { - "originalName": "type2", - "camelCase": { - "unsafeName": "type2", - "safeName": "type2" - }, - "snakeCase": { - "unsafeName": "type_2", - "safeName": "type_2" - }, - "screamingSnakeCase": { - "unsafeName": "TYPE_2", - "safeName": "TYPE_2" - }, - "pascalCase": { - "unsafeName": "Type2", - "safeName": "Type2" - } - }, - "wireValue": "type2" - }, - "properties": [] - } - } - }, - "type_:DiscriminatedUnion1InlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "DiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType1", - "safeName": "discriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_1", - "safeName": "discriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType1", - "safeName": "DiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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_:DiscriminatedUnion1InlineType2": { - "type": "object", - "declaration": { - "name": { - "originalName": "DiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "discriminatedUnion1InlineType2", - "safeName": "discriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "discriminated_union_1_inline_type_2", - "safeName": "discriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "DISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "DiscriminatedUnion1InlineType2", - "safeName": "DiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "typeReference": { - "_type": "primitive", - "value": "STRING" - } - } - ] - }, - "type_:UndiscriminatedUnion1": { - "type": "undiscriminatedUnion", - "declaration": { - "name": { - "originalName": "UndiscriminatedUnion1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1", - "safeName": "undiscriminatedUnion1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1", - "safeName": "undiscriminated_union_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1", - "safeName": "UNDISCRIMINATED_UNION_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1", - "safeName": "UndiscriminatedUnion1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "types": [ - { - "_type": "named", - "value": "type_:UndiscriminatedUnion1InlineType1" - }, - { - "_type": "named", - "value": "type_:UndiscriminatedUnion1InlineType2" - } - ] - }, - "type_:UndiscriminatedUnion1InlineType1": { - "type": "object", - "declaration": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType1", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType1", - "safeName": "undiscriminatedUnion1InlineType1" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_1", - "safeName": "undiscriminated_union_1_inline_type_1" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_1" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType1", - "safeName": "UndiscriminatedUnion1InlineType1" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "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_:UndiscriminatedUnion1InlineType2": { - "type": "object", - "declaration": { - "name": { - "originalName": "UndiscriminatedUnion1InlineType2", - "camelCase": { - "unsafeName": "undiscriminatedUnion1InlineType2", - "safeName": "undiscriminatedUnion1InlineType2" - }, - "snakeCase": { - "unsafeName": "undiscriminated_union_1_inline_type_2", - "safeName": "undiscriminated_union_1_inline_type_2" - }, - "screamingSnakeCase": { - "unsafeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2", - "safeName": "UNDISCRIMINATED_UNION_1_INLINE_TYPE_2" - }, - "pascalCase": { - "unsafeName": "UndiscriminatedUnion1InlineType2", - "safeName": "UndiscriminatedUnion1InlineType2" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "properties": [ - { - "name": { - "name": { - "originalName": "baz", - "camelCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "snakeCase": { - "unsafeName": "baz", - "safeName": "baz" - }, - "screamingSnakeCase": { - "unsafeName": "BAZ", - "safeName": "BAZ" - }, - "pascalCase": { - "unsafeName": "Baz", - "safeName": "Baz" - } - }, - "wireValue": "baz" - }, - "typeReference": { - "_type": "primitive", - "value": "STRING" - } - } - ] - }, - "type_:InlineEnum": { - "type": "enum", - "declaration": { - "name": { - "originalName": "InlineEnum", - "camelCase": { - "unsafeName": "inlineEnum", - "safeName": "inlineEnum" - }, - "snakeCase": { - "unsafeName": "inline_enum", - "safeName": "inline_enum" - }, - "screamingSnakeCase": { - "unsafeName": "INLINE_ENUM", - "safeName": "INLINE_ENUM" - }, - "pascalCase": { - "unsafeName": "InlineEnum", - "safeName": "InlineEnum" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "values": [ - { - "name": { - "originalName": "SUNNY", - "camelCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "snakeCase": { - "unsafeName": "sunny", - "safeName": "sunny" - }, - "screamingSnakeCase": { - "unsafeName": "SUNNY", - "safeName": "SUNNY" - }, - "pascalCase": { - "unsafeName": "Sunny", - "safeName": "Sunny" - } - }, - "wireValue": "SUNNY" - }, - { - "name": { - "originalName": "CLOUDY", - "camelCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "snakeCase": { - "unsafeName": "cloudy", - "safeName": "cloudy" - }, - "screamingSnakeCase": { - "unsafeName": "CLOUDY", - "safeName": "CLOUDY" - }, - "pascalCase": { - "unsafeName": "Cloudy", - "safeName": "Cloudy" - } - }, - "wireValue": "CLOUDY" - }, - { - "name": { - "originalName": "RAINING", - "camelCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "snakeCase": { - "unsafeName": "raining", - "safeName": "raining" - }, - "screamingSnakeCase": { - "unsafeName": "RAINING", - "safeName": "RAINING" - }, - "pascalCase": { - "unsafeName": "Raining", - "safeName": "Raining" - } - }, - "wireValue": "RAINING" - }, - { - "name": { - "originalName": "SNOWING", - "camelCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "snakeCase": { - "unsafeName": "snowing", - "safeName": "snowing" - }, - "screamingSnakeCase": { - "unsafeName": "SNOWING", - "safeName": "SNOWING" - }, - "pascalCase": { - "unsafeName": "Snowing", - "safeName": "Snowing" - } - }, - "wireValue": "SNOWING" - } - ] - } - }, - "headers": [], - "endpoints": { - "endpoint_.getRoot": { - "auth": null, - "declaration": { - "name": { - "originalName": "getRoot", - "camelCase": { - "unsafeName": "getRoot", - "safeName": "getRoot" - }, - "snakeCase": { - "unsafeName": "get_root", - "safeName": "get_root" - }, - "screamingSnakeCase": { - "unsafeName": "GET_ROOT", - "safeName": "GET_ROOT" - }, - "pascalCase": { - "unsafeName": "GetRoot", - "safeName": "GetRoot" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "POST", - "path": "/root/root" - }, - "request": { - "type": "inlined", - "declaration": { - "name": { - "originalName": "PostRootRequest", - "camelCase": { - "unsafeName": "postRootRequest", - "safeName": "postRootRequest" - }, - "snakeCase": { - "unsafeName": "post_root_request", - "safeName": "post_root_request" - }, - "screamingSnakeCase": { - "unsafeName": "POST_ROOT_REQUEST", - "safeName": "POST_ROOT_REQUEST" - }, - "pascalCase": { - "unsafeName": "PostRootRequest", - "safeName": "PostRootRequest" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "pathParameters": [], - "queryParameters": [], - "headers": [], - "body": { - "type": "properties", - "value": [ - { - "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_:RequestTypeInlineType1" - } - }, - { - "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" - } - } - ] - }, - "metadata": { - "includePathParameters": false, - "onlyPathParameters": false - } - }, - "response": { - "type": "json" - } - }, - "endpoint_.getDiscriminatedUnion": { - "auth": null, - "declaration": { - "name": { - "originalName": "getDiscriminatedUnion", - "camelCase": { - "unsafeName": "getDiscriminatedUnion", - "safeName": "getDiscriminatedUnion" - }, - "snakeCase": { - "unsafeName": "get_discriminated_union", - "safeName": "get_discriminated_union" - }, - "screamingSnakeCase": { - "unsafeName": "GET_DISCRIMINATED_UNION", - "safeName": "GET_DISCRIMINATED_UNION" - }, - "pascalCase": { - "unsafeName": "GetDiscriminatedUnion", - "safeName": "GetDiscriminatedUnion" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "GET", - "path": "/root/discriminated-union" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": null - }, - "response": { - "type": "json" - } - }, - "endpoint_.getUndiscriminatedUnion": { - "auth": null, - "declaration": { - "name": { - "originalName": "getUndiscriminatedUnion", - "camelCase": { - "unsafeName": "getUndiscriminatedUnion", - "safeName": "getUndiscriminatedUnion" - }, - "snakeCase": { - "unsafeName": "get_undiscriminated_union", - "safeName": "get_undiscriminated_union" - }, - "screamingSnakeCase": { - "unsafeName": "GET_UNDISCRIMINATED_UNION", - "safeName": "GET_UNDISCRIMINATED_UNION" - }, - "pascalCase": { - "unsafeName": "GetUndiscriminatedUnion", - "safeName": "GetUndiscriminatedUnion" - } - }, - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - } - }, - "location": { - "method": "GET", - "path": "/root/undiscriminated-union" - }, - "request": { - "type": "body", - "pathParameters": [], - "body": null - }, - "response": { - "type": "json" - } - } - } - }, - "subpackages": {}, - "rootPackage": { - "fernFilepath": { - "allParts": [], - "packagePath": [], - "file": null - }, - "websocket": null, - "service": "service_", - "types": [ - "type_:RequestTypeInlineType1", - "type_:RootType1", - "type_:RootType1InlineType1", - "type_:RootType1InlineType1NestedInlineType1", - "type_:DiscriminatedUnion1", - "type_:DiscriminatedUnion1InlineType1", - "type_:DiscriminatedUnion1InlineType2", - "type_:UndiscriminatedUnion1", - "type_:UndiscriminatedUnion1InlineType1", - "type_:UndiscriminatedUnion1InlineType2", - "type_:InlineEnum" - ], - "errors": [], - "subpackages": [], - "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/ts-sdk/inline-types/no-inline/.npmignore b/seed/ts-sdk/inline-types/no-inline/.npmignore deleted file mode 100644 index 6db0876c41c..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/.npmignore +++ /dev/null @@ -1,9 +0,0 @@ -node_modules -src -tests -.gitignore -.github -.fernignore -.prettierrc.yml -tsconfig.json -yarn.lock \ No newline at end of file diff --git a/seed/ts-sdk/inline-types/no-inline/.prettierrc.yml b/seed/ts-sdk/inline-types/no-inline/.prettierrc.yml deleted file mode 100644 index 0c06786bf53..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/.prettierrc.yml +++ /dev/null @@ -1,2 +0,0 @@ -tabWidth: 4 -printWidth: 120 diff --git a/seed/ts-sdk/inline-types/no-inline/jest.config.js b/seed/ts-sdk/inline-types/no-inline/jest.config.js deleted file mode 100644 index 35d6e65bf93..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @type {import('jest').Config} */ -module.exports = { - preset: "ts-jest", - testEnvironment: "node", -}; diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/client/index.ts b/seed/ts-sdk/inline-types/no-inline/src/api/client/index.ts deleted file mode 100644 index 415726b7fea..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests"; diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/AliasInlineValue.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/AliasInlineValue.ts deleted file mode 100644 index 0beb9652513..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/AliasInlineValue.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface AliasInlineValue { - foo: string; - bar: string; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/AliasListInline.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/AliasListInline.ts deleted file mode 100644 index a684ff0eef7..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/AliasListInline.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -export type AliasListInline = SeedObject.AliasInlineValue[]; diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/AliasMapInline.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/AliasMapInline.ts deleted file mode 100644 index f0d6f380859..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/AliasMapInline.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -export type AliasMapInline = Record; diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/AliasSetInline.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/AliasSetInline.ts deleted file mode 100644 index 32d6e6ebd97..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/AliasSetInline.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -export type AliasSetInline = SeedObject.AliasInlineValue[]; diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1.ts deleted file mode 100644 index 1ecb788196f..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export type DiscriminatedUnion1 = - /** - * lorem ipsum */ - | SeedObject.DiscriminatedUnion1.Type1 - /** - * lorem ipsum */ - | SeedObject.DiscriminatedUnion1.Type2 - /** - * lorem ipsum */ - | SeedObject.DiscriminatedUnion1.Ref; - -export namespace DiscriminatedUnion1 { - export interface Type1 extends SeedObject.DiscriminatedUnion1InlineType1 { - type: "type1"; - } - - export interface Type2 extends SeedObject.DiscriminatedUnion1InlineType2 { - type: "type2"; - } - - export interface Ref extends SeedObject.ReferenceType { - type: "ref"; - } -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType1.ts deleted file mode 100644 index aee4789e932..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface DiscriminatedUnion1InlineType1 { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - bar: SeedObject.DiscriminatedUnion1InlineType1InlineType1; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType1InlineType1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType1InlineType1.ts deleted file mode 100644 index 259925b7704..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType1InlineType1.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface DiscriminatedUnion1InlineType1InlineType1 { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType2.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType2.ts deleted file mode 100644 index b90bfb679a2..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType2.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface DiscriminatedUnion1InlineType2 { - /** lorem ipsum */ - baz: string; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/InlineEnum1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/InlineEnum1.ts deleted file mode 100644 index c678052d190..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/InlineEnum1.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * lorem ipsum - */ -export type InlineEnum1 = "SUNNY" | "CLOUDY" | "RAINING" | "SNOWING"; -export const InlineEnum1 = { - Sunny: "SUNNY", - Cloudy: "CLOUDY", - Raining: "RAINING", - Snowing: "SNOWING", -} as const; diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/ReferenceType.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/ReferenceType.ts deleted file mode 100644 index 3754bc9c7e2..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/ReferenceType.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * lorem ipsum - */ -export interface ReferenceType { - /** lorem ipsum */ - foo: string; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/RequestTypeInlineType1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/RequestTypeInlineType1.ts deleted file mode 100644 index 1e390edb73c..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/RequestTypeInlineType1.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * lorem ipsum - */ -export interface RequestTypeInlineType1 { - /** lorem ipsum */ - foo: string; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1.ts deleted file mode 100644 index d0d33243bcc..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface RootType1 { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - bar: SeedObject.RootType1InlineType1; - /** lorem ipsum */ - fooMap: Record; - /** lorem ipsum */ - fooList: SeedObject.RootType1FooListItem[]; - /** lorem ipsum */ - fooSet: SeedObject.RootType1FooSetItem[]; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1FooListItem.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1FooListItem.ts deleted file mode 100644 index 0ffcae98837..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1FooListItem.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface RootType1FooListItem { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1FooMapValue.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1FooMapValue.ts deleted file mode 100644 index 431bc3c905f..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1FooMapValue.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface RootType1FooMapValue { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1FooSetItem.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1FooSetItem.ts deleted file mode 100644 index b4c3b6b5788..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1FooSetItem.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface RootType1FooSetItem { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1InlineType1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1InlineType1.ts deleted file mode 100644 index 786b87523f5..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1InlineType1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface RootType1InlineType1 { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - bar: SeedObject.RootType1InlineType1NestedInlineType1; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1InlineType1NestedInlineType1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1InlineType1NestedInlineType1.ts deleted file mode 100644 index 7f2cca73ba7..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/RootType1InlineType1NestedInlineType1.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface RootType1InlineType1NestedInlineType1 { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - bar: string; - /** lorem ipsum */ - myEnum: SeedObject.InlineEnum1; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1.ts deleted file mode 100644 index e27127ef2eb..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export type UndiscriminatedUnion1 = - /** - * lorem ipsum */ - | SeedObject.UndiscriminatedUnion1InlineType1 - /** - * lorem ipsum */ - | SeedObject.UndiscriminatedUnion1InlineType2 - /** - * lorem ipsum */ - | SeedObject.UndiscriminatedUnion1DiscriminatedUnion1 - /** - * lorem ipsum */ - | SeedObject.UndiscriminatedUnion1DiscriminatedUnion1 - /** - * lorem ipsum */ - | SeedObject.UndiscriminatedUnion1InlineEnum1 - /** - * lorem ipsum */ - | SeedObject.UserId - /** - * lorem ipsum */ - | SeedObject.UndiscriminatedUnion1InlineListItem1[] - /** - * lorem ipsum */ - | SeedObject.UndiscriminatedUnion1InlineSetItem1[] - /** - * lorem ipsum */ - | Record - /** - * lorem ipsum */ - | SeedObject.ReferenceType; diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1.ts deleted file mode 100644 index 79d5ac09d41..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export type UndiscriminatedUnion1DiscriminatedUnion1 = - /** - * lorem ipsum */ - | SeedObject.UndiscriminatedUnion1DiscriminatedUnion1.Type1 - /** - * lorem ipsum */ - | SeedObject.UndiscriminatedUnion1DiscriminatedUnion1.Type2 - /** - * lorem ipsum */ - | SeedObject.UndiscriminatedUnion1DiscriminatedUnion1.Ref; - -export namespace UndiscriminatedUnion1DiscriminatedUnion1 { - export interface Type1 extends SeedObject.UndiscriminatedUnion1DiscriminatedUnion1InlineType1 { - type: "type1"; - } - - export interface Type2 extends SeedObject.UndiscriminatedUnion1DiscriminatedUnion1InlineType2 { - type: "type2"; - } - - export interface Ref extends SeedObject.ReferenceType { - type: "ref"; - } -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts deleted file mode 100644 index ed023f35ece..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface UndiscriminatedUnion1DiscriminatedUnion1InlineType1 { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - bar: SeedObject.UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts deleted file mode 100644 index 06dc9f4879f..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1 { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts deleted file mode 100644 index a691050422a..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface UndiscriminatedUnion1DiscriminatedUnion1InlineType2 { - /** lorem ipsum */ - baz: string; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineEnum1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineEnum1.ts deleted file mode 100644 index b0184d4a8fe..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineEnum1.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * lorem ipsum - */ -export type UndiscriminatedUnion1InlineEnum1 = "SUNNY" | "CLOUDY" | "RAINING" | "SNOWING"; -export const UndiscriminatedUnion1InlineEnum1 = { - Sunny: "SUNNY", - Cloudy: "CLOUDY", - Raining: "RAINING", - Snowing: "SNOWING", -} as const; diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineListItem1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineListItem1.ts deleted file mode 100644 index a4e8738f30e..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineListItem1.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface UndiscriminatedUnion1InlineListItem1 { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineMapItem1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineMapItem1.ts deleted file mode 100644 index 2c343a1648d..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineMapItem1.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface UndiscriminatedUnion1InlineMapItem1 { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineSetItem1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineSetItem1.ts deleted file mode 100644 index bfb627dff7a..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineSetItem1.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface UndiscriminatedUnion1InlineSetItem1 { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType1.ts deleted file mode 100644 index cd15e0f5170..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface UndiscriminatedUnion1InlineType1 { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - bar: SeedObject.UndiscriminatedUnion1InlineType1InlineType1; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType1InlineType1.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType1InlineType1.ts deleted file mode 100644 index 104de7c900d..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType1InlineType1.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface UndiscriminatedUnion1InlineType1InlineType1 { - /** lorem ipsum */ - foo: string; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType2.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType2.ts deleted file mode 100644 index ceaf78891a0..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType2.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -/** - * lorem ipsum - */ -export interface UndiscriminatedUnion1InlineType2 { - /** lorem ipsum */ - baz: string; - /** lorem ipsum */ - ref: SeedObject.ReferenceType; -} diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/UserId.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/UserId.ts deleted file mode 100644 index 5a6e3e5152f..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/UserId.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * lorem ipsum - */ -export type UserId = string; diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/types/index.ts b/seed/ts-sdk/inline-types/no-inline/src/api/types/index.ts deleted file mode 100644 index 57d21ed5261..00000000000 --- a/seed/ts-sdk/inline-types/no-inline/src/api/types/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -export * from "./AliasMapInline"; -export * from "./AliasSetInline"; -export * from "./AliasListInline"; -export * from "./AliasInlineValue"; -export * from "./RequestTypeInlineType1"; -export * from "./RootType1"; -export * from "./RootType1FooMapValue"; -export * from "./RootType1FooListItem"; -export * from "./RootType1FooSetItem"; -export * from "./RootType1InlineType1"; -export * from "./RootType1InlineType1NestedInlineType1"; -export * from "./DiscriminatedUnion1"; -export * from "./DiscriminatedUnion1InlineType1"; -export * from "./DiscriminatedUnion1InlineType1InlineType1"; -export * from "./DiscriminatedUnion1InlineType2"; -export * from "./UndiscriminatedUnion1"; -export * from "./UndiscriminatedUnion1InlineType1"; -export * from "./UndiscriminatedUnion1InlineType1InlineType1"; -export * from "./UndiscriminatedUnion1InlineType2"; -export * from "./InlineEnum1"; -export * from "./UndiscriminatedUnion1DiscriminatedUnion1"; -export * from "./UndiscriminatedUnion1DiscriminatedUnion1InlineType1"; -export * from "./UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1"; -export * from "./UndiscriminatedUnion1DiscriminatedUnion1InlineType2"; -export * from "./UndiscriminatedUnion1InlineEnum1"; -export * from "./UserId"; -export * from "./UndiscriminatedUnion1InlineListItem1"; -export * from "./UndiscriminatedUnion1InlineSetItem1"; -export * from "./UndiscriminatedUnion1InlineMapItem1"; -export * from "./ReferenceType"; diff --git a/seed/ts-sdk/inline-types/reference.md b/seed/ts-sdk/inline-types/reference.md deleted file mode 100644 index afb56aee833..00000000000 --- a/seed/ts-sdk/inline-types/reference.md +++ /dev/null @@ -1,61 +0,0 @@ -# Reference - -

client.getRoot({ ...params }) -> SeedObject.RootType1 -
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.getRoot({ - bar: { - foo: "foo", - bar: { - foo: "foo", - bar: "bar", - myEnum: "SUNNY", - }, - }, - foo: "foo", -}); -``` - -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `SeedObject.PostRootRequest` - -
-
- -
-
- -**requestOptions:** `SeedObjectClient.RequestOptions` - -
-
-
-
- -
-
-
- -## diff --git a/seed/ts-sdk/inline-types/resolved-snippet-templates.md b/seed/ts-sdk/inline-types/resolved-snippet-templates.md deleted file mode 100644 index 21d6ab8b321..00000000000 --- a/seed/ts-sdk/inline-types/resolved-snippet-templates.md +++ /dev/null @@ -1,18 +0,0 @@ -```typescript -import { SeedObjectClient } from "@fern/inline-types"; - -const client = new SeedObjectClient({ environment: "YOUR_BASE_URL" }); -await client.getRoot({ - bar: { - foo: "foo", - bar: { - foo: "foo", - bar: "bar", - }, - }, - foo: "foo", -}); - -``` - - diff --git a/seed/ts-sdk/inline-types/snippet-templates.json b/seed/ts-sdk/inline-types/snippet-templates.json deleted file mode 100644 index 0c426fdd32c..00000000000 --- a/seed/ts-sdk/inline-types/snippet-templates.json +++ /dev/null @@ -1,178 +0,0 @@ -[ - { - "sdk": { - "package": "@fern/inline-types", - "version": "0.0.1", - "type": "typescript" - }, - "endpointId": { - "path": "/root/root", - "method": "POST", - "identifierOverride": "endpoint_.getRoot" - }, - "snippetTemplate": { - "clientInstantiation": { - "imports": [ - "import { SeedObjectClient } from \"@fern/inline-types\";" - ], - "templateString": "const client = new SeedObjectClient($FERN_INPUT);", - "isOptional": false, - "inputDelimiter": ",", - "templateInputs": [ - { - "value": { - "imports": [], - "templateString": "{ $FERN_INPUT }", - "isOptional": true, - "templateInputs": [ - { - "value": { - "imports": [], - "templateString": "environment: \"YOUR_BASE_URL\"", - "isOptional": false, - "templateInputs": [], - "type": "generic" - }, - "type": "template" - } - ], - "type": "generic" - }, - "type": "template" - } - ], - "type": "generic" - }, - "functionInvocation": { - "imports": [], - "templateString": "await client.getRoot(\n\t$FERN_INPUT\n)", - "isOptional": false, - "inputDelimiter": ",\n\t", - "templateInputs": [ - { - "value": { - "imports": [], - "templateString": "{\n\t\t$FERN_INPUT\n\t}", - "isOptional": true, - "inputDelimiter": ",\n\t\t", - "templateInputs": [ - { - "value": { - "imports": [], - "templateString": "bar: {\n\t\t\t$FERN_INPUT\n\t\t}", - "isOptional": true, - "inputDelimiter": ",\n\t\t\t", - "templateInputs": [ - { - "value": { - "imports": [], - "templateString": "foo: $FERN_INPUT", - "isOptional": true, - "templateInputs": [ - { - "location": "BODY", - "path": "bar.foo", - "type": "payload" - } - ], - "type": "generic" - }, - "type": "template" - }, - { - "value": { - "imports": [], - "templateString": "bar: {\n\t\t\t\t$FERN_INPUT\n\t\t\t}", - "isOptional": true, - "inputDelimiter": ",\n\t\t\t\t", - "templateInputs": [ - { - "value": { - "imports": [], - "templateString": "foo: $FERN_INPUT", - "isOptional": true, - "templateInputs": [ - { - "location": "BODY", - "path": "bar.bar.foo", - "type": "payload" - } - ], - "type": "generic" - }, - "type": "template" - }, - { - "value": { - "imports": [], - "templateString": "bar: $FERN_INPUT", - "isOptional": true, - "templateInputs": [ - { - "location": "BODY", - "path": "bar.bar.bar", - "type": "payload" - } - ], - "type": "generic" - }, - "type": "template" - }, - { - "value": { - "imports": [], - "isOptional": true, - "values": { - "SUNNY": "\"SUNNY\"", - "CLOUDY": "\"CLOUDY\"", - "RAINING": "\"RAINING\"", - "SNOWING": "\"SNOWING\"" - }, - "templateString": "myEnum: $FERN_INPUT", - "templateInput": { - "location": "BODY", - "path": "bar.bar.myEnum", - "type": "payload" - }, - "type": "enum" - }, - "type": "template" - } - ], - "type": "generic" - }, - "type": "template" - } - ], - "type": "generic" - }, - "type": "template" - }, - { - "value": { - "imports": [], - "templateString": "foo: $FERN_INPUT", - "isOptional": true, - "templateInputs": [ - { - "location": "BODY", - "path": "foo", - "type": "payload" - } - ], - "type": "generic" - }, - "type": "template" - } - ], - "type": "generic" - }, - "type": "template" - } - ], - "type": "generic" - }, - "type": "v1" - } - } -] \ No newline at end of file diff --git a/seed/ts-sdk/inline-types/snippet.json b/seed/ts-sdk/inline-types/snippet.json deleted file mode 100644 index cc655f15e29..00000000000 --- a/seed/ts-sdk/inline-types/snippet.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "endpoints": [ - { - "id": { - "path": "/root/root", - "method": "POST", - "identifier_override": "endpoint_.getRoot" - }, - "snippet": { - "type": "typescript", - "client": "import { SeedObjectClient } from \"@fern/inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getRoot({\n bar: {\n foo: \"foo\",\n bar: {\n foo: \"foo\",\n bar: \"bar\",\n myEnum: \"SUNNY\"\n }\n },\n foo: \"foo\"\n});\n" - } - } - ], - "types": {} -} \ No newline at end of file diff --git a/seed/ts-sdk/inline-types/src/Client.ts b/seed/ts-sdk/inline-types/src/Client.ts deleted file mode 100644 index ec282732e20..00000000000 --- a/seed/ts-sdk/inline-types/src/Client.ts +++ /dev/null @@ -1,101 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as core from "./core"; -import * as SeedObject from "./api/index"; -import * as serializers from "./serialization/index"; -import urlJoin from "url-join"; -import * as errors from "./errors/index"; - -export declare namespace SeedObjectClient { - interface Options { - environment: core.Supplier; - } - - interface RequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional headers to include in the request. */ - headers?: Record; - } -} - -export class SeedObjectClient { - constructor(protected readonly _options: SeedObjectClient.Options) {} - - /** - * @param {SeedObject.PostRootRequest} request - * @param {SeedObjectClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.getRoot({ - * bar: { - * foo: "foo", - * bar: { - * foo: "foo", - * bar: "bar", - * myEnum: "SUNNY" - * } - * }, - * foo: "foo" - * }) - */ - public async getRoot( - request: SeedObject.PostRootRequest, - requestOptions?: SeedObjectClient.RequestOptions - ): Promise { - const _response = await core.fetcher({ - url: urlJoin(await core.Supplier.get(this._options.environment), "/root/root"), - method: "POST", - headers: { - "X-Fern-Language": "JavaScript", - "X-Fern-SDK-Name": "@fern/inline-types", - "X-Fern-SDK-Version": "0.0.1", - "User-Agent": "@fern/inline-types/0.0.1", - "X-Fern-Runtime": core.RUNTIME.type, - "X-Fern-Runtime-Version": core.RUNTIME.version, - ...requestOptions?.headers, - }, - contentType: "application/json", - requestType: "json", - body: serializers.PostRootRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, - maxRetries: requestOptions?.maxRetries, - abortSignal: requestOptions?.abortSignal, - }); - if (_response.ok) { - return serializers.RootType1.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - breadcrumbsPrefix: ["response"], - }); - } - - if (_response.error.reason === "status-code") { - throw new errors.SeedObjectError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - }); - } - - switch (_response.error.reason) { - case "non-json": - throw new errors.SeedObjectError({ - statusCode: _response.error.statusCode, - body: _response.error.rawBody, - }); - case "timeout": - throw new errors.SeedObjectTimeoutError("Timeout exceeded when calling POST /root/root."); - case "unknown": - throw new errors.SeedObjectError({ - message: _response.error.errorMessage, - }); - } - } -} diff --git a/seed/ts-sdk/inline-types/src/api/client/index.ts b/seed/ts-sdk/inline-types/src/api/client/index.ts deleted file mode 100644 index 415726b7fea..00000000000 --- a/seed/ts-sdk/inline-types/src/api/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests"; diff --git a/seed/ts-sdk/inline-types/src/api/client/requests/PostRootRequest.ts b/seed/ts-sdk/inline-types/src/api/client/requests/PostRootRequest.ts deleted file mode 100644 index 77a7c554453..00000000000 --- a/seed/ts-sdk/inline-types/src/api/client/requests/PostRootRequest.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../../index"; - -/** - * @example - * { - * bar: { - * foo: "foo", - * bar: { - * foo: "foo", - * bar: "bar", - * myEnum: "SUNNY" - * } - * }, - * foo: "foo" - * } - */ -export interface PostRootRequest { - bar: SeedObject.InlineType1; - foo: string; -} diff --git a/seed/ts-sdk/inline-types/src/api/client/requests/index.ts b/seed/ts-sdk/inline-types/src/api/client/requests/index.ts deleted file mode 100644 index 175cff8a599..00000000000 --- a/seed/ts-sdk/inline-types/src/api/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { type PostRootRequest } from "./PostRootRequest"; diff --git a/seed/ts-sdk/inline-types/src/api/index.ts b/seed/ts-sdk/inline-types/src/api/index.ts deleted file mode 100644 index c9240f83b48..00000000000 --- a/seed/ts-sdk/inline-types/src/api/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./types"; -export * from "./client"; diff --git a/seed/ts-sdk/inline-types/src/api/types/InlineEnum.ts b/seed/ts-sdk/inline-types/src/api/types/InlineEnum.ts deleted file mode 100644 index efc9b2dc13b..00000000000 --- a/seed/ts-sdk/inline-types/src/api/types/InlineEnum.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export type InlineEnum = "SUNNY" | "CLOUDY" | "RAINING" | "SNOWING"; - -export const InlineEnum = { - Sunny: "SUNNY", - Cloudy: "CLOUDY", - Raining: "RAINING", - Snowing: "SNOWING", -} as const; diff --git a/seed/ts-sdk/inline-types/src/api/types/InlineType1.ts b/seed/ts-sdk/inline-types/src/api/types/InlineType1.ts deleted file mode 100644 index 46eb751da7c..00000000000 --- a/seed/ts-sdk/inline-types/src/api/types/InlineType1.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -export interface InlineType1 { - foo: string; - bar: SeedObject.NestedInlineType1; -} diff --git a/seed/ts-sdk/inline-types/src/api/types/InlineType2.ts b/seed/ts-sdk/inline-types/src/api/types/InlineType2.ts deleted file mode 100644 index 6fd9bee2f7c..00000000000 --- a/seed/ts-sdk/inline-types/src/api/types/InlineType2.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface InlineType2 { - baz: string; -} diff --git a/seed/ts-sdk/inline-types/src/api/types/InlinedDiscriminatedUnion1.ts b/seed/ts-sdk/inline-types/src/api/types/InlinedDiscriminatedUnion1.ts deleted file mode 100644 index 6fd939b1ecd..00000000000 --- a/seed/ts-sdk/inline-types/src/api/types/InlinedDiscriminatedUnion1.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -export type InlinedDiscriminatedUnion1 = - | SeedObject.InlinedDiscriminatedUnion1.Type1 - | SeedObject.InlinedDiscriminatedUnion1.Type2; - -export declare namespace InlinedDiscriminatedUnion1 { - interface Type1 extends SeedObject.InlineType1 { - type: "type1"; - } - - interface Type2 extends SeedObject.InlineType2 { - type: "type2"; - } -} diff --git a/seed/ts-sdk/inline-types/src/api/types/InlinedUndiscriminatedUnion1.ts b/seed/ts-sdk/inline-types/src/api/types/InlinedUndiscriminatedUnion1.ts deleted file mode 100644 index aa17b80bb9a..00000000000 --- a/seed/ts-sdk/inline-types/src/api/types/InlinedUndiscriminatedUnion1.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -export type InlinedUndiscriminatedUnion1 = SeedObject.InlineType1 | SeedObject.InlineType2; diff --git a/seed/ts-sdk/inline-types/src/api/types/NestedInlineType1.ts b/seed/ts-sdk/inline-types/src/api/types/NestedInlineType1.ts deleted file mode 100644 index 149f04ffa10..00000000000 --- a/seed/ts-sdk/inline-types/src/api/types/NestedInlineType1.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -export interface NestedInlineType1 { - foo: string; - bar: string; - myEnum: SeedObject.InlineEnum; -} diff --git a/seed/ts-sdk/inline-types/src/api/types/RootType1.ts b/seed/ts-sdk/inline-types/src/api/types/RootType1.ts deleted file mode 100644 index 5fd2ba90356..00000000000 --- a/seed/ts-sdk/inline-types/src/api/types/RootType1.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as SeedObject from "../index"; - -export interface RootType1 { - foo: string; - bar: SeedObject.InlineType1; -} diff --git a/seed/ts-sdk/inline-types/src/api/types/index.ts b/seed/ts-sdk/inline-types/src/api/types/index.ts deleted file mode 100644 index bb183ec944a..00000000000 --- a/seed/ts-sdk/inline-types/src/api/types/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from "./RootType1"; -export * from "./InlineType1"; -export * from "./InlineType2"; -export * from "./NestedInlineType1"; -export * from "./InlinedDiscriminatedUnion1"; -export * from "./InlinedUndiscriminatedUnion1"; -export * from "./InlineEnum"; diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/APIResponse.ts b/seed/ts-sdk/inline-types/src/core/fetcher/APIResponse.ts deleted file mode 100644 index 3664d09e168..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/APIResponse.ts +++ /dev/null @@ -1,12 +0,0 @@ -export type APIResponse = SuccessfulResponse | FailedResponse; - -export interface SuccessfulResponse { - ok: true; - body: T; - headers?: Record; -} - -export interface FailedResponse { - ok: false; - error: T; -} diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/inline-types/src/core/fetcher/Fetcher.ts deleted file mode 100644 index b8f23717b69..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/Fetcher.ts +++ /dev/null @@ -1,143 +0,0 @@ -import { APIResponse } from "./APIResponse"; -import { createRequestUrl } from "./createRequestUrl"; -import { getFetchFn } from "./getFetchFn"; -import { getRequestBody } from "./getRequestBody"; -import { getResponseBody } from "./getResponseBody"; -import { makeRequest } from "./makeRequest"; -import { requestWithRetries } from "./requestWithRetries"; - -export type FetchFunction = (args: Fetcher.Args) => Promise>; - -export declare namespace Fetcher { - export interface Args { - url: string; - method: string; - contentType?: string; - headers?: Record; - queryParameters?: Record; - body?: unknown; - timeoutMs?: number; - maxRetries?: number; - withCredentials?: boolean; - abortSignal?: AbortSignal; - requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; - duplex?: "half"; - } - - export type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError; - - export interface FailedStatusCodeError { - reason: "status-code"; - statusCode: number; - body: unknown; - } - - export interface NonJsonError { - reason: "non-json"; - statusCode: number; - rawBody: string; - } - - export interface TimeoutError { - reason: "timeout"; - } - - export interface UnknownError { - reason: "unknown"; - errorMessage: string; - } -} - -export async function fetcherImpl(args: Fetcher.Args): Promise> { - const headers: Record = {}; - if (args.body !== undefined && args.contentType != null) { - headers["Content-Type"] = args.contentType; - } - - if (args.headers != null) { - for (const [key, value] of Object.entries(args.headers)) { - if (value != null) { - headers[key] = value; - } - } - } - - const url = createRequestUrl(args.url, args.queryParameters); - let requestBody: BodyInit | undefined = await getRequestBody({ - body: args.body, - type: args.requestType === "json" ? "json" : "other", - }); - const fetchFn = await getFetchFn(); - - try { - const response = await requestWithRetries( - async () => - makeRequest( - fetchFn, - url, - args.method, - headers, - requestBody, - args.timeoutMs, - args.abortSignal, - args.withCredentials, - args.duplex - ), - args.maxRetries - ); - let responseBody = await getResponseBody(response, args.responseType); - - if (response.status >= 200 && response.status < 400) { - return { - ok: true, - body: responseBody as R, - headers: response.headers, - }; - } else { - return { - ok: false, - error: { - reason: "status-code", - statusCode: response.status, - body: responseBody, - }, - }; - } - } catch (error) { - if (args.abortSignal != null && args.abortSignal.aborted) { - return { - ok: false, - error: { - reason: "unknown", - errorMessage: "The user aborted a request", - }, - }; - } else if (error instanceof Error && error.name === "AbortError") { - return { - ok: false, - error: { - reason: "timeout", - }, - }; - } else if (error instanceof Error) { - return { - ok: false, - error: { - reason: "unknown", - errorMessage: error.message, - }, - }; - } - - return { - ok: false, - error: { - reason: "unknown", - errorMessage: JSON.stringify(error), - }, - }; - } -} - -export const fetcher: FetchFunction = fetcherImpl; diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/Supplier.ts b/seed/ts-sdk/inline-types/src/core/fetcher/Supplier.ts deleted file mode 100644 index 867c931c02f..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/Supplier.ts +++ /dev/null @@ -1,11 +0,0 @@ -export type Supplier = T | Promise | (() => T | Promise); - -export const Supplier = { - get: async (supplier: Supplier): Promise => { - if (typeof supplier === "function") { - return (supplier as () => T)(); - } else { - return supplier; - } - }, -}; diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/createRequestUrl.ts b/seed/ts-sdk/inline-types/src/core/fetcher/createRequestUrl.ts deleted file mode 100644 index 9288a99bb22..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/createRequestUrl.ts +++ /dev/null @@ -1,10 +0,0 @@ -import qs from "qs"; - -export function createRequestUrl( - baseUrl: string, - queryParameters?: Record -): string { - return Object.keys(queryParameters ?? {}).length > 0 - ? `${baseUrl}?${qs.stringify(queryParameters, { arrayFormat: "repeat" })}` - : baseUrl; -} diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/getFetchFn.ts b/seed/ts-sdk/inline-types/src/core/fetcher/getFetchFn.ts deleted file mode 100644 index 9fd9bfc42bd..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/getFetchFn.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { RUNTIME } from "../runtime"; - -/** - * Returns a fetch function based on the runtime - */ -export async function getFetchFn(): Promise { - // In Node.js 18+ environments, use native fetch - if (RUNTIME.type === "node" && RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { - return fetch; - } - - // In Node.js 18 or lower environments, the SDK always uses`node-fetch`. - if (RUNTIME.type === "node") { - return (await import("node-fetch")).default as any; - } - - // Otherwise the SDK uses global fetch if available, - // and falls back to node-fetch. - if (typeof fetch == "function") { - return fetch; - } - - // Defaults to node `node-fetch` if global fetch isn't available - return (await import("node-fetch")).default as any; -} diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/getHeader.ts b/seed/ts-sdk/inline-types/src/core/fetcher/getHeader.ts deleted file mode 100644 index 50f922b0e87..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/getHeader.ts +++ /dev/null @@ -1,8 +0,0 @@ -export function getHeader(headers: Record, header: string): string | undefined { - for (const [headerKey, headerValue] of Object.entries(headers)) { - if (headerKey.toLowerCase() === header.toLowerCase()) { - return headerValue; - } - } - return undefined; -} diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/getRequestBody.ts b/seed/ts-sdk/inline-types/src/core/fetcher/getRequestBody.ts deleted file mode 100644 index 1138414b1c2..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/getRequestBody.ts +++ /dev/null @@ -1,14 +0,0 @@ -export declare namespace GetRequestBody { - interface Args { - body: unknown; - type: "json" | "file" | "bytes" | "other"; - } -} - -export async function getRequestBody({ body, type }: GetRequestBody.Args): Promise { - if (type.includes("json")) { - return JSON.stringify(body); - } else { - return body as BodyInit; - } -} diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/inline-types/src/core/fetcher/getResponseBody.ts deleted file mode 100644 index d046e6ea275..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/getResponseBody.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; - -export async function getResponseBody(response: Response, responseType?: string): Promise { - if (response.body != null && responseType === "blob") { - return await response.blob(); - } else if (response.body != null && responseType === "arrayBuffer") { - return await response.arrayBuffer(); - } else if (response.body != null && responseType === "sse") { - return response.body; - } else if (response.body != null && responseType === "streaming") { - return chooseStreamWrapper(response.body); - } else if (response.body != null && responseType === "text") { - return await response.text(); - } else { - const text = await response.text(); - if (text.length > 0) { - try { - let responseBody = JSON.parse(text); - return responseBody; - } catch (err) { - return { - ok: false, - error: { - reason: "non-json", - statusCode: response.status, - rawBody: text, - }, - }; - } - } else { - return undefined; - } - } -} diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/index.ts b/seed/ts-sdk/inline-types/src/core/fetcher/index.ts deleted file mode 100644 index 2d658ca48f9..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type { APIResponse } from "./APIResponse"; -export { fetcher } from "./Fetcher"; -export type { Fetcher, FetchFunction } from "./Fetcher"; -export { getHeader } from "./getHeader"; -export { Supplier } from "./Supplier"; diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/makeRequest.ts b/seed/ts-sdk/inline-types/src/core/fetcher/makeRequest.ts deleted file mode 100644 index 8fb4bace466..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/makeRequest.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { anySignal, getTimeoutSignal } from "./signals"; - -export const makeRequest = async ( - fetchFn: (url: string, init: RequestInit) => Promise, - url: string, - method: string, - headers: Record, - requestBody: BodyInit | undefined, - timeoutMs?: number, - abortSignal?: AbortSignal, - withCredentials?: boolean, - duplex?: "half" -): Promise => { - const signals: AbortSignal[] = []; - - // Add timeout signal - let timeoutAbortId: NodeJS.Timeout | undefined = undefined; - if (timeoutMs != null) { - const { signal, abortId } = getTimeoutSignal(timeoutMs); - timeoutAbortId = abortId; - signals.push(signal); - } - - // Add arbitrary signal - if (abortSignal != null) { - signals.push(abortSignal); - } - let newSignals = anySignal(signals); - const response = await fetchFn(url, { - method: method, - headers, - body: requestBody, - signal: newSignals, - credentials: withCredentials ? "include" : undefined, - // @ts-ignore - duplex, - }); - - if (timeoutAbortId != null) { - clearTimeout(timeoutAbortId); - } - - return response; -}; diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/requestWithRetries.ts b/seed/ts-sdk/inline-types/src/core/fetcher/requestWithRetries.ts deleted file mode 100644 index 8d5af9d5a82..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/requestWithRetries.ts +++ /dev/null @@ -1,33 +0,0 @@ -const INITIAL_RETRY_DELAY = 1000; // in milliseconds -const MAX_RETRY_DELAY = 60000; // in milliseconds -const DEFAULT_MAX_RETRIES = 2; -const JITTER_FACTOR = 0.2; // 20% random jitter - -function addJitter(delay: number): number { - // Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR - const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR; - return delay * jitterMultiplier; -} - -export async function requestWithRetries( - requestFn: () => Promise, - maxRetries: number = DEFAULT_MAX_RETRIES -): Promise { - let response: Response = await requestFn(); - - for (let i = 0; i < maxRetries; ++i) { - if ([408, 409, 429].includes(response.status) || response.status >= 500) { - // Calculate base delay using exponential backoff (in milliseconds) - const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY); - - // Add jitter to the delay - const delayWithJitter = addJitter(baseDelay); - - await new Promise((resolve) => setTimeout(resolve, delayWithJitter)); - response = await requestFn(); - } else { - break; - } - } - return response!; -} diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/signals.ts b/seed/ts-sdk/inline-types/src/core/fetcher/signals.ts deleted file mode 100644 index 6c124ff7985..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/signals.ts +++ /dev/null @@ -1,38 +0,0 @@ -const TIMEOUT = "timeout"; - -export function getTimeoutSignal(timeoutMs: number): { signal: AbortSignal; abortId: NodeJS.Timeout } { - const controller = new AbortController(); - const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs); - return { signal: controller.signal, abortId }; -} - -/** - * Returns an abort signal that is getting aborted when - * at least one of the specified abort signals is aborted. - * - * Requires at least node.js 18. - */ -export function anySignal(...args: AbortSignal[] | [AbortSignal[]]): AbortSignal { - // Allowing signals to be passed either as array - // of signals or as multiple arguments. - const signals = (args.length === 1 && Array.isArray(args[0]) ? args[0] : args); - - const controller = new AbortController(); - - for (const signal of signals) { - if (signal.aborted) { - // Exiting early if one of the signals - // is already aborted. - controller.abort((signal as any)?.reason); - break; - } - - // Listening for signals and removing the listeners - // when at least one symbol is aborted. - signal.addEventListener("abort", () => controller.abort((signal as any)?.reason), { - signal: controller.signal, - }); - } - - return controller.signal; -} diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts deleted file mode 100644 index 4d7b7d52e8f..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ /dev/null @@ -1,256 +0,0 @@ -import type { Writable } from "readable-stream"; -import { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; - -export class Node18UniversalStreamWrapper - implements - StreamWrapper | Writable | WritableStream, ReadFormat> -{ - private readableStream: ReadableStream; - private reader: ReadableStreamDefaultReader; - private events: Record; - private paused: boolean; - private resumeCallback: ((value?: unknown) => void) | null; - private encoding: string | null; - - constructor(readableStream: ReadableStream) { - this.readableStream = readableStream; - this.reader = this.readableStream.getReader(); - this.events = { - data: [], - end: [], - error: [], - readable: [], - close: [], - pause: [], - resume: [], - }; - this.paused = false; - this.resumeCallback = null; - this.encoding = null; - } - - public on(event: string, callback: EventCallback): void { - this.events[event]?.push(callback); - } - - public off(event: string, callback: EventCallback): void { - this.events[event] = this.events[event]?.filter((cb) => cb !== callback); - } - - public pipe( - dest: Node18UniversalStreamWrapper | Writable | WritableStream - ): Node18UniversalStreamWrapper | Writable | WritableStream { - this.on("data", async (chunk) => { - if (dest instanceof Node18UniversalStreamWrapper) { - dest._write(chunk); - } else if (dest instanceof WritableStream) { - const writer = dest.getWriter(); - writer.write(chunk).then(() => writer.releaseLock()); - } else { - dest.write(chunk); - } - }); - - this.on("end", async () => { - if (dest instanceof Node18UniversalStreamWrapper) { - dest._end(); - } else if (dest instanceof WritableStream) { - const writer = dest.getWriter(); - writer.close(); - } else { - dest.end(); - } - }); - - this.on("error", async (error) => { - if (dest instanceof Node18UniversalStreamWrapper) { - dest._error(error); - } else if (dest instanceof WritableStream) { - const writer = dest.getWriter(); - writer.abort(error); - } else { - dest.destroy(error); - } - }); - - this._startReading(); - - return dest; - } - - public pipeTo( - dest: Node18UniversalStreamWrapper | Writable | WritableStream - ): Node18UniversalStreamWrapper | Writable | WritableStream { - return this.pipe(dest); - } - - public unpipe(dest: Node18UniversalStreamWrapper | Writable | WritableStream): void { - this.off("data", async (chunk) => { - if (dest instanceof Node18UniversalStreamWrapper) { - dest._write(chunk); - } else if (dest instanceof WritableStream) { - const writer = dest.getWriter(); - writer.write(chunk).then(() => writer.releaseLock()); - } else { - dest.write(chunk); - } - }); - - this.off("end", async () => { - if (dest instanceof Node18UniversalStreamWrapper) { - dest._end(); - } else if (dest instanceof WritableStream) { - const writer = dest.getWriter(); - writer.close(); - } else { - dest.end(); - } - }); - - this.off("error", async (error) => { - if (dest instanceof Node18UniversalStreamWrapper) { - dest._error(error); - } else if (dest instanceof WritableStream) { - const writer = dest.getWriter(); - writer.abort(error); - } else { - dest.destroy(error); - } - }); - } - - public destroy(error?: Error): void { - this.reader - .cancel(error) - .then(() => { - this._emit("close"); - }) - .catch((err) => { - this._emit("error", err); - }); - } - - public pause(): void { - this.paused = true; - this._emit("pause"); - } - - public resume(): void { - if (this.paused) { - this.paused = false; - this._emit("resume"); - if (this.resumeCallback) { - this.resumeCallback(); - this.resumeCallback = null; - } - } - } - - public get isPaused(): boolean { - return this.paused; - } - - public async read(): Promise { - if (this.paused) { - await new Promise((resolve) => { - this.resumeCallback = resolve; - }); - } - const { done, value } = await this.reader.read(); - - if (done) { - return undefined; - } - return value; - } - - public setEncoding(encoding: string): void { - this.encoding = encoding; - } - - public async text(): Promise { - const chunks: ReadFormat[] = []; - - while (true) { - const { done, value } = await this.reader.read(); - if (done) { - break; - } - if (value) { - chunks.push(value); - } - } - - const decoder = new TextDecoder(this.encoding || "utf-8"); - return decoder.decode(await new Blob(chunks).arrayBuffer()); - } - - public async json(): Promise { - const text = await this.text(); - return JSON.parse(text); - } - - private _write(chunk: ReadFormat): void { - this._emit("data", chunk); - } - - private _end(): void { - this._emit("end"); - } - - private _error(error: any): void { - this._emit("error", error); - } - - private _emit(event: string, data?: any): void { - if (this.events[event]) { - for (const callback of this.events[event] || []) { - callback(data); - } - } - } - - private async _startReading(): Promise { - try { - this._emit("readable"); - while (true) { - if (this.paused) { - await new Promise((resolve) => { - this.resumeCallback = resolve; - }); - } - const { done, value } = await this.reader.read(); - if (done) { - this._emit("end"); - this._emit("close"); - break; - } - if (value) { - this._emit("data", value); - } - } - } catch (error) { - this._emit("error", error); - } - } - - [Symbol.asyncIterator](): AsyncIterableIterator { - return { - next: async () => { - if (this.paused) { - await new Promise((resolve) => { - this.resumeCallback = resolve; - }); - } - const { done, value } = await this.reader.read(); - if (done) { - return { done: true, value: undefined }; - } - return { done: false, value }; - }, - [Symbol.asyncIterator]() { - return this; - }, - }; - } -} diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts b/seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts deleted file mode 100644 index ba5f7276750..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts +++ /dev/null @@ -1,106 +0,0 @@ -import type { Readable, Writable } from "readable-stream"; -import { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; - -export class NodePre18StreamWrapper implements StreamWrapper { - private readableStream: Readable; - private encoding: string | undefined; - - constructor(readableStream: Readable) { - this.readableStream = readableStream; - } - - public on(event: string, callback: EventCallback): void { - this.readableStream.on(event, callback); - } - - public off(event: string, callback: EventCallback): void { - this.readableStream.off(event, callback); - } - - public pipe(dest: Writable): Writable { - this.readableStream.pipe(dest); - return dest; - } - - public pipeTo(dest: Writable): Writable { - return this.pipe(dest); - } - - public unpipe(dest?: Writable): void { - if (dest) { - this.readableStream.unpipe(dest); - } else { - this.readableStream.unpipe(); - } - } - - public destroy(error?: Error): void { - this.readableStream.destroy(error); - } - - public pause(): void { - this.readableStream.pause(); - } - - public resume(): void { - this.readableStream.resume(); - } - - public get isPaused(): boolean { - return this.readableStream.isPaused(); - } - - public async read(): Promise { - return new Promise((resolve, reject) => { - const chunk = this.readableStream.read(); - if (chunk) { - resolve(chunk); - } else { - this.readableStream.once("readable", () => { - const chunk = this.readableStream.read(); - resolve(chunk); - }); - this.readableStream.once("error", reject); - } - }); - } - - public setEncoding(encoding?: string): void { - this.readableStream.setEncoding(encoding as BufferEncoding); - this.encoding = encoding; - } - - public async text(): Promise { - const chunks: Uint8Array[] = []; - const encoder = new TextEncoder(); - this.readableStream.setEncoding((this.encoding || "utf-8") as BufferEncoding); - - for await (const chunk of this.readableStream) { - chunks.push(encoder.encode(chunk)); - } - - const decoder = new TextDecoder(this.encoding || "utf-8"); - return decoder.decode(Buffer.concat(chunks)); - } - - public async json(): Promise { - const text = await this.text(); - return JSON.parse(text); - } - - public [Symbol.asyncIterator](): AsyncIterableIterator { - const readableStream = this.readableStream; - const iterator = readableStream[Symbol.asyncIterator](); - - // Create and return an async iterator that yields buffers - return { - async next(): Promise> { - const { value, done } = await iterator.next(); - return { value: value as Buffer, done }; - }, - [Symbol.asyncIterator]() { - return this; - }, - }; - } -} diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts deleted file mode 100644 index 263af00911f..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ /dev/null @@ -1,243 +0,0 @@ -import { StreamWrapper } from "./chooseStreamWrapper"; - -type EventCallback = (data?: any) => void; - -export class UndiciStreamWrapper - implements StreamWrapper | WritableStream, ReadFormat> -{ - private readableStream: ReadableStream; - private reader: ReadableStreamDefaultReader; - private events: Record; - private paused: boolean; - private resumeCallback: ((value?: unknown) => void) | null; - private encoding: string | null; - - constructor(readableStream: ReadableStream) { - this.readableStream = readableStream; - this.reader = this.readableStream.getReader(); - this.events = { - data: [], - end: [], - error: [], - readable: [], - close: [], - pause: [], - resume: [], - }; - this.paused = false; - this.resumeCallback = null; - this.encoding = null; - } - - public on(event: string, callback: EventCallback): void { - this.events[event]?.push(callback); - } - - public off(event: string, callback: EventCallback): void { - this.events[event] = this.events[event]?.filter((cb) => cb !== callback); - } - - public pipe( - dest: UndiciStreamWrapper | WritableStream - ): UndiciStreamWrapper | WritableStream { - this.on("data", (chunk) => { - if (dest instanceof UndiciStreamWrapper) { - dest._write(chunk); - } else { - const writer = dest.getWriter(); - writer.write(chunk).then(() => writer.releaseLock()); - } - }); - - this.on("end", () => { - if (dest instanceof UndiciStreamWrapper) { - dest._end(); - } else { - const writer = dest.getWriter(); - writer.close(); - } - }); - - this.on("error", (error) => { - if (dest instanceof UndiciStreamWrapper) { - dest._error(error); - } else { - const writer = dest.getWriter(); - writer.abort(error); - } - }); - - this._startReading(); - - return dest; - } - - public pipeTo( - dest: UndiciStreamWrapper | WritableStream - ): UndiciStreamWrapper | WritableStream { - return this.pipe(dest); - } - - public unpipe(dest: UndiciStreamWrapper | WritableStream): void { - this.off("data", (chunk) => { - if (dest instanceof UndiciStreamWrapper) { - dest._write(chunk); - } else { - const writer = dest.getWriter(); - writer.write(chunk).then(() => writer.releaseLock()); - } - }); - - this.off("end", () => { - if (dest instanceof UndiciStreamWrapper) { - dest._end(); - } else { - const writer = dest.getWriter(); - writer.close(); - } - }); - - this.off("error", (error) => { - if (dest instanceof UndiciStreamWrapper) { - dest._error(error); - } else { - const writer = dest.getWriter(); - writer.abort(error); - } - }); - } - - public destroy(error?: Error): void { - this.reader - .cancel(error) - .then(() => { - this._emit("close"); - }) - .catch((err) => { - this._emit("error", err); - }); - } - - public pause(): void { - this.paused = true; - this._emit("pause"); - } - - public resume(): void { - if (this.paused) { - this.paused = false; - this._emit("resume"); - if (this.resumeCallback) { - this.resumeCallback(); - this.resumeCallback = null; - } - } - } - - public get isPaused(): boolean { - return this.paused; - } - - public async read(): Promise { - if (this.paused) { - await new Promise((resolve) => { - this.resumeCallback = resolve; - }); - } - const { done, value } = await this.reader.read(); - if (done) { - return undefined; - } - return value; - } - - public setEncoding(encoding: string): void { - this.encoding = encoding; - } - - public async text(): Promise { - const chunks: BlobPart[] = []; - - while (true) { - const { done, value } = await this.reader.read(); - if (done) { - break; - } - if (value) { - chunks.push(value); - } - } - - const decoder = new TextDecoder(this.encoding || "utf-8"); - return decoder.decode(await new Blob(chunks).arrayBuffer()); - } - - public async json(): Promise { - const text = await this.text(); - return JSON.parse(text); - } - - private _write(chunk: ReadFormat): void { - this._emit("data", chunk); - } - - private _end(): void { - this._emit("end"); - } - - private _error(error: any): void { - this._emit("error", error); - } - - private _emit(event: string, data?: any): void { - if (this.events[event]) { - for (const callback of this.events[event] || []) { - callback(data); - } - } - } - - private async _startReading(): Promise { - try { - this._emit("readable"); - while (true) { - if (this.paused) { - await new Promise((resolve) => { - this.resumeCallback = resolve; - }); - } - const { done, value } = await this.reader.read(); - if (done) { - this._emit("end"); - this._emit("close"); - break; - } - if (value) { - this._emit("data", value); - } - } - } catch (error) { - this._emit("error", error); - } - } - - [Symbol.asyncIterator](): AsyncIterableIterator { - return { - next: async () => { - if (this.paused) { - await new Promise((resolve) => { - this.resumeCallback = resolve; - }); - } - const { done, value } = await this.reader.read(); - if (done) { - return { done: true, value: undefined }; - } - return { done: false, value }; - }, - [Symbol.asyncIterator]() { - return this; - }, - }; - } -} diff --git a/seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts b/seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts deleted file mode 100644 index 2abd6b2ba1c..00000000000 --- a/seed/ts-sdk/inline-types/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { Readable } from "readable-stream"; -import { RUNTIME } from "../../runtime"; - -export type EventCallback = (data?: any) => void; - -export interface StreamWrapper { - setEncoding(encoding?: string): void; - on(event: string, callback: EventCallback): void; - off(event: string, callback: EventCallback): void; - pipe(dest: WritableStream): WritableStream; - pipeTo(dest: WritableStream): WritableStream; - unpipe(dest?: WritableStream): void; - destroy(error?: Error): void; - pause(): void; - resume(): void; - get isPaused(): boolean; - read(): Promise; - text(): Promise; - json(): Promise; - [Symbol.asyncIterator](): AsyncIterableIterator; -} - -export async function chooseStreamWrapper(responseBody: any): Promise>> { - if (RUNTIME.type === "node" && RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { - return new (await import("./Node18UniversalStreamWrapper")).Node18UniversalStreamWrapper( - responseBody as ReadableStream - ); - } else if (RUNTIME.type !== "node" && typeof fetch === "function") { - return new (await import("./UndiciStreamWrapper")).UndiciStreamWrapper(responseBody as ReadableStream); - } else { - return new (await import("./NodePre18StreamWrapper")).NodePre18StreamWrapper(responseBody as Readable); - } -} diff --git a/seed/ts-sdk/inline-types/src/core/index.ts b/seed/ts-sdk/inline-types/src/core/index.ts deleted file mode 100644 index e3006860f4d..00000000000 --- a/seed/ts-sdk/inline-types/src/core/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./fetcher"; -export * from "./runtime"; -export * as serialization from "./schemas"; diff --git a/seed/ts-sdk/inline-types/src/core/runtime/index.ts b/seed/ts-sdk/inline-types/src/core/runtime/index.ts deleted file mode 100644 index 5c76dbb133f..00000000000 --- a/seed/ts-sdk/inline-types/src/core/runtime/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { RUNTIME } from "./runtime"; diff --git a/seed/ts-sdk/inline-types/src/core/runtime/runtime.ts b/seed/ts-sdk/inline-types/src/core/runtime/runtime.ts deleted file mode 100644 index 4d0687e8eb4..00000000000 --- a/seed/ts-sdk/inline-types/src/core/runtime/runtime.ts +++ /dev/null @@ -1,126 +0,0 @@ -interface DenoGlobal { - version: { - deno: string; - }; -} - -interface BunGlobal { - version: string; -} - -declare const Deno: DenoGlobal; -declare const Bun: BunGlobal; - -/** - * A constant that indicates whether the environment the code is running is a Web Browser. - */ -const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; - -/** - * A constant that indicates whether the environment the code is running is a Web Worker. - */ -const isWebWorker = - typeof self === "object" && - // @ts-ignore - typeof self?.importScripts === "function" && - (self.constructor?.name === "DedicatedWorkerGlobalScope" || - self.constructor?.name === "ServiceWorkerGlobalScope" || - self.constructor?.name === "SharedWorkerGlobalScope"); - -/** - * A constant that indicates whether the environment the code is running is Deno. - */ -const isDeno = - typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined"; - -/** - * A constant that indicates whether the environment the code is running is Bun.sh. - */ -const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; - -/** - * A constant that indicates whether the environment the code is running is Node.JS. - */ -const isNode = - typeof process !== "undefined" && - Boolean(process.version) && - Boolean(process.versions?.node) && - // Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions - !isDeno && - !isBun; - -/** - * A constant that indicates whether the environment the code is running is in React-Native. - * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js - */ -const isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative"; - -/** - * A constant that indicates whether the environment the code is running is Cloudflare. - * https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent - */ -const isCloudflare = typeof globalThis !== "undefined" && globalThis?.navigator?.userAgent === "Cloudflare-Workers"; - -/** - * A constant that indicates which environment and version the SDK is running in. - */ -export const RUNTIME: Runtime = evaluateRuntime(); - -export interface Runtime { - type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd"; - version?: string; - parsedVersion?: number; -} - -function evaluateRuntime(): Runtime { - if (isBrowser) { - return { - type: "browser", - version: window.navigator.userAgent, - }; - } - - if (isCloudflare) { - return { - type: "workerd", - }; - } - - if (isWebWorker) { - return { - type: "web-worker", - }; - } - - if (isDeno) { - return { - type: "deno", - version: Deno.version.deno, - }; - } - - if (isBun) { - return { - type: "bun", - version: Bun.version, - }; - } - - if (isNode) { - return { - type: "node", - version: process.versions.node, - parsedVersion: Number(process.versions.node.split(".")[0]), - }; - } - - if (isReactNative) { - return { - type: "react-native", - }; - } - - return { - type: "unknown", - }; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/Schema.ts b/seed/ts-sdk/inline-types/src/core/schemas/Schema.ts deleted file mode 100644 index 2a72eacec99..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/Schema.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { SchemaUtils } from "./builders"; - -export type Schema = BaseSchema & SchemaUtils; - -export type inferRaw = S extends Schema ? Raw : never; -export type inferParsed = S extends Schema ? Parsed : never; - -export interface BaseSchema { - parse: (raw: unknown, opts?: SchemaOptions) => MaybeValid; - json: (parsed: unknown, opts?: SchemaOptions) => MaybeValid; - getType: () => SchemaType | SchemaType; -} - -export const SchemaType = { - BIGINT: "bigint", - DATE: "date", - ENUM: "enum", - LIST: "list", - STRING_LITERAL: "stringLiteral", - BOOLEAN_LITERAL: "booleanLiteral", - OBJECT: "object", - ANY: "any", - BOOLEAN: "boolean", - NUMBER: "number", - STRING: "string", - UNKNOWN: "unknown", - RECORD: "record", - SET: "set", - UNION: "union", - UNDISCRIMINATED_UNION: "undiscriminatedUnion", - OPTIONAL: "optional", -} as const; -export type SchemaType = typeof SchemaType[keyof typeof SchemaType]; - -export type MaybeValid = Valid | Invalid; - -export interface Valid { - ok: true; - value: T; -} - -export interface Invalid { - ok: false; - errors: ValidationError[]; -} - -export interface ValidationError { - path: string[]; - message: string; -} - -export interface SchemaOptions { - /** - * how to handle unrecognized keys in objects - * - * @default "fail" - */ - unrecognizedObjectKeys?: "fail" | "passthrough" | "strip"; - - /** - * whether to fail when an unrecognized discriminant value is - * encountered in a union - * - * @default false - */ - allowUnrecognizedUnionMembers?: boolean; - - /** - * whether to fail when an unrecognized enum value is encountered - * - * @default false - */ - allowUnrecognizedEnumValues?: boolean; - - /** - * whether to allow data that doesn't conform to the schema. - * invalid data is passed through without transformation. - * - * when this is enabled, .parse() and .json() will always - * return `ok: true`. `.parseOrThrow()` and `.jsonOrThrow()` - * will never fail. - * - * @default false - */ - skipValidation?: boolean; - - /** - * each validation failure contains a "path" property, which is - * the breadcrumbs to the offending node in the JSON. you can supply - * a prefix that is prepended to all the errors' paths. this can be - * helpful for zurg's internal debug logging. - */ - breadcrumbsPrefix?: string[]; - - /** - * whether to send 'null' for optional properties explicitly set to 'undefined'. - */ - omitUndefined?: boolean; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/bigint/bigint.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/bigint/bigint.ts deleted file mode 100644 index dc9c742e007..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/bigint/bigint.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; - -export function bigint(): Schema { - const baseSchema: BaseSchema = { - parse: (raw, { breadcrumbsPrefix = [] } = {}) => { - if (typeof raw !== "string") { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(raw, "string"), - }, - ], - }; - } - return { - ok: true, - value: BigInt(raw), - }; - }, - json: (bigint, { breadcrumbsPrefix = [] } = {}) => { - if (typeof bigint === "bigint") { - return { - ok: true, - value: bigint.toString(), - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(bigint, "bigint"), - }, - ], - }; - } - }, - getType: () => SchemaType.BIGINT, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/bigint/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/bigint/index.ts deleted file mode 100644 index e5843043fcb..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/bigint/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { bigint } from "./bigint"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/date/date.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/date/date.ts deleted file mode 100644 index b70f24b045a..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/date/date.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; - -// https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime -const ISO_8601_REGEX = - /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/; - -export function date(): Schema { - const baseSchema: BaseSchema = { - parse: (raw, { breadcrumbsPrefix = [] } = {}) => { - if (typeof raw !== "string") { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(raw, "string"), - }, - ], - }; - } - if (!ISO_8601_REGEX.test(raw)) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(raw, "ISO 8601 date string"), - }, - ], - }; - } - return { - ok: true, - value: new Date(raw), - }; - }, - json: (date, { breadcrumbsPrefix = [] } = {}) => { - if (date instanceof Date) { - return { - ok: true, - value: date.toISOString(), - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(date, "Date object"), - }, - ], - }; - } - }, - getType: () => SchemaType.DATE, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/date/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/date/index.ts deleted file mode 100644 index 187b29040f6..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/date/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { date } from "./date"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/enum/enum.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/enum/enum.ts deleted file mode 100644 index c1e24d69dec..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/enum/enum.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Schema, SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; - -export function enum_(values: E): Schema { - const validValues = new Set(values); - - const schemaCreator = createIdentitySchemaCreator( - SchemaType.ENUM, - (value, { allowUnrecognizedEnumValues, breadcrumbsPrefix = [] } = {}) => { - if (typeof value !== "string") { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "string"), - }, - ], - }; - } - - if (!validValues.has(value) && !allowUnrecognizedEnumValues) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "enum"), - }, - ], - }; - } - - return { - ok: true, - value: value as U, - }; - } - ); - - return schemaCreator(); -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/enum/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/enum/index.ts deleted file mode 100644 index fe6faed93e3..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/enum/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { enum_ } from "./enum"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/index.ts deleted file mode 100644 index 65211f92522..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -export * from "./bigint"; -export * from "./date"; -export * from "./enum"; -export * from "./lazy"; -export * from "./list"; -export * from "./literals"; -export * from "./object"; -export * from "./object-like"; -export * from "./primitives"; -export * from "./record"; -export * from "./schema-utils"; -export * from "./set"; -export * from "./undiscriminated-union"; -export * from "./union"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/lazy/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/lazy/index.ts deleted file mode 100644 index 77420fb031c..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/lazy/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { lazy } from "./lazy"; -export type { SchemaGetter } from "./lazy"; -export { lazyObject } from "./lazyObject"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/lazy/lazy.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/lazy/lazy.ts deleted file mode 100644 index 835c61f8a56..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/lazy/lazy.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { BaseSchema, Schema } from "../../Schema"; -import { getSchemaUtils } from "../schema-utils"; - -export type SchemaGetter> = () => SchemaType; - -export function lazy(getter: SchemaGetter>): Schema { - const baseSchema = constructLazyBaseSchema(getter); - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - }; -} - -export function constructLazyBaseSchema( - getter: SchemaGetter> -): BaseSchema { - return { - parse: (raw, opts) => getMemoizedSchema(getter).parse(raw, opts), - json: (parsed, opts) => getMemoizedSchema(getter).json(parsed, opts), - getType: () => getMemoizedSchema(getter).getType(), - }; -} - -type MemoizedGetter> = SchemaGetter & { __zurg_memoized?: SchemaType }; - -export function getMemoizedSchema>(getter: SchemaGetter): SchemaType { - const castedGetter = getter as MemoizedGetter; - if (castedGetter.__zurg_memoized == null) { - castedGetter.__zurg_memoized = getter(); - } - return castedGetter.__zurg_memoized; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/lazy/lazyObject.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/lazy/lazyObject.ts deleted file mode 100644 index 38c9e28404b..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/lazy/lazyObject.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { getObjectUtils } from "../object"; -import { getObjectLikeUtils } from "../object-like"; -import { BaseObjectSchema, ObjectSchema } from "../object/types"; -import { getSchemaUtils } from "../schema-utils"; -import { constructLazyBaseSchema, getMemoizedSchema, SchemaGetter } from "./lazy"; - -export function lazyObject(getter: SchemaGetter>): ObjectSchema { - const baseSchema: BaseObjectSchema = { - ...constructLazyBaseSchema(getter), - _getRawProperties: () => getMemoizedSchema(getter)._getRawProperties(), - _getParsedProperties: () => getMemoizedSchema(getter)._getParsedProperties(), - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - ...getObjectUtils(baseSchema), - }; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/list/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/list/index.ts deleted file mode 100644 index 25f4bcc1737..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/list/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { list } from "./list"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/list/list.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/list/list.ts deleted file mode 100644 index e4c5c4a4a99..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/list/list.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { BaseSchema, MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; - -export function list(schema: Schema): Schema { - const baseSchema: BaseSchema = { - parse: (raw, opts) => - validateAndTransformArray(raw, (item, index) => - schema.parse(item, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `[${index}]`], - }) - ), - json: (parsed, opts) => - validateAndTransformArray(parsed, (item, index) => - schema.json(item, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `[${index}]`], - }) - ), - getType: () => SchemaType.LIST, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} - -function validateAndTransformArray( - value: unknown, - transformItem: (item: Raw, index: number) => MaybeValid -): MaybeValid { - if (!Array.isArray(value)) { - return { - ok: false, - errors: [ - { - message: getErrorMessageForIncorrectType(value, "list"), - path: [], - }, - ], - }; - } - - const maybeValidItems = value.map((item, index) => transformItem(item, index)); - - return maybeValidItems.reduce>( - (acc, item) => { - if (acc.ok && item.ok) { - return { - ok: true, - value: [...acc.value, item.value], - }; - } - - const errors: ValidationError[] = []; - if (!acc.ok) { - errors.push(...acc.errors); - } - if (!item.ok) { - errors.push(...item.errors); - } - - return { - ok: false, - errors, - }; - }, - { ok: true, value: [] } - ); -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/literals/booleanLiteral.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/literals/booleanLiteral.ts deleted file mode 100644 index a83d22cd48a..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/literals/booleanLiteral.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Schema, SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; - -export function booleanLiteral(literal: V): Schema { - const schemaCreator = createIdentitySchemaCreator( - SchemaType.BOOLEAN_LITERAL, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (value === literal) { - return { - ok: true, - value: literal, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, `${literal.toString()}`), - }, - ], - }; - } - } - ); - - return schemaCreator(); -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/literals/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/literals/index.ts deleted file mode 100644 index d2bf08fc6ca..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/literals/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { stringLiteral } from "./stringLiteral"; -export { booleanLiteral } from "./booleanLiteral"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/literals/stringLiteral.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/literals/stringLiteral.ts deleted file mode 100644 index 3939b76b48d..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/literals/stringLiteral.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Schema, SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; - -export function stringLiteral(literal: V): Schema { - const schemaCreator = createIdentitySchemaCreator( - SchemaType.STRING_LITERAL, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (value === literal) { - return { - ok: true, - value: literal, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, `"${literal}"`), - }, - ], - }; - } - } - ); - - return schemaCreator(); -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/object-like/getObjectLikeUtils.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/object-like/getObjectLikeUtils.ts deleted file mode 100644 index 8331d08da89..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/object-like/getObjectLikeUtils.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { BaseSchema } from "../../Schema"; -import { filterObject } from "../../utils/filterObject"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { isPlainObject } from "../../utils/isPlainObject"; -import { getSchemaUtils } from "../schema-utils"; -import { ObjectLikeSchema, ObjectLikeUtils } from "./types"; - -export function getObjectLikeUtils(schema: BaseSchema): ObjectLikeUtils { - return { - withParsedProperties: (properties) => withParsedProperties(schema, properties), - }; -} - -/** - * object-like utils are defined in one file to resolve issues with circular imports - */ - -export function withParsedProperties( - objectLike: BaseSchema, - properties: { [K in keyof Properties]: Properties[K] | ((parsed: ParsedObjectShape) => Properties[K]) } -): ObjectLikeSchema { - const objectSchema: BaseSchema = { - parse: (raw, opts) => { - const parsedObject = objectLike.parse(raw, opts); - if (!parsedObject.ok) { - return parsedObject; - } - - const additionalProperties = Object.entries(properties).reduce>( - (processed, [key, value]) => { - return { - ...processed, - [key]: typeof value === "function" ? value(parsedObject.value) : value, - }; - }, - {} - ); - - return { - ok: true, - value: { - ...parsedObject.value, - ...(additionalProperties as Properties), - }, - }; - }, - - json: (parsed, opts) => { - if (!isPlainObject(parsed)) { - return { - ok: false, - errors: [ - { - path: opts?.breadcrumbsPrefix ?? [], - message: getErrorMessageForIncorrectType(parsed, "object"), - }, - ], - }; - } - - // strip out added properties - const addedPropertyKeys = new Set(Object.keys(properties)); - const parsedWithoutAddedProperties = filterObject( - parsed, - Object.keys(parsed).filter((key) => !addedPropertyKeys.has(key)) - ); - - return objectLike.json(parsedWithoutAddedProperties as ParsedObjectShape, opts); - }, - - getType: () => objectLike.getType(), - }; - - return { - ...objectSchema, - ...getSchemaUtils(objectSchema), - ...getObjectLikeUtils(objectSchema), - }; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/object-like/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/object-like/index.ts deleted file mode 100644 index c342e72cf9d..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/object-like/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { getObjectLikeUtils, withParsedProperties } from "./getObjectLikeUtils"; -export type { ObjectLikeSchema, ObjectLikeUtils } from "./types"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/object-like/types.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/object-like/types.ts deleted file mode 100644 index 75b3698729c..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/object-like/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BaseSchema, Schema } from "../../Schema"; - -export type ObjectLikeSchema = Schema & - BaseSchema & - ObjectLikeUtils; - -export interface ObjectLikeUtils { - withParsedProperties: >(properties: { - [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]); - }) => ObjectLikeSchema; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/object/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/object/index.ts deleted file mode 100644 index e3f4388db28..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/object/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -export { getObjectUtils, object } from "./object"; -export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties"; -export type { - inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas, - inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas, -} from "./objectWithoutOptionalProperties"; -export { isProperty, property } from "./property"; -export type { Property } from "./property"; -export type { - BaseObjectSchema, - inferObjectSchemaFromPropertySchemas, - inferParsedObject, - inferParsedObjectFromPropertySchemas, - inferParsedPropertySchema, - inferRawKey, - inferRawObject, - inferRawObjectFromPropertySchemas, - inferRawPropertySchema, - ObjectSchema, - ObjectUtils, - PropertySchemas, -} from "./types"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/object/object.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/object/object.ts deleted file mode 100644 index 8d40c33c80a..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/object/object.ts +++ /dev/null @@ -1,365 +0,0 @@ -import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; -import { entries } from "../../utils/entries"; -import { filterObject } from "../../utils/filterObject"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { isPlainObject } from "../../utils/isPlainObject"; -import { keys } from "../../utils/keys"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { partition } from "../../utils/partition"; -import { getObjectLikeUtils } from "../object-like"; -import { getSchemaUtils } from "../schema-utils"; -import { isProperty } from "./property"; -import { - BaseObjectSchema, - inferObjectSchemaFromPropertySchemas, - inferParsedObjectFromPropertySchemas, - inferRawObjectFromPropertySchemas, - ObjectSchema, - ObjectUtils, - PropertySchemas, -} from "./types"; - -interface ObjectPropertyWithRawKey { - rawKey: string; - parsedKey: string; - valueSchema: Schema; -} - -export function object>( - schemas: T -): inferObjectSchemaFromPropertySchemas { - const baseSchema: BaseObjectSchema< - inferRawObjectFromPropertySchemas, - inferParsedObjectFromPropertySchemas - > = { - _getRawProperties: () => - Object.entries(schemas).map(([parsedKey, propertySchema]) => - isProperty(propertySchema) ? propertySchema.rawKey : parsedKey - ) as unknown as (keyof inferRawObjectFromPropertySchemas)[], - _getParsedProperties: () => keys(schemas) as unknown as (keyof inferParsedObjectFromPropertySchemas)[], - - parse: (raw, opts) => { - const rawKeyToProperty: Record = {}; - const requiredKeys: string[] = []; - - for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { - const rawKey = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.rawKey : parsedKey; - const valueSchema: Schema = isProperty(schemaOrObjectProperty) - ? schemaOrObjectProperty.valueSchema - : schemaOrObjectProperty; - - const property: ObjectPropertyWithRawKey = { - rawKey, - parsedKey: parsedKey as string, - valueSchema, - }; - - rawKeyToProperty[rawKey] = property; - - if (isSchemaRequired(valueSchema)) { - requiredKeys.push(rawKey); - } - } - - return validateAndTransformObject({ - value: raw, - requiredKeys, - getProperty: (rawKey) => { - const property = rawKeyToProperty[rawKey]; - if (property == null) { - return undefined; - } - return { - transformedKey: property.parsedKey, - transform: (propertyValue) => - property.valueSchema.parse(propertyValue, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawKey], - }), - }; - }, - unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, - skipValidation: opts?.skipValidation, - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - omitUndefined: opts?.omitUndefined, - }); - }, - - json: (parsed, opts) => { - const requiredKeys: string[] = []; - - for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { - const valueSchema: Schema = isProperty(schemaOrObjectProperty) - ? schemaOrObjectProperty.valueSchema - : schemaOrObjectProperty; - - if (isSchemaRequired(valueSchema)) { - requiredKeys.push(parsedKey as string); - } - } - - return validateAndTransformObject({ - value: parsed, - requiredKeys, - getProperty: ( - parsedKey - ): { transformedKey: string; transform: (propertyValue: unknown) => MaybeValid } | undefined => { - const property = schemas[parsedKey as keyof T]; - - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (property == null) { - return undefined; - } - - if (isProperty(property)) { - return { - transformedKey: property.rawKey, - transform: (propertyValue) => - property.valueSchema.json(propertyValue, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], - }), - }; - } else { - return { - transformedKey: parsedKey, - transform: (propertyValue) => - property.json(propertyValue, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], - }), - }; - } - }, - unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, - skipValidation: opts?.skipValidation, - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - omitUndefined: opts?.omitUndefined, - }); - }, - - getType: () => SchemaType.OBJECT, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - ...getObjectUtils(baseSchema), - }; -} - -function validateAndTransformObject({ - value, - requiredKeys, - getProperty, - unrecognizedObjectKeys = "fail", - skipValidation = false, - breadcrumbsPrefix = [], -}: { - value: unknown; - requiredKeys: string[]; - getProperty: ( - preTransformedKey: string - ) => { transformedKey: string; transform: (propertyValue: unknown) => MaybeValid } | undefined; - unrecognizedObjectKeys: "fail" | "passthrough" | "strip" | undefined; - skipValidation: boolean | undefined; - breadcrumbsPrefix: string[] | undefined; - omitUndefined: boolean | undefined; -}): MaybeValid { - if (!isPlainObject(value)) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "object"), - }, - ], - }; - } - - const missingRequiredKeys = new Set(requiredKeys); - const errors: ValidationError[] = []; - const transformed: Record = {}; - - for (const [preTransformedKey, preTransformedItemValue] of Object.entries(value)) { - const property = getProperty(preTransformedKey); - - if (property != null) { - missingRequiredKeys.delete(preTransformedKey); - - const value = property.transform(preTransformedItemValue); - if (value.ok) { - transformed[property.transformedKey] = value.value; - } else { - transformed[preTransformedKey] = preTransformedItemValue; - errors.push(...value.errors); - } - } else { - switch (unrecognizedObjectKeys) { - case "fail": - errors.push({ - path: [...breadcrumbsPrefix, preTransformedKey], - message: `Unexpected key "${preTransformedKey}"`, - }); - break; - case "strip": - break; - case "passthrough": - transformed[preTransformedKey] = preTransformedItemValue; - break; - } - } - } - - errors.push( - ...requiredKeys - .filter((key) => missingRequiredKeys.has(key)) - .map((key) => ({ - path: breadcrumbsPrefix, - message: `Missing required key "${key}"`, - })) - ); - - if (errors.length === 0 || skipValidation) { - return { - ok: true, - value: transformed as Transformed, - }; - } else { - return { - ok: false, - errors, - }; - } -} - -export function getObjectUtils(schema: BaseObjectSchema): ObjectUtils { - return { - extend: (extension: ObjectSchema) => { - const baseSchema: BaseObjectSchema = { - _getParsedProperties: () => [...schema._getParsedProperties(), ...extension._getParsedProperties()], - _getRawProperties: () => [...schema._getRawProperties(), ...extension._getRawProperties()], - parse: (raw, opts) => { - return validateAndTransformExtendedObject({ - extensionKeys: extension._getRawProperties(), - value: raw, - transformBase: (rawBase) => schema.parse(rawBase, opts), - transformExtension: (rawExtension) => extension.parse(rawExtension, opts), - }); - }, - json: (parsed, opts) => { - return validateAndTransformExtendedObject({ - extensionKeys: extension._getParsedProperties(), - value: parsed, - transformBase: (parsedBase) => schema.json(parsedBase, opts), - transformExtension: (parsedExtension) => extension.json(parsedExtension, opts), - }); - }, - getType: () => SchemaType.OBJECT, - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - ...getObjectUtils(baseSchema), - }; - }, - passthrough: () => { - const baseSchema: BaseObjectSchema = - { - _getParsedProperties: () => schema._getParsedProperties(), - _getRawProperties: () => schema._getRawProperties(), - parse: (raw, opts) => { - const transformed = schema.parse(raw, { ...opts, unrecognizedObjectKeys: "passthrough" }); - if (!transformed.ok) { - return transformed; - } - return { - ok: true, - value: { - ...(raw as any), - ...transformed.value, - }, - }; - }, - json: (parsed, opts) => { - const transformed = schema.json(parsed, { ...opts, unrecognizedObjectKeys: "passthrough" }); - if (!transformed.ok) { - return transformed; - } - return { - ok: true, - value: { - ...(parsed as any), - ...transformed.value, - }, - }; - }, - getType: () => SchemaType.OBJECT, - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - ...getObjectUtils(baseSchema), - }; - }, - }; -} - -function validateAndTransformExtendedObject({ - extensionKeys, - value, - transformBase, - transformExtension, -}: { - extensionKeys: (keyof PreTransformedExtension)[]; - value: unknown; - transformBase: (value: unknown) => MaybeValid; - transformExtension: (value: unknown) => MaybeValid; -}): MaybeValid { - const extensionPropertiesSet = new Set(extensionKeys); - const [extensionProperties, baseProperties] = partition(keys(value), (key) => - extensionPropertiesSet.has(key as keyof PreTransformedExtension) - ); - - const transformedBase = transformBase(filterObject(value, baseProperties)); - const transformedExtension = transformExtension(filterObject(value, extensionProperties)); - - if (transformedBase.ok && transformedExtension.ok) { - return { - ok: true, - value: { - ...transformedBase.value, - ...transformedExtension.value, - }, - }; - } else { - return { - ok: false, - errors: [ - ...(transformedBase.ok ? [] : transformedBase.errors), - ...(transformedExtension.ok ? [] : transformedExtension.errors), - ], - }; - } -} - -function isSchemaRequired(schema: Schema): boolean { - return !isSchemaOptional(schema); -} - -function isSchemaOptional(schema: Schema): boolean { - switch (schema.getType()) { - case SchemaType.ANY: - case SchemaType.UNKNOWN: - case SchemaType.OPTIONAL: - return true; - default: - return false; - } -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts deleted file mode 100644 index a0951f48efc..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { object } from "./object"; -import { inferParsedPropertySchema, inferRawObjectFromPropertySchemas, ObjectSchema, PropertySchemas } from "./types"; - -export function objectWithoutOptionalProperties>( - schemas: T -): inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas { - return object(schemas) as unknown as inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas; -} - -export type inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas> = - ObjectSchema< - inferRawObjectFromPropertySchemas, - inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas - >; - -export type inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas> = { - [K in keyof T]: inferParsedPropertySchema; -}; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/object/property.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/object/property.ts deleted file mode 100644 index d245c4b193a..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/object/property.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Schema } from "../../Schema"; - -export function property( - rawKey: RawKey, - valueSchema: Schema -): Property { - return { - rawKey, - valueSchema, - isProperty: true, - }; -} - -export interface Property { - rawKey: RawKey; - valueSchema: Schema; - isProperty: true; -} - -export function isProperty>(maybeProperty: unknown): maybeProperty is O { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - return (maybeProperty as O).isProperty; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/object/types.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/object/types.ts deleted file mode 100644 index 9f87cbb787b..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/object/types.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { BaseSchema, inferParsed, inferRaw, Schema } from "../../Schema"; -import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties"; -import { ObjectLikeUtils } from "../object-like"; -import { SchemaUtils } from "../schema-utils"; -import { Property } from "./property"; - -export type ObjectSchema = BaseObjectSchema & - ObjectLikeUtils & - ObjectUtils & - SchemaUtils; - -export interface BaseObjectSchema extends BaseSchema { - _getRawProperties: () => (keyof Raw)[]; - _getParsedProperties: () => (keyof Parsed)[]; -} - -export interface ObjectUtils { - extend: ( - schemas: ObjectSchema - ) => ObjectSchema; - passthrough: () => ObjectSchema; -} - -export type inferRawObject> = O extends ObjectSchema ? Raw : never; - -export type inferParsedObject> = O extends ObjectSchema - ? Parsed - : never; - -export type inferObjectSchemaFromPropertySchemas> = ObjectSchema< - inferRawObjectFromPropertySchemas, - inferParsedObjectFromPropertySchemas ->; - -export type inferRawObjectFromPropertySchemas> = - addQuestionMarksToNullableProperties<{ - [ParsedKey in keyof T as inferRawKey]: inferRawPropertySchema; - }>; - -export type inferParsedObjectFromPropertySchemas> = - addQuestionMarksToNullableProperties<{ - [K in keyof T]: inferParsedPropertySchema; - }>; - -export type PropertySchemas = Record< - ParsedKeys, - Property | Schema ->; - -export type inferRawPropertySchema

| Schema> = P extends Property< - any, - infer Raw, - any -> - ? Raw - : P extends Schema - ? inferRaw

- : never; - -export type inferParsedPropertySchema

| Schema> = P extends Property< - any, - any, - infer Parsed -> - ? Parsed - : P extends Schema - ? inferParsed

- : never; - -export type inferRawKey< - ParsedKey extends string | number | symbol, - P extends Property | Schema -> = P extends Property ? Raw : ParsedKey; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/any.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/any.ts deleted file mode 100644 index fcaeb04255a..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/any.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; - -export const any = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ ok: true, value })); diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/boolean.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/boolean.ts deleted file mode 100644 index fad60562120..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/boolean.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; - -export const boolean = createIdentitySchemaCreator( - SchemaType.BOOLEAN, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (typeof value === "boolean") { - return { - ok: true, - value, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "boolean"), - }, - ], - }; - } - } -); diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/index.ts deleted file mode 100644 index 788f9416bfe..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { any } from "./any"; -export { boolean } from "./boolean"; -export { number } from "./number"; -export { string } from "./string"; -export { unknown } from "./unknown"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/number.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/number.ts deleted file mode 100644 index c2689456936..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/number.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; - -export const number = createIdentitySchemaCreator( - SchemaType.NUMBER, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (typeof value === "number") { - return { - ok: true, - value, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "number"), - }, - ], - }; - } - } -); diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/string.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/string.ts deleted file mode 100644 index 949f1f2a630..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/string.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; - -export const string = createIdentitySchemaCreator( - SchemaType.STRING, - (value, { breadcrumbsPrefix = [] } = {}) => { - if (typeof value === "string") { - return { - ok: true, - value, - }; - } else { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "string"), - }, - ], - }; - } - } -); diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/unknown.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/unknown.ts deleted file mode 100644 index 4d5249571f5..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/primitives/unknown.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { SchemaType } from "../../Schema"; -import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; - -export const unknown = createIdentitySchemaCreator(SchemaType.UNKNOWN, (value) => ({ ok: true, value })); diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/record/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/record/index.ts deleted file mode 100644 index 82e25c5c2af..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/record/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { record } from "./record"; -export type { BaseRecordSchema, RecordSchema } from "./types"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/record/record.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/record/record.ts deleted file mode 100644 index 6683ac3609f..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/record/record.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; -import { entries } from "../../utils/entries"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { isPlainObject } from "../../utils/isPlainObject"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; -import { BaseRecordSchema, RecordSchema } from "./types"; - -export function record( - keySchema: Schema, - valueSchema: Schema -): RecordSchema { - const baseSchema: BaseRecordSchema = { - parse: (raw, opts) => { - return validateAndTransformRecord({ - value: raw, - isKeyNumeric: keySchema.getType() === SchemaType.NUMBER, - transformKey: (key) => - keySchema.parse(key, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], - }), - transformValue: (value, key) => - valueSchema.parse(value, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], - }), - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - }); - }, - json: (parsed, opts) => { - return validateAndTransformRecord({ - value: parsed, - isKeyNumeric: keySchema.getType() === SchemaType.NUMBER, - transformKey: (key) => - keySchema.json(key, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], - }), - transformValue: (value, key) => - valueSchema.json(value, { - ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], - }), - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - }); - }, - getType: () => SchemaType.RECORD, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} - -function validateAndTransformRecord({ - value, - isKeyNumeric, - transformKey, - transformValue, - breadcrumbsPrefix = [], -}: { - value: unknown; - isKeyNumeric: boolean; - transformKey: (key: string | number) => MaybeValid; - transformValue: (value: unknown, key: string | number) => MaybeValid; - breadcrumbsPrefix: string[] | undefined; -}): MaybeValid> { - if (!isPlainObject(value)) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "object"), - }, - ], - }; - } - - return entries(value).reduce>>( - (accPromise, [stringKey, value]) => { - // skip nullish keys - if (value == null) { - return accPromise; - } - - const acc = accPromise; - - let key: string | number = stringKey; - if (isKeyNumeric) { - const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN; - if (!isNaN(numberKey)) { - key = numberKey; - } - } - const transformedKey = transformKey(key); - - const transformedValue = transformValue(value, key); - - if (acc.ok && transformedKey.ok && transformedValue.ok) { - return { - ok: true, - value: { - ...acc.value, - [transformedKey.value]: transformedValue.value, - }, - }; - } - - const errors: ValidationError[] = []; - if (!acc.ok) { - errors.push(...acc.errors); - } - if (!transformedKey.ok) { - errors.push(...transformedKey.errors); - } - if (!transformedValue.ok) { - errors.push(...transformedValue.errors); - } - - return { - ok: false, - errors, - }; - }, - { ok: true, value: {} as Record } - ); -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/record/types.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/record/types.ts deleted file mode 100644 index eb82cc7f65c..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/record/types.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { BaseSchema } from "../../Schema"; -import { SchemaUtils } from "../schema-utils"; - -export type RecordSchema< - RawKey extends string | number, - RawValue, - ParsedKey extends string | number, - ParsedValue -> = BaseRecordSchema & - SchemaUtils, Record>; - -export type BaseRecordSchema< - RawKey extends string | number, - RawValue, - ParsedKey extends string | number, - ParsedValue -> = BaseSchema, Record>; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/JsonError.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/JsonError.ts deleted file mode 100644 index 2b89ca0e7ad..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/JsonError.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ValidationError } from "../../Schema"; -import { stringifyValidationError } from "./stringifyValidationErrors"; - -export class JsonError extends Error { - constructor(public readonly errors: ValidationError[]) { - super(errors.map(stringifyValidationError).join("; ")); - Object.setPrototypeOf(this, JsonError.prototype); - } -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/ParseError.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/ParseError.ts deleted file mode 100644 index d056eb45cf7..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/ParseError.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ValidationError } from "../../Schema"; -import { stringifyValidationError } from "./stringifyValidationErrors"; - -export class ParseError extends Error { - constructor(public readonly errors: ValidationError[]) { - super(errors.map(stringifyValidationError).join("; ")); - Object.setPrototypeOf(this, ParseError.prototype); - } -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/getSchemaUtils.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/getSchemaUtils.ts deleted file mode 100644 index 79ecad92132..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/getSchemaUtils.ts +++ /dev/null @@ -1,105 +0,0 @@ -import { BaseSchema, Schema, SchemaOptions, SchemaType } from "../../Schema"; -import { JsonError } from "./JsonError"; -import { ParseError } from "./ParseError"; - -export interface SchemaUtils { - optional: () => Schema; - transform: (transformer: SchemaTransformer) => Schema; - parseOrThrow: (raw: unknown, opts?: SchemaOptions) => Parsed; - jsonOrThrow: (raw: unknown, opts?: SchemaOptions) => Raw; -} - -export interface SchemaTransformer { - transform: (parsed: Parsed) => Transformed; - untransform: (transformed: any) => Parsed; -} - -export function getSchemaUtils(schema: BaseSchema): SchemaUtils { - return { - optional: () => optional(schema), - transform: (transformer) => transform(schema, transformer), - parseOrThrow: (raw, opts) => { - const parsed = schema.parse(raw, opts); - if (parsed.ok) { - return parsed.value; - } - throw new ParseError(parsed.errors); - }, - jsonOrThrow: (parsed, opts) => { - const raw = schema.json(parsed, opts); - if (raw.ok) { - return raw.value; - } - throw new JsonError(raw.errors); - }, - }; -} - -/** - * schema utils are defined in one file to resolve issues with circular imports - */ - -export function optional( - schema: BaseSchema -): Schema { - const baseSchema: BaseSchema = { - parse: (raw, opts) => { - if (raw == null) { - return { - ok: true, - value: undefined, - }; - } - return schema.parse(raw, opts); - }, - json: (parsed, opts) => { - if (opts?.omitUndefined && parsed === undefined) { - return { - ok: true, - value: undefined, - }; - } - if (parsed == null) { - return { - ok: true, - value: null, - }; - } - return schema.json(parsed, opts); - }, - getType: () => SchemaType.OPTIONAL, - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - }; -} - -export function transform( - schema: BaseSchema, - transformer: SchemaTransformer -): Schema { - const baseSchema: BaseSchema = { - parse: (raw, opts) => { - const parsed = schema.parse(raw, opts); - if (!parsed.ok) { - return parsed; - } - return { - ok: true, - value: transformer.transform(parsed.value), - }; - }, - json: (transformed, opts) => { - const parsed = transformer.untransform(transformed); - return schema.json(parsed, opts); - }, - getType: () => schema.getType(), - }; - - return { - ...baseSchema, - ...getSchemaUtils(baseSchema), - }; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/index.ts deleted file mode 100644 index aa04e051dfa..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { getSchemaUtils, optional, transform } from "./getSchemaUtils"; -export type { SchemaUtils } from "./getSchemaUtils"; -export { JsonError } from "./JsonError"; -export { ParseError } from "./ParseError"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts deleted file mode 100644 index 4160f0a2617..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ValidationError } from "../../Schema"; - -export function stringifyValidationError(error: ValidationError): string { - if (error.path.length === 0) { - return error.message; - } - return `${error.path.join(" -> ")}: ${error.message}`; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/set/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/set/index.ts deleted file mode 100644 index f3310e8bdad..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/set/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { set } from "./set"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/set/set.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/set/set.ts deleted file mode 100644 index e9e6bb7e539..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/set/set.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { BaseSchema, Schema, SchemaType } from "../../Schema"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { list } from "../list"; -import { getSchemaUtils } from "../schema-utils"; - -export function set(schema: Schema): Schema> { - const listSchema = list(schema); - const baseSchema: BaseSchema> = { - parse: (raw, opts) => { - const parsedList = listSchema.parse(raw, opts); - if (parsedList.ok) { - return { - ok: true, - value: new Set(parsedList.value), - }; - } else { - return parsedList; - } - }, - json: (parsed, opts) => { - if (!(parsed instanceof Set)) { - return { - ok: false, - errors: [ - { - path: opts?.breadcrumbsPrefix ?? [], - message: getErrorMessageForIncorrectType(parsed, "Set"), - }, - ], - }; - } - const jsonList = listSchema.json([...parsed], opts); - return jsonList; - }, - getType: () => SchemaType.SET, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/undiscriminated-union/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/undiscriminated-union/index.ts deleted file mode 100644 index 75b71cb3565..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/undiscriminated-union/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type { - inferParsedUnidiscriminatedUnionSchema, - inferRawUnidiscriminatedUnionSchema, - UndiscriminatedUnionSchema, -} from "./types"; -export { undiscriminatedUnion } from "./undiscriminatedUnion"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/undiscriminated-union/types.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/undiscriminated-union/types.ts deleted file mode 100644 index 43e7108a060..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/undiscriminated-union/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { inferParsed, inferRaw, Schema } from "../../Schema"; - -export type UndiscriminatedUnionSchema = Schema< - inferRawUnidiscriminatedUnionSchema, - inferParsedUnidiscriminatedUnionSchema ->; - -export type inferRawUnidiscriminatedUnionSchema = inferRaw; - -export type inferParsedUnidiscriminatedUnionSchema = inferParsed; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts deleted file mode 100644 index 21ed3df0f40..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType, ValidationError } from "../../Schema"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils"; -import { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types"; - -export function undiscriminatedUnion, ...Schema[]]>( - schemas: Schemas -): Schema, inferParsedUnidiscriminatedUnionSchema> { - const baseSchema: BaseSchema< - inferRawUnidiscriminatedUnionSchema, - inferParsedUnidiscriminatedUnionSchema - > = { - parse: (raw, opts) => { - return validateAndTransformUndiscriminatedUnion>( - (schema, opts) => schema.parse(raw, opts), - schemas, - opts - ); - }, - json: (parsed, opts) => { - return validateAndTransformUndiscriminatedUnion>( - (schema, opts) => schema.json(parsed, opts), - schemas, - opts - ); - }, - getType: () => SchemaType.UNDISCRIMINATED_UNION, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; -} - -function validateAndTransformUndiscriminatedUnion( - transform: (schema: Schema, opts: SchemaOptions) => MaybeValid, - schemas: Schema[], - opts: SchemaOptions | undefined -): MaybeValid { - const errors: ValidationError[] = []; - for (const [index, schema] of schemas.entries()) { - const transformed = transform(schema, { ...opts, skipValidation: false }); - if (transformed.ok) { - return transformed; - } else { - for (const error of transformed.errors) { - errors.push({ - path: error.path, - message: `[Variant ${index}] ${error.message}`, - }); - } - } - } - - return { - ok: false, - errors, - }; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/union/discriminant.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/union/discriminant.ts deleted file mode 100644 index 55065bc8946..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/union/discriminant.ts +++ /dev/null @@ -1,14 +0,0 @@ -export function discriminant( - parsedDiscriminant: ParsedDiscriminant, - rawDiscriminant: RawDiscriminant -): Discriminant { - return { - parsedDiscriminant, - rawDiscriminant, - }; -} - -export interface Discriminant { - parsedDiscriminant: ParsedDiscriminant; - rawDiscriminant: RawDiscriminant; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/union/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/union/index.ts deleted file mode 100644 index 85fc008a2d8..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/union/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -export { discriminant } from "./discriminant"; -export type { Discriminant } from "./discriminant"; -export type { - inferParsedDiscriminant, - inferParsedUnion, - inferRawDiscriminant, - inferRawUnion, - UnionSubtypes, -} from "./types"; -export { union } from "./union"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/union/types.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/union/types.ts deleted file mode 100644 index 6f82c868b2d..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/union/types.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { inferParsedObject, inferRawObject, ObjectSchema } from "../object"; -import { Discriminant } from "./discriminant"; - -export type UnionSubtypes = { - [K in DiscriminantValues]: ObjectSchema; -}; - -export type inferRawUnion, U extends UnionSubtypes> = { - [K in keyof U]: Record, K> & inferRawObject; -}[keyof U]; - -export type inferParsedUnion, U extends UnionSubtypes> = { - [K in keyof U]: Record, K> & inferParsedObject; -}[keyof U]; - -export type inferRawDiscriminant> = D extends string - ? D - : D extends Discriminant - ? Raw - : never; - -export type inferParsedDiscriminant> = D extends string - ? D - : D extends Discriminant - ? Parsed - : never; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/builders/union/union.ts b/seed/ts-sdk/inline-types/src/core/schemas/builders/union/union.ts deleted file mode 100644 index ab61475a572..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/builders/union/union.ts +++ /dev/null @@ -1,170 +0,0 @@ -import { BaseSchema, MaybeValid, SchemaType } from "../../Schema"; -import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -import { isPlainObject } from "../../utils/isPlainObject"; -import { keys } from "../../utils/keys"; -import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { enum_ } from "../enum"; -import { ObjectSchema } from "../object"; -import { getObjectLikeUtils, ObjectLikeSchema } from "../object-like"; -import { getSchemaUtils } from "../schema-utils"; -import { Discriminant } from "./discriminant"; -import { inferParsedDiscriminant, inferParsedUnion, inferRawDiscriminant, inferRawUnion, UnionSubtypes } from "./types"; - -export function union, U extends UnionSubtypes>( - discriminant: D, - union: U -): ObjectLikeSchema, inferParsedUnion> { - const rawDiscriminant = - typeof discriminant === "string" ? discriminant : (discriminant.rawDiscriminant as inferRawDiscriminant); - const parsedDiscriminant = - typeof discriminant === "string" - ? discriminant - : (discriminant.parsedDiscriminant as inferParsedDiscriminant); - - const discriminantValueSchema = enum_(keys(union) as string[]); - - const baseSchema: BaseSchema, inferParsedUnion> = { - parse: (raw, opts) => { - return transformAndValidateUnion({ - value: raw, - discriminant: rawDiscriminant, - transformedDiscriminant: parsedDiscriminant, - transformDiscriminantValue: (discriminantValue) => - discriminantValueSchema.parse(discriminantValue, { - allowUnrecognizedEnumValues: opts?.allowUnrecognizedUnionMembers, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawDiscriminant], - }), - getAdditionalPropertiesSchema: (discriminantValue) => union[discriminantValue], - allowUnrecognizedUnionMembers: opts?.allowUnrecognizedUnionMembers, - transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => - additionalPropertiesSchema.parse(additionalProperties, opts), - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - }); - }, - json: (parsed, opts) => { - return transformAndValidateUnion({ - value: parsed, - discriminant: parsedDiscriminant, - transformedDiscriminant: rawDiscriminant, - transformDiscriminantValue: (discriminantValue) => - discriminantValueSchema.json(discriminantValue, { - allowUnrecognizedEnumValues: opts?.allowUnrecognizedUnionMembers, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedDiscriminant], - }), - getAdditionalPropertiesSchema: (discriminantValue) => union[discriminantValue], - allowUnrecognizedUnionMembers: opts?.allowUnrecognizedUnionMembers, - transformAdditionalProperties: (additionalProperties, additionalPropertiesSchema) => - additionalPropertiesSchema.json(additionalProperties, opts), - breadcrumbsPrefix: opts?.breadcrumbsPrefix, - }); - }, - getType: () => SchemaType.UNION, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - ...getObjectLikeUtils(baseSchema), - }; -} - -function transformAndValidateUnion< - TransformedDiscriminant extends string, - TransformedDiscriminantValue extends string, - TransformedAdditionalProperties ->({ - value, - discriminant, - transformedDiscriminant, - transformDiscriminantValue, - getAdditionalPropertiesSchema, - allowUnrecognizedUnionMembers = false, - transformAdditionalProperties, - breadcrumbsPrefix = [], -}: { - value: unknown; - discriminant: string; - transformedDiscriminant: TransformedDiscriminant; - transformDiscriminantValue: (discriminantValue: unknown) => MaybeValid; - getAdditionalPropertiesSchema: (discriminantValue: string) => ObjectSchema | undefined; - allowUnrecognizedUnionMembers: boolean | undefined; - transformAdditionalProperties: ( - additionalProperties: unknown, - additionalPropertiesSchema: ObjectSchema - ) => MaybeValid; - breadcrumbsPrefix: string[] | undefined; -}): MaybeValid & TransformedAdditionalProperties> { - if (!isPlainObject(value)) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: getErrorMessageForIncorrectType(value, "object"), - }, - ], - }; - } - - const { [discriminant]: discriminantValue, ...additionalProperties } = value; - - if (discriminantValue == null) { - return { - ok: false, - errors: [ - { - path: breadcrumbsPrefix, - message: `Missing discriminant ("${discriminant}")`, - }, - ], - }; - } - - const transformedDiscriminantValue = transformDiscriminantValue(discriminantValue); - if (!transformedDiscriminantValue.ok) { - return { - ok: false, - errors: transformedDiscriminantValue.errors, - }; - } - - const additionalPropertiesSchema = getAdditionalPropertiesSchema(transformedDiscriminantValue.value); - - if (additionalPropertiesSchema == null) { - if (allowUnrecognizedUnionMembers) { - return { - ok: true, - value: { - [transformedDiscriminant]: transformedDiscriminantValue.value, - ...additionalProperties, - } as Record & TransformedAdditionalProperties, - }; - } else { - return { - ok: false, - errors: [ - { - path: [...breadcrumbsPrefix, discriminant], - message: "Unexpected discriminant value", - }, - ], - }; - } - } - - const transformedAdditionalProperties = transformAdditionalProperties( - additionalProperties, - additionalPropertiesSchema - ); - if (!transformedAdditionalProperties.ok) { - return transformedAdditionalProperties; - } - - return { - ok: true, - value: { - [transformedDiscriminant]: discriminantValue, - ...transformedAdditionalProperties.value, - } as Record & TransformedAdditionalProperties, - }; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/index.ts b/seed/ts-sdk/inline-types/src/core/schemas/index.ts deleted file mode 100644 index 5429d8b43eb..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./builders"; -export type { inferParsed, inferRaw, Schema, SchemaOptions } from "./Schema"; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/utils/MaybePromise.ts b/seed/ts-sdk/inline-types/src/core/schemas/utils/MaybePromise.ts deleted file mode 100644 index 9cd354b3418..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/utils/MaybePromise.ts +++ /dev/null @@ -1 +0,0 @@ -export type MaybePromise = T | Promise; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/utils/addQuestionMarksToNullableProperties.ts b/seed/ts-sdk/inline-types/src/core/schemas/utils/addQuestionMarksToNullableProperties.ts deleted file mode 100644 index 4111d703cd0..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/utils/addQuestionMarksToNullableProperties.ts +++ /dev/null @@ -1,15 +0,0 @@ -export type addQuestionMarksToNullableProperties = { - [K in OptionalKeys]?: T[K]; -} & Pick>; - -export type OptionalKeys = { - [K in keyof T]-?: undefined extends T[K] - ? K - : null extends T[K] - ? K - : 1 extends (any extends T[K] ? 0 : 1) - ? never - : K; -}[keyof T]; - -export type RequiredKeys = Exclude>; diff --git a/seed/ts-sdk/inline-types/src/core/schemas/utils/createIdentitySchemaCreator.ts b/seed/ts-sdk/inline-types/src/core/schemas/utils/createIdentitySchemaCreator.ts deleted file mode 100644 index de107cf5ee1..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/utils/createIdentitySchemaCreator.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { getSchemaUtils } from "../builders/schema-utils"; -import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema"; -import { maybeSkipValidation } from "./maybeSkipValidation"; - -export function createIdentitySchemaCreator( - schemaType: SchemaType, - validate: (value: unknown, opts?: SchemaOptions) => MaybeValid -): () => Schema { - return () => { - const baseSchema: BaseSchema = { - parse: validate, - json: validate, - getType: () => schemaType, - }; - - return { - ...maybeSkipValidation(baseSchema), - ...getSchemaUtils(baseSchema), - }; - }; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/utils/entries.ts b/seed/ts-sdk/inline-types/src/core/schemas/utils/entries.ts deleted file mode 100644 index e122952137d..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/utils/entries.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function entries(object: T): [keyof T, T[keyof T]][] { - return Object.entries(object) as [keyof T, T[keyof T]][]; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/utils/filterObject.ts b/seed/ts-sdk/inline-types/src/core/schemas/utils/filterObject.ts deleted file mode 100644 index 2c25a3455bc..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/utils/filterObject.ts +++ /dev/null @@ -1,10 +0,0 @@ -export function filterObject(obj: T, keysToInclude: K[]): Pick { - const keysToIncludeSet = new Set(keysToInclude); - return Object.entries(obj).reduce((acc, [key, value]) => { - if (keysToIncludeSet.has(key as K)) { - acc[key as K] = value; - } - return acc; - // eslint-disable-next-line @typescript-eslint/prefer-reduce-type-parameter - }, {} as Pick); -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/utils/getErrorMessageForIncorrectType.ts b/seed/ts-sdk/inline-types/src/core/schemas/utils/getErrorMessageForIncorrectType.ts deleted file mode 100644 index 1a5c31027ce..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/utils/getErrorMessageForIncorrectType.ts +++ /dev/null @@ -1,25 +0,0 @@ -export function getErrorMessageForIncorrectType(value: unknown, expectedType: string): string { - return `Expected ${expectedType}. Received ${getTypeAsString(value)}.`; -} - -function getTypeAsString(value: unknown): string { - if (Array.isArray(value)) { - return "list"; - } - if (value === null) { - return "null"; - } - if (value instanceof BigInt) { - return "BigInt"; - } - switch (typeof value) { - case "string": - return `"${value}"`; - case "bigint": - case "number": - case "boolean": - case "undefined": - return `${value}`; - } - return typeof value; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/utils/isPlainObject.ts b/seed/ts-sdk/inline-types/src/core/schemas/utils/isPlainObject.ts deleted file mode 100644 index db82a722c35..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/utils/isPlainObject.ts +++ /dev/null @@ -1,17 +0,0 @@ -// borrowed from https://github.com/lodash/lodash/blob/master/isPlainObject.js -export function isPlainObject(value: unknown): value is Record { - if (typeof value !== "object" || value === null) { - return false; - } - - if (Object.getPrototypeOf(value) === null) { - return true; - } - - let proto = value; - while (Object.getPrototypeOf(proto) !== null) { - proto = Object.getPrototypeOf(proto); - } - - return Object.getPrototypeOf(value) === proto; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/utils/keys.ts b/seed/ts-sdk/inline-types/src/core/schemas/utils/keys.ts deleted file mode 100644 index 01867098287..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/utils/keys.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function keys(object: T): (keyof T)[] { - return Object.keys(object) as (keyof T)[]; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/utils/maybeSkipValidation.ts b/seed/ts-sdk/inline-types/src/core/schemas/utils/maybeSkipValidation.ts deleted file mode 100644 index 86c07abf2b4..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/utils/maybeSkipValidation.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { BaseSchema, MaybeValid, SchemaOptions } from "../Schema"; - -export function maybeSkipValidation, Raw, Parsed>(schema: S): S { - return { - ...schema, - json: transformAndMaybeSkipValidation(schema.json), - parse: transformAndMaybeSkipValidation(schema.parse), - }; -} - -function transformAndMaybeSkipValidation( - transform: (value: unknown, opts?: SchemaOptions) => MaybeValid -): (value: unknown, opts?: SchemaOptions) => MaybeValid { - return (value, opts): MaybeValid => { - const transformed = transform(value, opts); - const { skipValidation = false } = opts ?? {}; - if (!transformed.ok && skipValidation) { - // eslint-disable-next-line no-console - console.warn( - [ - "Failed to validate.", - ...transformed.errors.map( - (error) => - " - " + - (error.path.length > 0 ? `${error.path.join(".")}: ${error.message}` : error.message) - ), - ].join("\n") - ); - - return { - ok: true, - value: value as T, - }; - } else { - return transformed; - } - }; -} diff --git a/seed/ts-sdk/inline-types/src/core/schemas/utils/partition.ts b/seed/ts-sdk/inline-types/src/core/schemas/utils/partition.ts deleted file mode 100644 index f58d6f3d35f..00000000000 --- a/seed/ts-sdk/inline-types/src/core/schemas/utils/partition.ts +++ /dev/null @@ -1,12 +0,0 @@ -export function partition(items: readonly T[], predicate: (item: T) => boolean): [T[], T[]] { - const trueItems: T[] = [], - falseItems: T[] = []; - for (const item of items) { - if (predicate(item)) { - trueItems.push(item); - } else { - falseItems.push(item); - } - } - return [trueItems, falseItems]; -} diff --git a/seed/ts-sdk/inline-types/src/errors/SeedObjectError.ts b/seed/ts-sdk/inline-types/src/errors/SeedObjectError.ts deleted file mode 100644 index 489ad43d19e..00000000000 --- a/seed/ts-sdk/inline-types/src/errors/SeedObjectError.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export class SeedObjectError extends Error { - readonly statusCode?: number; - readonly body?: unknown; - - constructor({ message, statusCode, body }: { message?: string; statusCode?: number; body?: unknown }) { - super(buildMessage({ message, statusCode, body })); - Object.setPrototypeOf(this, SeedObjectError.prototype); - if (statusCode != null) { - this.statusCode = statusCode; - } - - if (body !== undefined) { - this.body = body; - } - } -} - -function buildMessage({ - message, - statusCode, - body, -}: { - message: string | undefined; - statusCode: number | undefined; - body: unknown | undefined; -}): string { - let lines: string[] = []; - if (message != null) { - lines.push(message); - } - - if (statusCode != null) { - lines.push(`Status code: ${statusCode.toString()}`); - } - - if (body != null) { - lines.push(`Body: ${JSON.stringify(body, undefined, 2)}`); - } - - return lines.join("\n"); -} diff --git a/seed/ts-sdk/inline-types/src/errors/SeedObjectTimeoutError.ts b/seed/ts-sdk/inline-types/src/errors/SeedObjectTimeoutError.ts deleted file mode 100644 index 27e69eb189f..00000000000 --- a/seed/ts-sdk/inline-types/src/errors/SeedObjectTimeoutError.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export class SeedObjectTimeoutError extends Error { - constructor(message: string) { - super(message); - Object.setPrototypeOf(this, SeedObjectTimeoutError.prototype); - } -} diff --git a/seed/ts-sdk/inline-types/src/errors/index.ts b/seed/ts-sdk/inline-types/src/errors/index.ts deleted file mode 100644 index c41ddbbfd72..00000000000 --- a/seed/ts-sdk/inline-types/src/errors/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { SeedObjectError } from "./SeedObjectError"; -export { SeedObjectTimeoutError } from "./SeedObjectTimeoutError"; diff --git a/seed/ts-sdk/inline-types/src/index.ts b/seed/ts-sdk/inline-types/src/index.ts deleted file mode 100644 index bbb7c569b72..00000000000 --- a/seed/ts-sdk/inline-types/src/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * as SeedObject from "./api"; -export { SeedObjectClient } from "./Client"; -export { SeedObjectError, SeedObjectTimeoutError } from "./errors"; diff --git a/seed/ts-sdk/inline-types/src/serialization/client/index.ts b/seed/ts-sdk/inline-types/src/serialization/client/index.ts deleted file mode 100644 index 415726b7fea..00000000000 --- a/seed/ts-sdk/inline-types/src/serialization/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./requests"; diff --git a/seed/ts-sdk/inline-types/src/serialization/client/requests/PostRootRequest.ts b/seed/ts-sdk/inline-types/src/serialization/client/requests/PostRootRequest.ts deleted file mode 100644 index 08cd8c34175..00000000000 --- a/seed/ts-sdk/inline-types/src/serialization/client/requests/PostRootRequest.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../index"; -import * as SeedObject from "../../../api/index"; -import * as core from "../../../core"; -import { InlineType1 } from "../../types/InlineType1"; - -export const PostRootRequest: core.serialization.Schema = - core.serialization.object({ - bar: InlineType1, - foo: core.serialization.string(), - }); - -export declare namespace PostRootRequest { - interface Raw { - bar: InlineType1.Raw; - foo: string; - } -} diff --git a/seed/ts-sdk/inline-types/src/serialization/client/requests/index.ts b/seed/ts-sdk/inline-types/src/serialization/client/requests/index.ts deleted file mode 100644 index 497781074f3..00000000000 --- a/seed/ts-sdk/inline-types/src/serialization/client/requests/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { PostRootRequest } from "./PostRootRequest"; diff --git a/seed/ts-sdk/inline-types/src/serialization/index.ts b/seed/ts-sdk/inline-types/src/serialization/index.ts deleted file mode 100644 index c9240f83b48..00000000000 --- a/seed/ts-sdk/inline-types/src/serialization/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./types"; -export * from "./client"; diff --git a/seed/ts-sdk/inline-types/src/serialization/types/InlineEnum.ts b/seed/ts-sdk/inline-types/src/serialization/types/InlineEnum.ts deleted file mode 100644 index ee1e24ef1f6..00000000000 --- a/seed/ts-sdk/inline-types/src/serialization/types/InlineEnum.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const InlineEnum: core.serialization.Schema = - core.serialization.enum_(["SUNNY", "CLOUDY", "RAINING", "SNOWING"]); - -export declare namespace InlineEnum { - type Raw = "SUNNY" | "CLOUDY" | "RAINING" | "SNOWING"; -} diff --git a/seed/ts-sdk/inline-types/src/serialization/types/InlineType1.ts b/seed/ts-sdk/inline-types/src/serialization/types/InlineType1.ts deleted file mode 100644 index 500f97d9af6..00000000000 --- a/seed/ts-sdk/inline-types/src/serialization/types/InlineType1.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; -import { NestedInlineType1 } from "./NestedInlineType1"; - -export const InlineType1: core.serialization.ObjectSchema = - core.serialization.object({ - foo: core.serialization.string(), - bar: NestedInlineType1, - }); - -export declare namespace InlineType1 { - interface Raw { - foo: string; - bar: NestedInlineType1.Raw; - } -} diff --git a/seed/ts-sdk/inline-types/src/serialization/types/InlineType2.ts b/seed/ts-sdk/inline-types/src/serialization/types/InlineType2.ts deleted file mode 100644 index a2590844567..00000000000 --- a/seed/ts-sdk/inline-types/src/serialization/types/InlineType2.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; - -export const InlineType2: core.serialization.ObjectSchema = - core.serialization.object({ - baz: core.serialization.string(), - }); - -export declare namespace InlineType2 { - interface Raw { - baz: string; - } -} diff --git a/seed/ts-sdk/inline-types/src/serialization/types/InlinedDiscriminatedUnion1.ts b/seed/ts-sdk/inline-types/src/serialization/types/InlinedDiscriminatedUnion1.ts deleted file mode 100644 index 21931514662..00000000000 --- a/seed/ts-sdk/inline-types/src/serialization/types/InlinedDiscriminatedUnion1.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; -import { InlineType1 } from "./InlineType1"; -import { InlineType2 } from "./InlineType2"; - -export const InlinedDiscriminatedUnion1: core.serialization.Schema< - serializers.InlinedDiscriminatedUnion1.Raw, - SeedObject.InlinedDiscriminatedUnion1 -> = core.serialization - .union("type", { - type1: InlineType1, - type2: InlineType2, - }) - .transform({ - transform: (value) => value, - untransform: (value) => value, - }); - -export declare namespace InlinedDiscriminatedUnion1 { - type Raw = InlinedDiscriminatedUnion1.Type1 | InlinedDiscriminatedUnion1.Type2; - - interface Type1 extends InlineType1.Raw { - type: "type1"; - } - - interface Type2 extends InlineType2.Raw { - type: "type2"; - } -} diff --git a/seed/ts-sdk/inline-types/src/serialization/types/InlinedUndiscriminatedUnion1.ts b/seed/ts-sdk/inline-types/src/serialization/types/InlinedUndiscriminatedUnion1.ts deleted file mode 100644 index 828580e64df..00000000000 --- a/seed/ts-sdk/inline-types/src/serialization/types/InlinedUndiscriminatedUnion1.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; -import { InlineType1 } from "./InlineType1"; -import { InlineType2 } from "./InlineType2"; - -export const InlinedUndiscriminatedUnion1: core.serialization.Schema< - serializers.InlinedUndiscriminatedUnion1.Raw, - SeedObject.InlinedUndiscriminatedUnion1 -> = core.serialization.undiscriminatedUnion([InlineType1, InlineType2]); - -export declare namespace InlinedUndiscriminatedUnion1 { - type Raw = InlineType1.Raw | InlineType2.Raw; -} diff --git a/seed/ts-sdk/inline-types/src/serialization/types/NestedInlineType1.ts b/seed/ts-sdk/inline-types/src/serialization/types/NestedInlineType1.ts deleted file mode 100644 index 8378c0a51ae..00000000000 --- a/seed/ts-sdk/inline-types/src/serialization/types/NestedInlineType1.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; -import { InlineEnum } from "./InlineEnum"; - -export const NestedInlineType1: core.serialization.ObjectSchema< - serializers.NestedInlineType1.Raw, - SeedObject.NestedInlineType1 -> = core.serialization.object({ - foo: core.serialization.string(), - bar: core.serialization.string(), - myEnum: InlineEnum, -}); - -export declare namespace NestedInlineType1 { - interface Raw { - foo: string; - bar: string; - myEnum: InlineEnum.Raw; - } -} diff --git a/seed/ts-sdk/inline-types/src/serialization/types/RootType1.ts b/seed/ts-sdk/inline-types/src/serialization/types/RootType1.ts deleted file mode 100644 index cb7851b7e78..00000000000 --- a/seed/ts-sdk/inline-types/src/serialization/types/RootType1.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as SeedObject from "../../api/index"; -import * as core from "../../core"; -import { InlineType1 } from "./InlineType1"; - -export const RootType1: core.serialization.ObjectSchema = - core.serialization.object({ - foo: core.serialization.string(), - bar: InlineType1, - }); - -export declare namespace RootType1 { - interface Raw { - foo: string; - bar: InlineType1.Raw; - } -} diff --git a/seed/ts-sdk/inline-types/src/serialization/types/index.ts b/seed/ts-sdk/inline-types/src/serialization/types/index.ts deleted file mode 100644 index bb183ec944a..00000000000 --- a/seed/ts-sdk/inline-types/src/serialization/types/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from "./RootType1"; -export * from "./InlineType1"; -export * from "./InlineType2"; -export * from "./NestedInlineType1"; -export * from "./InlinedDiscriminatedUnion1"; -export * from "./InlinedUndiscriminatedUnion1"; -export * from "./InlineEnum"; diff --git a/seed/ts-sdk/inline-types/src/version.ts b/seed/ts-sdk/inline-types/src/version.ts deleted file mode 100644 index b643a3e3ea2..00000000000 --- a/seed/ts-sdk/inline-types/src/version.ts +++ /dev/null @@ -1 +0,0 @@ -export const SDK_VERSION = "0.0.1"; diff --git a/seed/ts-sdk/inline-types/tests/custom.test.ts b/seed/ts-sdk/inline-types/tests/custom.test.ts deleted file mode 100644 index 7f5e031c839..00000000000 --- a/seed/ts-sdk/inline-types/tests/custom.test.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * This is a custom test file, if you wish to add more tests - * to your SDK. - * Be sure to mark this file in `.fernignore`. - * - * If you include example requests/responses in your fern definition, - * you will have tests automatically generated for you. - */ -describe("test", () => { - it("default", () => { - expect(true).toBe(true); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/Fetcher.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/Fetcher.test.ts deleted file mode 100644 index ff8042175ff..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/Fetcher.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import fs from "fs"; -import { Fetcher, fetcherImpl } from "../../../src/core/fetcher/Fetcher"; -import { join } from "path"; - -describe("Test fetcherImpl", () => { - it("should handle successful request", async () => { - const mockArgs: Fetcher.Args = { - url: "https://httpbin.org/post", - method: "POST", - headers: { "X-Test": "x-test-header" }, - body: { data: "test" }, - contentType: "application/json", - requestType: "json", - }; - - global.fetch = jest.fn().mockResolvedValue({ - ok: true, - status: 200, - text: () => Promise.resolve(JSON.stringify({ data: "test" })), - json: () => ({ data: "test" }), - }); - - const result = await fetcherImpl(mockArgs); - expect(result.ok).toBe(true); - if (result.ok) { - expect(result.body).toEqual({ data: "test" }); - } - - expect(global.fetch).toHaveBeenCalledWith( - "https://httpbin.org/post", - expect.objectContaining({ - method: "POST", - headers: expect.objectContaining({ "X-Test": "x-test-header" }), - body: JSON.stringify({ data: "test" }), - }) - ); - }); - - it("should send octet stream", async () => { - const url = "https://httpbin.org/post/file"; - const mockArgs: Fetcher.Args = { - url, - method: "POST", - headers: { "X-Test": "x-test-header" }, - contentType: "application/octet-stream", - requestType: "bytes", - duplex: "half", - body: fs.createReadStream(join(__dirname, "test-file.txt")), - }; - - global.fetch = jest.fn().mockResolvedValue({ - ok: true, - status: 200, - text: () => Promise.resolve(JSON.stringify({ data: "test" })), - json: () => Promise.resolve({ data: "test" }), - }); - - const result = await fetcherImpl(mockArgs); - - expect(global.fetch).toHaveBeenCalledWith( - url, - expect.objectContaining({ - method: "POST", - headers: expect.objectContaining({ "X-Test": "x-test-header" }), - body: expect.any(fs.ReadStream), - }) - ); - expect(result.ok).toBe(true); - if (result.ok) { - expect(result.body).toEqual({ data: "test" }); - } - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/createRequestUrl.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/createRequestUrl.test.ts deleted file mode 100644 index f2cd24b6721..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/createRequestUrl.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { createRequestUrl } from "../../../src/core/fetcher/createRequestUrl"; - -describe("Test createRequestUrl", () => { - it("should return the base URL when no query parameters are provided", () => { - const baseUrl = "https://api.example.com"; - expect(createRequestUrl(baseUrl)).toBe(baseUrl); - }); - - it("should append simple query parameters", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { key: "value", another: "param" }; - expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?key=value&another=param"); - }); - - it("should handle array query parameters", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { items: ["a", "b", "c"] }; - expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?items=a&items=b&items=c"); - }); - - it("should handle object query parameters", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { filter: { name: "John", age: 30 } }; - expect(createRequestUrl(baseUrl, queryParams)).toBe( - "https://api.example.com?filter%5Bname%5D=John&filter%5Bage%5D=30" - ); - }); - - it("should handle mixed types of query parameters", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { - simple: "value", - array: ["x", "y"], - object: { key: "value" }, - }; - expect(createRequestUrl(baseUrl, queryParams)).toBe( - "https://api.example.com?simple=value&array=x&array=y&object%5Bkey%5D=value" - ); - }); - - it("should handle empty query parameters object", () => { - const baseUrl = "https://api.example.com"; - expect(createRequestUrl(baseUrl, {})).toBe(baseUrl); - }); - - it("should encode special characters in query parameters", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { special: "a&b=c d" }; - expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?special=a%26b%3Dc%20d"); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/getFetchFn.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/getFetchFn.test.ts deleted file mode 100644 index 9b315ad095a..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/getFetchFn.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { RUNTIME } from "../../../src/core/runtime"; -import { getFetchFn } from "../../../src/core/fetcher/getFetchFn"; - -describe("Test for getFetchFn", () => { - it("should get node-fetch function", async () => { - if (RUNTIME.type == "node") { - if (RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { - expect(await getFetchFn()).toBe(fetch); - } else { - expect(await getFetchFn()).toEqual((await import("node-fetch")).default as any); - } - } - }); - - it("should get fetch function", async () => { - if (RUNTIME.type == "browser") { - const fetchFn = await getFetchFn(); - expect(typeof fetchFn).toBe("function"); - expect(fetchFn.name).toBe("fetch"); - } - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/getRequestBody.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/getRequestBody.test.ts deleted file mode 100644 index 919604c2e12..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/getRequestBody.test.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { RUNTIME } from "../../../src/core/runtime"; -import { getRequestBody } from "../../../src/core/fetcher/getRequestBody"; - -describe("Test getRequestBody", () => { - it("should return FormData as is in Node environment", async () => { - if (RUNTIME.type === "node") { - const formData = new (await import("formdata-node")).FormData(); - formData.append("key", "value"); - const result = await getRequestBody({ - body: formData, - type: "file", - }); - expect(result).toBe(formData); - } - }); - - it("should stringify body if not FormData in Node environment", async () => { - if (RUNTIME.type === "node") { - const body = { key: "value" }; - const result = await getRequestBody({ - body, - type: "json", - }); - expect(result).toBe('{"key":"value"}'); - } - }); - - it("should return FormData in browser environment", async () => { - if (RUNTIME.type === "browser") { - const formData = new (await import("form-data")).default(); - formData.append("key", "value"); - const result = await getRequestBody({ - body: formData, - type: "file", - }); - expect(result).toBe(formData); - } - }); - - it("should stringify body if not FormData in browser environment", async () => { - if (RUNTIME.type === "browser") { - const body = { key: "value" }; - const result = await getRequestBody({ - body, - type: "json", - }); - expect(result).toBe('{"key":"value"}'); - } - }); - - it("should return the Uint8Array", async () => { - const input = new Uint8Array([1, 2, 3]); - const result = await getRequestBody({ - body: input, - type: "bytes", - }); - expect(result).toBe(input); - }); - - it("should return the input for content-type 'application/x-www-form-urlencoded'", async () => { - const input = "key=value&another=param"; - const result = await getRequestBody({ - body: input, - type: "other", - }); - expect(result).toBe(input); - }); - - it("should JSON stringify objects", async () => { - const input = { key: "value" }; - const result = await getRequestBody({ - body: input, - type: "json", - }); - expect(result).toBe('{"key":"value"}'); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/getResponseBody.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/getResponseBody.test.ts deleted file mode 100644 index 1030c517ced..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/getResponseBody.test.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { RUNTIME } from "../../../src/core/runtime"; -import { getResponseBody } from "../../../src/core/fetcher/getResponseBody"; -import { chooseStreamWrapper } from "../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; - -describe("Test getResponseBody", () => { - it("should handle blob response type", async () => { - const mockBlob = new Blob(["test"], { type: "text/plain" }); - const mockResponse = new Response(mockBlob); - const result = await getResponseBody(mockResponse, "blob"); - // @ts-expect-error - expect(result.constructor.name).toBe("Blob"); - }); - - it("should handle sse response type", async () => { - if (RUNTIME.type === "node") { - const mockStream = new ReadableStream(); - const mockResponse = new Response(mockStream); - const result = await getResponseBody(mockResponse, "sse"); - expect(result).toBe(mockStream); - } - }); - - it("should handle streaming response type", async () => { - if (RUNTIME.type === "node") { - const mockStream = new ReadableStream(); - const mockResponse = new Response(mockStream); - const result = await getResponseBody(mockResponse, "streaming"); - // need to reinstantiate string as a result of locked state in Readable Stream after registration with Response - expect(JSON.stringify(result)).toBe(JSON.stringify(await chooseStreamWrapper(new ReadableStream()))); - } - }); - - it("should handle text response type", async () => { - const mockResponse = new Response("test text"); - const result = await getResponseBody(mockResponse, "text"); - expect(result).toBe("test text"); - }); - - it("should handle JSON response", async () => { - const mockJson = { key: "value" }; - const mockResponse = new Response(JSON.stringify(mockJson)); - const result = await getResponseBody(mockResponse); - expect(result).toEqual(mockJson); - }); - - it("should handle empty response", async () => { - const mockResponse = new Response(""); - const result = await getResponseBody(mockResponse); - expect(result).toBeUndefined(); - }); - - it("should handle non-JSON response", async () => { - const mockResponse = new Response("invalid json"); - const result = await getResponseBody(mockResponse); - expect(result).toEqual({ - ok: false, - error: { - reason: "non-json", - statusCode: 200, - rawBody: "invalid json", - }, - }); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/makeRequest.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/makeRequest.test.ts deleted file mode 100644 index be94ab45f10..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/makeRequest.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { RUNTIME } from "../../../src/core/runtime"; -import { makeRequest } from "../../../src/core/fetcher/makeRequest"; - -describe("Test makeRequest", () => { - const mockPostUrl = "https://httpbin.org/post"; - const mockGetUrl = "https://httpbin.org/get"; - const mockHeaders = { "Content-Type": "application/json" }; - const mockBody = JSON.stringify({ key: "value" }); - - let mockFetch: jest.Mock; - - beforeEach(() => { - mockFetch = jest.fn(); - mockFetch.mockResolvedValue(new Response(JSON.stringify({ test: "successful" }), { status: 200 })); - }); - - it("should handle POST request correctly", async () => { - const response = await makeRequest(mockFetch, mockPostUrl, "POST", mockHeaders, mockBody); - const responseBody = await response.json(); - expect(responseBody).toEqual({ test: "successful" }); - expect(mockFetch).toHaveBeenCalledTimes(1); - const [calledUrl, calledOptions] = mockFetch.mock.calls[0]; - expect(calledUrl).toBe(mockPostUrl); - expect(calledOptions).toEqual( - expect.objectContaining({ - method: "POST", - headers: mockHeaders, - body: mockBody, - credentials: undefined, - }) - ); - expect(calledOptions.signal).toBeDefined(); - expect(calledOptions.signal).toBeInstanceOf(AbortSignal); - }); - - it("should handle GET request correctly", async () => { - const response = await makeRequest(mockFetch, mockGetUrl, "GET", mockHeaders, undefined); - const responseBody = await response.json(); - expect(responseBody).toEqual({ test: "successful" }); - expect(mockFetch).toHaveBeenCalledTimes(1); - const [calledUrl, calledOptions] = mockFetch.mock.calls[0]; - expect(calledUrl).toBe(mockGetUrl); - expect(calledOptions).toEqual( - expect.objectContaining({ - method: "GET", - headers: mockHeaders, - body: undefined, - credentials: undefined, - }) - ); - expect(calledOptions.signal).toBeDefined(); - expect(calledOptions.signal).toBeInstanceOf(AbortSignal); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/requestWithRetries.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/requestWithRetries.test.ts deleted file mode 100644 index 6f77f093edf..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/requestWithRetries.test.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { RUNTIME } from "../../../src/core/runtime"; -import { requestWithRetries } from "../../../src/core/fetcher/requestWithRetries"; - -describe("requestWithRetries", () => { - let mockFetch: jest.Mock; - let originalMathRandom: typeof Math.random; - let setTimeoutSpy: jest.SpyInstance; - - beforeEach(() => { - mockFetch = jest.fn(); - originalMathRandom = Math.random; - - // Mock Math.random for consistent jitter - Math.random = jest.fn(() => 0.5); - - jest.useFakeTimers({ doNotFake: ["nextTick"] }); - }); - - afterEach(() => { - Math.random = originalMathRandom; - jest.clearAllMocks(); - jest.clearAllTimers(); - }); - - it("should retry on retryable status codes", async () => { - setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback) => { - process.nextTick(callback); - return null as any; - }); - - const retryableStatuses = [408, 409, 429, 500, 502]; - let callCount = 0; - - mockFetch.mockImplementation(async () => { - if (callCount < retryableStatuses.length) { - return new Response("", { status: retryableStatuses[callCount++] }); - } - return new Response("", { status: 200 }); - }); - - const responsePromise = requestWithRetries(() => mockFetch(), retryableStatuses.length); - await jest.runAllTimersAsync(); - const response = await responsePromise; - - expect(mockFetch).toHaveBeenCalledTimes(retryableStatuses.length + 1); - expect(response.status).toBe(200); - }); - - it("should respect maxRetries limit", async () => { - setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback) => { - process.nextTick(callback); - return null as any; - }); - - const maxRetries = 2; - mockFetch.mockResolvedValue(new Response("", { status: 500 })); - - const responsePromise = requestWithRetries(() => mockFetch(), maxRetries); - await jest.runAllTimersAsync(); - const response = await responsePromise; - - expect(mockFetch).toHaveBeenCalledTimes(maxRetries + 1); - expect(response.status).toBe(500); - }); - - it("should not retry on success status codes", async () => { - setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback) => { - process.nextTick(callback); - return null as any; - }); - - const successStatuses = [200, 201, 202]; - - for (const status of successStatuses) { - mockFetch.mockReset(); - setTimeoutSpy.mockClear(); - mockFetch.mockResolvedValueOnce(new Response("", { status })); - - const responsePromise = requestWithRetries(() => mockFetch(), 3); - await jest.runAllTimersAsync(); - await responsePromise; - - expect(mockFetch).toHaveBeenCalledTimes(1); - expect(setTimeoutSpy).not.toHaveBeenCalled(); - } - }); - - it("should apply correct exponential backoff with jitter", async () => { - setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback) => { - process.nextTick(callback); - return null as any; - }); - - mockFetch.mockResolvedValue(new Response("", { status: 500 })); - const maxRetries = 3; - const expectedDelays = [1000, 2000, 4000]; - - const responsePromise = requestWithRetries(() => mockFetch(), maxRetries); - await jest.runAllTimersAsync(); - await responsePromise; - - // Verify setTimeout calls - expect(setTimeoutSpy).toHaveBeenCalledTimes(expectedDelays.length); - - expectedDelays.forEach((delay, index) => { - expect(setTimeoutSpy).toHaveBeenNthCalledWith(index + 1, expect.any(Function), delay); - }); - - expect(mockFetch).toHaveBeenCalledTimes(maxRetries + 1); - }); - - it("should handle concurrent retries independently", async () => { - setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback) => { - process.nextTick(callback); - return null as any; - }); - - mockFetch - .mockResolvedValueOnce(new Response("", { status: 500 })) - .mockResolvedValueOnce(new Response("", { status: 500 })) - .mockResolvedValueOnce(new Response("", { status: 200 })) - .mockResolvedValueOnce(new Response("", { status: 200 })); - - const promise1 = requestWithRetries(() => mockFetch(), 1); - const promise2 = requestWithRetries(() => mockFetch(), 1); - - await jest.runAllTimersAsync(); - const [response1, response2] = await Promise.all([promise1, promise2]); - - expect(response1.status).toBe(200); - expect(response2.status).toBe(200); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/signals.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/signals.test.ts deleted file mode 100644 index 9cabfa07447..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/signals.test.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { anySignal, getTimeoutSignal } from "../../../src/core/fetcher/signals"; - -describe("Test getTimeoutSignal", () => { - beforeEach(() => { - jest.useFakeTimers(); - }); - - afterEach(() => { - jest.useRealTimers(); - }); - - it("should return an object with signal and abortId", () => { - const { signal, abortId } = getTimeoutSignal(1000); - - expect(signal).toBeDefined(); - expect(abortId).toBeDefined(); - expect(signal).toBeInstanceOf(AbortSignal); - expect(signal.aborted).toBe(false); - }); - - it("should create a signal that aborts after the specified timeout", () => { - const timeoutMs = 5000; - const { signal } = getTimeoutSignal(timeoutMs); - - expect(signal.aborted).toBe(false); - - jest.advanceTimersByTime(timeoutMs - 1); - expect(signal.aborted).toBe(false); - - jest.advanceTimersByTime(1); - expect(signal.aborted).toBe(true); - }); -}); - -describe("Test anySignal", () => { - it("should return an AbortSignal", () => { - const signal = anySignal(new AbortController().signal); - expect(signal).toBeInstanceOf(AbortSignal); - }); - - it("should abort when any of the input signals is aborted", () => { - const controller1 = new AbortController(); - const controller2 = new AbortController(); - const signal = anySignal(controller1.signal, controller2.signal); - - expect(signal.aborted).toBe(false); - controller1.abort(); - expect(signal.aborted).toBe(true); - }); - - it("should handle an array of signals", () => { - const controller1 = new AbortController(); - const controller2 = new AbortController(); - const signal = anySignal([controller1.signal, controller2.signal]); - - expect(signal.aborted).toBe(false); - controller2.abort(); - expect(signal.aborted).toBe(true); - }); - - it("should abort immediately if one of the input signals is already aborted", () => { - const controller1 = new AbortController(); - const controller2 = new AbortController(); - controller1.abort(); - - const signal = anySignal(controller1.signal, controller2.signal); - expect(signal.aborted).toBe(true); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts deleted file mode 100644 index 1dc9be0cc0e..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { Node18UniversalStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper"; - -describe("Node18UniversalStreamWrapper", () => { - it("should set encoding to utf-8", async () => { - const rawStream = new ReadableStream(); - const stream = new Node18UniversalStreamWrapper(rawStream); - const setEncodingSpy = jest.spyOn(stream, "setEncoding"); - - stream.setEncoding("utf-8"); - - expect(setEncodingSpy).toHaveBeenCalledWith("utf-8"); - }); - - it("should register an event listener for readable", async () => { - const rawStream = new ReadableStream(); - const stream = new Node18UniversalStreamWrapper(rawStream); - const onSpy = jest.spyOn(stream, "on"); - - stream.on("readable", () => {}); - - expect(onSpy).toHaveBeenCalledWith("readable", expect.any(Function)); - }); - - it("should remove an event listener for data", async () => { - const rawStream = new ReadableStream(); - const stream = new Node18UniversalStreamWrapper(rawStream); - const offSpy = jest.spyOn(stream, "off"); - - const fn = () => {}; - stream.on("data", fn); - stream.off("data", fn); - - expect(offSpy).toHaveBeenCalledWith("data", expect.any(Function)); - }); - - it("should write to dest when calling pipe to writable stream", async () => { - const rawStream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("test")); - controller.enqueue(new TextEncoder().encode("test")); - controller.close(); - }, - }); - const stream = new Node18UniversalStreamWrapper(rawStream); - const dest = new WritableStream({ - write(chunk) { - expect(chunk).toEqual(new TextEncoder().encode("test")); - }, - }); - - stream.pipe(dest); - }); - - it("should write to dest when calling pipe to node writable stream", async () => { - const rawStream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("test")); - controller.enqueue(new TextEncoder().encode("test")); - controller.close(); - }, - }); - const stream = new Node18UniversalStreamWrapper(rawStream); - const dest = new (await import("readable-stream")).Writable({ - write(chunk, encoding, callback) { - expect(chunk.toString()).toEqual("test"); - callback(); - }, - }); - - stream.pipe(dest); - }); - - it("should write nothing when calling pipe and unpipe", async () => { - const rawStream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("test")); - controller.enqueue(new TextEncoder().encode("test")); - controller.close(); - }, - }); - const stream = new Node18UniversalStreamWrapper(rawStream); - const buffer: Uint8Array[] = []; - const dest = new WritableStream({ - write(chunk) { - buffer.push(chunk); - }, - }); - - stream.pipe(dest); - stream.unpipe(dest); - expect(buffer).toEqual([]); - }); - - it("should destroy the stream", async () => { - const rawStream = new ReadableStream(); - const stream = new Node18UniversalStreamWrapper(rawStream); - const destroySpy = jest.spyOn(stream, "destroy"); - - stream.destroy(); - - expect(destroySpy).toHaveBeenCalled(); - }); - - it("should pause and resume the stream", async () => { - const rawStream = new ReadableStream(); - const stream = new Node18UniversalStreamWrapper(rawStream); - const pauseSpy = jest.spyOn(stream, "pause"); - const resumeSpy = jest.spyOn(stream, "resume"); - - expect(stream.isPaused).toBe(false); - stream.pause(); - expect(stream.isPaused).toBe(true); - stream.resume(); - - expect(pauseSpy).toHaveBeenCalled(); - expect(resumeSpy).toHaveBeenCalled(); - }); - - it("should read the stream", async () => { - const rawStream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("test")); - controller.enqueue(new TextEncoder().encode("test")); - controller.close(); - }, - }); - const stream = new Node18UniversalStreamWrapper(rawStream); - - expect(await stream.read()).toEqual(new TextEncoder().encode("test")); - expect(await stream.read()).toEqual(new TextEncoder().encode("test")); - }); - - it("should read the stream as text", async () => { - const rawStream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("test")); - controller.enqueue(new TextEncoder().encode("test")); - controller.close(); - }, - }); - const stream = new Node18UniversalStreamWrapper(rawStream); - - const data = await stream.text(); - - expect(data).toEqual("testtest"); - }); - - it("should read the stream as json", async () => { - const rawStream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode(JSON.stringify({ test: "test" }))); - controller.close(); - }, - }); - const stream = new Node18UniversalStreamWrapper(rawStream); - - const data = await stream.json(); - - expect(data).toEqual({ test: "test" }); - }); - - it("should allow use with async iteratable stream", async () => { - const rawStream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("test")); - controller.enqueue(new TextEncoder().encode("test")); - controller.close(); - }, - }); - let data = ""; - const stream = new Node18UniversalStreamWrapper(rawStream); - for await (const chunk of stream) { - data += new TextDecoder().decode(chunk); - } - - expect(data).toEqual("testtest"); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts deleted file mode 100644 index 0c99d3b2655..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { NodePre18StreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/NodePre18StreamWrapper"; - -describe("NodePre18StreamWrapper", () => { - it("should set encoding to utf-8", async () => { - const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); - const stream = new NodePre18StreamWrapper(rawStream); - const setEncodingSpy = jest.spyOn(stream, "setEncoding"); - - stream.setEncoding("utf-8"); - - expect(setEncodingSpy).toHaveBeenCalledWith("utf-8"); - }); - - it("should register an event listener for readable", async () => { - const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); - const stream = new NodePre18StreamWrapper(rawStream); - const onSpy = jest.spyOn(stream, "on"); - - stream.on("readable", () => {}); - - expect(onSpy).toHaveBeenCalledWith("readable", expect.any(Function)); - }); - - it("should remove an event listener for data", async () => { - const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); - const stream = new NodePre18StreamWrapper(rawStream); - const offSpy = jest.spyOn(stream, "off"); - - const fn = () => {}; - stream.on("data", fn); - stream.off("data", fn); - - expect(offSpy).toHaveBeenCalledWith("data", expect.any(Function)); - }); - - it("should write to dest when calling pipe to node writable stream", async () => { - const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); - const stream = new NodePre18StreamWrapper(rawStream); - const dest = new (await import("readable-stream")).Writable({ - write(chunk, encoding, callback) { - expect(chunk.toString()).toEqual("test"); - callback(); - }, - }); - - stream.pipe(dest); - }); - - it("should write nothing when calling pipe and unpipe", async () => { - const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); - const stream = new NodePre18StreamWrapper(rawStream); - const buffer: Uint8Array[] = []; - const dest = new (await import("readable-stream")).Writable({ - write(chunk, encoding, callback) { - buffer.push(chunk); - callback(); - }, - }); - stream.pipe(dest); - stream.unpipe(); - - expect(buffer).toEqual([]); - }); - - it("should destroy the stream", async () => { - const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); - const stream = new NodePre18StreamWrapper(rawStream); - const destroySpy = jest.spyOn(stream, "destroy"); - - stream.destroy(); - - expect(destroySpy).toHaveBeenCalledWith(); - }); - - it("should pause the stream and resume", async () => { - const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); - const stream = new NodePre18StreamWrapper(rawStream); - const pauseSpy = jest.spyOn(stream, "pause"); - - stream.pause(); - expect(stream.isPaused).toBe(true); - stream.resume(); - expect(stream.isPaused).toBe(false); - - expect(pauseSpy).toHaveBeenCalledWith(); - }); - - it("should read the stream", async () => { - const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); - const stream = new NodePre18StreamWrapper(rawStream); - - expect(await stream.read()).toEqual("test"); - expect(await stream.read()).toEqual("test"); - }); - - it("should read the stream as text", async () => { - const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); - const stream = new NodePre18StreamWrapper(rawStream); - - const data = await stream.text(); - - expect(data).toEqual("testtest"); - }); - - it("should read the stream as json", async () => { - const rawStream = (await import("readable-stream")).Readable.from([JSON.stringify({ test: "test" })]); - const stream = new NodePre18StreamWrapper(rawStream); - - const data = await stream.json(); - - expect(data).toEqual({ test: "test" }); - }); - - it("should allow use with async iteratable stream", async () => { - const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); - let data = ""; - const stream = new NodePre18StreamWrapper(rawStream); - for await (const chunk of stream) { - data += chunk; - } - - expect(data).toEqual("testtest"); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts deleted file mode 100644 index 1d171ce6c67..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts +++ /dev/null @@ -1,153 +0,0 @@ -import { UndiciStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/UndiciStreamWrapper"; - -describe("UndiciStreamWrapper", () => { - it("should set encoding to utf-8", async () => { - const rawStream = new ReadableStream(); - const stream = new UndiciStreamWrapper(rawStream); - const setEncodingSpy = jest.spyOn(stream, "setEncoding"); - - stream.setEncoding("utf-8"); - - expect(setEncodingSpy).toHaveBeenCalledWith("utf-8"); - }); - - it("should register an event listener for readable", async () => { - const rawStream = new ReadableStream(); - const stream = new UndiciStreamWrapper(rawStream); - const onSpy = jest.spyOn(stream, "on"); - - stream.on("readable", () => {}); - - expect(onSpy).toHaveBeenCalledWith("readable", expect.any(Function)); - }); - - it("should remove an event listener for data", async () => { - const rawStream = new ReadableStream(); - const stream = new UndiciStreamWrapper(rawStream); - const offSpy = jest.spyOn(stream, "off"); - - const fn = () => {}; - stream.on("data", fn); - stream.off("data", fn); - - expect(offSpy).toHaveBeenCalledWith("data", expect.any(Function)); - }); - - it("should write to dest when calling pipe to writable stream", async () => { - const rawStream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("test")); - controller.enqueue(new TextEncoder().encode("test")); - controller.close(); - }, - }); - const stream = new UndiciStreamWrapper(rawStream); - const dest = new WritableStream({ - write(chunk) { - expect(chunk).toEqual(new TextEncoder().encode("test")); - }, - }); - - stream.pipe(dest); - }); - - it("should write nothing when calling pipe and unpipe", async () => { - const rawStream = new ReadableStream(); - const stream = new UndiciStreamWrapper(rawStream); - const buffer: Uint8Array[] = []; - const dest = new WritableStream({ - write(chunk) { - buffer.push(chunk); - }, - }); - stream.pipe(dest); - stream.unpipe(dest); - - expect(buffer).toEqual([]); - }); - - it("should destroy the stream", async () => { - const rawStream = new ReadableStream(); - const stream = new UndiciStreamWrapper(rawStream); - const destroySpy = jest.spyOn(stream, "destroy"); - - stream.destroy(); - - expect(destroySpy).toHaveBeenCalled(); - }); - - it("should pause and resume the stream", async () => { - const rawStream = new ReadableStream(); - const stream = new UndiciStreamWrapper(rawStream); - const pauseSpy = jest.spyOn(stream, "pause"); - const resumeSpy = jest.spyOn(stream, "resume"); - - expect(stream.isPaused).toBe(false); - stream.pause(); - expect(stream.isPaused).toBe(true); - stream.resume(); - - expect(pauseSpy).toHaveBeenCalled(); - expect(resumeSpy).toHaveBeenCalled(); - }); - - it("should read the stream", async () => { - const rawStream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("test")); - controller.enqueue(new TextEncoder().encode("test")); - controller.close(); - }, - }); - const stream = new UndiciStreamWrapper(rawStream); - - expect(await stream.read()).toEqual(new TextEncoder().encode("test")); - expect(await stream.read()).toEqual(new TextEncoder().encode("test")); - }); - - it("should read the stream as text", async () => { - const rawStream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("test")); - controller.enqueue(new TextEncoder().encode("test")); - controller.close(); - }, - }); - const stream = new UndiciStreamWrapper(rawStream); - - const data = await stream.text(); - - expect(data).toEqual("testtest"); - }); - - it("should read the stream as json", async () => { - const rawStream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode(JSON.stringify({ test: "test" }))); - controller.close(); - }, - }); - const stream = new UndiciStreamWrapper(rawStream); - - const data = await stream.json(); - - expect(data).toEqual({ test: "test" }); - }); - - it("should allow use with async iteratable stream", async () => { - const rawStream = new ReadableStream({ - start(controller) { - controller.enqueue(new TextEncoder().encode("test")); - controller.enqueue(new TextEncoder().encode("test")); - controller.close(); - }, - }); - let data = ""; - const stream = new UndiciStreamWrapper(rawStream); - for await (const chunk of stream) { - data += new TextDecoder().decode(chunk); - } - - expect(data).toEqual("testtest"); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts deleted file mode 100644 index 17cf37a2f7f..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { RUNTIME } from "../../../../src/core/runtime"; -import { chooseStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; -import { Node18UniversalStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper"; -import { NodePre18StreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/NodePre18StreamWrapper"; -import { UndiciStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/UndiciStreamWrapper"; - -describe("chooseStreamWrapper", () => { - beforeEach(() => { - RUNTIME.type = "unknown"; - RUNTIME.parsedVersion = 0; - }); - - it('should return a Node18UniversalStreamWrapper when RUNTIME.type is "node" and RUNTIME.parsedVersion is not null and RUNTIME.parsedVersion is greater than or equal to 18', async () => { - const expected = new Node18UniversalStreamWrapper(new ReadableStream()); - RUNTIME.type = "node"; - RUNTIME.parsedVersion = 18; - - const result = await chooseStreamWrapper(new ReadableStream()); - - expect(JSON.stringify(result)).toBe(JSON.stringify(expected)); - }); - - it('should return a NodePre18StreamWrapper when RUNTIME.type is "node" and RUNTIME.parsedVersion is not null and RUNTIME.parsedVersion is less than 18', async () => { - const stream = await import("readable-stream"); - const expected = new NodePre18StreamWrapper(new stream.Readable()); - - RUNTIME.type = "node"; - RUNTIME.parsedVersion = 16; - - const result = await chooseStreamWrapper(new stream.Readable()); - - expect(JSON.stringify(result)).toEqual(JSON.stringify(expected)); - }); - - it('should return a Undici when RUNTIME.type is not "node"', async () => { - const expected = new UndiciStreamWrapper(new ReadableStream()); - RUNTIME.type = "browser"; - - const result = await chooseStreamWrapper(new ReadableStream()); - - expect(JSON.stringify(result)).toEqual(JSON.stringify(expected)); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/webpack.test.ts b/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/webpack.test.ts deleted file mode 100644 index 557db6dc4ef..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/stream-wrappers/webpack.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import webpack from "webpack"; - -describe("test env compatibility", () => { - test("webpack", () => { - return new Promise((resolve, reject) => { - webpack( - { - mode: "production", - entry: "./src/index.ts", - module: { - rules: [ - { - test: /\.tsx?$/, - use: "ts-loader", - exclude: /node_modules/, - }, - ], - }, - resolve: { - extensions: [".tsx", ".ts", ".js"], - }, - }, - (err, stats) => { - try { - expect(err).toBe(null); - if (stats?.hasErrors()) { - console.log(stats?.toString()); - } - expect(stats?.hasErrors()).toBe(false); - resolve(); - } catch (error) { - reject(error); - } - } - ); - }); - }, 60_000); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/fetcher/test-file.txt b/seed/ts-sdk/inline-types/tests/unit/fetcher/test-file.txt deleted file mode 100644 index c66d471e359..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/fetcher/test-file.txt +++ /dev/null @@ -1 +0,0 @@ -This is a test file! diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/bigint/bigint.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/bigint/bigint.test.ts deleted file mode 100644 index cf9935a749a..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/bigint/bigint.test.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { bigint } from "../../../../src/core/schemas/builders/bigint"; -import { itSchema } from "../utils/itSchema"; -import { itValidateJson, itValidateParse } from "../utils/itValidate"; - -describe("bigint", () => { - itSchema("converts between raw string and parsed bigint", bigint(), { - raw: "123456789012345678901234567890123456789012345678901234567890", - parsed: BigInt("123456789012345678901234567890123456789012345678901234567890"), - }); - - itValidateParse("non-string", bigint(), 42, [ - { - message: "Expected string. Received 42.", - path: [], - }, - ]); - - itValidateJson("non-bigint", bigint(), "hello", [ - { - message: 'Expected bigint. Received "hello".', - path: [], - }, - ]); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/date/date.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/date/date.test.ts deleted file mode 100644 index 2790268a09c..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/date/date.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { date } from "../../../../src/core/schemas/builders/date"; -import { itSchema } from "../utils/itSchema"; -import { itValidateJson, itValidateParse } from "../utils/itValidate"; - -describe("date", () => { - itSchema("converts between raw ISO string and parsed Date", date(), { - raw: "2022-09-29T05:41:21.939Z", - parsed: new Date("2022-09-29T05:41:21.939Z"), - }); - - itValidateParse("non-string", date(), 42, [ - { - message: "Expected string. Received 42.", - path: [], - }, - ]); - - itValidateParse("non-ISO", date(), "hello world", [ - { - message: 'Expected ISO 8601 date string. Received "hello world".', - path: [], - }, - ]); - - itValidateJson("non-Date", date(), "hello", [ - { - message: 'Expected Date object. Received "hello".', - path: [], - }, - ]); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/enum/enum.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/enum/enum.test.ts deleted file mode 100644 index ab0df0285cd..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/enum/enum.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { enum_ } from "../../../../src/core/schemas/builders/enum"; -import { itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("enum", () => { - itSchemaIdentity(enum_(["A", "B", "C"]), "A"); - - itSchemaIdentity(enum_(["A", "B", "C"]), "D" as any, { - opts: { allowUnrecognizedEnumValues: true }, - }); - - itValidate("invalid enum", enum_(["A", "B", "C"]), "D", [ - { - message: 'Expected enum. Received "D".', - path: [], - }, - ]); - - itValidate( - "non-string", - enum_(["A", "B", "C"]), - [], - [ - { - message: "Expected string. Received list.", - path: [], - }, - ] - ); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/lazy/lazy.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/lazy/lazy.test.ts deleted file mode 100644 index 6906bf4cf91..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/lazy/lazy.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Schema } from "../../../../src/core/schemas/Schema"; -import { lazy, list, object, string } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; - -describe("lazy", () => { - it("doesn't run immediately", () => { - let wasRun = false; - lazy(() => { - wasRun = true; - return string(); - }); - expect(wasRun).toBe(false); - }); - - it("only runs first time", async () => { - let count = 0; - const schema = lazy(() => { - count++; - return string(); - }); - await schema.parse("hello"); - await schema.json("world"); - expect(count).toBe(1); - }); - - itSchemaIdentity( - lazy(() => object({})), - { foo: "hello" }, - { - title: "passes opts through", - opts: { unrecognizedObjectKeys: "passthrough" }, - } - ); - - itSchemaIdentity( - lazy(() => object({ foo: string() })), - { foo: "hello" } - ); - - // eslint-disable-next-line jest/expect-expect - it("self-referencial schema doesn't compile", () => { - () => { - // @ts-expect-error - const a = lazy(() => object({ foo: a })); - }; - }); - - // eslint-disable-next-line jest/expect-expect - it("self-referencial compiles with explicit type", () => { - () => { - interface TreeNode { - children: TreeNode[]; - } - const TreeNode: Schema = lazy(() => object({ children: list(TreeNode) })); - }; - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/lazy/lazyObject.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/lazy/lazyObject.test.ts deleted file mode 100644 index 8813cc9fbb4..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/lazy/lazyObject.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { lazyObject, number, object, string } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; - -describe("lazy", () => { - itSchemaIdentity( - lazyObject(() => object({ foo: string() })), - { foo: "hello" } - ); - - itSchemaIdentity( - lazyObject(() => object({ foo: string() })).extend(object({ bar: number() })), - { - foo: "hello", - bar: 42, - }, - { title: "returned schema has object utils" } - ); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/lazy/recursive/a.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/lazy/recursive/a.ts deleted file mode 100644 index 8b7d5e40cfa..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/lazy/recursive/a.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { object } from "../../../../../src/core/schemas/builders/object"; -import { schemaB } from "./b"; - -// @ts-expect-error -export const schemaA = object({ - b: schemaB, -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/lazy/recursive/b.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/lazy/recursive/b.ts deleted file mode 100644 index fb219d54c8e..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/lazy/recursive/b.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { object } from "../../../../../src/core/schemas/builders/object"; -import { optional } from "../../../../../src/core/schemas/builders/schema-utils"; -import { schemaA } from "./a"; - -// @ts-expect-error -export const schemaB = object({ - a: optional(schemaA), -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/list/list.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/list/list.test.ts deleted file mode 100644 index 424ed642db2..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/list/list.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { list, object, property, string } from "../../../../src/core/schemas/builders"; -import { itSchema, itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("list", () => { - itSchemaIdentity(list(string()), ["hello", "world"], { - title: "functions as identity when item type is primitive", - }); - - itSchema( - "converts objects correctly", - list( - object({ - helloWorld: property("hello_world", string()), - }) - ), - { - raw: [{ hello_world: "123" }], - parsed: [{ helloWorld: "123" }], - } - ); - - itValidate("not a list", list(string()), 42, [ - { - path: [], - message: "Expected list. Received 42.", - }, - ]); - - itValidate( - "invalid item type", - list(string()), - [42], - [ - { - path: ["[0]"], - message: "Expected string. Received 42.", - }, - ] - ); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/literals/stringLiteral.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/literals/stringLiteral.test.ts deleted file mode 100644 index fa6c88873c6..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/literals/stringLiteral.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { stringLiteral } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("stringLiteral", () => { - itSchemaIdentity(stringLiteral("A"), "A"); - - itValidate("incorrect string", stringLiteral("A"), "B", [ - { - path: [], - message: 'Expected "A". Received "B".', - }, - ]); - - itValidate("non-string", stringLiteral("A"), 42, [ - { - path: [], - message: 'Expected "A". Received 42.', - }, - ]); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/object-like/withParsedProperties.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/object-like/withParsedProperties.test.ts deleted file mode 100644 index 9f5dd0ed39b..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/object-like/withParsedProperties.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { object, property, string, stringLiteral } from "../../../../src/core/schemas/builders"; - -describe("withParsedProperties", () => { - it("Added properties included on parsed object", async () => { - const schema = object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }).withParsedProperties({ - printFoo: (parsed) => () => parsed.foo, - printHelloWorld: () => () => "Hello world", - helloWorld: "Hello world", - }); - - const parsed = await schema.parse({ raw_foo: "value of foo", bar: "bar" }); - if (!parsed.ok) { - throw new Error("Failed to parse"); - } - expect(parsed.value.printFoo()).toBe("value of foo"); - expect(parsed.value.printHelloWorld()).toBe("Hello world"); - expect(parsed.value.helloWorld).toBe("Hello world"); - }); - - it("Added property is removed on raw object", async () => { - const schema = object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }).withParsedProperties({ - printFoo: (parsed) => () => parsed.foo, - }); - - const original = { raw_foo: "value of foo", bar: "bar" } as const; - const parsed = await schema.parse(original); - if (!parsed.ok) { - throw new Error("Failed to parse()"); - } - - const raw = await schema.json(parsed.value); - - if (!raw.ok) { - throw new Error("Failed to json()"); - } - - expect(raw.value).toEqual(original); - }); - - describe("compile", () => { - // eslint-disable-next-line jest/expect-expect - it("doesn't compile with non-object schema", () => { - () => - object({ - foo: string(), - }) - // @ts-expect-error - .withParsedProperties(42); - }); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/object/extend.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/object/extend.test.ts deleted file mode 100644 index 54fc8c4ebf8..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/object/extend.test.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { boolean, object, property, string, stringLiteral } from "../../../../src/core/schemas/builders"; -import { itSchema, itSchemaIdentity } from "../utils/itSchema"; - -describe("extend", () => { - itSchemaIdentity( - object({ - foo: string(), - }).extend( - object({ - bar: stringLiteral("bar"), - }) - ), - { - foo: "", - bar: "bar", - } as const, - { - title: "extended properties are included in schema", - } - ); - - itSchemaIdentity( - object({ - foo: string(), - }) - .extend( - object({ - bar: stringLiteral("bar"), - }) - ) - .extend( - object({ - baz: boolean(), - }) - ), - { - foo: "", - bar: "bar", - baz: true, - } as const, - { - title: "extensions can be extended", - } - ); - - itSchema( - "converts nested object", - object({ - item: object({ - helloWorld: property("hello_world", string()), - }), - }).extend( - object({ - goodbye: property("goodbye_raw", string()), - }) - ), - { - raw: { item: { hello_world: "yo" }, goodbye_raw: "peace" }, - parsed: { item: { helloWorld: "yo" }, goodbye: "peace" }, - } - ); - - itSchema( - "extensions work with raw/parsed property name conversions", - object({ - item: property("item_raw", string()), - }).extend( - object({ - goodbye: property("goodbye_raw", string()), - }) - ), - { - raw: { item_raw: "hi", goodbye_raw: "peace" }, - parsed: { item: "hi", goodbye: "peace" }, - } - ); - - describe("compile", () => { - // eslint-disable-next-line jest/expect-expect - it("doesn't compile with non-object schema", () => { - () => - object({ - foo: string(), - }) - // @ts-expect-error - .extend([]); - }); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/object/object.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/object/object.test.ts deleted file mode 100644 index 0acf0e240f6..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/object/object.test.ts +++ /dev/null @@ -1,255 +0,0 @@ -import { any, number, object, property, string, stringLiteral, unknown } from "../../../../src/core/schemas/builders"; -import { itJson, itParse, itSchema, itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("object", () => { - itSchemaIdentity( - object({ - foo: string(), - bar: stringLiteral("bar"), - }), - { - foo: "", - bar: "bar", - }, - { - title: "functions as identity when values are primitives and property() isn't used", - } - ); - - itSchema( - "uses raw key from property()", - object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }), - { - raw: { raw_foo: "foo", bar: "bar" }, - parsed: { foo: "foo", bar: "bar" }, - } - ); - - itSchema( - "keys with unknown type can be omitted", - object({ - foo: unknown(), - }), - { - raw: {}, - parsed: {}, - } - ); - - itSchema( - "keys with any type can be omitted", - object({ - foo: any(), - }), - { - raw: {}, - parsed: {}, - } - ); - - describe("unrecognizedObjectKeys", () => { - describe("parse", () => { - itParse( - 'includes unknown values when unrecognizedObjectKeys === "passthrough"', - object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }), - { - raw: { - raw_foo: "foo", - bar: "bar", - // @ts-expect-error - baz: "yoyo", - }, - parsed: { - foo: "foo", - bar: "bar", - // @ts-expect-error - baz: "yoyo", - }, - opts: { - unrecognizedObjectKeys: "passthrough", - }, - } - ); - - itParse( - 'strips unknown values when unrecognizedObjectKeys === "strip"', - object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }), - { - raw: { - raw_foo: "foo", - bar: "bar", - // @ts-expect-error - baz: "yoyo", - }, - parsed: { - foo: "foo", - bar: "bar", - }, - opts: { - unrecognizedObjectKeys: "strip", - }, - } - ); - }); - - describe("json", () => { - itJson( - 'includes unknown values when unrecognizedObjectKeys === "passthrough"', - object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }), - { - raw: { - raw_foo: "foo", - bar: "bar", - // @ts-expect-error - baz: "yoyo", - }, - parsed: { - foo: "foo", - bar: "bar", - // @ts-expect-error - baz: "yoyo", - }, - opts: { - unrecognizedObjectKeys: "passthrough", - }, - } - ); - - itJson( - 'strips unknown values when unrecognizedObjectKeys === "strip"', - object({ - foo: property("raw_foo", string()), - bar: stringLiteral("bar"), - }), - { - raw: { - raw_foo: "foo", - bar: "bar", - }, - parsed: { - foo: "foo", - bar: "bar", - // @ts-expect-error - baz: "yoyo", - }, - opts: { - unrecognizedObjectKeys: "strip", - }, - } - ); - }); - }); - - describe("nullish properties", () => { - itSchema("missing properties are not added", object({ foo: property("raw_foo", string().optional()) }), { - raw: {}, - parsed: {}, - }); - - itSchema("undefined properties are not dropped", object({ foo: property("raw_foo", string().optional()) }), { - raw: { raw_foo: null }, - parsed: { foo: undefined }, - }); - - itSchema("null properties are not dropped", object({ foo: property("raw_foo", string().optional()) }), { - raw: { raw_foo: null }, - parsed: { foo: undefined }, - }); - - describe("extensions", () => { - itSchema( - "undefined properties are not dropped", - object({}).extend(object({ foo: property("raw_foo", string().optional()) })), - { - raw: { raw_foo: null }, - parsed: { foo: undefined }, - } - ); - - describe("parse()", () => { - itParse( - "null properties are not dropped", - object({}).extend(object({ foo: property("raw_foo", string().optional()) })), - { - raw: { raw_foo: null }, - parsed: { foo: undefined }, - } - ); - }); - }); - }); - - itValidate( - "missing property", - object({ - foo: string(), - bar: stringLiteral("bar"), - }), - { foo: "hello" }, - [ - { - path: [], - message: 'Missing required key "bar"', - }, - ] - ); - - itValidate( - "extra property", - object({ - foo: string(), - bar: stringLiteral("bar"), - }), - { foo: "hello", bar: "bar", baz: 42 }, - [ - { - path: ["baz"], - message: 'Unexpected key "baz"', - }, - ] - ); - - itValidate( - "not an object", - object({ - foo: string(), - bar: stringLiteral("bar"), - }), - [], - [ - { - path: [], - message: "Expected object. Received list.", - }, - ] - ); - - itValidate( - "nested validation error", - object({ - foo: object({ - bar: number(), - }), - }), - { foo: { bar: "hello" } }, - [ - { - path: ["foo", "bar"], - message: 'Expected number. Received "hello".', - }, - ] - ); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/object/objectWithoutOptionalProperties.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/object/objectWithoutOptionalProperties.test.ts deleted file mode 100644 index d87a65febfd..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/object/objectWithoutOptionalProperties.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { objectWithoutOptionalProperties, string, stringLiteral } from "../../../../src/core/schemas/builders"; -import { itSchema } from "../utils/itSchema"; - -describe("objectWithoutOptionalProperties", () => { - itSchema( - "all properties are required", - objectWithoutOptionalProperties({ - foo: string(), - bar: stringLiteral("bar").optional(), - }), - { - raw: { - foo: "hello", - }, - // @ts-expect-error - parsed: { - foo: "hello", - }, - } - ); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/object/passthrough.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/object/passthrough.test.ts deleted file mode 100644 index 28ce3b1fea0..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/object/passthrough.test.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { object, string, stringLiteral } from "../../../../src/core/schemas/builders"; -import { itJson, itParse, itSchema } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("passthrough", () => { - const baseSchema = object({ - foo: string(), - bar: stringLiteral("bar"), - }); - - describe("parse", () => { - itParse("includes unknown values", baseSchema.passthrough(), { - raw: { - foo: "hello", - bar: "bar", - baz: "extra", - }, - parsed: { - foo: "hello", - bar: "bar", - baz: "extra", - }, - }); - - itValidate( - "preserves schema validation", - baseSchema.passthrough(), - { - foo: 123, - bar: "bar", - baz: "extra", - }, - [ - { - path: ["foo"], - message: "Expected string. Received 123.", - }, - ] - ); - }); - - describe("json", () => { - itJson("includes unknown values", baseSchema.passthrough(), { - raw: { - foo: "hello", - bar: "bar", - - baz: "extra", - }, - parsed: { - foo: "hello", - bar: "bar", - - baz: "extra", - }, - }); - - itValidate( - "preserves schema validation", - baseSchema.passthrough(), - { - foo: "hello", - bar: "wrong", - baz: "extra", - }, - [ - { - path: ["bar"], - message: 'Expected "bar". Received "wrong".', - }, - ] - ); - }); - - itSchema("preserves schema validation in both directions", baseSchema.passthrough(), { - raw: { - foo: "hello", - bar: "bar", - extra: 42, - }, - parsed: { - foo: "hello", - bar: "bar", - extra: 42, - }, - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/any.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/any.test.ts deleted file mode 100644 index 1adbbe2a838..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/any.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { any } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; - -describe("any", () => { - itSchemaIdentity(any(), true); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/boolean.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/boolean.test.ts deleted file mode 100644 index 897a8295dca..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/boolean.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { boolean } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("boolean", () => { - itSchemaIdentity(boolean(), true); - - itValidate("non-boolean", boolean(), {}, [ - { - path: [], - message: "Expected boolean. Received object.", - }, - ]); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/number.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/number.test.ts deleted file mode 100644 index 2d01415a60b..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/number.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { number } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("number", () => { - itSchemaIdentity(number(), 42); - - itValidate("non-number", number(), "hello", [ - { - path: [], - message: 'Expected number. Received "hello".', - }, - ]); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/string.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/string.test.ts deleted file mode 100644 index 57b2368784a..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/string.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { string } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("string", () => { - itSchemaIdentity(string(), "hello"); - - itValidate("non-string", string(), 42, [ - { - path: [], - message: "Expected string. Received 42.", - }, - ]); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/unknown.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/unknown.test.ts deleted file mode 100644 index 4d17a7dbd00..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/primitives/unknown.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { unknown } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; - -describe("unknown", () => { - itSchemaIdentity(unknown(), true); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/record/record.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/record/record.test.ts deleted file mode 100644 index 7e4ba39cc55..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/record/record.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { number, record, string } from "../../../../src/core/schemas/builders"; -import { itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("record", () => { - itSchemaIdentity(record(string(), string()), { hello: "world" }); - itSchemaIdentity(record(number(), string()), { 42: "world" }); - - itValidate( - "non-record", - record(number(), string()), - [], - [ - { - path: [], - message: "Expected object. Received list.", - }, - ] - ); - - itValidate("invalid key type", record(number(), string()), { hello: "world" }, [ - { - path: ["hello (key)"], - message: 'Expected number. Received "hello".', - }, - ]); - - itValidate("invalid value type", record(string(), number()), { hello: "world" }, [ - { - path: ["hello"], - message: 'Expected number. Received "world".', - }, - ]); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/schema-utils/getSchemaUtils.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/schema-utils/getSchemaUtils.test.ts deleted file mode 100644 index da10086bc1d..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/schema-utils/getSchemaUtils.test.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { object, string } from "../../../../src/core/schemas/builders"; -import { itSchema } from "../utils/itSchema"; - -describe("getSchemaUtils", () => { - describe("optional()", () => { - itSchema("optional fields allow original schema", string().optional(), { - raw: "hello", - parsed: "hello", - }); - - itSchema("optional fields are not required", string().optional(), { - raw: null, - parsed: undefined, - }); - }); - - describe("transform()", () => { - itSchema( - "transorm and untransform run correctly", - string().transform({ - transform: (x) => x + "X", - untransform: (x) => (x as string).slice(0, -1), - }), - { - raw: "hello", - parsed: "helloX", - } - ); - }); - - describe("parseOrThrow()", () => { - it("parses valid value", async () => { - const value = string().parseOrThrow("hello"); - expect(value).toBe("hello"); - }); - - it("throws on invalid value", async () => { - const value = () => object({ a: string(), b: string() }).parseOrThrow({ a: 24 }); - expect(value).toThrowError(new Error('a: Expected string. Received 24.; Missing required key "b"')); - }); - }); - - describe("jsonOrThrow()", () => { - it("serializes valid value", async () => { - const value = string().jsonOrThrow("hello"); - expect(value).toBe("hello"); - }); - - it("throws on invalid value", async () => { - const value = () => object({ a: string(), b: string() }).jsonOrThrow({ a: 24 }); - expect(value).toThrowError(new Error('a: Expected string. Received 24.; Missing required key "b"')); - }); - }); - - describe("omitUndefined", () => { - it("serializes undefined as null", async () => { - const value = object({ - a: string().optional(), - b: string().optional(), - }).jsonOrThrow({ - a: "hello", - b: undefined, - }); - expect(value).toEqual({ a: "hello", b: null }); - }); - - it("omits undefined values", async () => { - const value = object({ - a: string().optional(), - b: string().optional(), - }).jsonOrThrow( - { - a: "hello", - b: undefined, - }, - { - omitUndefined: true, - } - ); - expect(value).toEqual({ a: "hello" }); - }); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/schema.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/schema.test.ts deleted file mode 100644 index 94089a9a91b..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/schema.test.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { - boolean, - discriminant, - list, - number, - object, - string, - stringLiteral, - union, -} from "../../../src/core/schemas/builders"; -import { booleanLiteral } from "../../../src/core/schemas/builders/literals/booleanLiteral"; -import { property } from "../../../src/core/schemas/builders/object/property"; -import { itSchema } from "./utils/itSchema"; - -describe("Schema", () => { - itSchema( - "large nested object", - object({ - a: string(), - b: stringLiteral("b value"), - c: property( - "raw_c", - list( - object({ - animal: union(discriminant("type", "_type"), { - dog: object({ value: boolean() }), - cat: object({ value: property("raw_cat", number()) }), - }), - }) - ) - ), - d: property("raw_d", boolean()), - e: booleanLiteral(true), - }), - { - raw: { - a: "hello", - b: "b value", - raw_c: [ - { - animal: { - _type: "dog", - value: true, - }, - }, - { - animal: { - _type: "cat", - raw_cat: 42, - }, - }, - ], - raw_d: false, - e: true, - }, - parsed: { - a: "hello", - b: "b value", - c: [ - { - animal: { - type: "dog", - value: true, - }, - }, - { - animal: { - type: "cat", - value: 42, - }, - }, - ], - d: false, - e: true, - }, - } - ); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/set/set.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/set/set.test.ts deleted file mode 100644 index e17f908c80e..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/set/set.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { set, string } from "../../../../src/core/schemas/builders"; -import { itSchema } from "../utils/itSchema"; -import { itValidateJson, itValidateParse } from "../utils/itValidate"; - -describe("set", () => { - itSchema("converts between raw list and parsed Set", set(string()), { - raw: ["A", "B"], - parsed: new Set(["A", "B"]), - }); - - itValidateParse("not a list", set(string()), 42, [ - { - path: [], - message: "Expected list. Received 42.", - }, - ]); - - itValidateJson( - "not a Set", - set(string()), - [], - [ - { - path: [], - message: "Expected Set. Received list.", - }, - ] - ); - - itValidateParse( - "invalid item type", - set(string()), - [42], - [ - { - path: ["[0]"], - message: "Expected string. Received 42.", - }, - ] - ); - - itValidateJson("invalid item type", set(string()), new Set([42]), [ - { - path: ["[0]"], - message: "Expected string. Received 42.", - }, - ]); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/skipValidation.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/skipValidation.test.ts deleted file mode 100644 index 5dc88096a9f..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/skipValidation.test.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* eslint-disable no-console */ - -import { boolean, number, object, property, string, undiscriminatedUnion } from "../../../src/core/schemas/builders"; - -describe("skipValidation", () => { - it("allows data that doesn't conform to the schema", async () => { - const warningLogs: string[] = []; - const originalConsoleWarn = console.warn; - console.warn = (...args) => warningLogs.push(args.join(" ")); - - const schema = object({ - camelCase: property("snake_case", string()), - numberProperty: number(), - requiredProperty: boolean(), - anyPrimitive: undiscriminatedUnion([string(), number(), boolean()]), - }); - - const parsed = await schema.parse( - { - snake_case: "hello", - numberProperty: "oops", - anyPrimitive: true, - }, - { - skipValidation: true, - } - ); - - expect(parsed).toEqual({ - ok: true, - value: { - camelCase: "hello", - numberProperty: "oops", - anyPrimitive: true, - }, - }); - - expect(warningLogs).toEqual([ - `Failed to validate. - - numberProperty: Expected number. Received "oops".`, - ]); - - console.warn = originalConsoleWarn; - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/undiscriminated-union/undiscriminatedUnion.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/undiscriminated-union/undiscriminatedUnion.test.ts deleted file mode 100644 index 0e66433371c..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/undiscriminated-union/undiscriminatedUnion.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { number, object, property, string, undiscriminatedUnion } from "../../../../src/core/schemas/builders"; -import { itSchema, itSchemaIdentity } from "../utils/itSchema"; - -describe("undiscriminatedUnion", () => { - itSchemaIdentity(undiscriminatedUnion([string(), number()]), "hello world"); - - itSchemaIdentity(undiscriminatedUnion([object({ hello: string() }), object({ goodbye: string() })]), { - goodbye: "foo", - }); - - itSchema( - "Correctly transforms", - undiscriminatedUnion([object({ hello: string() }), object({ helloWorld: property("hello_world", string()) })]), - { - raw: { hello_world: "foo " }, - parsed: { helloWorld: "foo " }, - } - ); - - it("Returns errors for all variants", async () => { - const result = await undiscriminatedUnion([string(), number()]).parse(true); - if (result.ok) { - throw new Error("Unexpectedly passed validation"); - } - expect(result.errors).toEqual([ - { - message: "[Variant 0] Expected string. Received true.", - path: [], - }, - { - message: "[Variant 1] Expected number. Received true.", - path: [], - }, - ]); - }); - - describe("compile", () => { - // eslint-disable-next-line jest/expect-expect - it("doesn't compile with zero members", () => { - // @ts-expect-error - () => undiscriminatedUnion([]); - }); - }); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/union/union.test.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/union/union.test.ts deleted file mode 100644 index 790184603ac..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/union/union.test.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { boolean, discriminant, number, object, string, union } from "../../../../src/core/schemas/builders"; -import { itSchema, itSchemaIdentity } from "../utils/itSchema"; -import { itValidate } from "../utils/itValidate"; - -describe("union", () => { - itSchemaIdentity( - union("type", { - lion: object({ - meows: boolean(), - }), - giraffe: object({ - heightInInches: number(), - }), - }), - { type: "lion", meows: true }, - { title: "doesn't transform discriminant when it's a string" } - ); - - itSchema( - "transforms discriminant when it's a discriminant()", - union(discriminant("type", "_type"), { - lion: object({ meows: boolean() }), - giraffe: object({ heightInInches: number() }), - }), - { - raw: { _type: "lion", meows: true }, - parsed: { type: "lion", meows: true }, - } - ); - - describe("allowUnrecognizedUnionMembers", () => { - itSchema( - "transforms discriminant & passes through values when discriminant value is unrecognized", - union(discriminant("type", "_type"), { - lion: object({ meows: boolean() }), - giraffe: object({ heightInInches: number() }), - }), - { - // @ts-expect-error - raw: { _type: "moose", isAMoose: true }, - // @ts-expect-error - parsed: { type: "moose", isAMoose: true }, - opts: { - allowUnrecognizedUnionMembers: true, - }, - } - ); - }); - - describe("withParsedProperties", () => { - it("Added property is included on parsed object", async () => { - const schema = union("type", { - lion: object({}), - tiger: object({ value: string() }), - }).withParsedProperties({ - printType: (parsed) => () => parsed.type, - }); - - const parsed = await schema.parse({ type: "lion" }); - if (!parsed.ok) { - throw new Error("Failed to parse"); - } - expect(parsed.value.printType()).toBe("lion"); - }); - }); - - itValidate( - "non-object", - union("type", { - lion: object({}), - tiger: object({ value: string() }), - }), - [], - [ - { - path: [], - message: "Expected object. Received list.", - }, - ] - ); - - itValidate( - "missing discriminant", - union("type", { - lion: object({}), - tiger: object({ value: string() }), - }), - {}, - [ - { - path: [], - message: 'Missing discriminant ("type")', - }, - ] - ); - - itValidate( - "unrecognized discriminant value", - union("type", { - lion: object({}), - tiger: object({ value: string() }), - }), - { - type: "bear", - }, - [ - { - path: ["type"], - message: 'Expected enum. Received "bear".', - }, - ] - ); -}); diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/utils/itSchema.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/utils/itSchema.ts deleted file mode 100644 index 67b6c928175..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/utils/itSchema.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* eslint-disable jest/no-export */ -import { Schema, SchemaOptions } from "../../../../src/core/schemas/Schema"; - -export function itSchemaIdentity( - schema: Schema, - value: T, - { title = "functions as identity", opts }: { title?: string; opts?: SchemaOptions } = {} -): void { - itSchema(title, schema, { raw: value, parsed: value, opts }); -} - -export function itSchema( - title: string, - schema: Schema, - { - raw, - parsed, - opts, - only = false, - }: { - raw: Raw; - parsed: Parsed; - opts?: SchemaOptions; - only?: boolean; - } -): void { - // eslint-disable-next-line jest/valid-title - (only ? describe.only : describe)(title, () => { - itParse("parse()", schema, { raw, parsed, opts }); - itJson("json()", schema, { raw, parsed, opts }); - }); -} - -export function itParse( - title: string, - schema: Schema, - { - raw, - parsed, - opts, - }: { - raw: Raw; - parsed: Parsed; - opts?: SchemaOptions; - } -): void { - // eslint-disable-next-line jest/valid-title - it(title, () => { - const maybeValid = schema.parse(raw, opts); - if (!maybeValid.ok) { - throw new Error("Failed to parse() " + JSON.stringify(maybeValid.errors, undefined, 4)); - } - expect(maybeValid.value).toStrictEqual(parsed); - }); -} - -export function itJson( - title: string, - schema: Schema, - { - raw, - parsed, - opts, - }: { - raw: Raw; - parsed: Parsed; - opts?: SchemaOptions; - } -): void { - // eslint-disable-next-line jest/valid-title - it(title, () => { - const maybeValid = schema.json(parsed, opts); - if (!maybeValid.ok) { - throw new Error("Failed to json() " + JSON.stringify(maybeValid.errors, undefined, 4)); - } - expect(maybeValid.value).toStrictEqual(raw); - }); -} diff --git a/seed/ts-sdk/inline-types/tests/unit/zurg/utils/itValidate.ts b/seed/ts-sdk/inline-types/tests/unit/zurg/utils/itValidate.ts deleted file mode 100644 index 75b2c08b036..00000000000 --- a/seed/ts-sdk/inline-types/tests/unit/zurg/utils/itValidate.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* eslint-disable jest/no-export */ -import { Schema, SchemaOptions, ValidationError } from "../../../../src/core/schemas/Schema"; - -export function itValidate( - title: string, - schema: Schema, - input: unknown, - errors: ValidationError[], - opts?: SchemaOptions -): void { - // eslint-disable-next-line jest/valid-title - describe("parse()", () => { - itValidateParse(title, schema, input, errors, opts); - }); - describe("json()", () => { - itValidateJson(title, schema, input, errors, opts); - }); -} - -export function itValidateParse( - title: string, - schema: Schema, - raw: unknown, - errors: ValidationError[], - opts?: SchemaOptions -): void { - describe("parse", () => { - // eslint-disable-next-line jest/valid-title - it(title, async () => { - const maybeValid = await schema.parse(raw, opts); - if (maybeValid.ok) { - throw new Error("Value passed validation"); - } - expect(maybeValid.errors).toStrictEqual(errors); - }); - }); -} - -export function itValidateJson( - title: string, - schema: Schema, - parsed: unknown, - errors: ValidationError[], - opts?: SchemaOptions -): void { - describe("json", () => { - // eslint-disable-next-line jest/valid-title - it(title, async () => { - const maybeValid = await schema.json(parsed, opts); - if (maybeValid.ok) { - throw new Error("Value passed validation"); - } - expect(maybeValid.errors).toStrictEqual(errors); - }); - }); -} diff --git a/seed/ts-sdk/inline-types/tsconfig.json b/seed/ts-sdk/inline-types/tsconfig.json deleted file mode 100644 index 538c94fe015..00000000000 --- a/seed/ts-sdk/inline-types/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "extendedDiagnostics": true, - "strict": true, - "target": "ES6", - "module": "CommonJS", - "moduleResolution": "node", - "esModuleInterop": true, - "skipLibCheck": true, - "declaration": true, - "outDir": "dist", - "rootDir": "src", - "baseUrl": "src" - }, - "include": ["src"], - "exclude": [] -} diff --git a/seed/ts-sdk/seed.yml b/seed/ts-sdk/seed.yml index 898989cce99..81f9d58eb26 100644 --- a/seed/ts-sdk/seed.yml +++ b/seed/ts-sdk/seed.yml @@ -206,7 +206,7 @@ fixtures: - customConfig: retainOriginalCasing: true outputFolder: retain-original-casing - inline-types: + ts-inline-types: - customConfig: noSerdeLayer: true enableInlineTypes: true diff --git a/seed/ts-sdk/inline-types/.github/workflows/ci.yml b/seed/ts-sdk/ts-inline-types/inline/.github/workflows/ci.yml similarity index 100% rename from seed/ts-sdk/inline-types/.github/workflows/ci.yml rename to seed/ts-sdk/ts-inline-types/inline/.github/workflows/ci.yml diff --git a/seed/ts-sdk/inline-types/.gitignore b/seed/ts-sdk/ts-inline-types/inline/.gitignore similarity index 100% rename from seed/ts-sdk/inline-types/.gitignore rename to seed/ts-sdk/ts-inline-types/inline/.gitignore diff --git a/seed/ts-express/inline-types/.mock/definition/__package__.yml b/seed/ts-sdk/ts-inline-types/inline/.mock/definition/__package__.yml similarity index 100% rename from seed/ts-express/inline-types/.mock/definition/__package__.yml rename to seed/ts-sdk/ts-inline-types/inline/.mock/definition/__package__.yml diff --git a/seed/csharp-model/inline-types/.mock/definition/api.yml b/seed/ts-sdk/ts-inline-types/inline/.mock/definition/api.yml similarity index 100% rename from seed/csharp-model/inline-types/.mock/definition/api.yml rename to seed/ts-sdk/ts-inline-types/inline/.mock/definition/api.yml diff --git a/seed/csharp-model/inline-types/.mock/fern.config.json b/seed/ts-sdk/ts-inline-types/inline/.mock/fern.config.json similarity index 100% rename from seed/csharp-model/inline-types/.mock/fern.config.json rename to seed/ts-sdk/ts-inline-types/inline/.mock/fern.config.json diff --git a/seed/csharp-model/inline-types/.mock/generators.yml b/seed/ts-sdk/ts-inline-types/inline/.mock/generators.yml similarity index 100% rename from seed/csharp-model/inline-types/.mock/generators.yml rename to seed/ts-sdk/ts-inline-types/inline/.mock/generators.yml diff --git a/seed/ts-sdk/inline-types/.npmignore b/seed/ts-sdk/ts-inline-types/inline/.npmignore similarity index 100% rename from seed/ts-sdk/inline-types/.npmignore rename to seed/ts-sdk/ts-inline-types/inline/.npmignore diff --git a/seed/ts-sdk/inline-types/.prettierrc.yml b/seed/ts-sdk/ts-inline-types/inline/.prettierrc.yml similarity index 100% rename from seed/ts-sdk/inline-types/.prettierrc.yml rename to seed/ts-sdk/ts-inline-types/inline/.prettierrc.yml diff --git a/seed/ts-sdk/inline-types/inline/README.md b/seed/ts-sdk/ts-inline-types/inline/README.md similarity index 91% rename from seed/ts-sdk/inline-types/inline/README.md rename to seed/ts-sdk/ts-inline-types/inline/README.md index 3a27a521141..1c1803e3a0f 100644 --- a/seed/ts-sdk/inline-types/inline/README.md +++ b/seed/ts-sdk/ts-inline-types/inline/README.md @@ -1,14 +1,14 @@ # Seed TypeScript 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%2FTypeScript) -[![npm shield](https://img.shields.io/npm/v/@fern/inline-types)](https://www.npmjs.com/package/@fern/inline-types) +[![npm shield](https://img.shields.io/npm/v/@fern/ts-inline-types)](https://www.npmjs.com/package/@fern/ts-inline-types) The Seed TypeScript library provides convenient access to the Seed API from TypeScript. ## Installation ```sh -npm i -s @fern/inline-types +npm i -s @fern/ts-inline-types ``` ## Reference @@ -20,7 +20,7 @@ A full reference for this library is available [here](./reference.md). Instantiate and use the client with the following: ```typescript -import { SeedObjectClient } from "@fern/inline-types"; +import { SeedObjectClient } from "@fern/ts-inline-types"; const client = new SeedObjectClient({ environment: "YOUR_BASE_URL" }); await client.getRoot({ @@ -37,7 +37,7 @@ The SDK exports all request and response types as TypeScript interfaces. Simply following namespace: ```typescript -import { SeedObject } from "@fern/inline-types"; +import { SeedObject } from "@fern/ts-inline-types"; const request: SeedObject.PostRootRequest = { ... @@ -50,7 +50,7 @@ When the API returns a non-success status code (4xx or 5xx response), a subclass will be thrown. ```typescript -import { SeedObjectError } from "@fern/inline-types"; +import { SeedObjectError } from "@fern/ts-inline-types"; try { await client.getRoot(...); @@ -137,7 +137,7 @@ The SDK provides a way for your to customize the underlying HTTP client / Fetch unsupported environment, this provides a way for you to break glass and ensure the SDK works. ```typescript -import { SeedObjectClient } from "@fern/inline-types"; +import { SeedObjectClient } from "@fern/ts-inline-types"; const client = new SeedObjectClient({ ... diff --git a/seed/ts-sdk/inline-types/inline/jest.config.js b/seed/ts-sdk/ts-inline-types/inline/jest.config.js similarity index 100% rename from seed/ts-sdk/inline-types/inline/jest.config.js rename to seed/ts-sdk/ts-inline-types/inline/jest.config.js diff --git a/seed/ts-sdk/inline-types/package.json b/seed/ts-sdk/ts-inline-types/inline/package.json similarity index 91% rename from seed/ts-sdk/inline-types/package.json rename to seed/ts-sdk/ts-inline-types/inline/package.json index c62c4aac8d7..dc2a30803f2 100644 --- a/seed/ts-sdk/inline-types/package.json +++ b/seed/ts-sdk/ts-inline-types/inline/package.json @@ -1,8 +1,8 @@ { - "name": "@fern/inline-types", + "name": "@fern/ts-inline-types", "version": "0.0.1", "private": false, - "repository": "https://github.com/inline-types/fern", + "repository": "https://github.com/ts-inline-types/fern", "main": "./index.js", "types": "./index.d.ts", "scripts": { diff --git a/seed/ts-sdk/inline-types/inline/reference.md b/seed/ts-sdk/ts-inline-types/inline/reference.md similarity index 100% rename from seed/ts-sdk/inline-types/inline/reference.md rename to seed/ts-sdk/ts-inline-types/inline/reference.md diff --git a/seed/ts-sdk/inline-types/inline/resolved-snippet-templates.md b/seed/ts-sdk/ts-inline-types/inline/resolved-snippet-templates.md similarity index 80% rename from seed/ts-sdk/inline-types/inline/resolved-snippet-templates.md rename to seed/ts-sdk/ts-inline-types/inline/resolved-snippet-templates.md index 816b2039fa1..fbcda93ce53 100644 --- a/seed/ts-sdk/inline-types/inline/resolved-snippet-templates.md +++ b/seed/ts-sdk/ts-inline-types/inline/resolved-snippet-templates.md @@ -1,5 +1,5 @@ ```typescript -import { SeedObjectClient } from "@fern/inline-types"; +import { SeedObjectClient } from "@fern/ts-inline-types"; const client = new SeedObjectClient({ environment: "YOUR_BASE_URL" }); await client.getRoot({ @@ -13,7 +13,7 @@ await client.getRoot({ ```typescript -import { SeedObjectClient } from "@fern/inline-types"; +import { SeedObjectClient } from "@fern/ts-inline-types"; const client = new SeedObjectClient({ environment: "YOUR_BASE_URL" }); await client.getDiscriminatedUnion( @@ -39,7 +39,7 @@ await client.getDiscriminatedUnion( ```typescript -import { SeedObjectClient } from "@fern/inline-types"; +import { SeedObjectClient } from "@fern/ts-inline-types"; const client = new SeedObjectClient({ environment: "YOUR_BASE_URL" }); await client.getUndiscriminatedUnion({ diff --git a/seed/ts-sdk/inline-types/inline/snippet-templates.json b/seed/ts-sdk/ts-inline-types/inline/snippet-templates.json similarity index 99% rename from seed/ts-sdk/inline-types/inline/snippet-templates.json rename to seed/ts-sdk/ts-inline-types/inline/snippet-templates.json index 30032968443..cd56b6e54ef 100644 --- a/seed/ts-sdk/inline-types/inline/snippet-templates.json +++ b/seed/ts-sdk/ts-inline-types/inline/snippet-templates.json @@ -1,7 +1,7 @@ [ { "sdk": { - "package": "@fern/inline-types", + "package": "@fern/ts-inline-types", "version": "0.0.1", "type": "typescript" }, @@ -13,7 +13,7 @@ "snippetTemplate": { "clientInstantiation": { "imports": [ - "import { SeedObjectClient } from \"@fern/inline-types\";" + "import { SeedObjectClient } from \"@fern/ts-inline-types\";" ], "templateString": "const client = new SeedObjectClient($FERN_INPUT);", "isOptional": false, @@ -113,7 +113,7 @@ }, { "sdk": { - "package": "@fern/inline-types", + "package": "@fern/ts-inline-types", "version": "0.0.1", "type": "typescript" }, @@ -125,7 +125,7 @@ "snippetTemplate": { "clientInstantiation": { "imports": [ - "import { SeedObjectClient } from \"@fern/inline-types\";" + "import { SeedObjectClient } from \"@fern/ts-inline-types\";" ], "templateString": "const client = new SeedObjectClient($FERN_INPUT);", "isOptional": false, @@ -434,7 +434,7 @@ }, { "sdk": { - "package": "@fern/inline-types", + "package": "@fern/ts-inline-types", "version": "0.0.1", "type": "typescript" }, @@ -446,7 +446,7 @@ "snippetTemplate": { "clientInstantiation": { "imports": [ - "import { SeedObjectClient } from \"@fern/inline-types\";" + "import { SeedObjectClient } from \"@fern/ts-inline-types\";" ], "templateString": "const client = new SeedObjectClient($FERN_INPUT);", "isOptional": false, diff --git a/seed/ts-sdk/inline-types/no-inline/snippet.json b/seed/ts-sdk/ts-inline-types/inline/snippet.json similarity index 52% rename from seed/ts-sdk/inline-types/no-inline/snippet.json rename to seed/ts-sdk/ts-inline-types/inline/snippet.json index 6b5456d3c0d..e312ef07c6f 100644 --- a/seed/ts-sdk/inline-types/no-inline/snippet.json +++ b/seed/ts-sdk/ts-inline-types/inline/snippet.json @@ -8,7 +8,7 @@ }, "snippet": { "type": "typescript", - "client": "import { SeedObjectClient } from \"@fern/inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getRoot({\n bar: {\n foo: \"foo\"\n },\n foo: \"foo\"\n});\n" + "client": "import { SeedObjectClient } from \"@fern/ts-inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getRoot({\n bar: {\n foo: \"foo\"\n },\n foo: \"foo\"\n});\n" } }, { @@ -19,7 +19,7 @@ }, "snippet": { "type": "typescript", - "client": "import { SeedObjectClient } from \"@fern/inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getDiscriminatedUnion({\n bar: {\n type: \"type1\",\n foo: \"foo\",\n bar: {\n foo: \"foo\",\n ref: {\n foo: \"foo\"\n }\n },\n ref: {\n foo: \"foo\"\n }\n },\n foo: \"foo\"\n});\n" + "client": "import { SeedObjectClient } from \"@fern/ts-inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getDiscriminatedUnion({\n bar: {\n type: \"type1\",\n foo: \"foo\",\n bar: {\n foo: \"foo\",\n ref: {\n foo: \"foo\"\n }\n },\n ref: {\n foo: \"foo\"\n }\n },\n foo: \"foo\"\n});\n" } }, { @@ -30,7 +30,7 @@ }, "snippet": { "type": "typescript", - "client": "import { SeedObjectClient } from \"@fern/inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getUndiscriminatedUnion({\n bar: {\n foo: \"foo\",\n bar: {\n foo: \"foo\",\n ref: {\n foo: \"foo\"\n }\n },\n ref: {\n foo: \"foo\"\n }\n },\n foo: \"foo\"\n});\n" + "client": "import { SeedObjectClient } from \"@fern/ts-inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getUndiscriminatedUnion({\n bar: {\n foo: \"foo\",\n bar: {\n foo: \"foo\",\n ref: {\n foo: \"foo\"\n }\n },\n ref: {\n foo: \"foo\"\n }\n },\n foo: \"foo\"\n});\n" } } ], diff --git a/seed/ts-sdk/inline-types/inline/src/Client.ts b/seed/ts-sdk/ts-inline-types/inline/src/Client.ts similarity index 95% rename from seed/ts-sdk/inline-types/inline/src/Client.ts rename to seed/ts-sdk/ts-inline-types/inline/src/Client.ts index 888489f9147..d0e9dbcc717 100644 --- a/seed/ts-sdk/inline-types/inline/src/Client.ts +++ b/seed/ts-sdk/ts-inline-types/inline/src/Client.ts @@ -48,9 +48,9 @@ export class SeedObjectClient { method: "POST", headers: { "X-Fern-Language": "JavaScript", - "X-Fern-SDK-Name": "@fern/inline-types", + "X-Fern-SDK-Name": "@fern/ts-inline-types", "X-Fern-SDK-Version": "0.0.1", - "User-Agent": "@fern/inline-types/0.0.1", + "User-Agent": "@fern/ts-inline-types/0.0.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -119,9 +119,9 @@ export class SeedObjectClient { method: "POST", headers: { "X-Fern-Language": "JavaScript", - "X-Fern-SDK-Name": "@fern/inline-types", + "X-Fern-SDK-Name": "@fern/ts-inline-types", "X-Fern-SDK-Version": "0.0.1", - "User-Agent": "@fern/inline-types/0.0.1", + "User-Agent": "@fern/ts-inline-types/0.0.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -191,9 +191,9 @@ export class SeedObjectClient { method: "POST", headers: { "X-Fern-Language": "JavaScript", - "X-Fern-SDK-Name": "@fern/inline-types", + "X-Fern-SDK-Name": "@fern/ts-inline-types", "X-Fern-SDK-Version": "0.0.1", - "User-Agent": "@fern/inline-types/0.0.1", + "User-Agent": "@fern/ts-inline-types/0.0.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/seed/ts-express/inline-types/api/service/index.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/client/index.ts similarity index 100% rename from seed/ts-express/inline-types/api/service/index.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/client/index.ts diff --git a/seed/ts-sdk/inline-types/inline/src/api/client/requests/GetDiscriminatedUnionRequest.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/client/requests/GetDiscriminatedUnionRequest.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/api/client/requests/GetDiscriminatedUnionRequest.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/client/requests/GetDiscriminatedUnionRequest.ts diff --git a/seed/ts-sdk/inline-types/inline/src/api/client/requests/GetUndiscriminatedUnionRequest.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/client/requests/GetUndiscriminatedUnionRequest.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/api/client/requests/GetUndiscriminatedUnionRequest.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/client/requests/GetUndiscriminatedUnionRequest.ts diff --git a/seed/ts-sdk/inline-types/inline/src/api/client/requests/PostRootRequest.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/client/requests/PostRootRequest.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/api/client/requests/PostRootRequest.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/client/requests/PostRootRequest.ts diff --git a/seed/ts-sdk/inline-types/inline/src/api/client/requests/index.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/client/requests/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/api/client/requests/index.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/client/requests/index.ts diff --git a/seed/ts-sdk/inline-types/inline/src/api/index.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/api/index.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/index.ts diff --git a/seed/ts-sdk/inline-types/inline/src/api/types/AliasListInline.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/types/AliasListInline.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/api/types/AliasListInline.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/types/AliasListInline.ts diff --git a/seed/ts-sdk/inline-types/inline/src/api/types/AliasMapInline.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/types/AliasMapInline.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/api/types/AliasMapInline.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/types/AliasMapInline.ts diff --git a/seed/ts-sdk/inline-types/inline/src/api/types/AliasSetInline.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/types/AliasSetInline.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/api/types/AliasSetInline.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/types/AliasSetInline.ts diff --git a/seed/ts-express/inline-types/api/types/ReferenceType.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/types/ReferenceType.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/ReferenceType.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/types/ReferenceType.ts diff --git a/seed/ts-sdk/inline-types/inline/src/api/types/RootType1.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/types/RootType1.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/api/types/RootType1.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/types/RootType1.ts diff --git a/seed/ts-express/inline-types/api/types/UserId.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/types/UserId.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UserId.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/types/UserId.ts diff --git a/seed/ts-sdk/inline-types/inline/src/api/types/index.ts b/seed/ts-sdk/ts-inline-types/inline/src/api/types/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/api/types/index.ts rename to seed/ts-sdk/ts-inline-types/inline/src/api/types/index.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/APIResponse.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/APIResponse.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/APIResponse.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/APIResponse.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/Fetcher.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/Fetcher.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/Fetcher.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/Supplier.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/Supplier.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/Supplier.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/Supplier.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/createRequestUrl.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/createRequestUrl.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/createRequestUrl.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/createRequestUrl.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/getFetchFn.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/getFetchFn.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/getFetchFn.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/getFetchFn.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/getHeader.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/getHeader.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/getHeader.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/getHeader.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/getRequestBody.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/getRequestBody.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/getRequestBody.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/getRequestBody.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/getResponseBody.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/getResponseBody.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/getResponseBody.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/index.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/index.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/index.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/makeRequest.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/makeRequest.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/makeRequest.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/makeRequest.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/requestWithRetries.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/requestWithRetries.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/requestWithRetries.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/requestWithRetries.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/signals.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/signals.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/signals.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/signals.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/index.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/index.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/index.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/runtime/index.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/runtime/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/runtime/index.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/runtime/index.ts diff --git a/seed/ts-sdk/inline-types/inline/src/core/runtime/runtime.ts b/seed/ts-sdk/ts-inline-types/inline/src/core/runtime/runtime.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/core/runtime/runtime.ts rename to seed/ts-sdk/ts-inline-types/inline/src/core/runtime/runtime.ts diff --git a/seed/ts-sdk/inline-types/inline/src/errors/SeedObjectError.ts b/seed/ts-sdk/ts-inline-types/inline/src/errors/SeedObjectError.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/errors/SeedObjectError.ts rename to seed/ts-sdk/ts-inline-types/inline/src/errors/SeedObjectError.ts diff --git a/seed/ts-sdk/inline-types/inline/src/errors/SeedObjectTimeoutError.ts b/seed/ts-sdk/ts-inline-types/inline/src/errors/SeedObjectTimeoutError.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/errors/SeedObjectTimeoutError.ts rename to seed/ts-sdk/ts-inline-types/inline/src/errors/SeedObjectTimeoutError.ts diff --git a/seed/ts-sdk/inline-types/inline/src/errors/index.ts b/seed/ts-sdk/ts-inline-types/inline/src/errors/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/errors/index.ts rename to seed/ts-sdk/ts-inline-types/inline/src/errors/index.ts diff --git a/seed/ts-sdk/inline-types/inline/src/index.ts b/seed/ts-sdk/ts-inline-types/inline/src/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/index.ts rename to seed/ts-sdk/ts-inline-types/inline/src/index.ts diff --git a/seed/ts-sdk/inline-types/inline/src/version.ts b/seed/ts-sdk/ts-inline-types/inline/src/version.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/version.ts rename to seed/ts-sdk/ts-inline-types/inline/src/version.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/custom.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/custom.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/custom.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/custom.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/Fetcher.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/Fetcher.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/Fetcher.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/Fetcher.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/createRequestUrl.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/createRequestUrl.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/createRequestUrl.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/createRequestUrl.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/getFetchFn.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/getFetchFn.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/getFetchFn.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/getFetchFn.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/getRequestBody.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/getRequestBody.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/getRequestBody.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/getRequestBody.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/getResponseBody.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/getResponseBody.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/getResponseBody.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/getResponseBody.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/makeRequest.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/makeRequest.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/makeRequest.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/makeRequest.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/requestWithRetries.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/requestWithRetries.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/requestWithRetries.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/requestWithRetries.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/signals.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/signals.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/signals.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/signals.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/stream-wrappers/webpack.test.ts b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/stream-wrappers/webpack.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/stream-wrappers/webpack.test.ts rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/stream-wrappers/webpack.test.ts diff --git a/seed/ts-sdk/inline-types/inline/tests/unit/fetcher/test-file.txt b/seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/test-file.txt similarity index 100% rename from seed/ts-sdk/inline-types/inline/tests/unit/fetcher/test-file.txt rename to seed/ts-sdk/ts-inline-types/inline/tests/unit/fetcher/test-file.txt diff --git a/seed/ts-sdk/inline-types/inline/tsconfig.json b/seed/ts-sdk/ts-inline-types/inline/tsconfig.json similarity index 100% rename from seed/ts-sdk/inline-types/inline/tsconfig.json rename to seed/ts-sdk/ts-inline-types/inline/tsconfig.json diff --git a/seed/ts-sdk/inline-types/inline/.github/workflows/ci.yml b/seed/ts-sdk/ts-inline-types/no-inline/.github/workflows/ci.yml similarity index 100% rename from seed/ts-sdk/inline-types/inline/.github/workflows/ci.yml rename to seed/ts-sdk/ts-inline-types/no-inline/.github/workflows/ci.yml diff --git a/seed/ts-sdk/inline-types/inline/.gitignore b/seed/ts-sdk/ts-inline-types/no-inline/.gitignore similarity index 100% rename from seed/ts-sdk/inline-types/inline/.gitignore rename to seed/ts-sdk/ts-inline-types/no-inline/.gitignore diff --git a/seed/ts-sdk/inline-types/inline/.mock/definition/__package__.yml b/seed/ts-sdk/ts-inline-types/no-inline/.mock/definition/__package__.yml similarity index 100% rename from seed/ts-sdk/inline-types/inline/.mock/definition/__package__.yml rename to seed/ts-sdk/ts-inline-types/no-inline/.mock/definition/__package__.yml diff --git a/seed/csharp-sdk/inline-types/.mock/definition/api.yml b/seed/ts-sdk/ts-inline-types/no-inline/.mock/definition/api.yml similarity index 100% rename from seed/csharp-sdk/inline-types/.mock/definition/api.yml rename to seed/ts-sdk/ts-inline-types/no-inline/.mock/definition/api.yml diff --git a/seed/csharp-sdk/inline-types/.mock/fern.config.json b/seed/ts-sdk/ts-inline-types/no-inline/.mock/fern.config.json similarity index 100% rename from seed/csharp-sdk/inline-types/.mock/fern.config.json rename to seed/ts-sdk/ts-inline-types/no-inline/.mock/fern.config.json diff --git a/seed/csharp-sdk/inline-types/.mock/generators.yml b/seed/ts-sdk/ts-inline-types/no-inline/.mock/generators.yml similarity index 100% rename from seed/csharp-sdk/inline-types/.mock/generators.yml rename to seed/ts-sdk/ts-inline-types/no-inline/.mock/generators.yml diff --git a/seed/ts-sdk/inline-types/inline/.npmignore b/seed/ts-sdk/ts-inline-types/no-inline/.npmignore similarity index 100% rename from seed/ts-sdk/inline-types/inline/.npmignore rename to seed/ts-sdk/ts-inline-types/no-inline/.npmignore diff --git a/seed/ts-sdk/inline-types/inline/.prettierrc.yml b/seed/ts-sdk/ts-inline-types/no-inline/.prettierrc.yml similarity index 100% rename from seed/ts-sdk/inline-types/inline/.prettierrc.yml rename to seed/ts-sdk/ts-inline-types/no-inline/.prettierrc.yml diff --git a/seed/ts-sdk/inline-types/no-inline/README.md b/seed/ts-sdk/ts-inline-types/no-inline/README.md similarity index 91% rename from seed/ts-sdk/inline-types/no-inline/README.md rename to seed/ts-sdk/ts-inline-types/no-inline/README.md index 3a27a521141..1c1803e3a0f 100644 --- a/seed/ts-sdk/inline-types/no-inline/README.md +++ b/seed/ts-sdk/ts-inline-types/no-inline/README.md @@ -1,14 +1,14 @@ # Seed TypeScript 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%2FTypeScript) -[![npm shield](https://img.shields.io/npm/v/@fern/inline-types)](https://www.npmjs.com/package/@fern/inline-types) +[![npm shield](https://img.shields.io/npm/v/@fern/ts-inline-types)](https://www.npmjs.com/package/@fern/ts-inline-types) The Seed TypeScript library provides convenient access to the Seed API from TypeScript. ## Installation ```sh -npm i -s @fern/inline-types +npm i -s @fern/ts-inline-types ``` ## Reference @@ -20,7 +20,7 @@ A full reference for this library is available [here](./reference.md). Instantiate and use the client with the following: ```typescript -import { SeedObjectClient } from "@fern/inline-types"; +import { SeedObjectClient } from "@fern/ts-inline-types"; const client = new SeedObjectClient({ environment: "YOUR_BASE_URL" }); await client.getRoot({ @@ -37,7 +37,7 @@ The SDK exports all request and response types as TypeScript interfaces. Simply following namespace: ```typescript -import { SeedObject } from "@fern/inline-types"; +import { SeedObject } from "@fern/ts-inline-types"; const request: SeedObject.PostRootRequest = { ... @@ -50,7 +50,7 @@ When the API returns a non-success status code (4xx or 5xx response), a subclass will be thrown. ```typescript -import { SeedObjectError } from "@fern/inline-types"; +import { SeedObjectError } from "@fern/ts-inline-types"; try { await client.getRoot(...); @@ -137,7 +137,7 @@ The SDK provides a way for your to customize the underlying HTTP client / Fetch unsupported environment, this provides a way for you to break glass and ensure the SDK works. ```typescript -import { SeedObjectClient } from "@fern/inline-types"; +import { SeedObjectClient } from "@fern/ts-inline-types"; const client = new SeedObjectClient({ ... diff --git a/seed/ts-sdk/inline-types/jest.config.js b/seed/ts-sdk/ts-inline-types/no-inline/jest.config.js similarity index 100% rename from seed/ts-sdk/inline-types/jest.config.js rename to seed/ts-sdk/ts-inline-types/no-inline/jest.config.js diff --git a/seed/ts-sdk/inline-types/no-inline/package.json b/seed/ts-sdk/ts-inline-types/no-inline/package.json similarity index 91% rename from seed/ts-sdk/inline-types/no-inline/package.json rename to seed/ts-sdk/ts-inline-types/no-inline/package.json index c62c4aac8d7..dc2a30803f2 100644 --- a/seed/ts-sdk/inline-types/no-inline/package.json +++ b/seed/ts-sdk/ts-inline-types/no-inline/package.json @@ -1,8 +1,8 @@ { - "name": "@fern/inline-types", + "name": "@fern/ts-inline-types", "version": "0.0.1", "private": false, - "repository": "https://github.com/inline-types/fern", + "repository": "https://github.com/ts-inline-types/fern", "main": "./index.js", "types": "./index.d.ts", "scripts": { diff --git a/seed/ts-sdk/inline-types/no-inline/reference.md b/seed/ts-sdk/ts-inline-types/no-inline/reference.md similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/reference.md rename to seed/ts-sdk/ts-inline-types/no-inline/reference.md diff --git a/seed/ts-sdk/inline-types/no-inline/resolved-snippet-templates.md b/seed/ts-sdk/ts-inline-types/no-inline/resolved-snippet-templates.md similarity index 80% rename from seed/ts-sdk/inline-types/no-inline/resolved-snippet-templates.md rename to seed/ts-sdk/ts-inline-types/no-inline/resolved-snippet-templates.md index 816b2039fa1..fbcda93ce53 100644 --- a/seed/ts-sdk/inline-types/no-inline/resolved-snippet-templates.md +++ b/seed/ts-sdk/ts-inline-types/no-inline/resolved-snippet-templates.md @@ -1,5 +1,5 @@ ```typescript -import { SeedObjectClient } from "@fern/inline-types"; +import { SeedObjectClient } from "@fern/ts-inline-types"; const client = new SeedObjectClient({ environment: "YOUR_BASE_URL" }); await client.getRoot({ @@ -13,7 +13,7 @@ await client.getRoot({ ```typescript -import { SeedObjectClient } from "@fern/inline-types"; +import { SeedObjectClient } from "@fern/ts-inline-types"; const client = new SeedObjectClient({ environment: "YOUR_BASE_URL" }); await client.getDiscriminatedUnion( @@ -39,7 +39,7 @@ await client.getDiscriminatedUnion( ```typescript -import { SeedObjectClient } from "@fern/inline-types"; +import { SeedObjectClient } from "@fern/ts-inline-types"; const client = new SeedObjectClient({ environment: "YOUR_BASE_URL" }); await client.getUndiscriminatedUnion({ diff --git a/seed/ts-sdk/inline-types/no-inline/snippet-templates.json b/seed/ts-sdk/ts-inline-types/no-inline/snippet-templates.json similarity index 99% rename from seed/ts-sdk/inline-types/no-inline/snippet-templates.json rename to seed/ts-sdk/ts-inline-types/no-inline/snippet-templates.json index 30032968443..cd56b6e54ef 100644 --- a/seed/ts-sdk/inline-types/no-inline/snippet-templates.json +++ b/seed/ts-sdk/ts-inline-types/no-inline/snippet-templates.json @@ -1,7 +1,7 @@ [ { "sdk": { - "package": "@fern/inline-types", + "package": "@fern/ts-inline-types", "version": "0.0.1", "type": "typescript" }, @@ -13,7 +13,7 @@ "snippetTemplate": { "clientInstantiation": { "imports": [ - "import { SeedObjectClient } from \"@fern/inline-types\";" + "import { SeedObjectClient } from \"@fern/ts-inline-types\";" ], "templateString": "const client = new SeedObjectClient($FERN_INPUT);", "isOptional": false, @@ -113,7 +113,7 @@ }, { "sdk": { - "package": "@fern/inline-types", + "package": "@fern/ts-inline-types", "version": "0.0.1", "type": "typescript" }, @@ -125,7 +125,7 @@ "snippetTemplate": { "clientInstantiation": { "imports": [ - "import { SeedObjectClient } from \"@fern/inline-types\";" + "import { SeedObjectClient } from \"@fern/ts-inline-types\";" ], "templateString": "const client = new SeedObjectClient($FERN_INPUT);", "isOptional": false, @@ -434,7 +434,7 @@ }, { "sdk": { - "package": "@fern/inline-types", + "package": "@fern/ts-inline-types", "version": "0.0.1", "type": "typescript" }, @@ -446,7 +446,7 @@ "snippetTemplate": { "clientInstantiation": { "imports": [ - "import { SeedObjectClient } from \"@fern/inline-types\";" + "import { SeedObjectClient } from \"@fern/ts-inline-types\";" ], "templateString": "const client = new SeedObjectClient($FERN_INPUT);", "isOptional": false, diff --git a/seed/ts-sdk/inline-types/inline/snippet.json b/seed/ts-sdk/ts-inline-types/no-inline/snippet.json similarity index 52% rename from seed/ts-sdk/inline-types/inline/snippet.json rename to seed/ts-sdk/ts-inline-types/no-inline/snippet.json index 6b5456d3c0d..e312ef07c6f 100644 --- a/seed/ts-sdk/inline-types/inline/snippet.json +++ b/seed/ts-sdk/ts-inline-types/no-inline/snippet.json @@ -8,7 +8,7 @@ }, "snippet": { "type": "typescript", - "client": "import { SeedObjectClient } from \"@fern/inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getRoot({\n bar: {\n foo: \"foo\"\n },\n foo: \"foo\"\n});\n" + "client": "import { SeedObjectClient } from \"@fern/ts-inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getRoot({\n bar: {\n foo: \"foo\"\n },\n foo: \"foo\"\n});\n" } }, { @@ -19,7 +19,7 @@ }, "snippet": { "type": "typescript", - "client": "import { SeedObjectClient } from \"@fern/inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getDiscriminatedUnion({\n bar: {\n type: \"type1\",\n foo: \"foo\",\n bar: {\n foo: \"foo\",\n ref: {\n foo: \"foo\"\n }\n },\n ref: {\n foo: \"foo\"\n }\n },\n foo: \"foo\"\n});\n" + "client": "import { SeedObjectClient } from \"@fern/ts-inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getDiscriminatedUnion({\n bar: {\n type: \"type1\",\n foo: \"foo\",\n bar: {\n foo: \"foo\",\n ref: {\n foo: \"foo\"\n }\n },\n ref: {\n foo: \"foo\"\n }\n },\n foo: \"foo\"\n});\n" } }, { @@ -30,7 +30,7 @@ }, "snippet": { "type": "typescript", - "client": "import { SeedObjectClient } from \"@fern/inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getUndiscriminatedUnion({\n bar: {\n foo: \"foo\",\n bar: {\n foo: \"foo\",\n ref: {\n foo: \"foo\"\n }\n },\n ref: {\n foo: \"foo\"\n }\n },\n foo: \"foo\"\n});\n" + "client": "import { SeedObjectClient } from \"@fern/ts-inline-types\";\n\nconst client = new SeedObjectClient({ environment: \"YOUR_BASE_URL\" });\nawait client.getUndiscriminatedUnion({\n bar: {\n foo: \"foo\",\n bar: {\n foo: \"foo\",\n ref: {\n foo: \"foo\"\n }\n },\n ref: {\n foo: \"foo\"\n }\n },\n foo: \"foo\"\n});\n" } } ], diff --git a/seed/ts-sdk/inline-types/no-inline/src/Client.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/Client.ts similarity index 95% rename from seed/ts-sdk/inline-types/no-inline/src/Client.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/Client.ts index 888489f9147..d0e9dbcc717 100644 --- a/seed/ts-sdk/inline-types/no-inline/src/Client.ts +++ b/seed/ts-sdk/ts-inline-types/no-inline/src/Client.ts @@ -48,9 +48,9 @@ export class SeedObjectClient { method: "POST", headers: { "X-Fern-Language": "JavaScript", - "X-Fern-SDK-Name": "@fern/inline-types", + "X-Fern-SDK-Name": "@fern/ts-inline-types", "X-Fern-SDK-Version": "0.0.1", - "User-Agent": "@fern/inline-types/0.0.1", + "User-Agent": "@fern/ts-inline-types/0.0.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -119,9 +119,9 @@ export class SeedObjectClient { method: "POST", headers: { "X-Fern-Language": "JavaScript", - "X-Fern-SDK-Name": "@fern/inline-types", + "X-Fern-SDK-Name": "@fern/ts-inline-types", "X-Fern-SDK-Version": "0.0.1", - "User-Agent": "@fern/inline-types/0.0.1", + "User-Agent": "@fern/ts-inline-types/0.0.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -191,9 +191,9 @@ export class SeedObjectClient { method: "POST", headers: { "X-Fern-Language": "JavaScript", - "X-Fern-SDK-Name": "@fern/inline-types", + "X-Fern-SDK-Name": "@fern/ts-inline-types", "X-Fern-SDK-Version": "0.0.1", - "User-Agent": "@fern/inline-types/0.0.1", + "User-Agent": "@fern/ts-inline-types/0.0.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/seed/ts-express/inline-types/serialization/service/index.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/client/index.ts similarity index 100% rename from seed/ts-express/inline-types/serialization/service/index.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/client/index.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/client/requests/GetDiscriminatedUnionRequest.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/client/requests/GetDiscriminatedUnionRequest.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/api/client/requests/GetDiscriminatedUnionRequest.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/client/requests/GetDiscriminatedUnionRequest.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/client/requests/GetUndiscriminatedUnionRequest.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/client/requests/GetUndiscriminatedUnionRequest.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/api/client/requests/GetUndiscriminatedUnionRequest.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/client/requests/GetUndiscriminatedUnionRequest.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/client/requests/PostRootRequest.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/client/requests/PostRootRequest.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/api/client/requests/PostRootRequest.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/client/requests/PostRootRequest.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/client/requests/index.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/client/requests/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/api/client/requests/index.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/client/requests/index.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/api/index.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/api/index.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/index.ts diff --git a/seed/ts-express/inline-types/api/types/AliasInlineValue.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/AliasInlineValue.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/AliasInlineValue.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/AliasInlineValue.ts diff --git a/seed/ts-express/inline-types/api/types/AliasListInline.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/AliasListInline.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/AliasListInline.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/AliasListInline.ts diff --git a/seed/ts-express/inline-types/api/types/AliasMapInline.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/AliasMapInline.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/AliasMapInline.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/AliasMapInline.ts diff --git a/seed/ts-express/inline-types/api/types/AliasSetInline.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/AliasSetInline.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/AliasSetInline.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/AliasSetInline.ts diff --git a/seed/ts-express/inline-types/api/types/DiscriminatedUnion1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/DiscriminatedUnion1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/DiscriminatedUnion1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/DiscriminatedUnion1.ts diff --git a/seed/ts-express/inline-types/api/types/DiscriminatedUnion1InlineType1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/DiscriminatedUnion1InlineType1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType1.ts diff --git a/seed/ts-express/inline-types/api/types/DiscriminatedUnion1InlineType1InlineType1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType1InlineType1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/DiscriminatedUnion1InlineType1InlineType1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType1InlineType1.ts diff --git a/seed/ts-express/inline-types/api/types/DiscriminatedUnion1InlineType2.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType2.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/DiscriminatedUnion1InlineType2.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/DiscriminatedUnion1InlineType2.ts diff --git a/seed/ts-express/inline-types/api/types/InlineEnum1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/InlineEnum1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/InlineEnum1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/InlineEnum1.ts diff --git a/seed/ts-sdk/inline-types/inline/src/api/types/ReferenceType.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/ReferenceType.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/api/types/ReferenceType.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/ReferenceType.ts diff --git a/seed/ts-express/inline-types/api/types/RequestTypeInlineType1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RequestTypeInlineType1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/RequestTypeInlineType1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RequestTypeInlineType1.ts diff --git a/seed/ts-express/inline-types/api/types/RootType1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RootType1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/RootType1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RootType1.ts diff --git a/seed/ts-express/inline-types/api/types/RootType1FooListItem.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RootType1FooListItem.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/RootType1FooListItem.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RootType1FooListItem.ts diff --git a/seed/ts-express/inline-types/api/types/RootType1FooMapValue.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RootType1FooMapValue.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/RootType1FooMapValue.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RootType1FooMapValue.ts diff --git a/seed/ts-express/inline-types/api/types/RootType1FooSetItem.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RootType1FooSetItem.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/RootType1FooSetItem.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RootType1FooSetItem.ts diff --git a/seed/ts-express/inline-types/api/types/RootType1InlineType1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RootType1InlineType1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/RootType1InlineType1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RootType1InlineType1.ts diff --git a/seed/ts-express/inline-types/api/types/RootType1InlineType1NestedInlineType1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RootType1InlineType1NestedInlineType1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/RootType1InlineType1NestedInlineType1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/RootType1InlineType1NestedInlineType1.ts diff --git a/seed/ts-express/inline-types/api/types/UndiscriminatedUnion1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UndiscriminatedUnion1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1.ts diff --git a/seed/ts-express/inline-types/api/types/UndiscriminatedUnion1DiscriminatedUnion1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UndiscriminatedUnion1DiscriminatedUnion1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1.ts diff --git a/seed/ts-express/inline-types/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1.ts diff --git a/seed/ts-express/inline-types/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1.ts diff --git a/seed/ts-express/inline-types/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1DiscriminatedUnion1InlineType2.ts diff --git a/seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineEnum1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineEnum1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineEnum1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineEnum1.ts diff --git a/seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineListItem1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineListItem1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineListItem1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineListItem1.ts diff --git a/seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineMapItem1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineMapItem1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineMapItem1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineMapItem1.ts diff --git a/seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineSetItem1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineSetItem1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineSetItem1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineSetItem1.ts diff --git a/seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineType1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineType1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType1.ts diff --git a/seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineType1InlineType1.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType1InlineType1.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineType1InlineType1.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType1InlineType1.ts diff --git a/seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineType2.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType2.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/UndiscriminatedUnion1InlineType2.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UndiscriminatedUnion1InlineType2.ts diff --git a/seed/ts-sdk/inline-types/inline/src/api/types/UserId.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UserId.ts similarity index 100% rename from seed/ts-sdk/inline-types/inline/src/api/types/UserId.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/UserId.ts diff --git a/seed/ts-express/inline-types/api/types/index.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/api/types/index.ts similarity index 100% rename from seed/ts-express/inline-types/api/types/index.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/api/types/index.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/APIResponse.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/APIResponse.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/APIResponse.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/APIResponse.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/Fetcher.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/Fetcher.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/Fetcher.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/Supplier.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/Supplier.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/Supplier.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/Supplier.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/createRequestUrl.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/createRequestUrl.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/createRequestUrl.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/createRequestUrl.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/getFetchFn.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/getFetchFn.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/getFetchFn.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/getFetchFn.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/getHeader.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/getHeader.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/getHeader.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/getHeader.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/getRequestBody.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/getRequestBody.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/getRequestBody.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/getRequestBody.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/getResponseBody.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/getResponseBody.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/getResponseBody.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/index.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/index.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/index.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/makeRequest.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/makeRequest.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/makeRequest.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/makeRequest.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/requestWithRetries.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/requestWithRetries.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/requestWithRetries.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/requestWithRetries.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/signals.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/signals.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/signals.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/signals.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/index.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/index.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/index.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/runtime/index.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/runtime/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/runtime/index.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/runtime/index.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/core/runtime/runtime.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/core/runtime/runtime.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/core/runtime/runtime.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/core/runtime/runtime.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/errors/SeedObjectError.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/errors/SeedObjectError.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/errors/SeedObjectError.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/errors/SeedObjectError.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/errors/SeedObjectTimeoutError.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/errors/SeedObjectTimeoutError.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/errors/SeedObjectTimeoutError.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/errors/SeedObjectTimeoutError.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/errors/index.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/errors/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/errors/index.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/errors/index.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/index.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/index.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/index.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/index.ts diff --git a/seed/ts-sdk/inline-types/no-inline/src/version.ts b/seed/ts-sdk/ts-inline-types/no-inline/src/version.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/src/version.ts rename to seed/ts-sdk/ts-inline-types/no-inline/src/version.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/custom.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/custom.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/custom.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/custom.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/Fetcher.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/Fetcher.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/Fetcher.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/Fetcher.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/createRequestUrl.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/createRequestUrl.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/createRequestUrl.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/createRequestUrl.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/getFetchFn.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/getFetchFn.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/getFetchFn.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/getFetchFn.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/getRequestBody.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/getRequestBody.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/getRequestBody.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/getRequestBody.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/getResponseBody.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/getResponseBody.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/getResponseBody.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/getResponseBody.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/makeRequest.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/makeRequest.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/makeRequest.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/makeRequest.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/requestWithRetries.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/requestWithRetries.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/requestWithRetries.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/requestWithRetries.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/signals.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/signals.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/signals.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/signals.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/stream-wrappers/webpack.test.ts b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/stream-wrappers/webpack.test.ts similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/stream-wrappers/webpack.test.ts rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/stream-wrappers/webpack.test.ts diff --git a/seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/test-file.txt b/seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/test-file.txt similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tests/unit/fetcher/test-file.txt rename to seed/ts-sdk/ts-inline-types/no-inline/tests/unit/fetcher/test-file.txt diff --git a/seed/ts-sdk/inline-types/no-inline/tsconfig.json b/seed/ts-sdk/ts-inline-types/no-inline/tsconfig.json similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/tsconfig.json rename to seed/ts-sdk/ts-inline-types/no-inline/tsconfig.json diff --git a/test-definitions-openapi/fern/apis/inline-schema-reference/generators.yml b/test-definitions-openapi/fern/apis/ts-inline-schema-reference/generators.yml similarity index 100% rename from test-definitions-openapi/fern/apis/inline-schema-reference/generators.yml rename to test-definitions-openapi/fern/apis/ts-inline-schema-reference/generators.yml diff --git a/test-definitions-openapi/fern/apis/inline-schema-reference/openapi.yml b/test-definitions-openapi/fern/apis/ts-inline-schema-reference/openapi.yml similarity index 100% rename from test-definitions-openapi/fern/apis/inline-schema-reference/openapi.yml rename to test-definitions-openapi/fern/apis/ts-inline-schema-reference/openapi.yml diff --git a/test-definitions/fern/apis/inline-types/definition/__package__.yml b/test-definitions/fern/apis/inline-types/definition/__package__.yml deleted file mode 100644 index af14bf356cd..00000000000 --- a/test-definitions/fern/apis/inline-types/definition/__package__.yml +++ /dev/null @@ -1,365 +0,0 @@ -service: - base-path: /root - auth: false - endpoints: - getRoot: - path: /root - method: POST - request: - body: - properties: - bar: RequestTypeInlineType1 - foo: string - content-type: application/json - name: PostRootRequest - response: RootType1 - getDiscriminatedUnion: - path: /discriminated-union - method: POST - request: - body: - properties: - bar: DiscriminatedUnion1 - foo: string - content-type: application/json - name: GetDiscriminatedUnionRequest - getUndiscriminatedUnion: - path: /undiscriminated-union - method: POST - request: - body: - properties: - bar: UndiscriminatedUnion1 - foo: string - content-type: application/json - name: GetUndiscriminatedUnionRequest - -types: - # this is also the type that would be produced by - AliasMapInline: map - AliasSetInline: set - AliasListInline: list - - AliasInlineValue: - inline: true - properties: - foo: string - bar: string - - RequestTypeInlineType1: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - - RootType1: - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - bar: - type: RootType1InlineType1 - docs: lorem ipsum - fooMap: - type: map - docs: lorem ipsum - fooList: - type: list - docs: lorem ipsum - fooSet: - type: set - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - RootType1FooMapValue: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - RootType1FooListItem: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - RootType1FooSetItem: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - RootType1InlineType1: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - bar: - type: RootType1InlineType1NestedInlineType1 - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - RootType1InlineType1NestedInlineType1: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - bar: - type: string - docs: lorem ipsum - myEnum: - type: InlineEnum1 - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - DiscriminatedUnion1: - inline: true - docs: lorem ipsum - union: - type1: - type: DiscriminatedUnion1InlineType1 - docs: lorem ipsum - type2: - type: DiscriminatedUnion1InlineType2 - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - DiscriminatedUnion1InlineType1: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - bar: - type: DiscriminatedUnion1InlineType1InlineType1 - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - DiscriminatedUnion1InlineType1InlineType1: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - DiscriminatedUnion1InlineType2: - inline: true - docs: lorem ipsum - properties: - baz: - type: string - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - UndiscriminatedUnion1: - inline: true - docs: lorem ipsum - discriminated: false - union: - - type: UndiscriminatedUnion1InlineType1 - docs: lorem ipsum - - type: UndiscriminatedUnion1InlineType2 - docs: lorem ipsum - - type: UndiscriminatedUnion1DiscriminatedUnion1 - docs: lorem ipsum - - type: UndiscriminatedUnion1DiscriminatedUnion1 - docs: lorem ipsum - - type: UndiscriminatedUnion1InlineEnum1 - docs: lorem ipsum - - type: UserId - docs: lorem ipsum - - type: list - docs: lorem ipsum - - type: set - docs: lorem ipsum - - type: map - docs: lorem ipsum - - type: ReferenceType - docs: lorem ipsum - - UndiscriminatedUnion1InlineType1: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - bar: - type: UndiscriminatedUnion1InlineType1InlineType1 - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - UndiscriminatedUnion1InlineType1InlineType1: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - UndiscriminatedUnion1InlineType2: - inline: true - docs: lorem ipsum - properties: - baz: - type: string - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - InlineEnum1: - inline: true - docs: lorem ipsum - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING - - UndiscriminatedUnion1DiscriminatedUnion1: - inline: true - docs: lorem ipsum - union: - type1: - type: UndiscriminatedUnion1DiscriminatedUnion1InlineType1 - docs: lorem ipsum - type2: - type: UndiscriminatedUnion1DiscriminatedUnion1InlineType2 - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - UndiscriminatedUnion1DiscriminatedUnion1InlineType1: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - bar: - type: UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1 - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - UndiscriminatedUnion1DiscriminatedUnion1InlineType1InlineType1: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - UndiscriminatedUnion1DiscriminatedUnion1InlineType2: - inline: true - docs: lorem ipsum - properties: - baz: - type: string - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - UndiscriminatedUnion1InlineEnum1: - inline: true - docs: lorem ipsum - enum: - - SUNNY - - CLOUDY - - RAINING - - SNOWING - - UserId: - type: string - docs: lorem ipsum - - UndiscriminatedUnion1InlineListItem1: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - UndiscriminatedUnion1InlineSetItem1: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - UndiscriminatedUnion1InlineMapItem1: - inline: true - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum - ref: - type: ReferenceType - docs: lorem ipsum - - ReferenceType: - docs: lorem ipsum - properties: - foo: - type: string - docs: lorem ipsum diff --git a/test-definitions/fern/apis/inline-types/definition/api.yml b/test-definitions/fern/apis/inline-types/definition/api.yml deleted file mode 100644 index a82930c145b..00000000000 --- a/test-definitions/fern/apis/inline-types/definition/api.yml +++ /dev/null @@ -1 +0,0 @@ -name: object diff --git a/test-definitions/fern/apis/inline-types/generators.yml b/test-definitions/fern/apis/inline-types/generators.yml deleted file mode 100644 index 0967ef424bc..00000000000 --- a/test-definitions/fern/apis/inline-types/generators.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/seed/ts-sdk/inline-types/no-inline/.mock/definition/__package__.yml b/test-definitions/fern/apis/ts-inline-types/definition/__package__.yml similarity index 100% rename from seed/ts-sdk/inline-types/no-inline/.mock/definition/__package__.yml rename to test-definitions/fern/apis/ts-inline-types/definition/__package__.yml diff --git a/seed/fastapi/inline-types/.mock/definition/api.yml b/test-definitions/fern/apis/ts-inline-types/definition/api.yml similarity index 100% rename from seed/fastapi/inline-types/.mock/definition/api.yml rename to test-definitions/fern/apis/ts-inline-types/definition/api.yml diff --git a/seed/fastapi/inline-types/.mock/generators.yml b/test-definitions/fern/apis/ts-inline-types/generators.yml similarity index 100% rename from seed/fastapi/inline-types/.mock/generators.yml rename to test-definitions/fern/apis/ts-inline-types/generators.yml From 3d35a756f17b22d6ba936c3d6d60ea3036fe3e23 Mon Sep 17 00:00:00 2001 From: Noa Flaherty Date: Thu, 12 Dec 2024 09:37:30 -0500 Subject: [PATCH 2/6] fix(python): Fix Case of Multiple Star Imports (#5394) Fix case of multiple star imports --- generators/python-v2/ast/src/PythonFile.ts | 5 +++++ generators/python-v2/ast/src/__test__/PythonFile.test.ts | 7 +++++-- .../ast/src/__test__/__snapshots__/PythonFile.test.ts.snap | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/generators/python-v2/ast/src/PythonFile.ts b/generators/python-v2/ast/src/PythonFile.ts index 4e386c1aa85..558bde6b910 100644 --- a/generators/python-v2/ast/src/PythonFile.ts +++ b/generators/python-v2/ast/src/PythonFile.ts @@ -90,6 +90,11 @@ export class PythonFile extends AstNode { const usedNames = this.getInitialUsedNames(); references.forEach((reference) => { + // Skip star imports since we should never override their import alias + if (reference instanceof StarImport) { + return; + } + const name = reference.alias ?? reference.name; const fullyQualifiedModulePath = reference.getFullyQualifiedModulePath(); diff --git a/generators/python-v2/ast/src/__test__/PythonFile.test.ts b/generators/python-v2/ast/src/__test__/PythonFile.test.ts index feedb3d4313..4cfac924fc5 100644 --- a/generators/python-v2/ast/src/__test__/PythonFile.test.ts +++ b/generators/python-v2/ast/src/__test__/PythonFile.test.ts @@ -303,7 +303,10 @@ describe("PythonFile", () => { const file = python.file({ path: ["root"], comments: [python.comment({ docs: "flake8: noqa: F401, F403" })], - imports: [python.starImport({ modulePath: ["root", "my_module"] })], + imports: [ + python.starImport({ modulePath: ["root", "my_module_a"] }), + python.starImport({ modulePath: ["root", "my_module_b"] }) + ], statements: [ python.field({ name: "my_id", @@ -314,7 +317,7 @@ describe("PythonFile", () => { file.write(writer); expect(await writer.toStringFormatted()).toMatchSnapshot(); - expect(file.getReferences()).toHaveLength(2); + expect(file.getReferences()).toHaveLength(3); }); it("Write duplicative import names", async () => { diff --git a/generators/python-v2/ast/src/__test__/__snapshots__/PythonFile.test.ts.snap b/generators/python-v2/ast/src/__test__/__snapshots__/PythonFile.test.ts.snap index b4df0b363f9..68b01d373f2 100644 --- a/generators/python-v2/ast/src/__test__/__snapshots__/PythonFile.test.ts.snap +++ b/generators/python-v2/ast/src/__test__/__snapshots__/PythonFile.test.ts.snap @@ -131,7 +131,8 @@ exports[`PythonFile > Write star imports 1`] = ` "# flake8: noqa: F401, F403 from uuid import UUID -from .my_module import * +from .my_module_a import * +from .my_module_b import * my_id = UUID("1234") " From 14ab8585e86a08794594f7cd39ae68ba5e74fcbc Mon Sep 17 00:00:00 2001 From: Catherine Deskur <46695336+chdeskur@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:01:47 -0500 Subject: [PATCH 3/6] chore(docs): update readme for php (#5396) Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a61a4d0d182..224a93bf1bf 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ Postman Collections, Server boilerplate, etc.). To add a generator run `fern add | `fernapi/fern-ruby-sdk` | ![Ruby Generator Version](https://img.shields.io/docker/v/fernapi/fern-ruby-sdk) | [cli.ts](./generators/ruby/sdk/src/cli.ts) | | `fernapi/fern-go-sdk` | ![Go Generator Version](https://img.shields.io/docker/v/fernapi/fern-go-sdk) | [main.go](./generators/go/cmd/fern-go-sdk/main.go) | | `fernapi/fern-csharp-sdk` | ![C# Generator Version](https://img.shields.io/docker/v/fernapi/fern-csharp-sdk) | [cli.ts](./generators/csharp/sdk/src/cli.ts) | +| `fernapi/fern-php-sdk` | ![PHP Generator Version](https://img.shields.io/docker/v/fernapi/fern-php-sdk) | [cli.ts](./generators/php/sdk/src/cli.ts) | ### Server-side Generators From 4936e190ba456abcaac67519da945d3158882c8d Mon Sep 17 00:00:00 2001 From: Emre <29920706+emretezisci@users.noreply.github.com> Date: Thu, 12 Dec 2024 07:28:36 -0800 Subject: [PATCH 4/6] fix(docs): update documentation (#5390) --- fern/pages/sdks/comparison/speakeasy.mdx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/fern/pages/sdks/comparison/speakeasy.mdx b/fern/pages/sdks/comparison/speakeasy.mdx index 8b3d55b2e79..36e22954903 100644 --- a/fern/pages/sdks/comparison/speakeasy.mdx +++ b/fern/pages/sdks/comparison/speakeasy.mdx @@ -8,7 +8,7 @@ walk through the different capabilities of Fern and Speakeasy. ### 1. Fern is an all-in-one: SDKs + Docs -If you choose Speakeasy, you'll have to find a separate docs vendor such as ReadMe. With Fern, you'll be able to generate SDKs and +If you choose Speakeasy, you can integrate with third-party documentation providers or use its native Scalar integration. With Fern, you'll be able to generate SDKs and Docs with embedded code snippets. @@ -21,8 +21,8 @@ Fern's SDKs are battle-tested and have been downloaded millions of times. | Language | Fern | Speakeasy | | ---------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- | -| TypeScript | **93k** weekly downloads ([Cohere](https://www.npmjs.com/package/cohere-ai)) | **5k** weekly downloads ([Unstructured](https://www.npmjs.com/package/unstructured-client)) | -| Python | **5 million** lifetime downloads ([ElevenLabs](https://github.com/elevenlabs/elevenlabs-python)) | **194k** lifetime downloads ([Airbyte](https://github.com/airbytehq/airbyte-api-python-sdk)) | +| TypeScript | **120k** weekly downloads ([Cohere](https://www.npmjs.com/package/cohere-ai)) | **85k** weekly downloads ([Mistral AI](https://www.npmjs.com/package/@mistralai/mistralai)) | +| Python | **6 million** lifetime downloads ([ElevenLabs](https://pepy.tech/projects/ElevenLabs)) | **17 million** lifetime downloads ([Unstructured](https://pepy.tech/projects/unstructured-client)) | ### 3. Fern offers more Generally Available SDK languages. @@ -33,7 +33,11 @@ Fern's SDKs are battle-tested and have been downloaded millions of times. | Java | ✅ | ✅ | | Go | ✅ | ✅ | | C# | ✅ | ✅ | +| PHP | ✅ | ✅ | +| Terraform | ❌ | ✅ | | Ruby | ✅ | ❌ (Alpha) | +| Unity | ❌ | ❌ (Beta) | + ### 4. Speakeasy generates Terraform providers. @@ -49,7 +53,7 @@ is blocked if any failures are encountered. -On the other hand, Speakeasy produces no tests in their SDKs ([example](https://github.com/airbytehq/airbyte-api-python-sdk)). +On the other hand, Speakeasy supports contract testing, server mocking, and API sequence testing to streamline development workflows. ([example](https://www.speakeasy.com/docs/testing)). ### 6. Fern supports OAuth + DPoP. @@ -58,8 +62,8 @@ On the other hand, Speakeasy produces no tests in their SDKs ([example](https:// | `Bearer` | ✅ | ✅ | | `Basic` | ✅ | ✅ | | Custom Headers | ✅ | ✅ | -| `OAuth` Client Credentials | ✅ | 🏗️ Partial | -| `OAuth` Refresh | ✅ | 🏗️ Partial | +| `OAuth` Client Credentials | ✅ | ✅ | +| `OAuth` Refresh | ✅ | ✅ | | DPop (Proof of possession) | ✅ | ❌ | ### 7. Fern's file structure is resource based. @@ -91,6 +95,6 @@ behavior. | Feature | Fern | Speakeasy | | ---------------- | ---- | --------- | -| Auth Override | ✅ | ❌ | -| Timeout Override | ✅ | ❌ | -| Retry Override | ✅ | ❌ | +| Auth Override | ✅ | ✅ | +| Timeout Override | ✅ | ✅ | +| Retry Override | ✅ | ✅ | From 0e1afdc847da2112c0815fe08d1262ce8f127d1d Mon Sep 17 00:00:00 2001 From: Alex McKinney Date: Thu, 12 Dec 2024 10:33:24 -0500 Subject: [PATCH 5/6] chore(cli): Release 0.46.0 (#5397) --- fern/pages/changelogs/cli/2024-12-12.mdx | 4 ++++ packages/cli/cli/versions.yml | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 fern/pages/changelogs/cli/2024-12-12.mdx diff --git a/fern/pages/changelogs/cli/2024-12-12.mdx b/fern/pages/changelogs/cli/2024-12-12.mdx new file mode 100644 index 00000000000..e84d5b08da9 --- /dev/null +++ b/fern/pages/changelogs/cli/2024-12-12.mdx @@ -0,0 +1,4 @@ +## 0.46.0 +**`(internal):`** No changes; promote `0.46.0-rc1` release candidate to minor version. + + diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index d8193bd1d94..78e26165b5b 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,3 +1,10 @@ +- changelogEntry: + - summary: | + No changes; promote `0.46.0-rc1` release candidate to minor version. + type: internal + irVersion: 53 + version: 0.46.0 + - changelogEntry: - summary: | * Set `inline: true` for inline enums imported from OpenAPI. From 186588d9bdd940ead42d42c8ea7acb241ad460a2 Mon Sep 17 00:00:00 2001 From: Alex McKinney Date: Thu, 12 Dec 2024 11:07:48 -0500 Subject: [PATCH 6/6] feat(go): Add support for User-Agent header (#5398) --- fern/pages/changelogs/go-sdk/2024-12-12.mdx | 4 +++ .../src/utils/getSdkVersion.ts | 29 ------------------- generators/go/internal/generator/sdk.go | 3 ++ generators/go/sdk/versions.yml | 12 ++++++++ packages/cli/cli/versions.yml | 7 +++++ .../convertGeneratorsConfiguration.ts | 1 + .../generators-yml/GeneratorsConfiguration.ts | 18 ++++++++++++ seed/go-sdk/alias/core/request_option.go | 1 + seed/go-sdk/any-auth/core/request_option.go | 1 + .../api-wide-base-path/core/request_option.go | 1 + seed/go-sdk/audiences/core/request_option.go | 1 + .../core/request_option.go | 1 + .../core/request_option.go | 1 + seed/go-sdk/basic-auth/core/request_option.go | 1 + .../core/request_option.go | 1 + seed/go-sdk/bytes/core/request_option.go | 1 + .../core/request_option.go | 1 + .../core/request_option.go | 1 + .../core/request_option.go | 1 + .../go-sdk/custom-auth/core/request_option.go | 1 + seed/go-sdk/enum/core/request_option.go | 1 + .../error-property/core/request_option.go | 1 + .../core/request_option.go | 1 + .../core/request_option.go | 1 + .../no-custom-config/core/request_option.go | 1 + seed/go-sdk/extends/core/request_option.go | 1 + .../extra-properties/core/request_option.go | 1 + .../file-download/core/request_option.go | 1 + .../core/request_option.go | 1 + .../no-custom-config/core/request_option.go | 1 + seed/go-sdk/folders/core/request_option.go | 1 + .../go-content-type/core/request_option.go | 1 + .../core/request_option.go | 1 + seed/go-sdk/imdb/core/request_option.go | 1 + seed/go-sdk/license/core/request_option.go | 1 + seed/go-sdk/literal/core/request_option.go | 1 + seed/go-sdk/mixed-case/core/request_option.go | 1 + .../core/request_option.go | 1 + .../multi-line-docs/core/request_option.go | 1 + .../core/request_option.go | 1 + .../core/request_option.go | 1 + .../no-environment/core/request_option.go | 1 + .../core/request_option.go | 1 + .../core/request_option.go | 1 + .../core/request_option.go | 1 + .../core/request_option.go | 1 + seed/go-sdk/object/core/request_option.go | 1 + .../core/request_option.go | 1 + seed/go-sdk/optional/core/request_option.go | 1 + .../go-sdk/package-yml/core/request_option.go | 1 + seed/go-sdk/pagination/core/request_option.go | 1 + .../core/request_option.go | 1 + .../no-custom-config/core/request_option.go | 1 + seed/go-sdk/plain-text/core/request_option.go | 1 + .../query-parameters/core/request_option.go | 1 + .../response-property/core/request_option.go | 1 + .../core/request_option.go | 1 + .../server-sent-events/core/request_option.go | 1 + .../go-sdk/simple-fhir/core/request_option.go | 1 + .../core/request_option.go | 1 + .../core/request_option.go | 1 + seed/go-sdk/streaming/core/request_option.go | 1 + .../core/request_option.go | 1 + seed/go-sdk/unions/core/request_option.go | 1 + seed/go-sdk/unknown/core/request_option.go | 1 + seed/go-sdk/validation/core/request_option.go | 1 + seed/go-sdk/variables/core/request_option.go | 1 + .../version-no-default/core/request_option.go | 1 + seed/go-sdk/version/core/request_option.go | 1 + seed/go-sdk/websocket/core/request_option.go | 1 + 70 files changed, 108 insertions(+), 29 deletions(-) create mode 100644 fern/pages/changelogs/go-sdk/2024-12-12.mdx diff --git a/fern/pages/changelogs/go-sdk/2024-12-12.mdx b/fern/pages/changelogs/go-sdk/2024-12-12.mdx new file mode 100644 index 00000000000..6476bfd794c --- /dev/null +++ b/fern/pages/changelogs/go-sdk/2024-12-12.mdx @@ -0,0 +1,4 @@ +## 0.34.0 +**`(feat):`** Add support for sending the `User-Agent` header on every request. Go packages are uniquely identified by their full module path, so the `User-Agent` header is generated in the `/` format, e.g. +``` User-Agent: github.com/acme/acme-go/1.0.0 ``` + diff --git a/generators/browser-compatible-base/src/utils/getSdkVersion.ts b/generators/browser-compatible-base/src/utils/getSdkVersion.ts index 2bf95c59e84..fd2aff5f68f 100644 --- a/generators/browser-compatible-base/src/utils/getSdkVersion.ts +++ b/generators/browser-compatible-base/src/utils/getSdkVersion.ts @@ -10,32 +10,3 @@ export function getSdkVersion(config: FernGeneratorExec.GeneratorConfig): string } }); } - -export function getPackageName(config: FernGeneratorExec.GeneratorConfig): string | undefined { - return config.output.mode._visit({ - publish: (gpc: FernGeneratorExec.GeneratorPublishConfig) => - gpc.publishTarget?._visit({ - maven: (mrc: FernGeneratorExec.MavenRegistryConfigV2) => mrc.coordinate, - npm: (nrc: FernGeneratorExec.NpmRegistryConfigV2) => nrc.packageName, - pypi: (prc: FernGeneratorExec.PypiRegistryConfig) => prc.packageName, - rubygems: (rgrc: FernGeneratorExec.RubyGemsRegistryConfig) => rgrc.packageName, - nuget: (nrc: FernGeneratorExec.NugetRegistryConfig) => nrc.packageName, - postman: () => undefined, - _other: () => undefined - }), - downloadFiles: () => undefined, - github: (gom: FernGeneratorExec.GithubOutputMode) => - gom.publishInfo?._visit({ - maven: (mrc: FernGeneratorExec.MavenGithubPublishInfo) => mrc.coordinate, - npm: (nrc: FernGeneratorExec.NpmGithubPublishInfo) => nrc.packageName, - pypi: (prc: FernGeneratorExec.PypiGithubPublishInfo) => prc.packageName, - rubygems: (rgrc: FernGeneratorExec.RubyGemsGithubPublishInfo) => rgrc.packageName, - nuget: (nrc: FernGeneratorExec.NugetGithubPublishInfo) => nrc.packageName, - postman: () => undefined, - _other: () => undefined - }), - _other: () => { - throw new Error("Unrecognized output mode."); - } - }); -} diff --git a/generators/go/internal/generator/sdk.go b/generators/go/internal/generator/sdk.go index df87652c474..6922d35ebfa 100644 --- a/generators/go/internal/generator/sdk.go +++ b/generators/go/internal/generator/sdk.go @@ -496,6 +496,9 @@ func (f *fileWriter) writePlatformHeaders( f.P(fmt.Sprintf("headers.Set(%q, %q)", sdkConfig.PlatformHeaders.Language, goLanguageHeader)) f.P(fmt.Sprintf("headers.Set(%q, %q)", sdkConfig.PlatformHeaders.SdkName, moduleConfig.Path)) f.P(fmt.Sprintf("headers.Set(%q, %q)", sdkConfig.PlatformHeaders.SdkVersion, sdkVersion)) + if sdkConfig.PlatformHeaders.UserAgent != nil { + f.P(fmt.Sprintf("headers.Set(%q, %q)", sdkConfig.PlatformHeaders.UserAgent.Header(), sdkConfig.PlatformHeaders.UserAgent.Value)) + } f.P("return headers") f.P("}") } diff --git a/generators/go/sdk/versions.yml b/generators/go/sdk/versions.yml index 380e182455f..9ce98490dc0 100644 --- a/generators/go/sdk/versions.yml +++ b/generators/go/sdk/versions.yml @@ -1,3 +1,15 @@ +- version: 0.34.0 + changelogEntry: + - type: feat + summary: >- + Add support for sending the `User-Agent` header on every request. Go packages + are uniquely identified by their full module path, so the `User-Agent` header + is generated in the `/` format, e.g. + + ``` + User-Agent: github.com/acme/acme-go/1.0.0 + ``` + irVersion: 53 - version: 0.33.0 changelogEntry: - type: feat diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index 78e26165b5b..f289eff7a57 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,3 +1,10 @@ +- changelogEntry: + - summary: | + Add support for setting the `User-Agent` header value for Go generators. + type: fix + irVersion: 53 + version: 0.46.1 + - changelogEntry: - summary: | No changes; promote `0.46.0-rc1` release candidate to minor version. diff --git a/packages/cli/configuration-loader/src/generators-yml/convertGeneratorsConfiguration.ts b/packages/cli/configuration-loader/src/generators-yml/convertGeneratorsConfiguration.ts index 67ccd8eb3e0..b1aa6f620ff 100644 --- a/packages/cli/configuration-loader/src/generators-yml/convertGeneratorsConfiguration.ts +++ b/packages/cli/configuration-loader/src/generators-yml/convertGeneratorsConfiguration.ts @@ -752,6 +752,7 @@ async function getGithubLicense({ }); } +// TODO: This is where we should add support for Go and PHP. function getGithubPublishInfo( output: generatorsYml.GeneratorOutputSchema, maybeGroupLevelMetadata: OutputMetadata | undefined, diff --git a/packages/cli/configuration/src/generators-yml/GeneratorsConfiguration.ts b/packages/cli/configuration/src/generators-yml/GeneratorsConfiguration.ts index 9aeae957b7c..2b28aca9bc3 100644 --- a/packages/cli/configuration/src/generators-yml/GeneratorsConfiguration.ts +++ b/packages/cli/configuration/src/generators-yml/GeneratorsConfiguration.ts @@ -137,6 +137,9 @@ export function getPackageName({ }: { generatorInvocation: GeneratorInvocation; }): string | undefined { + if (generatorInvocation.language === "go") { + return getGoPackageName(generatorInvocation); + } return generatorInvocation.outputMode._visit({ downloadFiles: () => undefined, github: (val) => @@ -164,3 +167,18 @@ export function getPackageName({ _other: () => undefined }); } + +/** + * Go doesn't use a central package manager; the Go Module Proxy simply uses the name + * of the GitHub repository. + */ +function getGoPackageName(generatorInvocation: GeneratorInvocation): string | undefined { + return generatorInvocation.outputMode._visit({ + downloadFiles: () => undefined, + github: (val) => `github.com/${val.owner}/${val.repo}`, + githubV2: (val) => `github.com/${val.owner}/${val.repo}`, + publish: () => undefined, + publishV2: () => undefined, + _other: () => undefined + }); +} diff --git a/seed/go-sdk/alias/core/request_option.go b/seed/go-sdk/alias/core/request_option.go index e975914d3cb..5af9dfba2bc 100644 --- a/seed/go-sdk/alias/core/request_option.go +++ b/seed/go-sdk/alias/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/alias/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/alias/fern/0.0.1") return headers } diff --git a/seed/go-sdk/any-auth/core/request_option.go b/seed/go-sdk/any-auth/core/request_option.go index fbfb825ef61..883868da722 100644 --- a/seed/go-sdk/any-auth/core/request_option.go +++ b/seed/go-sdk/any-auth/core/request_option.go @@ -62,6 +62,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/any-auth/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/any-auth/fern/0.0.1") return headers } diff --git a/seed/go-sdk/api-wide-base-path/core/request_option.go b/seed/go-sdk/api-wide-base-path/core/request_option.go index ad2cad430a3..fb69dd65e9a 100644 --- a/seed/go-sdk/api-wide-base-path/core/request_option.go +++ b/seed/go-sdk/api-wide-base-path/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/api-wide-base-path/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/api-wide-base-path/fern/0.0.1") return headers } diff --git a/seed/go-sdk/audiences/core/request_option.go b/seed/go-sdk/audiences/core/request_option.go index 90398890dd0..074f2079078 100644 --- a/seed/go-sdk/audiences/core/request_option.go +++ b/seed/go-sdk/audiences/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/audiences/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/audiences/fern/0.0.1") return headers } diff --git a/seed/go-sdk/auth-environment-variables/core/request_option.go b/seed/go-sdk/auth-environment-variables/core/request_option.go index 1b63430fde9..3dbccf27b31 100644 --- a/seed/go-sdk/auth-environment-variables/core/request_option.go +++ b/seed/go-sdk/auth-environment-variables/core/request_option.go @@ -67,6 +67,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/auth-environment-variables/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/auth-environment-variables/fern/0.0.1") return headers } diff --git a/seed/go-sdk/basic-auth-environment-variables/core/request_option.go b/seed/go-sdk/basic-auth-environment-variables/core/request_option.go index bb4b6d7fc71..811faab7eb3 100644 --- a/seed/go-sdk/basic-auth-environment-variables/core/request_option.go +++ b/seed/go-sdk/basic-auth-environment-variables/core/request_option.go @@ -59,6 +59,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/basic-auth-environment-variables/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/basic-auth-environment-variables/fern/0.0.1") return headers } diff --git a/seed/go-sdk/basic-auth/core/request_option.go b/seed/go-sdk/basic-auth/core/request_option.go index 6023e564a09..74d0ddeb981 100644 --- a/seed/go-sdk/basic-auth/core/request_option.go +++ b/seed/go-sdk/basic-auth/core/request_option.go @@ -59,6 +59,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/basic-auth/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/basic-auth/fern/0.0.1") return headers } diff --git a/seed/go-sdk/bearer-token-environment-variable/core/request_option.go b/seed/go-sdk/bearer-token-environment-variable/core/request_option.go index db06b8303d6..cbbcf4e858f 100644 --- a/seed/go-sdk/bearer-token-environment-variable/core/request_option.go +++ b/seed/go-sdk/bearer-token-environment-variable/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/bearer-token-environment-variable/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/bearer-token-environment-variable/fern/0.0.1") return headers } diff --git a/seed/go-sdk/bytes/core/request_option.go b/seed/go-sdk/bytes/core/request_option.go index 779b12efac7..8f183107e07 100644 --- a/seed/go-sdk/bytes/core/request_option.go +++ b/seed/go-sdk/bytes/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/bytes/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/bytes/fern/0.0.1") return headers } diff --git a/seed/go-sdk/circular-references-advanced/core/request_option.go b/seed/go-sdk/circular-references-advanced/core/request_option.go index be46fb88567..038634019b5 100644 --- a/seed/go-sdk/circular-references-advanced/core/request_option.go +++ b/seed/go-sdk/circular-references-advanced/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/circular-references-advanced/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/circular-references-advanced/fern/0.0.1") return headers } diff --git a/seed/go-sdk/circular-references/core/request_option.go b/seed/go-sdk/circular-references/core/request_option.go index 816ec2dc321..d0c812c17f7 100644 --- a/seed/go-sdk/circular-references/core/request_option.go +++ b/seed/go-sdk/circular-references/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/circular-references/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/circular-references/fern/0.0.1") return headers } diff --git a/seed/go-sdk/cross-package-type-names/core/request_option.go b/seed/go-sdk/cross-package-type-names/core/request_option.go index ba4826f7d53..0644a9753ff 100644 --- a/seed/go-sdk/cross-package-type-names/core/request_option.go +++ b/seed/go-sdk/cross-package-type-names/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/cross-package-type-names/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/cross-package-type-names/fern/0.0.1") return headers } diff --git a/seed/go-sdk/custom-auth/core/request_option.go b/seed/go-sdk/custom-auth/core/request_option.go index df54886580e..ee2176a58cf 100644 --- a/seed/go-sdk/custom-auth/core/request_option.go +++ b/seed/go-sdk/custom-auth/core/request_option.go @@ -58,6 +58,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/custom-auth/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/custom-auth/fern/0.0.1") return headers } diff --git a/seed/go-sdk/enum/core/request_option.go b/seed/go-sdk/enum/core/request_option.go index f9b2adc1c19..81c757214e9 100644 --- a/seed/go-sdk/enum/core/request_option.go +++ b/seed/go-sdk/enum/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/enum/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/enum/fern/0.0.1") return headers } diff --git a/seed/go-sdk/error-property/core/request_option.go b/seed/go-sdk/error-property/core/request_option.go index 80b9ecd36cb..ce644cda330 100644 --- a/seed/go-sdk/error-property/core/request_option.go +++ b/seed/go-sdk/error-property/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/error-property/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/error-property/fern/0.0.1") return headers } diff --git a/seed/go-sdk/examples/always-send-required-properties/core/request_option.go b/seed/go-sdk/examples/always-send-required-properties/core/request_option.go index 94c9c735344..4fe862e0f12 100644 --- a/seed/go-sdk/examples/always-send-required-properties/core/request_option.go +++ b/seed/go-sdk/examples/always-send-required-properties/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/examples/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/examples/fern/0.0.1") return headers } diff --git a/seed/go-sdk/examples/exported-client-name/core/request_option.go b/seed/go-sdk/examples/exported-client-name/core/request_option.go index 94c9c735344..4fe862e0f12 100644 --- a/seed/go-sdk/examples/exported-client-name/core/request_option.go +++ b/seed/go-sdk/examples/exported-client-name/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/examples/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/examples/fern/0.0.1") return headers } diff --git a/seed/go-sdk/examples/no-custom-config/core/request_option.go b/seed/go-sdk/examples/no-custom-config/core/request_option.go index 94c9c735344..4fe862e0f12 100644 --- a/seed/go-sdk/examples/no-custom-config/core/request_option.go +++ b/seed/go-sdk/examples/no-custom-config/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/examples/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/examples/fern/0.0.1") return headers } diff --git a/seed/go-sdk/extends/core/request_option.go b/seed/go-sdk/extends/core/request_option.go index 11592b349f8..7c8475191ea 100644 --- a/seed/go-sdk/extends/core/request_option.go +++ b/seed/go-sdk/extends/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/extends/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/extends/fern/0.0.1") return headers } diff --git a/seed/go-sdk/extra-properties/core/request_option.go b/seed/go-sdk/extra-properties/core/request_option.go index 3cdf7e5e465..1de226cb6dc 100644 --- a/seed/go-sdk/extra-properties/core/request_option.go +++ b/seed/go-sdk/extra-properties/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/extra-properties/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/extra-properties/fern/0.0.1") return headers } diff --git a/seed/go-sdk/file-download/core/request_option.go b/seed/go-sdk/file-download/core/request_option.go index 3999694456f..434a9774c54 100644 --- a/seed/go-sdk/file-download/core/request_option.go +++ b/seed/go-sdk/file-download/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/file-download/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/file-download/fern/0.0.1") return headers } diff --git a/seed/go-sdk/file-upload/inline-file-properties/core/request_option.go b/seed/go-sdk/file-upload/inline-file-properties/core/request_option.go index a82f9442526..643a4cc0524 100644 --- a/seed/go-sdk/file-upload/inline-file-properties/core/request_option.go +++ b/seed/go-sdk/file-upload/inline-file-properties/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/fern-api/file-upload-go") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/file-upload/fern/0.0.1") return headers } diff --git a/seed/go-sdk/file-upload/no-custom-config/core/request_option.go b/seed/go-sdk/file-upload/no-custom-config/core/request_option.go index 06ec480e4c3..3fe7b06129c 100644 --- a/seed/go-sdk/file-upload/no-custom-config/core/request_option.go +++ b/seed/go-sdk/file-upload/no-custom-config/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/file-upload/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/file-upload/fern/0.0.1") return headers } diff --git a/seed/go-sdk/folders/core/request_option.go b/seed/go-sdk/folders/core/request_option.go index e4cf758da8f..9e1b2e78135 100644 --- a/seed/go-sdk/folders/core/request_option.go +++ b/seed/go-sdk/folders/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/folders/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/folders/fern/0.0.1") return headers } diff --git a/seed/go-sdk/go-content-type/core/request_option.go b/seed/go-sdk/go-content-type/core/request_option.go index 8a6dc26b3cb..ad4f74589ed 100644 --- a/seed/go-sdk/go-content-type/core/request_option.go +++ b/seed/go-sdk/go-content-type/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/go-content-type/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/go-content-type/fern/0.0.1") return headers } diff --git a/seed/go-sdk/idempotency-headers/core/request_option.go b/seed/go-sdk/idempotency-headers/core/request_option.go index 5c6fb3ecf8e..5a77c8c1846 100644 --- a/seed/go-sdk/idempotency-headers/core/request_option.go +++ b/seed/go-sdk/idempotency-headers/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/idempotency-headers/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/idempotency-headers/fern/0.0.1") return headers } diff --git a/seed/go-sdk/imdb/core/request_option.go b/seed/go-sdk/imdb/core/request_option.go index 3cdfd248268..de9180f5296 100644 --- a/seed/go-sdk/imdb/core/request_option.go +++ b/seed/go-sdk/imdb/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/imdb/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/imdb/fern/0.0.1") return headers } diff --git a/seed/go-sdk/license/core/request_option.go b/seed/go-sdk/license/core/request_option.go index b6de5a1efe3..4509a930261 100644 --- a/seed/go-sdk/license/core/request_option.go +++ b/seed/go-sdk/license/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/license/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/license/fern/0.0.1") return headers } diff --git a/seed/go-sdk/literal/core/request_option.go b/seed/go-sdk/literal/core/request_option.go index 321ebb0f8ad..75014f0c1da 100644 --- a/seed/go-sdk/literal/core/request_option.go +++ b/seed/go-sdk/literal/core/request_option.go @@ -56,6 +56,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/literal/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/literal/fern/0.0.1") return headers } diff --git a/seed/go-sdk/mixed-case/core/request_option.go b/seed/go-sdk/mixed-case/core/request_option.go index b8132f77f38..f06d16349be 100644 --- a/seed/go-sdk/mixed-case/core/request_option.go +++ b/seed/go-sdk/mixed-case/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/mixed-case/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/mixed-case/fern/0.0.1") return headers } diff --git a/seed/go-sdk/mixed-file-directory/core/request_option.go b/seed/go-sdk/mixed-file-directory/core/request_option.go index 9f996795ec1..cb066639289 100644 --- a/seed/go-sdk/mixed-file-directory/core/request_option.go +++ b/seed/go-sdk/mixed-file-directory/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/mixed-file-directory/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/mixed-file-directory/fern/0.0.1") return headers } diff --git a/seed/go-sdk/multi-line-docs/core/request_option.go b/seed/go-sdk/multi-line-docs/core/request_option.go index 9246b0ecee2..5fb32194782 100644 --- a/seed/go-sdk/multi-line-docs/core/request_option.go +++ b/seed/go-sdk/multi-line-docs/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/multi-line-docs/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/multi-line-docs/fern/0.0.1") return headers } diff --git a/seed/go-sdk/multi-url-environment-no-default/core/request_option.go b/seed/go-sdk/multi-url-environment-no-default/core/request_option.go index ea71e7806e4..2d24ab71723 100644 --- a/seed/go-sdk/multi-url-environment-no-default/core/request_option.go +++ b/seed/go-sdk/multi-url-environment-no-default/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/multi-url-environment-no-default/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/multi-url-environment-no-default/fern/0.0.1") return headers } diff --git a/seed/go-sdk/multi-url-environment/core/request_option.go b/seed/go-sdk/multi-url-environment/core/request_option.go index 0d8db8d66b4..18fd3766b03 100644 --- a/seed/go-sdk/multi-url-environment/core/request_option.go +++ b/seed/go-sdk/multi-url-environment/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/multi-url-environment/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/multi-url-environment/fern/0.0.1") return headers } diff --git a/seed/go-sdk/no-environment/core/request_option.go b/seed/go-sdk/no-environment/core/request_option.go index 8e5b244c879..58252ccb30b 100644 --- a/seed/go-sdk/no-environment/core/request_option.go +++ b/seed/go-sdk/no-environment/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/no-environment/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/no-environment/fern/0.0.1") return headers } diff --git a/seed/go-sdk/oauth-client-credentials-default/core/request_option.go b/seed/go-sdk/oauth-client-credentials-default/core/request_option.go index fb29077d900..e05cfc3f932 100644 --- a/seed/go-sdk/oauth-client-credentials-default/core/request_option.go +++ b/seed/go-sdk/oauth-client-credentials-default/core/request_option.go @@ -53,6 +53,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/oauth-client-credentials-default/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/oauth-client-credentials-default/fern/0.0.1") return headers } diff --git a/seed/go-sdk/oauth-client-credentials-environment-variables/core/request_option.go b/seed/go-sdk/oauth-client-credentials-environment-variables/core/request_option.go index a194857fe0f..8e895acb657 100644 --- a/seed/go-sdk/oauth-client-credentials-environment-variables/core/request_option.go +++ b/seed/go-sdk/oauth-client-credentials-environment-variables/core/request_option.go @@ -53,6 +53,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/oauth-client-credentials-environment-variables/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/oauth-client-credentials-environment-variables/fern/0.0.1") return headers } diff --git a/seed/go-sdk/oauth-client-credentials-nested-root/core/request_option.go b/seed/go-sdk/oauth-client-credentials-nested-root/core/request_option.go index 43ac86d1357..d58d26224a1 100644 --- a/seed/go-sdk/oauth-client-credentials-nested-root/core/request_option.go +++ b/seed/go-sdk/oauth-client-credentials-nested-root/core/request_option.go @@ -53,6 +53,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/oauth-client-credentials-nested-root/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/oauth-client-credentials-nested-root/fern/0.0.1") return headers } diff --git a/seed/go-sdk/oauth-client-credentials/core/request_option.go b/seed/go-sdk/oauth-client-credentials/core/request_option.go index 54adc753862..5cdc67a4f04 100644 --- a/seed/go-sdk/oauth-client-credentials/core/request_option.go +++ b/seed/go-sdk/oauth-client-credentials/core/request_option.go @@ -53,6 +53,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/oauth-client-credentials/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/oauth-client-credentials/fern/0.0.1") return headers } diff --git a/seed/go-sdk/object/core/request_option.go b/seed/go-sdk/object/core/request_option.go index 763acd656e6..7adf23f1d07 100644 --- a/seed/go-sdk/object/core/request_option.go +++ b/seed/go-sdk/object/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/object/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/object/fern/0.0.1") return headers } diff --git a/seed/go-sdk/objects-with-imports/core/request_option.go b/seed/go-sdk/objects-with-imports/core/request_option.go index 203f69eaa90..bbb888f09c8 100644 --- a/seed/go-sdk/objects-with-imports/core/request_option.go +++ b/seed/go-sdk/objects-with-imports/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/objects-with-imports/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/objects-with-imports/fern/0.0.1") return headers } diff --git a/seed/go-sdk/optional/core/request_option.go b/seed/go-sdk/optional/core/request_option.go index 27f691e8c80..77e10813ac2 100644 --- a/seed/go-sdk/optional/core/request_option.go +++ b/seed/go-sdk/optional/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/optional/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/optional/fern/0.0.1") return headers } diff --git a/seed/go-sdk/package-yml/core/request_option.go b/seed/go-sdk/package-yml/core/request_option.go index 394045cc9a5..2a380515b18 100644 --- a/seed/go-sdk/package-yml/core/request_option.go +++ b/seed/go-sdk/package-yml/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/package-yml/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/package-yml/fern/0.0.1") return headers } diff --git a/seed/go-sdk/pagination/core/request_option.go b/seed/go-sdk/pagination/core/request_option.go index 17315669f66..0b4b08aa39c 100644 --- a/seed/go-sdk/pagination/core/request_option.go +++ b/seed/go-sdk/pagination/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/pagination/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/pagination/fern/0.0.1") return headers } diff --git a/seed/go-sdk/path-parameters/inline-path-parameters/core/request_option.go b/seed/go-sdk/path-parameters/inline-path-parameters/core/request_option.go index 5fc38db10e3..7ddb0dc4183 100644 --- a/seed/go-sdk/path-parameters/inline-path-parameters/core/request_option.go +++ b/seed/go-sdk/path-parameters/inline-path-parameters/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/fern-api/path-parameters-go") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/path-parameters/fern/0.0.1") return headers } diff --git a/seed/go-sdk/path-parameters/no-custom-config/core/request_option.go b/seed/go-sdk/path-parameters/no-custom-config/core/request_option.go index ab1af856a9b..b02eb499317 100644 --- a/seed/go-sdk/path-parameters/no-custom-config/core/request_option.go +++ b/seed/go-sdk/path-parameters/no-custom-config/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/path-parameters/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/path-parameters/fern/0.0.1") return headers } diff --git a/seed/go-sdk/plain-text/core/request_option.go b/seed/go-sdk/plain-text/core/request_option.go index f34284d3db2..5e7375a78ef 100644 --- a/seed/go-sdk/plain-text/core/request_option.go +++ b/seed/go-sdk/plain-text/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/plain-text/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/plain-text/fern/0.0.1") return headers } diff --git a/seed/go-sdk/query-parameters/core/request_option.go b/seed/go-sdk/query-parameters/core/request_option.go index 9391c6bf8b4..c9842fdd0e4 100644 --- a/seed/go-sdk/query-parameters/core/request_option.go +++ b/seed/go-sdk/query-parameters/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/query-parameters/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/query-parameters/fern/0.0.1") return headers } diff --git a/seed/go-sdk/response-property/core/request_option.go b/seed/go-sdk/response-property/core/request_option.go index 5175397ef38..2fa492c28c1 100644 --- a/seed/go-sdk/response-property/core/request_option.go +++ b/seed/go-sdk/response-property/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/response-property/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/response-property/fern/0.0.1") return headers } diff --git a/seed/go-sdk/server-sent-event-examples/core/request_option.go b/seed/go-sdk/server-sent-event-examples/core/request_option.go index 69ff2743ba5..01449ec43cd 100644 --- a/seed/go-sdk/server-sent-event-examples/core/request_option.go +++ b/seed/go-sdk/server-sent-event-examples/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/server-sent-event-examples/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/server-sent-event-examples/fern/0.0.1") return headers } diff --git a/seed/go-sdk/server-sent-events/core/request_option.go b/seed/go-sdk/server-sent-events/core/request_option.go index c25ed836172..cc08bd65011 100644 --- a/seed/go-sdk/server-sent-events/core/request_option.go +++ b/seed/go-sdk/server-sent-events/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/server-sent-events/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/server-sent-events/fern/0.0.1") return headers } diff --git a/seed/go-sdk/simple-fhir/core/request_option.go b/seed/go-sdk/simple-fhir/core/request_option.go index c2ff1611170..2c8b4389e41 100644 --- a/seed/go-sdk/simple-fhir/core/request_option.go +++ b/seed/go-sdk/simple-fhir/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/simple-fhir/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/simple-fhir/fern/0.0.1") return headers } diff --git a/seed/go-sdk/single-url-environment-default/core/request_option.go b/seed/go-sdk/single-url-environment-default/core/request_option.go index 5c2eecd5f5e..7cc35f36d65 100644 --- a/seed/go-sdk/single-url-environment-default/core/request_option.go +++ b/seed/go-sdk/single-url-environment-default/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/single-url-environment-default/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/single-url-environment-default/fern/0.0.1") return headers } diff --git a/seed/go-sdk/single-url-environment-no-default/core/request_option.go b/seed/go-sdk/single-url-environment-no-default/core/request_option.go index d46bb6ae149..a00cd9dc3fd 100644 --- a/seed/go-sdk/single-url-environment-no-default/core/request_option.go +++ b/seed/go-sdk/single-url-environment-no-default/core/request_option.go @@ -57,6 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/single-url-environment-no-default/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/single-url-environment-no-default/fern/0.0.1") return headers } diff --git a/seed/go-sdk/streaming/core/request_option.go b/seed/go-sdk/streaming/core/request_option.go index 2404f5dcf51..119a0f2ae71 100644 --- a/seed/go-sdk/streaming/core/request_option.go +++ b/seed/go-sdk/streaming/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/fern-api/stream-go/v2") headers.Set("X-Fern-SDK-Version", "v2.0.0") + headers.Set("User-Agent", "github.com/streaming/fern/v2.0.0") return headers } diff --git a/seed/go-sdk/undiscriminated-unions/core/request_option.go b/seed/go-sdk/undiscriminated-unions/core/request_option.go index 4b202f7fa14..04249d20226 100644 --- a/seed/go-sdk/undiscriminated-unions/core/request_option.go +++ b/seed/go-sdk/undiscriminated-unions/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/fern-api/undiscriminated-go") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/undiscriminated-unions/fern/0.0.1") return headers } diff --git a/seed/go-sdk/unions/core/request_option.go b/seed/go-sdk/unions/core/request_option.go index 8c16a46b060..0efb704a782 100644 --- a/seed/go-sdk/unions/core/request_option.go +++ b/seed/go-sdk/unions/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/fern-api/unions-go") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/unions/fern/0.0.1") return headers } diff --git a/seed/go-sdk/unknown/core/request_option.go b/seed/go-sdk/unknown/core/request_option.go index 3c4935033b3..b6da5e71698 100644 --- a/seed/go-sdk/unknown/core/request_option.go +++ b/seed/go-sdk/unknown/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/unknown/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/unknown/fern/0.0.1") return headers } diff --git a/seed/go-sdk/validation/core/request_option.go b/seed/go-sdk/validation/core/request_option.go index 4112abe890a..443497494d1 100644 --- a/seed/go-sdk/validation/core/request_option.go +++ b/seed/go-sdk/validation/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/validation/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/validation/fern/0.0.1") return headers } diff --git a/seed/go-sdk/variables/core/request_option.go b/seed/go-sdk/variables/core/request_option.go index 53188b10962..694cb4dad4c 100644 --- a/seed/go-sdk/variables/core/request_option.go +++ b/seed/go-sdk/variables/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/variables/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/variables/fern/0.0.1") return headers } diff --git a/seed/go-sdk/version-no-default/core/request_option.go b/seed/go-sdk/version-no-default/core/request_option.go index 52d50daffb4..877e9f214b5 100644 --- a/seed/go-sdk/version-no-default/core/request_option.go +++ b/seed/go-sdk/version-no-default/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/version-no-default/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/version-no-default/fern/0.0.1") return headers } diff --git a/seed/go-sdk/version/core/request_option.go b/seed/go-sdk/version/core/request_option.go index 9d5ae8880a2..bd69e5b7c75 100644 --- a/seed/go-sdk/version/core/request_option.go +++ b/seed/go-sdk/version/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/version/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/version/fern/0.0.1") return headers } diff --git a/seed/go-sdk/websocket/core/request_option.go b/seed/go-sdk/websocket/core/request_option.go index aa0f8a3dfbd..deab8cdcb8b 100644 --- a/seed/go-sdk/websocket/core/request_option.go +++ b/seed/go-sdk/websocket/core/request_option.go @@ -50,6 +50,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/websocket/fern") headers.Set("X-Fern-SDK-Version", "0.0.1") + headers.Set("User-Agent", "github.com/websocket/fern/0.0.1") return headers }