From 6eff4870b327ed17aa8b6f9b925d570bf59dd2f5 Mon Sep 17 00:00:00 2001 From: Alex McKinney Date: Fri, 28 Feb 2025 09:39:34 -0500 Subject: [PATCH] feat(csharp): Add support for inline-path-parameters (#6228) --- .../context/AbstractCsharpGeneratorContext.ts | 8 + generators/csharp/sdk/src/SdkCustomConfig.ts | 3 +- .../csharp/sdk/src/SdkGeneratorContext.ts | 16 + .../src/endpoint/AbstractEndpointGenerator.ts | 82 +- .../endpoint/http/HttpEndpointGenerator.ts | 2 +- .../WrappedRequestGenerator.ts | 43 +- generators/csharp/sdk/versions.yml | 22 + .../SeedAudiences/Foo/Requests/FindRequest.cs | 2 + .../Service/Requests/HeaderAuthRequest.cs | 2 + .../Foo/Requests/FindRequest.cs | 2 + .../Dataservice/Requests/FetchRequest.cs | 3 + .../Dataservice/Requests/ListRequest.cs | 5 + .../Requests/SendEnumAsQueryParamRequest.cs | 5 + .../SendEnumListAsQueryParamRequest.cs | 5 + .../Requests/SendEnumAsQueryParamRequest.cs | 5 + .../SendEnumListAsQueryParamRequest.cs | 5 + .../File/Service/Requests/GetFileRequest.cs | 2 + .../Service/Requests/GetMetadataRequest.cs | 4 + .../File/Service/Requests/GetFileRequest.cs | 2 + .../Service/Requests/GetMetadataRequest.cs | 4 + .../Requests/GetWithInlinePathAndQuery.cs | 2 + .../Params/Requests/GetWithMultipleQuery.cs | 3 + .../Params/Requests/GetWithPathAndQuery.cs | 2 + .../Endpoints/Params/Requests/GetWithQuery.cs | 3 + .../ReqWithHeaders/Requests/ReqWithHeaders.cs | 3 + .../Requests/GetWithInlinePathAndQuery.cs | 2 + .../Params/Requests/GetWithMultipleQuery.cs | 3 + .../Params/Requests/GetWithPathAndQuery.cs | 2 + .../Endpoints/Params/Requests/GetWithQuery.cs | 3 + .../ReqWithHeaders/Requests/ReqWithHeaders.cs | 3 + .../Requests/GetWithInlinePathAndQuery.cs | 2 + .../Params/Requests/GetWithMultipleQuery.cs | 3 + .../Params/Requests/GetWithPathAndQuery.cs | 2 + .../Endpoints/Params/Requests/GetWithQuery.cs | 3 + .../ReqWithHeaders/Requests/ReqWithHeaders.cs | 3 + .../JustFileWithQueryParamsRequest.cs | 6 + .../Requests/SendLiteralsInHeadersRequest.cs | 3 + .../Requests/SendLiteralsInQueryRequest.cs | 10 + .../Service/Requests/ListResourcesRequest.cs | 3 + .../Requests/GetEventMetadataRequest.cs | 2 + .../Events/Requests/ListUserEventsRequest.cs | 2 + .../User/Requests/ListUsersRequest.cs | 2 + .../Nullable/Requests/GetUsersRequest.cs | 6 + .../Users/Requests/ListUsernamesRequest.cs | 2 + .../ListUsersCursorPaginationRequest.cs | 5 + .../ListUsersDoubleOffsetPaginationRequest.cs | 5 + .../Requests/ListUsersExtendedRequest.cs | 2 + ...ListUsersExtendedRequestForOptionalData.cs | 2 + ...stUsersMixedTypeCursorPaginationRequest.cs | 2 + .../ListUsersOffsetPaginationRequest.cs | 5 + .../ListUsersOffsetStepPaginationRequest.cs | 4 + .../Requests/ListWithGlobalConfigRequest.cs | 2 + ...tWithOffsetPaginationHasNextPageRequest.cs | 4 + .../.github/workflows/ci.yml | 0 .../{ => inline-path-parameters}/.gitignore | 0 .../.mock/definition/api.yml | 0 .../.mock/definition/organizations.yml | 0 .../.mock/definition/user.yml | 0 .../.mock/fern.config.json | 0 .../.mock/generators.yml | 0 .../.mock/ir.json | 0 .../{ => inline-path-parameters}/README.md | 0 .../inline-path-parameters/reference.md | 350 + .../snippet-templates.json | 0 .../inline-path-parameters/snippet.json | 89 + .../Core/Json/DateOnlyJsonTests.cs | 0 .../Core/Json/DateTimeJsonTests.cs | 0 .../Core/Json/EnumSerializerTests.cs | 0 .../Core/Json/OneOfSerializerTests.cs | 0 .../Core/RawClientTests.cs | 0 .../SeedPathParameters.Test.Custom.props | 0 .../SeedPathParameters.Test.csproj | 0 .../src/SeedPathParameters.Test/TestClient.cs | 0 .../Unit/MockServer/BaseMockServerTest.cs | 0 .../Unit/MockServer/CreateUserTest.cs | 0 .../Unit/MockServer/GetOrganizationTest.cs | 0 .../MockServer/GetOrganizationUserTest.cs | 54 + .../Unit/MockServer/GetUserTest.cs | 49 + .../MockServer/SearchOrganizationsTest.cs | 0 .../Unit/MockServer/SearchUsersTest.cs | 64 + .../Unit/MockServer/UpdateUserTest.cs | 69 + .../Core/CollectionItemSerializer.cs | 0 .../src/SeedPathParameters/Core/Constants.cs | 0 .../Core/DateOnlyConverter.cs | 0 .../Core/DateTimeSerializer.cs | 0 .../SeedPathParameters/Core/EnumSerializer.cs | 0 .../src/SeedPathParameters/Core/Extensions.cs | 0 .../SeedPathParameters/Core/HeaderValue.cs | 0 .../src/SeedPathParameters/Core/Headers.cs | 0 .../Core/HttpMethodExtensions.cs | 0 .../Core/IRequestOptions.cs | 0 .../Core/JsonConfiguration.cs | 0 .../Core/OneOfSerializer.cs | 0 .../Core/Public/ClientOptions.cs | 0 .../Core/Public/RequestOptions.cs | 0 .../Public/SeedPathParametersApiException.cs | 0 .../Public/SeedPathParametersException.cs | 0 .../SeedPathParameters/Core/Public/Version.cs | 0 .../src/SeedPathParameters/Core/RawClient.cs | 0 .../Organizations/OrganizationsClient.cs | 168 + .../Requests/GetOrganizationUserRequest.cs | 21 + .../Requests/SearchOrganizationsRequest.cs | 2 + .../Organizations/Types/Organization.cs | 0 .../SeedPathParameters.Custom.props | 0 .../SeedPathParameters.csproj | 0 .../SeedPathParametersClient.cs | 0 .../User/Requests/GetUsersRequest.cs | 18 + .../User/Requests/SearchUsersRequest.cs | 21 + .../User/Requests/UpdateUserRequest.cs | 20 + .../src/SeedPathParameters/User/Types/User.cs | 0 .../src/SeedPathParameters/User/UserClient.cs | 225 + .../no-custom-config/.github/workflows/ci.yml | 69 + .../no-custom-config/.gitignore | 484 ++ .../no-custom-config/.mock/definition/api.yml | 4 + .../.mock/definition/organizations.yml | 37 + .../.mock/definition/user.yml | 47 + .../no-custom-config/.mock/fern.config.json | 1 + .../no-custom-config/.mock/generators.yml | 1 + .../no-custom-config/.mock/ir.json | 6602 +++++++++++++++++ .../no-custom-config/README.md | 94 + .../{ => no-custom-config}/reference.md | 0 .../no-custom-config/snippet-templates.json | 0 .../{ => no-custom-config}/snippet.json | 0 .../Core/Json/DateOnlyJsonTests.cs | 76 + .../Core/Json/DateTimeJsonTests.cs | 110 + .../Core/Json/EnumSerializerTests.cs | 60 + .../Core/Json/OneOfSerializerTests.cs | 311 + .../Core/RawClientTests.cs | 109 + .../SeedPathParameters.Test.Custom.props | 7 + .../SeedPathParameters.Test.csproj | 38 + .../src/SeedPathParameters.Test/TestClient.cs | 6 + .../Unit/MockServer/BaseMockServerTest.cs | 38 + .../Unit/MockServer/CreateUserTest.cs | 65 + .../Unit/MockServer/GetOrganizationTest.cs | 49 + .../MockServer/GetOrganizationUserTest.cs | 0 .../Unit/MockServer/GetUserTest.cs | 0 .../MockServer/SearchOrganizationsTest.cs | 61 + .../Unit/MockServer/SearchUsersTest.cs | 0 .../Unit/MockServer/UpdateUserTest.cs | 0 .../Core/CollectionItemSerializer.cs | 91 + .../src/SeedPathParameters/Core/Constants.cs | 7 + .../Core/DateOnlyConverter.cs | 747 ++ .../Core/DateTimeSerializer.cs | 22 + .../SeedPathParameters/Core/EnumSerializer.cs | 53 + .../src/SeedPathParameters/Core/Extensions.cs | 14 + .../SeedPathParameters/Core/HeaderValue.cs | 17 + .../src/SeedPathParameters/Core/Headers.cs | 17 + .../Core/HttpMethodExtensions.cs | 8 + .../Core/IRequestOptions.cs | 32 + .../Core/JsonConfiguration.cs | 49 + .../Core/OneOfSerializer.cs | 91 + .../Core/Public/ClientOptions.cs | 48 + .../Core/Public/RequestOptions.cs | 33 + .../Public/SeedPathParametersApiException.cs | 18 + .../Public/SeedPathParametersException.cs | 9 + .../SeedPathParameters/Core/Public/Version.cs | 6 + .../src/SeedPathParameters/Core/RawClient.cs | 196 + .../Organizations/OrganizationsClient.cs | 0 .../Requests/GetOrganizationUserRequest.cs | 0 .../Requests/SearchOrganizationsRequest.cs | 15 + .../Organizations/Types/Organization.cs | 18 + .../SeedPathParameters.Custom.props | 20 + .../SeedPathParameters.csproj | 53 + .../SeedPathParametersClient.cs | 36 + .../User/Requests/GetUsersRequest.cs | 0 .../User/Requests/SearchUsersRequest.cs | 2 + .../User/Requests/UpdateUserRequest.cs | 0 .../src/SeedPathParameters/User/Types/User.cs | 18 + .../src/SeedPathParameters/User/UserClient.cs | 0 .../User/Requests/GetUsersRequest.cs | 15 + .../Package/Requests/TestRequest.cs | 2 + seed/csharp-sdk/seed.yml | 6 + .../Requests/GetAttemptedMigrationsRequest.cs | 2 + .../Requests/CreatePlaylistRequest.cs | 3 + .../Playlist/Requests/GetPlaylistsRequest.cs | 6 + .../src/SeedValidation/Requests/GetRequest.cs | 4 + 176 files changed, 11381 insertions(+), 24 deletions(-) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/.github/workflows/ci.yml (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/.gitignore (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/.mock/definition/api.yml (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/.mock/definition/organizations.yml (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/.mock/definition/user.yml (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/.mock/fern.config.json (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/.mock/generators.yml (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/.mock/ir.json (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/README.md (100%) create mode 100644 seed/csharp-sdk/path-parameters/inline-path-parameters/reference.md rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/snippet-templates.json (100%) create mode 100644 seed/csharp-sdk/path-parameters/inline-path-parameters/snippet.json rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters.Test/Core/Json/DateOnlyJsonTests.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters.Test/Core/Json/DateTimeJsonTests.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters.Test/Core/Json/EnumSerializerTests.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters.Test/Core/Json/OneOfSerializerTests.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters.Test/Core/RawClientTests.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters.Test/SeedPathParameters.Test.Custom.props (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters.Test/SeedPathParameters.Test.csproj (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters.Test/TestClient.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters.Test/Unit/MockServer/BaseMockServerTest.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters.Test/Unit/MockServer/CreateUserTest.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationTest.cs (100%) create mode 100644 seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationUserTest.cs create mode 100644 seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetUserTest.cs rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters.Test/Unit/MockServer/SearchOrganizationsTest.cs (100%) create mode 100644 seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/SearchUsersTest.cs create mode 100644 seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/UpdateUserTest.cs rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/CollectionItemSerializer.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/Constants.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/DateOnlyConverter.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/DateTimeSerializer.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/EnumSerializer.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/Extensions.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/HeaderValue.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/Headers.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/HttpMethodExtensions.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/IRequestOptions.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/JsonConfiguration.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/OneOfSerializer.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/Public/ClientOptions.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/Public/RequestOptions.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/Public/SeedPathParametersApiException.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/Public/SeedPathParametersException.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/Public/Version.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Core/RawClient.cs (100%) create mode 100644 seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/OrganizationsClient.cs create mode 100644 seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/Requests/GetOrganizationUserRequest.cs rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Organizations/Requests/SearchOrganizationsRequest.cs (81%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/Organizations/Types/Organization.cs (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/SeedPathParameters.Custom.props (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/SeedPathParameters.csproj (100%) rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/SeedPathParametersClient.cs (100%) create mode 100644 seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Requests/GetUsersRequest.cs create mode 100644 seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Requests/SearchUsersRequest.cs create mode 100644 seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Requests/UpdateUserRequest.cs rename seed/csharp-sdk/path-parameters/{ => inline-path-parameters}/src/SeedPathParameters/User/Types/User.cs (100%) create mode 100644 seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/UserClient.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/.github/workflows/ci.yml create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/.gitignore create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/.mock/definition/api.yml create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/.mock/definition/organizations.yml create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/.mock/definition/user.yml create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/.mock/fern.config.json create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/.mock/generators.yml create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/.mock/ir.json create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/README.md rename seed/csharp-sdk/path-parameters/{ => no-custom-config}/reference.md (100%) create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/snippet-templates.json rename seed/csharp-sdk/path-parameters/{ => no-custom-config}/snippet.json (100%) create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/DateOnlyJsonTests.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/DateTimeJsonTests.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/EnumSerializerTests.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/OneOfSerializerTests.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/RawClientTests.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/SeedPathParameters.Test.Custom.props create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/SeedPathParameters.Test.csproj create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/TestClient.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/BaseMockServerTest.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/CreateUserTest.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationTest.cs rename seed/csharp-sdk/path-parameters/{ => no-custom-config}/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationUserTest.cs (100%) rename seed/csharp-sdk/path-parameters/{ => no-custom-config}/src/SeedPathParameters.Test/Unit/MockServer/GetUserTest.cs (100%) create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/SearchOrganizationsTest.cs rename seed/csharp-sdk/path-parameters/{ => no-custom-config}/src/SeedPathParameters.Test/Unit/MockServer/SearchUsersTest.cs (100%) rename seed/csharp-sdk/path-parameters/{ => no-custom-config}/src/SeedPathParameters.Test/Unit/MockServer/UpdateUserTest.cs (100%) create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/CollectionItemSerializer.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Constants.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/DateOnlyConverter.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/DateTimeSerializer.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/EnumSerializer.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Extensions.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/HeaderValue.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Headers.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/HttpMethodExtensions.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/IRequestOptions.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/JsonConfiguration.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/OneOfSerializer.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/ClientOptions.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/RequestOptions.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/SeedPathParametersApiException.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/SeedPathParametersException.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/Version.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/RawClient.cs rename seed/csharp-sdk/path-parameters/{ => no-custom-config}/src/SeedPathParameters/Organizations/OrganizationsClient.cs (100%) rename seed/csharp-sdk/path-parameters/{ => no-custom-config}/src/SeedPathParameters/Organizations/Requests/GetOrganizationUserRequest.cs (100%) create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Organizations/Requests/SearchOrganizationsRequest.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Organizations/Types/Organization.cs create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParameters.Custom.props create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParameters.csproj create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParametersClient.cs rename seed/csharp-sdk/path-parameters/{ => no-custom-config}/src/SeedPathParameters/User/Requests/GetUsersRequest.cs (100%) rename seed/csharp-sdk/path-parameters/{ => no-custom-config}/src/SeedPathParameters/User/Requests/SearchUsersRequest.cs (80%) rename seed/csharp-sdk/path-parameters/{ => no-custom-config}/src/SeedPathParameters/User/Requests/UpdateUserRequest.cs (100%) create mode 100644 seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/Types/User.cs rename seed/csharp-sdk/path-parameters/{ => no-custom-config}/src/SeedPathParameters/User/UserClient.cs (100%) diff --git a/generators/csharp/codegen/src/context/AbstractCsharpGeneratorContext.ts b/generators/csharp/codegen/src/context/AbstractCsharpGeneratorContext.ts index 0e18b644c5a..50f8ff4ce8a 100644 --- a/generators/csharp/codegen/src/context/AbstractCsharpGeneratorContext.ts +++ b/generators/csharp/codegen/src/context/AbstractCsharpGeneratorContext.ts @@ -285,6 +285,14 @@ export abstract class AbstractCsharpGeneratorContext< }); } + public getJsonIgnoreAnnotation(): csharp.Annotation { + return csharp.annotation({ + reference: csharp.classReference({ + name: "JsonIgnore", + namespace: "System.Text.Json.Serialization" + }) + }); + } public getPascalCaseSafeName(name: Name): string { return name.pascalCase.safeName; } diff --git a/generators/csharp/sdk/src/SdkCustomConfig.ts b/generators/csharp/sdk/src/SdkCustomConfig.ts index dbbf1997347..f18742e9973 100644 --- a/generators/csharp/sdk/src/SdkCustomConfig.ts +++ b/generators/csharp/sdk/src/SdkCustomConfig.ts @@ -20,7 +20,8 @@ export const SdkCustomConfigSchema = z.strictObject({ ), "read-only-memory-types": z.optional(z.array(z.string())), "experimental-enable-forward-compatible-enums": z.boolean().optional(), - "generate-mock-server-tests": z.boolean().optional() + "generate-mock-server-tests": z.boolean().optional(), + "inline-path-parameters": z.boolean().optional() }); export type SdkCustomConfigSchema = z.infer; diff --git a/generators/csharp/sdk/src/SdkGeneratorContext.ts b/generators/csharp/sdk/src/SdkGeneratorContext.ts index 373a365231c..fe9b0a66afa 100644 --- a/generators/csharp/sdk/src/SdkGeneratorContext.ts +++ b/generators/csharp/sdk/src/SdkGeneratorContext.ts @@ -17,6 +17,7 @@ import { NameAndWireValue, OAuthScheme, ProtobufService, + SdkRequestWrapper, ServiceId, Subpackage, SubpackageId, @@ -132,6 +133,21 @@ export class SdkGeneratorContext extends AbstractCsharpGeneratorContext 0 && inlinePathParameters && wrapperShouldIncludePathParameters; + } + public getRawAsIsFiles(): string[] { return [AsIsFiles.GitIgnore]; } diff --git a/generators/csharp/sdk/src/endpoint/AbstractEndpointGenerator.ts b/generators/csharp/sdk/src/endpoint/AbstractEndpointGenerator.ts index 13e40ca365a..cc1a2f29a89 100644 --- a/generators/csharp/sdk/src/endpoint/AbstractEndpointGenerator.ts +++ b/generators/csharp/sdk/src/endpoint/AbstractEndpointGenerator.ts @@ -2,7 +2,7 @@ import { assertNever } from "@fern-api/core-utils"; import { csharp } from "@fern-api/csharp-codegen"; import { ExampleGenerator } from "@fern-api/fern-csharp-model"; -import { ExampleEndpointCall, ExampleRequestBody, HttpEndpoint, ServiceId } from "@fern-fern/ir-sdk/api"; +import { ExampleEndpointCall, ExampleRequestBody, HttpEndpoint, PathParameter, ServiceId } from "@fern-fern/ir-sdk/api"; import { SdkGeneratorContext } from "../SdkGeneratorContext"; import { WrappedRequestGenerator } from "../wrapped-request/WrappedRequestGenerator"; @@ -40,12 +40,16 @@ export abstract class AbstractEndpointGenerator { serviceId: ServiceId; endpoint: HttpEndpoint; }): EndpointSignatureInfo { - const { pathParameters, pathParameterReferences } = this.getAllPathParameters({ serviceId, endpoint }); const request = getEndpointRequest({ context: this.context, endpoint, serviceId }); const requestParameter = request != null ? csharp.parameter({ type: request.getParameterType(), name: request.getParameterName() }) : undefined; + const { pathParameters, pathParameterReferences } = this.getAllPathParameters({ + serviceId, + endpoint, + requestParameter + }); return { baseParameters: [...pathParameters, requestParameter].filter((p): p is csharp.Parameter => p != null), pathParameters, @@ -113,28 +117,32 @@ export abstract class AbstractEndpointGenerator { protected getAllPathParameters({ serviceId, - endpoint + endpoint, + requestParameter }: { serviceId: ServiceId; endpoint: HttpEndpoint; + requestParameter?: csharp.Parameter; }): Pick { const pathParameters: csharp.Parameter[] = []; - const service = this.context.getHttpServiceOrThrow(serviceId); const pathParameterReferences: Record = {}; - for (const pathParam of [ - ...this.context.ir.pathParameters, - ...service.pathParameters, - ...endpoint.pathParameters - ]) { - const parameterName = pathParam.name.camelCase.safeName; + const includePathParametersInEndpointSignature = this.includePathParametersInEndpointSignature({ endpoint }); + for (const pathParam of endpoint.allPathParameters) { + const parameterName = this.getPathParameterName({ + pathParameter: pathParam, + includePathParametersInEndpointSignature, + requestParameter + }); + if (includePathParametersInEndpointSignature) { + pathParameters.push( + csharp.parameter({ + docs: pathParam.docs, + name: parameterName, + type: this.context.csharpTypeMapper.convert({ reference: pathParam.valueType }) + }) + ); + } pathParameterReferences[pathParam.name.originalName] = parameterName; - pathParameters.push( - csharp.parameter({ - docs: pathParam.docs, - name: parameterName, - type: this.context.csharpTypeMapper.convert({ reference: pathParam.valueType }) - }) - ); } return { pathParameters, @@ -182,7 +190,7 @@ export abstract class AbstractEndpointGenerator { if (requestBodyType === "fileUpload" || requestBodyType === "bytes") { return undefined; } - const args = this.getNonEndpointArguments(example, parseDatetimes); + const args = this.getNonEndpointArguments({ endpoint, example, parseDatetimes }); const endpointRequestSnippet = this.getEndpointRequestSnippet(example, endpoint, serviceId, parseDatetimes); if (endpointRequestSnippet != null) { args.push(endpointRequestSnippet); @@ -245,7 +253,18 @@ export abstract class AbstractEndpointGenerator { }); } - protected getNonEndpointArguments(example: ExampleEndpointCall, parseDatetimes: boolean): csharp.CodeBlock[] { + protected getNonEndpointArguments({ + endpoint, + example, + parseDatetimes + }: { + endpoint: HttpEndpoint; + example: ExampleEndpointCall; + parseDatetimes: boolean; + }): csharp.CodeBlock[] { + if (!this.includePathParametersInEndpointSignature({ endpoint })) { + return []; + } const pathParameters = [ ...example.rootPathParameters, ...example.servicePathParameters, @@ -258,4 +277,29 @@ export abstract class AbstractEndpointGenerator { }) ); } + + private includePathParametersInEndpointSignature({ endpoint }: { endpoint: HttpEndpoint }): boolean { + if (endpoint.sdkRequest?.shape.type !== "wrapper") { + return true; + } + return !this.context.includePathParametersInWrappedRequest({ + endpoint, + wrapper: endpoint.sdkRequest.shape + }); + } + + private getPathParameterName({ + pathParameter, + includePathParametersInEndpointSignature, + requestParameter + }: { + pathParameter: PathParameter; + includePathParametersInEndpointSignature: boolean; + requestParameter?: csharp.Parameter; + }): string { + if (!includePathParametersInEndpointSignature && requestParameter != null) { + return `${requestParameter?.name}.${pathParameter.name.pascalCase.safeName}`; + } + return pathParameter.name.camelCase.safeName; + } } diff --git a/generators/csharp/sdk/src/endpoint/http/HttpEndpointGenerator.ts b/generators/csharp/sdk/src/endpoint/http/HttpEndpointGenerator.ts index c2f4f02bd74..384008fa0e2 100644 --- a/generators/csharp/sdk/src/endpoint/http/HttpEndpointGenerator.ts +++ b/generators/csharp/sdk/src/endpoint/http/HttpEndpointGenerator.ts @@ -661,7 +661,7 @@ export class HttpEndpointGenerator extends AbstractEndpointGenerator { }): csharp.MethodInvocation | undefined { const service = this.context.getHttpServiceOrThrow(serviceId); const serviceFilePath = service.name.fernFilepath; - const args = this.getNonEndpointArguments(example, parseDatetimes); + const args = this.getNonEndpointArguments({ endpoint, example, parseDatetimes }); const endpointRequestSnippet = this.getEndpointRequestSnippet(example, endpoint, serviceId, parseDatetimes); if (endpointRequestSnippet != null) { args.push(endpointRequestSnippet); diff --git a/generators/csharp/sdk/src/wrapped-request/WrappedRequestGenerator.ts b/generators/csharp/sdk/src/wrapped-request/WrappedRequestGenerator.ts index bb6e030e861..5d8df04cc99 100644 --- a/generators/csharp/sdk/src/wrapped-request/WrappedRequestGenerator.ts +++ b/generators/csharp/sdk/src/wrapped-request/WrappedRequestGenerator.ts @@ -51,6 +51,27 @@ export class WrappedRequestGenerator extends FileGenerator /// Specifies the endpoint key. /// + [JsonIgnore] public required string XEndpointHeader { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Foo/Requests/FindRequest.cs b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Foo/Requests/FindRequest.cs index 13696d1b6e5..ec07907382d 100644 --- a/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Foo/Requests/FindRequest.cs +++ b/seed/csharp-sdk/cross-package-type-names/src/SeedCrossPackageTypeNames/Foo/Requests/FindRequest.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedCrossPackageTypeNames.Core; namespace SeedCrossPackageTypeNames; public record FindRequest { + [JsonIgnore] public string? OptionalString { get; set; } public string? PublicProperty { get; set; } diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/src/SeedApi/Dataservice/Requests/FetchRequest.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/src/SeedApi/Dataservice/Requests/FetchRequest.cs index 3540748c4f5..cbe21c7665d 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/src/SeedApi/Dataservice/Requests/FetchRequest.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/src/SeedApi/Dataservice/Requests/FetchRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using SeedApi.Core; using Proto = Data.V1.Grpc; @@ -5,8 +6,10 @@ namespace SeedApi; public record FetchRequest { + [JsonIgnore] public IEnumerable Ids { get; set; } = new List(); + [JsonIgnore] public string? Namespace { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/src/SeedApi/Dataservice/Requests/ListRequest.cs b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/src/SeedApi/Dataservice/Requests/ListRequest.cs index 70f97ce4e88..bb467f875c6 100644 --- a/seed/csharp-sdk/csharp-grpc-proto-exhaustive/src/SeedApi/Dataservice/Requests/ListRequest.cs +++ b/seed/csharp-sdk/csharp-grpc-proto-exhaustive/src/SeedApi/Dataservice/Requests/ListRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using SeedApi.Core; using Proto = Data.V1.Grpc; @@ -5,12 +6,16 @@ namespace SeedApi; public record ListRequest { + [JsonIgnore] public string? Prefix { get; set; } + [JsonIgnore] public uint? Limit { get; set; } + [JsonIgnore] public string? PaginationToken { get; set; } + [JsonIgnore] public string? Namespace { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/QueryParam/Requests/SendEnumAsQueryParamRequest.cs b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/QueryParam/Requests/SendEnumAsQueryParamRequest.cs index ada70aff059..414e40e66c6 100644 --- a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/QueryParam/Requests/SendEnumAsQueryParamRequest.cs +++ b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/QueryParam/Requests/SendEnumAsQueryParamRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using OneOf; using SeedEnum.Core; @@ -5,12 +6,16 @@ namespace SeedEnum; public record SendEnumAsQueryParamRequest { + [JsonIgnore] public required Operand Operand { get; set; } + [JsonIgnore] public Operand? MaybeOperand { get; set; } + [JsonIgnore] public required OneOf OperandOrColor { get; set; } + [JsonIgnore] public OneOf? MaybeOperandOrColor { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/QueryParam/Requests/SendEnumListAsQueryParamRequest.cs b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/QueryParam/Requests/SendEnumListAsQueryParamRequest.cs index bad4032cbec..4a09e75110e 100644 --- a/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/QueryParam/Requests/SendEnumListAsQueryParamRequest.cs +++ b/seed/csharp-sdk/enum/forward-compatible-enums/src/SeedEnum/QueryParam/Requests/SendEnumListAsQueryParamRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using OneOf; using SeedEnum.Core; @@ -5,13 +6,17 @@ namespace SeedEnum; public record SendEnumListAsQueryParamRequest { + [JsonIgnore] public IEnumerable Operand { get; set; } = new List(); + [JsonIgnore] public IEnumerable MaybeOperand { get; set; } = new List(); + [JsonIgnore] public IEnumerable> OperandOrColor { get; set; } = new List>(); + [JsonIgnore] public IEnumerable> MaybeOperandOrColor { get; set; } = new List>(); diff --git a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/QueryParam/Requests/SendEnumAsQueryParamRequest.cs b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/QueryParam/Requests/SendEnumAsQueryParamRequest.cs index ada70aff059..414e40e66c6 100644 --- a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/QueryParam/Requests/SendEnumAsQueryParamRequest.cs +++ b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/QueryParam/Requests/SendEnumAsQueryParamRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using OneOf; using SeedEnum.Core; @@ -5,12 +6,16 @@ namespace SeedEnum; public record SendEnumAsQueryParamRequest { + [JsonIgnore] public required Operand Operand { get; set; } + [JsonIgnore] public Operand? MaybeOperand { get; set; } + [JsonIgnore] public required OneOf OperandOrColor { get; set; } + [JsonIgnore] public OneOf? MaybeOperandOrColor { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/QueryParam/Requests/SendEnumListAsQueryParamRequest.cs b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/QueryParam/Requests/SendEnumListAsQueryParamRequest.cs index bad4032cbec..4a09e75110e 100644 --- a/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/QueryParam/Requests/SendEnumListAsQueryParamRequest.cs +++ b/seed/csharp-sdk/enum/plain-enums/src/SeedEnum/QueryParam/Requests/SendEnumListAsQueryParamRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using OneOf; using SeedEnum.Core; @@ -5,13 +6,17 @@ namespace SeedEnum; public record SendEnumListAsQueryParamRequest { + [JsonIgnore] public IEnumerable Operand { get; set; } = new List(); + [JsonIgnore] public IEnumerable MaybeOperand { get; set; } = new List(); + [JsonIgnore] public IEnumerable> OperandOrColor { get; set; } = new List>(); + [JsonIgnore] public IEnumerable> MaybeOperandOrColor { get; set; } = new List>(); diff --git a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/File/Service/Requests/GetFileRequest.cs b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/File/Service/Requests/GetFileRequest.cs index 324b6b6a82a..e3eb5aece28 100644 --- a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/File/Service/Requests/GetFileRequest.cs +++ b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/File/Service/Requests/GetFileRequest.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedExamples.Core; namespace SeedExamples.File; public record GetFileRequest { + [JsonIgnore] public required string XFileApiVersion { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Service/Requests/GetMetadataRequest.cs b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Service/Requests/GetMetadataRequest.cs index dc8752f5507..1e668ea15f5 100644 --- a/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Service/Requests/GetMetadataRequest.cs +++ b/seed/csharp-sdk/examples/no-custom-config/src/SeedExamples/Service/Requests/GetMetadataRequest.cs @@ -1,13 +1,17 @@ +using System.Text.Json.Serialization; using SeedExamples.Core; namespace SeedExamples; public record GetMetadataRequest { + [JsonIgnore] public bool? Shallow { get; set; } + [JsonIgnore] public IEnumerable Tag { get; set; } = new List(); + [JsonIgnore] public required string XApiVersion { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/File/Service/Requests/GetFileRequest.cs b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/File/Service/Requests/GetFileRequest.cs index 324b6b6a82a..e3eb5aece28 100644 --- a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/File/Service/Requests/GetFileRequest.cs +++ b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/File/Service/Requests/GetFileRequest.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedExamples.Core; namespace SeedExamples.File; public record GetFileRequest { + [JsonIgnore] public required string XFileApiVersion { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Service/Requests/GetMetadataRequest.cs b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Service/Requests/GetMetadataRequest.cs index dc8752f5507..1e668ea15f5 100644 --- a/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Service/Requests/GetMetadataRequest.cs +++ b/seed/csharp-sdk/examples/readme-config/src/SeedExamples/Service/Requests/GetMetadataRequest.cs @@ -1,13 +1,17 @@ +using System.Text.Json.Serialization; using SeedExamples.Core; namespace SeedExamples; public record GetMetadataRequest { + [JsonIgnore] public bool? Shallow { get; set; } + [JsonIgnore] public IEnumerable Tag { get; set; } = new List(); + [JsonIgnore] public required string XApiVersion { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithInlinePathAndQuery.cs b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithInlinePathAndQuery.cs index a7c973969a5..c59498d8751 100644 --- a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithInlinePathAndQuery.cs +++ b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithInlinePathAndQuery.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.Endpoints.Params; public record GetWithInlinePathAndQuery { + [JsonIgnore] public required string Query { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithMultipleQuery.cs b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithMultipleQuery.cs index f34680ad00c..a73e38d2093 100644 --- a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithMultipleQuery.cs +++ b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithMultipleQuery.cs @@ -1,11 +1,14 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.Endpoints.Params; public record GetWithMultipleQuery { + [JsonIgnore] public IEnumerable Query { get; set; } = new List(); + [JsonIgnore] public IEnumerable Number { get; set; } = new List(); public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithPathAndQuery.cs b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithPathAndQuery.cs index c15aaef1783..f17976c16c1 100644 --- a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithPathAndQuery.cs +++ b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithPathAndQuery.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.Endpoints.Params; public record GetWithPathAndQuery { + [JsonIgnore] public required string Query { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithQuery.cs b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithQuery.cs index 12ab8d9d8f0..873f9f92577 100644 --- a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithQuery.cs +++ b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/Endpoints/Params/Requests/GetWithQuery.cs @@ -1,11 +1,14 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.Endpoints.Params; public record GetWithQuery { + [JsonIgnore] public required string Query { get; set; } + [JsonIgnore] public required int Number { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/ReqWithHeaders/Requests/ReqWithHeaders.cs b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/ReqWithHeaders/Requests/ReqWithHeaders.cs index 2fa7901c4bc..924d60ec13a 100644 --- a/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/ReqWithHeaders/Requests/ReqWithHeaders.cs +++ b/seed/csharp-sdk/exhaustive/explicit-namespaces/src/SeedExhaustive/ReqWithHeaders/Requests/ReqWithHeaders.cs @@ -1,11 +1,14 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.ReqWithHeaders; public record ReqWithHeaders { + [JsonIgnore] public required string XTestServiceHeader { get; set; } + [JsonIgnore] public required string XTestEndpointHeader { get; set; } public required string Body { get; set; } diff --git a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithInlinePathAndQuery.cs b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithInlinePathAndQuery.cs index ad92464f7ce..3d101146c48 100644 --- a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithInlinePathAndQuery.cs +++ b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithInlinePathAndQuery.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.Endpoints; public record GetWithInlinePathAndQuery { + [JsonIgnore] public required string Query { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithMultipleQuery.cs b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithMultipleQuery.cs index fbba966f6d3..d27ca4a14bc 100644 --- a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithMultipleQuery.cs +++ b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithMultipleQuery.cs @@ -1,11 +1,14 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.Endpoints; public record GetWithMultipleQuery { + [JsonIgnore] public IEnumerable Query { get; set; } = new List(); + [JsonIgnore] public IEnumerable Number { get; set; } = new List(); public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithPathAndQuery.cs b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithPathAndQuery.cs index 123a966953b..f2f276f13df 100644 --- a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithPathAndQuery.cs +++ b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithPathAndQuery.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.Endpoints; public record GetWithPathAndQuery { + [JsonIgnore] public required string Query { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithQuery.cs b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithQuery.cs index 0eb62f9888b..959d51ab752 100644 --- a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithQuery.cs +++ b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/Endpoints/Params/Requests/GetWithQuery.cs @@ -1,11 +1,14 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.Endpoints; public record GetWithQuery { + [JsonIgnore] public required string Query { get; set; } + [JsonIgnore] public required int Number { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/ReqWithHeaders/Requests/ReqWithHeaders.cs b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/ReqWithHeaders/Requests/ReqWithHeaders.cs index ab373001395..764e4c3732d 100644 --- a/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/ReqWithHeaders/Requests/ReqWithHeaders.cs +++ b/seed/csharp-sdk/exhaustive/no-generate-error-types/src/SeedExhaustive/ReqWithHeaders/Requests/ReqWithHeaders.cs @@ -1,11 +1,14 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive; public record ReqWithHeaders { + [JsonIgnore] public required string XTestServiceHeader { get; set; } + [JsonIgnore] public required string XTestEndpointHeader { get; set; } public required string Body { get; set; } diff --git a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithInlinePathAndQuery.cs b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithInlinePathAndQuery.cs index ad92464f7ce..3d101146c48 100644 --- a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithInlinePathAndQuery.cs +++ b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithInlinePathAndQuery.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.Endpoints; public record GetWithInlinePathAndQuery { + [JsonIgnore] public required string Query { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithMultipleQuery.cs b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithMultipleQuery.cs index fbba966f6d3..d27ca4a14bc 100644 --- a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithMultipleQuery.cs +++ b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithMultipleQuery.cs @@ -1,11 +1,14 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.Endpoints; public record GetWithMultipleQuery { + [JsonIgnore] public IEnumerable Query { get; set; } = new List(); + [JsonIgnore] public IEnumerable Number { get; set; } = new List(); public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithPathAndQuery.cs b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithPathAndQuery.cs index 123a966953b..f2f276f13df 100644 --- a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithPathAndQuery.cs +++ b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithPathAndQuery.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.Endpoints; public record GetWithPathAndQuery { + [JsonIgnore] public required string Query { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithQuery.cs b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithQuery.cs index 0eb62f9888b..959d51ab752 100644 --- a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithQuery.cs +++ b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/Endpoints/Params/Requests/GetWithQuery.cs @@ -1,11 +1,14 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive.Endpoints; public record GetWithQuery { + [JsonIgnore] public required string Query { get; set; } + [JsonIgnore] public required int Number { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/ReqWithHeaders/Requests/ReqWithHeaders.cs b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/ReqWithHeaders/Requests/ReqWithHeaders.cs index ab373001395..764e4c3732d 100644 --- a/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/ReqWithHeaders/Requests/ReqWithHeaders.cs +++ b/seed/csharp-sdk/exhaustive/no-root-namespace-for-core-classes/src/SeedExhaustive/ReqWithHeaders/Requests/ReqWithHeaders.cs @@ -1,11 +1,14 @@ +using System.Text.Json.Serialization; using SeedExhaustive.Core; namespace SeedExhaustive; public record ReqWithHeaders { + [JsonIgnore] public required string XTestServiceHeader { get; set; } + [JsonIgnore] public required string XTestEndpointHeader { get; set; } public required string Body { get; set; } diff --git a/seed/csharp-sdk/file-upload/src/SeedFileUpload/Service/Requests/JustFileWithQueryParamsRequest.cs b/seed/csharp-sdk/file-upload/src/SeedFileUpload/Service/Requests/JustFileWithQueryParamsRequest.cs index 706062d72e3..1fb2a58884f 100644 --- a/seed/csharp-sdk/file-upload/src/SeedFileUpload/Service/Requests/JustFileWithQueryParamsRequest.cs +++ b/seed/csharp-sdk/file-upload/src/SeedFileUpload/Service/Requests/JustFileWithQueryParamsRequest.cs @@ -1,17 +1,23 @@ +using System.Text.Json.Serialization; using SeedFileUpload.Core; namespace SeedFileUpload; public record JustFileWithQueryParamsRequest { + [JsonIgnore] public string? MaybeString { get; set; } + [JsonIgnore] public required int Integer { get; set; } + [JsonIgnore] public int? MaybeInteger { get; set; } + [JsonIgnore] public IEnumerable ListOfStrings { get; set; } = new List(); + [JsonIgnore] public IEnumerable OptionalListOfStrings { get; set; } = new List(); public override string ToString() diff --git a/seed/csharp-sdk/literal/src/SeedLiteral/Headers/Requests/SendLiteralsInHeadersRequest.cs b/seed/csharp-sdk/literal/src/SeedLiteral/Headers/Requests/SendLiteralsInHeadersRequest.cs index 9186e7d002a..99e11145260 100644 --- a/seed/csharp-sdk/literal/src/SeedLiteral/Headers/Requests/SendLiteralsInHeadersRequest.cs +++ b/seed/csharp-sdk/literal/src/SeedLiteral/Headers/Requests/SendLiteralsInHeadersRequest.cs @@ -1,11 +1,14 @@ +using System.Text.Json.Serialization; using SeedLiteral.Core; namespace SeedLiteral; public record SendLiteralsInHeadersRequest { + [JsonIgnore] public string EndpointVersion { get; set; } = "02-12-2024"; + [JsonIgnore] public bool Async { get; set; } = true; public required string Query { get; set; } diff --git a/seed/csharp-sdk/literal/src/SeedLiteral/Query/Requests/SendLiteralsInQueryRequest.cs b/seed/csharp-sdk/literal/src/SeedLiteral/Query/Requests/SendLiteralsInQueryRequest.cs index e00f97c1dab..16125ab8737 100644 --- a/seed/csharp-sdk/literal/src/SeedLiteral/Query/Requests/SendLiteralsInQueryRequest.cs +++ b/seed/csharp-sdk/literal/src/SeedLiteral/Query/Requests/SendLiteralsInQueryRequest.cs @@ -1,25 +1,35 @@ +using System.Text.Json.Serialization; using SeedLiteral.Core; namespace SeedLiteral; public record SendLiteralsInQueryRequest { + [JsonIgnore] public string Prompt { get; set; } = "You are a helpful assistant"; + [JsonIgnore] public string? OptionalPrompt { get; set; } + [JsonIgnore] public string AliasPrompt { get; set; } = "You are a helpful assistant"; + [JsonIgnore] public string? AliasOptionalPrompt { get; set; } + [JsonIgnore] public required string Query { get; set; } + [JsonIgnore] public bool Stream { get; set; } = false; + [JsonIgnore] public bool? OptionalStream { get; set; } + [JsonIgnore] public bool AliasStream { get; set; } = false; + [JsonIgnore] public bool? AliasOptionalStream { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Service/Requests/ListResourcesRequest.cs b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Service/Requests/ListResourcesRequest.cs index 4dd8f5af3e6..0574728fb3a 100644 --- a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Service/Requests/ListResourcesRequest.cs +++ b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Service/Requests/ListResourcesRequest.cs @@ -1,11 +1,14 @@ +using System.Text.Json.Serialization; using SeedMixedCase.Core; namespace SeedMixedCase; public record ListResourcesRequest { + [JsonIgnore] public required int PageLimit { get; set; } + [JsonIgnore] public required DateOnly BeforeDate { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/User/Events/Metadata/Requests/GetEventMetadataRequest.cs b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/User/Events/Metadata/Requests/GetEventMetadataRequest.cs index b6236aa9bf0..f61be790174 100644 --- a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/User/Events/Metadata/Requests/GetEventMetadataRequest.cs +++ b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/User/Events/Metadata/Requests/GetEventMetadataRequest.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedMixedFileDirectory.Core; namespace SeedMixedFileDirectory.User.Events; public record GetEventMetadataRequest { + [JsonIgnore] public required string Id { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/User/Events/Requests/ListUserEventsRequest.cs b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/User/Events/Requests/ListUserEventsRequest.cs index 9f9338c2bba..d23a8e9572a 100644 --- a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/User/Events/Requests/ListUserEventsRequest.cs +++ b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/User/Events/Requests/ListUserEventsRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using SeedMixedFileDirectory.Core; namespace SeedMixedFileDirectory.User; @@ -7,6 +8,7 @@ public record ListUserEventsRequest /// /// The maximum number of results to return. /// + [JsonIgnore] public int? Limit { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/User/Requests/ListUsersRequest.cs b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/User/Requests/ListUsersRequest.cs index 5ddeb28d6db..ae292924ab0 100644 --- a/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/User/Requests/ListUsersRequest.cs +++ b/seed/csharp-sdk/mixed-file-directory/src/SeedMixedFileDirectory/User/Requests/ListUsersRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using SeedMixedFileDirectory.Core; namespace SeedMixedFileDirectory; @@ -7,6 +8,7 @@ public record ListUsersRequest /// /// The maximum number of results to return. /// + [JsonIgnore] public int? Limit { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/nullable/src/SeedNullable/Nullable/Requests/GetUsersRequest.cs b/seed/csharp-sdk/nullable/src/SeedNullable/Nullable/Requests/GetUsersRequest.cs index 971d4769b8e..3a3fa6ad4cd 100644 --- a/seed/csharp-sdk/nullable/src/SeedNullable/Nullable/Requests/GetUsersRequest.cs +++ b/seed/csharp-sdk/nullable/src/SeedNullable/Nullable/Requests/GetUsersRequest.cs @@ -1,17 +1,23 @@ +using System.Text.Json.Serialization; using SeedNullable.Core; namespace SeedNullable; public record GetUsersRequest { + [JsonIgnore] public IEnumerable Usernames { get; set; } = new List(); + [JsonIgnore] public string? Avatar { get; set; } + [JsonIgnore] public IEnumerable Activated { get; set; } = new List(); + [JsonIgnore] public IEnumerable Tags { get; set; } = new List(); + [JsonIgnore] public bool? Extra { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsernamesRequest.cs b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsernamesRequest.cs index 1bfc3394ef1..e52694556d7 100644 --- a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsernamesRequest.cs +++ b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsernamesRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using SeedPagination.Core; namespace SeedPagination; @@ -8,6 +9,7 @@ public record ListUsernamesRequest /// The cursor used for pagination in order to fetch /// the next page of results. /// + [JsonIgnore] public string? StartingAfter { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersCursorPaginationRequest.cs b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersCursorPaginationRequest.cs index 1047cda6e1f..a8619840c59 100644 --- a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersCursorPaginationRequest.cs +++ b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersCursorPaginationRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using SeedPagination.Core; namespace SeedPagination; @@ -7,19 +8,23 @@ public record ListUsersCursorPaginationRequest /// /// Defaults to first page /// + [JsonIgnore] public int? Page { get; set; } /// /// Defaults to per page /// + [JsonIgnore] public int? PerPage { get; set; } + [JsonIgnore] public Order? Order { get; set; } /// /// The cursor used for pagination in order to fetch /// the next page of results. /// + [JsonIgnore] public string? StartingAfter { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersDoubleOffsetPaginationRequest.cs b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersDoubleOffsetPaginationRequest.cs index 6c97a31dbbd..74bd2c88560 100644 --- a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersDoubleOffsetPaginationRequest.cs +++ b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersDoubleOffsetPaginationRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using SeedPagination.Core; namespace SeedPagination; @@ -7,19 +8,23 @@ public record ListUsersDoubleOffsetPaginationRequest /// /// Defaults to first page /// + [JsonIgnore] public double? Page { get; set; } /// /// Defaults to per page /// + [JsonIgnore] public double? PerPage { get; set; } + [JsonIgnore] public Order? Order { get; set; } /// /// The cursor used for pagination in order to fetch /// the next page of results. /// + [JsonIgnore] public string? StartingAfter { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersExtendedRequest.cs b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersExtendedRequest.cs index 3b720b5e9a4..4c23aab10df 100644 --- a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersExtendedRequest.cs +++ b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersExtendedRequest.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedPagination.Core; namespace SeedPagination; public record ListUsersExtendedRequest { + [JsonIgnore] public string? Cursor { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersExtendedRequestForOptionalData.cs b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersExtendedRequestForOptionalData.cs index c5fab9323cb..1e60a88ffd0 100644 --- a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersExtendedRequestForOptionalData.cs +++ b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersExtendedRequestForOptionalData.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedPagination.Core; namespace SeedPagination; public record ListUsersExtendedRequestForOptionalData { + [JsonIgnore] public string? Cursor { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersMixedTypeCursorPaginationRequest.cs b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersMixedTypeCursorPaginationRequest.cs index 3928d4e1ea9..f8b7699110f 100644 --- a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersMixedTypeCursorPaginationRequest.cs +++ b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersMixedTypeCursorPaginationRequest.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedPagination.Core; namespace SeedPagination; public record ListUsersMixedTypeCursorPaginationRequest { + [JsonIgnore] public string? Cursor { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersOffsetPaginationRequest.cs b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersOffsetPaginationRequest.cs index 48bacdb0d67..01b09f4651e 100644 --- a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersOffsetPaginationRequest.cs +++ b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersOffsetPaginationRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using SeedPagination.Core; namespace SeedPagination; @@ -7,19 +8,23 @@ public record ListUsersOffsetPaginationRequest /// /// Defaults to first page /// + [JsonIgnore] public int? Page { get; set; } /// /// Defaults to per page /// + [JsonIgnore] public int? PerPage { get; set; } + [JsonIgnore] public Order? Order { get; set; } /// /// The cursor used for pagination in order to fetch /// the next page of results. /// + [JsonIgnore] public string? StartingAfter { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersOffsetStepPaginationRequest.cs b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersOffsetStepPaginationRequest.cs index 1fe2cd585b6..f337481d4d8 100644 --- a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersOffsetStepPaginationRequest.cs +++ b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListUsersOffsetStepPaginationRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using SeedPagination.Core; namespace SeedPagination; @@ -7,6 +8,7 @@ public record ListUsersOffsetStepPaginationRequest /// /// Defaults to first page /// + [JsonIgnore] public int? Page { get; set; } /// @@ -14,8 +16,10 @@ public record ListUsersOffsetStepPaginationRequest /// This is also used as the step size in this /// paginated endpoint. /// + [JsonIgnore] public int? Limit { get; set; } + [JsonIgnore] public Order? Order { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListWithGlobalConfigRequest.cs b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListWithGlobalConfigRequest.cs index bd1339bbf2e..c9b6176600c 100644 --- a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListWithGlobalConfigRequest.cs +++ b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListWithGlobalConfigRequest.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedPagination.Core; namespace SeedPagination; public record ListWithGlobalConfigRequest { + [JsonIgnore] public int? Offset { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListWithOffsetPaginationHasNextPageRequest.cs b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListWithOffsetPaginationHasNextPageRequest.cs index 43bc1480741..95c8f73894f 100644 --- a/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListWithOffsetPaginationHasNextPageRequest.cs +++ b/seed/csharp-sdk/pagination/src/SeedPagination/Users/Requests/ListWithOffsetPaginationHasNextPageRequest.cs @@ -1,3 +1,4 @@ +using System.Text.Json.Serialization; using SeedPagination.Core; namespace SeedPagination; @@ -7,6 +8,7 @@ public record ListWithOffsetPaginationHasNextPageRequest /// /// Defaults to first page /// + [JsonIgnore] public int? Page { get; set; } /// @@ -14,8 +16,10 @@ public record ListWithOffsetPaginationHasNextPageRequest /// This is also used as the step size in this /// paginated endpoint. /// + [JsonIgnore] public int? Limit { get; set; } + [JsonIgnore] public Order? Order { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/path-parameters/.github/workflows/ci.yml b/seed/csharp-sdk/path-parameters/inline-path-parameters/.github/workflows/ci.yml similarity index 100% rename from seed/csharp-sdk/path-parameters/.github/workflows/ci.yml rename to seed/csharp-sdk/path-parameters/inline-path-parameters/.github/workflows/ci.yml diff --git a/seed/csharp-sdk/path-parameters/.gitignore b/seed/csharp-sdk/path-parameters/inline-path-parameters/.gitignore similarity index 100% rename from seed/csharp-sdk/path-parameters/.gitignore rename to seed/csharp-sdk/path-parameters/inline-path-parameters/.gitignore diff --git a/seed/csharp-sdk/path-parameters/.mock/definition/api.yml b/seed/csharp-sdk/path-parameters/inline-path-parameters/.mock/definition/api.yml similarity index 100% rename from seed/csharp-sdk/path-parameters/.mock/definition/api.yml rename to seed/csharp-sdk/path-parameters/inline-path-parameters/.mock/definition/api.yml diff --git a/seed/csharp-sdk/path-parameters/.mock/definition/organizations.yml b/seed/csharp-sdk/path-parameters/inline-path-parameters/.mock/definition/organizations.yml similarity index 100% rename from seed/csharp-sdk/path-parameters/.mock/definition/organizations.yml rename to seed/csharp-sdk/path-parameters/inline-path-parameters/.mock/definition/organizations.yml diff --git a/seed/csharp-sdk/path-parameters/.mock/definition/user.yml b/seed/csharp-sdk/path-parameters/inline-path-parameters/.mock/definition/user.yml similarity index 100% rename from seed/csharp-sdk/path-parameters/.mock/definition/user.yml rename to seed/csharp-sdk/path-parameters/inline-path-parameters/.mock/definition/user.yml diff --git a/seed/csharp-sdk/path-parameters/.mock/fern.config.json b/seed/csharp-sdk/path-parameters/inline-path-parameters/.mock/fern.config.json similarity index 100% rename from seed/csharp-sdk/path-parameters/.mock/fern.config.json rename to seed/csharp-sdk/path-parameters/inline-path-parameters/.mock/fern.config.json diff --git a/seed/csharp-sdk/path-parameters/.mock/generators.yml b/seed/csharp-sdk/path-parameters/inline-path-parameters/.mock/generators.yml similarity index 100% rename from seed/csharp-sdk/path-parameters/.mock/generators.yml rename to seed/csharp-sdk/path-parameters/inline-path-parameters/.mock/generators.yml diff --git a/seed/csharp-sdk/path-parameters/.mock/ir.json b/seed/csharp-sdk/path-parameters/inline-path-parameters/.mock/ir.json similarity index 100% rename from seed/csharp-sdk/path-parameters/.mock/ir.json rename to seed/csharp-sdk/path-parameters/inline-path-parameters/.mock/ir.json diff --git a/seed/csharp-sdk/path-parameters/README.md b/seed/csharp-sdk/path-parameters/inline-path-parameters/README.md similarity index 100% rename from seed/csharp-sdk/path-parameters/README.md rename to seed/csharp-sdk/path-parameters/inline-path-parameters/README.md diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/reference.md b/seed/csharp-sdk/path-parameters/inline-path-parameters/reference.md new file mode 100644 index 00000000000..10df41417c6 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/reference.md @@ -0,0 +1,350 @@ +# Reference +## Organizations +
client.Organizations.GetOrganizationAsync(tenantId, organizationId) -> Organization +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Organizations.GetOrganizationAsync("tenant_id", "organization_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tenantId:** `string` + +
+
+ +
+
+ +**organizationId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.Organizations.GetOrganizationUserAsync(GetOrganizationUserRequest { ... }) -> User +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Organizations.GetOrganizationUserAsync( + new GetOrganizationUserRequest + { + TenantId = "tenant_id", + OrganizationId = "organization_id", + UserId = "user_id", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `GetOrganizationUserRequest` + +
+
+
+
+ + +
+
+
+ +
client.Organizations.SearchOrganizationsAsync(tenantId, organizationId, SearchOrganizationsRequest { ... }) -> IEnumerable +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Organizations.SearchOrganizationsAsync( + "tenant_id", + "organization_id", + new SearchOrganizationsRequest { Limit = 1 } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tenantId:** `string` + +
+
+ +
+
+ +**organizationId:** `string` + +
+
+ +
+
+ +**request:** `SearchOrganizationsRequest` + +
+
+
+
+ + +
+
+
+ +## User +
client.User.GetUserAsync(GetUsersRequest { ... }) -> User +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.User.GetUserAsync(new GetUsersRequest { TenantId = "tenant_id", UserId = "user_id" }); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `GetUsersRequest` + +
+
+
+
+ + +
+
+
+ +
client.User.CreateUserAsync(tenantId, User { ... }) -> User +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.User.CreateUserAsync( + "tenant_id", + new User + { + Name = "name", + Tags = new List() { "tags", "tags" }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tenantId:** `string` + +
+
+ +
+
+ +**request:** `User` + +
+
+
+
+ + +
+
+
+ +
client.User.UpdateUserAsync(UpdateUserRequest { ... }) -> User +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.User.UpdateUserAsync( + new UpdateUserRequest + { + TenantId = "tenant_id", + UserId = "user_id", + Body = new User + { + Name = "name", + Tags = new List() { "tags", "tags" }, + }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `UpdateUserRequest` + +
+
+
+
+ + +
+
+
+ +
client.User.SearchUsersAsync(SearchUsersRequest { ... }) -> IEnumerable +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.User.SearchUsersAsync( + new SearchUsersRequest + { + TenantId = "tenant_id", + UserId = "user_id", + Limit = 1, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `SearchUsersRequest` + +
+
+
+
+ + +
+
+
diff --git a/seed/csharp-sdk/path-parameters/snippet-templates.json b/seed/csharp-sdk/path-parameters/inline-path-parameters/snippet-templates.json similarity index 100% rename from seed/csharp-sdk/path-parameters/snippet-templates.json rename to seed/csharp-sdk/path-parameters/inline-path-parameters/snippet-templates.json diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/snippet.json b/seed/csharp-sdk/path-parameters/inline-path-parameters/snippet.json new file mode 100644 index 00000000000..8bdc391e6f3 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/snippet.json @@ -0,0 +1,89 @@ +{ + "types": {}, + "endpoints": [ + { + "example_identifier": null, + "id": { + "path": "/{tenant_id}/organizations/{organization_id}/", + "method": "GET", + "identifier_override": "endpoint_organizations.getOrganization" + }, + "snippet": { + "type": "csharp", + "client": "using SeedPathParameters;\n\nvar client = new SeedPathParametersClient();\nawait client.Organizations.GetOrganizationAsync(\"tenant_id\", \"organization_id\");\n" + } + }, + { + "example_identifier": null, + "id": { + "path": "/{tenant_id}/organizations/{organization_id}/users/{user_id}", + "method": "GET", + "identifier_override": "endpoint_organizations.getOrganizationUser" + }, + "snippet": { + "type": "csharp", + "client": "using SeedPathParameters;\n\nvar client = new SeedPathParametersClient();\nawait client.Organizations.GetOrganizationUserAsync(\n new GetOrganizationUserRequest\n {\n TenantId = \"tenant_id\",\n OrganizationId = \"organization_id\",\n UserId = \"user_id\",\n }\n);\n" + } + }, + { + "example_identifier": null, + "id": { + "path": "/{tenant_id}/organizations/{organization_id}/search", + "method": "GET", + "identifier_override": "endpoint_organizations.searchOrganizations" + }, + "snippet": { + "type": "csharp", + "client": "using SeedPathParameters;\n\nvar client = new SeedPathParametersClient();\nawait client.Organizations.SearchOrganizationsAsync(\n \"tenant_id\",\n \"organization_id\",\n new SearchOrganizationsRequest { Limit = 1 }\n);\n" + } + }, + { + "example_identifier": null, + "id": { + "path": "/{tenant_id}/user/{user_id}", + "method": "GET", + "identifier_override": "endpoint_user.getUser" + }, + "snippet": { + "type": "csharp", + "client": "using SeedPathParameters;\n\nvar client = new SeedPathParametersClient();\nawait client.User.GetUserAsync(new GetUsersRequest { TenantId = \"tenant_id\", UserId = \"user_id\" });\n" + } + }, + { + "example_identifier": null, + "id": { + "path": "/{tenant_id}/user/", + "method": "POST", + "identifier_override": "endpoint_user.createUser" + }, + "snippet": { + "type": "csharp", + "client": "using SeedPathParameters;\n\nvar client = new SeedPathParametersClient();\nawait client.User.CreateUserAsync(\n \"tenant_id\",\n new User\n {\n Name = \"name\",\n Tags = new List() { \"tags\", \"tags\" },\n }\n);\n" + } + }, + { + "example_identifier": null, + "id": { + "path": "/{tenant_id}/user/{user_id}", + "method": "PATCH", + "identifier_override": "endpoint_user.updateUser" + }, + "snippet": { + "type": "csharp", + "client": "using SeedPathParameters;\n\nvar client = new SeedPathParametersClient();\nawait client.User.UpdateUserAsync(\n new UpdateUserRequest\n {\n TenantId = \"tenant_id\",\n UserId = \"user_id\",\n Body = new User\n {\n Name = \"name\",\n Tags = new List() { \"tags\", \"tags\" },\n },\n }\n);\n" + } + }, + { + "example_identifier": null, + "id": { + "path": "/{tenant_id}/user/{user_id}/search", + "method": "GET", + "identifier_override": "endpoint_user.searchUsers" + }, + "snippet": { + "type": "csharp", + "client": "using SeedPathParameters;\n\nvar client = new SeedPathParametersClient();\nawait client.User.SearchUsersAsync(\n new SearchUsersRequest\n {\n TenantId = \"tenant_id\",\n UserId = \"user_id\",\n Limit = 1,\n }\n);\n" + } + } + ] +} \ No newline at end of file diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Core/Json/DateOnlyJsonTests.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Core/Json/DateOnlyJsonTests.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Core/Json/DateOnlyJsonTests.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Core/Json/DateOnlyJsonTests.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Core/Json/DateTimeJsonTests.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Core/Json/DateTimeJsonTests.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Core/Json/DateTimeJsonTests.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Core/Json/DateTimeJsonTests.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Core/Json/EnumSerializerTests.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Core/Json/EnumSerializerTests.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Core/Json/EnumSerializerTests.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Core/Json/EnumSerializerTests.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Core/Json/OneOfSerializerTests.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Core/Json/OneOfSerializerTests.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Core/Json/OneOfSerializerTests.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Core/Json/OneOfSerializerTests.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Core/RawClientTests.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Core/RawClientTests.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Core/RawClientTests.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Core/RawClientTests.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/SeedPathParameters.Test.Custom.props b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/SeedPathParameters.Test.Custom.props similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/SeedPathParameters.Test.Custom.props rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/SeedPathParameters.Test.Custom.props diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/SeedPathParameters.Test.csproj b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/SeedPathParameters.Test.csproj similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/SeedPathParameters.Test.csproj rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/SeedPathParameters.Test.csproj diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/TestClient.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/TestClient.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/TestClient.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/TestClient.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/BaseMockServerTest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/BaseMockServerTest.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/BaseMockServerTest.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/BaseMockServerTest.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/CreateUserTest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/CreateUserTest.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/CreateUserTest.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/CreateUserTest.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationTest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationTest.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationTest.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationTest.cs diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationUserTest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationUserTest.cs new file mode 100644 index 00000000000..6cd98b462a9 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationUserTest.cs @@ -0,0 +1,54 @@ +using FluentAssertions.Json; +using global::System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using NUnit.Framework; +using SeedPathParameters; +using SeedPathParameters.Core; + +namespace SeedPathParameters.Test.Unit.MockServer; + +[TestFixture] +public class GetOrganizationUserTest : BaseMockServerTest +{ + [Test] + public async global::System.Threading.Tasks.Task MockServerTest() + { + const string mockResponse = """ + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/tenant_id/organizations/organization_id/users/user_id") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Organizations.GetOrganizationUserAsync( + new GetOrganizationUserRequest + { + TenantId = "tenant_id", + OrganizationId = "organization_id", + UserId = "user_id", + }, + RequestOptions + ); + JToken + .Parse(mockResponse) + .Should() + .BeEquivalentTo(JToken.Parse(JsonUtils.Serialize(response))); + } +} diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetUserTest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetUserTest.cs new file mode 100644 index 00000000000..8f85bdd2cda --- /dev/null +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetUserTest.cs @@ -0,0 +1,49 @@ +using FluentAssertions.Json; +using global::System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using NUnit.Framework; +using SeedPathParameters; +using SeedPathParameters.Core; + +namespace SeedPathParameters.Test.Unit.MockServer; + +[TestFixture] +public class GetUserTest : BaseMockServerTest +{ + [Test] + public async global::System.Threading.Tasks.Task MockServerTest() + { + const string mockResponse = """ + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/tenant_id/user/user_id") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.User.GetUserAsync( + new GetUsersRequest { TenantId = "tenant_id", UserId = "user_id" }, + RequestOptions + ); + JToken + .Parse(mockResponse) + .Should() + .BeEquivalentTo(JToken.Parse(JsonUtils.Serialize(response))); + } +} diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/SearchOrganizationsTest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/SearchOrganizationsTest.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/SearchOrganizationsTest.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/SearchOrganizationsTest.cs diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/SearchUsersTest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/SearchUsersTest.cs new file mode 100644 index 00000000000..8e128c122d8 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/SearchUsersTest.cs @@ -0,0 +1,64 @@ +using FluentAssertions.Json; +using global::System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using NUnit.Framework; +using SeedPathParameters; +using SeedPathParameters.Core; + +namespace SeedPathParameters.Test.Unit.MockServer; + +[TestFixture] +public class SearchUsersTest : BaseMockServerTest +{ + [Test] + public async global::System.Threading.Tasks.Task MockServerTest() + { + const string mockResponse = """ + [ + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + }, + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + ] + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/tenant_id/user/user_id/search") + .WithParam("limit", "1") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.User.SearchUsersAsync( + new SearchUsersRequest + { + TenantId = "tenant_id", + UserId = "user_id", + Limit = 1, + }, + RequestOptions + ); + JToken + .Parse(mockResponse) + .Should() + .BeEquivalentTo(JToken.Parse(JsonUtils.Serialize(response))); + } +} diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/UpdateUserTest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/UpdateUserTest.cs new file mode 100644 index 00000000000..32c642f66bf --- /dev/null +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters.Test/Unit/MockServer/UpdateUserTest.cs @@ -0,0 +1,69 @@ +using FluentAssertions.Json; +using global::System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using NUnit.Framework; +using SeedPathParameters; +using SeedPathParameters.Core; + +namespace SeedPathParameters.Test.Unit.MockServer; + +[TestFixture] +public class UpdateUserTest : BaseMockServerTest +{ + [Test] + public async global::System.Threading.Tasks.Task MockServerTest() + { + const string requestJson = """ + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + """; + + const string mockResponse = """ + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/tenant_id/user/user_id") + .UsingPatch() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.User.UpdateUserAsync( + new UpdateUserRequest + { + TenantId = "tenant_id", + UserId = "user_id", + Body = new User + { + Name = "name", + Tags = new List() { "tags", "tags" }, + }, + }, + RequestOptions + ); + JToken + .Parse(mockResponse) + .Should() + .BeEquivalentTo(JToken.Parse(JsonUtils.Serialize(response))); + } +} diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/CollectionItemSerializer.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/CollectionItemSerializer.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/CollectionItemSerializer.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/CollectionItemSerializer.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Constants.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Constants.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Constants.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Constants.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/DateOnlyConverter.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/DateOnlyConverter.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/DateOnlyConverter.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/DateOnlyConverter.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/DateTimeSerializer.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/DateTimeSerializer.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/DateTimeSerializer.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/DateTimeSerializer.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/EnumSerializer.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/EnumSerializer.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/EnumSerializer.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/EnumSerializer.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Extensions.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Extensions.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Extensions.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Extensions.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/HeaderValue.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/HeaderValue.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/HeaderValue.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/HeaderValue.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Headers.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Headers.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Headers.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Headers.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/HttpMethodExtensions.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/HttpMethodExtensions.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/HttpMethodExtensions.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/HttpMethodExtensions.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/IRequestOptions.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/IRequestOptions.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/IRequestOptions.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/IRequestOptions.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/JsonConfiguration.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/JsonConfiguration.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/JsonConfiguration.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/JsonConfiguration.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/OneOfSerializer.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/OneOfSerializer.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/OneOfSerializer.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/OneOfSerializer.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Public/ClientOptions.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/ClientOptions.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Public/ClientOptions.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/ClientOptions.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Public/RequestOptions.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/RequestOptions.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Public/RequestOptions.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/RequestOptions.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Public/SeedPathParametersApiException.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/SeedPathParametersApiException.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Public/SeedPathParametersApiException.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/SeedPathParametersApiException.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Public/SeedPathParametersException.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/SeedPathParametersException.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Public/SeedPathParametersException.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/SeedPathParametersException.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Public/Version.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/Version.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/Public/Version.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/Public/Version.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/RawClient.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/RawClient.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Core/RawClient.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Core/RawClient.cs diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/OrganizationsClient.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/OrganizationsClient.cs new file mode 100644 index 00000000000..412f17a3ec4 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/OrganizationsClient.cs @@ -0,0 +1,168 @@ +using System.Net.Http; +using System.Text.Json; +using System.Threading; +using SeedPathParameters.Core; + +namespace SeedPathParameters; + +public partial class OrganizationsClient +{ + private RawClient _client; + + internal OrganizationsClient(RawClient client) + { + _client = client; + } + + /// + /// + /// await client.Organizations.GetOrganizationAsync("tenant_id", "organization_id"); + /// + /// + public async Task GetOrganizationAsync( + string tenantId, + string organizationId, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = + $"/{JsonUtils.SerializeAsString(tenantId)}/organizations/{JsonUtils.SerializeAsString(organizationId)}/", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new SeedPathParametersException("Failed to deserialize response", e); + } + } + + throw new SeedPathParametersApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + /// + /// + /// await client.Organizations.GetOrganizationUserAsync( + /// new GetOrganizationUserRequest + /// { + /// TenantId = "tenant_id", + /// OrganizationId = "organization_id", + /// UserId = "user_id", + /// } + /// ); + /// + /// + public async Task GetOrganizationUserAsync( + GetOrganizationUserRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = + $"/{JsonUtils.SerializeAsString(request.TenantId)}/organizations/{JsonUtils.SerializeAsString(request.OrganizationId)}/users/{JsonUtils.SerializeAsString(request.UserId)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new SeedPathParametersException("Failed to deserialize response", e); + } + } + + throw new SeedPathParametersApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + /// + /// + /// await client.Organizations.SearchOrganizationsAsync( + /// "tenant_id", + /// "organization_id", + /// new SearchOrganizationsRequest { Limit = 1 } + /// ); + /// + /// + public async Task> SearchOrganizationsAsync( + string tenantId, + string organizationId, + SearchOrganizationsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _query = new Dictionary(); + if (request.Limit != null) + { + _query["limit"] = request.Limit.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = + $"/{JsonUtils.SerializeAsString(tenantId)}/organizations/{JsonUtils.SerializeAsString(organizationId)}/search", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize>(responseBody)!; + } + catch (JsonException e) + { + throw new SeedPathParametersException("Failed to deserialize response", e); + } + } + + throw new SeedPathParametersApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } +} diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/Requests/GetOrganizationUserRequest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/Requests/GetOrganizationUserRequest.cs new file mode 100644 index 00000000000..4af93998ae0 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/Requests/GetOrganizationUserRequest.cs @@ -0,0 +1,21 @@ +using System.Text.Json.Serialization; +using SeedPathParameters.Core; + +namespace SeedPathParameters; + +public record GetOrganizationUserRequest +{ + [JsonIgnore] + public required string TenantId { get; set; } + + [JsonIgnore] + public required string OrganizationId { get; set; } + + [JsonIgnore] + public required string UserId { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Organizations/Requests/SearchOrganizationsRequest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/Requests/SearchOrganizationsRequest.cs similarity index 81% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Organizations/Requests/SearchOrganizationsRequest.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/Requests/SearchOrganizationsRequest.cs index 0fe4b850e48..578f4d3f6e5 100644 --- a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Organizations/Requests/SearchOrganizationsRequest.cs +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/Requests/SearchOrganizationsRequest.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedPathParameters.Core; namespace SeedPathParameters; public record SearchOrganizationsRequest { + [JsonIgnore] public int? Limit { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Organizations/Types/Organization.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/Types/Organization.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Organizations/Types/Organization.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/Organizations/Types/Organization.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/SeedPathParameters.Custom.props b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/SeedPathParameters.Custom.props similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/SeedPathParameters.Custom.props rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/SeedPathParameters.Custom.props diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/SeedPathParameters.csproj b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/SeedPathParameters.csproj similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/SeedPathParameters.csproj rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/SeedPathParameters.csproj diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/SeedPathParametersClient.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/SeedPathParametersClient.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/SeedPathParametersClient.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/SeedPathParametersClient.cs diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Requests/GetUsersRequest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Requests/GetUsersRequest.cs new file mode 100644 index 00000000000..f69e895ea2f --- /dev/null +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Requests/GetUsersRequest.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; +using SeedPathParameters.Core; + +namespace SeedPathParameters; + +public record GetUsersRequest +{ + [JsonIgnore] + public required string TenantId { get; set; } + + [JsonIgnore] + public required string UserId { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Requests/SearchUsersRequest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Requests/SearchUsersRequest.cs new file mode 100644 index 00000000000..d3ae99be767 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Requests/SearchUsersRequest.cs @@ -0,0 +1,21 @@ +using System.Text.Json.Serialization; +using SeedPathParameters.Core; + +namespace SeedPathParameters; + +public record SearchUsersRequest +{ + [JsonIgnore] + public required string TenantId { get; set; } + + [JsonIgnore] + public required string UserId { get; set; } + + [JsonIgnore] + public int? Limit { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Requests/UpdateUserRequest.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Requests/UpdateUserRequest.cs new file mode 100644 index 00000000000..57e4dffc1b9 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Requests/UpdateUserRequest.cs @@ -0,0 +1,20 @@ +using System.Text.Json.Serialization; +using SeedPathParameters.Core; + +namespace SeedPathParameters; + +public record UpdateUserRequest +{ + [JsonIgnore] + public required string TenantId { get; set; } + + [JsonIgnore] + public required string UserId { get; set; } + + public required User Body { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/User/Types/User.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Types/User.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/User/Types/User.cs rename to seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/Types/User.cs diff --git a/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/UserClient.cs b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/UserClient.cs new file mode 100644 index 00000000000..08e8d7fe74b --- /dev/null +++ b/seed/csharp-sdk/path-parameters/inline-path-parameters/src/SeedPathParameters/User/UserClient.cs @@ -0,0 +1,225 @@ +using System.Net.Http; +using System.Text.Json; +using System.Threading; +using SeedPathParameters.Core; + +namespace SeedPathParameters; + +public partial class UserClient +{ + private RawClient _client; + + internal UserClient(RawClient client) + { + _client = client; + } + + /// + /// + /// await client.User.GetUserAsync(new GetUsersRequest { TenantId = "tenant_id", UserId = "user_id" }); + /// + /// + public async Task GetUserAsync( + GetUsersRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = + $"/{JsonUtils.SerializeAsString(request.TenantId)}/user/{JsonUtils.SerializeAsString(request.UserId)}", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new SeedPathParametersException("Failed to deserialize response", e); + } + } + + throw new SeedPathParametersApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + /// + /// + /// await client.User.CreateUserAsync( + /// "tenant_id", + /// new User + /// { + /// Name = "name", + /// Tags = new List<string>() { "tags", "tags" }, + /// } + /// ); + /// + /// + public async Task CreateUserAsync( + string tenantId, + User request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Post, + Path = $"/{JsonUtils.SerializeAsString(tenantId)}/user/", + Body = request, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new SeedPathParametersException("Failed to deserialize response", e); + } + } + + throw new SeedPathParametersApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + /// + /// + /// await client.User.UpdateUserAsync( + /// new UpdateUserRequest + /// { + /// TenantId = "tenant_id", + /// UserId = "user_id", + /// Body = new User + /// { + /// Name = "name", + /// Tags = new List<string>() { "tags", "tags" }, + /// }, + /// } + /// ); + /// + /// + public async Task UpdateUserAsync( + UpdateUserRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethodExtensions.Patch, + Path = + $"/{JsonUtils.SerializeAsString(request.TenantId)}/user/{JsonUtils.SerializeAsString(request.UserId)}", + Body = request.Body, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize(responseBody)!; + } + catch (JsonException e) + { + throw new SeedPathParametersException("Failed to deserialize response", e); + } + } + + throw new SeedPathParametersApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } + + /// + /// + /// await client.User.SearchUsersAsync( + /// new SearchUsersRequest + /// { + /// TenantId = "tenant_id", + /// UserId = "user_id", + /// Limit = 1, + /// } + /// ); + /// + /// + public async Task> SearchUsersAsync( + SearchUsersRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _query = new Dictionary(); + if (request.Limit != null) + { + _query["limit"] = request.Limit.Value.ToString(); + } + var response = await _client + .MakeRequestAsync( + new RawClient.JsonApiRequest + { + BaseUrl = _client.Options.BaseUrl, + Method = HttpMethod.Get, + Path = + $"/{JsonUtils.SerializeAsString(request.TenantId)}/user/{JsonUtils.SerializeAsString(request.UserId)}/search", + Query = _query, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + var responseBody = await response.Raw.Content.ReadAsStringAsync(); + if (response.StatusCode is >= 200 and < 400) + { + try + { + return JsonUtils.Deserialize>(responseBody)!; + } + catch (JsonException e) + { + throw new SeedPathParametersException("Failed to deserialize response", e); + } + } + + throw new SeedPathParametersApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody + ); + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/.github/workflows/ci.yml b/seed/csharp-sdk/path-parameters/no-custom-config/.github/workflows/ci.yml new file mode 100644 index 00000000000..b34b75c042c --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: ci + +on: [push] + +jobs: + compile: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - uses: actions/checkout@master + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Install tools + run: | + dotnet tool restore + + - name: Build Release + run: dotnet build src -c Release /p:ContinuousIntegrationBuild=true + + unit-tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - uses: actions/checkout@master + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Install tools + run: | + dotnet tool restore + + - name: Run Tests + run: | + dotnet test src + + + publish: + needs: [compile] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.x + + - name: Publish + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_TOKEN }} + run: | + dotnet pack src -c Release + dotnet nuget push src/SeedPathParameters/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source "nuget.org" diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/.gitignore b/seed/csharp-sdk/path-parameters/no-custom-config/.gitignore new file mode 100644 index 00000000000..11014f2b33d --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/.gitignore @@ -0,0 +1,484 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +## This is based on `dotnet new gitignore` and customized by Fern + +# dotenv files +.env + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +# [Rr]elease/ (Ignored by Fern) +# [Rr]eleases/ (Ignored by Fern) +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +# [Ll]og/ (Ignored by Fern) +# [Ll]ogs/ (Ignored by Fern) + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml +.idea + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/.mock/definition/api.yml b/seed/csharp-sdk/path-parameters/no-custom-config/.mock/definition/api.yml new file mode 100644 index 00000000000..728dc9ef0c5 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/.mock/definition/api.yml @@ -0,0 +1,4 @@ +name: path-parameters +base-path: "/{tenant_id}" +path-parameters: + tenant_id: string diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/.mock/definition/organizations.yml b/seed/csharp-sdk/path-parameters/no-custom-config/.mock/definition/organizations.yml new file mode 100644 index 00000000000..c2ec61602f9 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/.mock/definition/organizations.yml @@ -0,0 +1,37 @@ +imports: + user: user.yml + +types: + Organization: + properties: + name: string + tags: list + +service: + base-path: "/organizations/{organization_id}" + auth: false + path-parameters: + organization_id: string + endpoints: + getOrganization: + path: "/" + method: GET + response: Organization + + getOrganizationUser: + path: "/users/{user_id}" + method: GET + request: + name: GetOrganizationUserRequest + path-parameters: + user_id: string + response: user.User + + searchOrganizations: + path: "/search" + method: GET + request: + name: SearchOrganizationsRequest + query-parameters: + limit: optional + response: list diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/.mock/definition/user.yml b/seed/csharp-sdk/path-parameters/no-custom-config/.mock/definition/user.yml new file mode 100644 index 00000000000..b34c9b28a09 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/.mock/definition/user.yml @@ -0,0 +1,47 @@ +types: + User: + properties: + name: string + tags: list + +service: + base-path: /user + auth: false + endpoints: + getUser: + path: "/{user_id}" + method: GET + request: + name: GetUsersRequest + path-parameters: + user_id: string + response: User + + createUser: + path: "/" + method: POST + request: + name: CreateUserRequest + body: User + response: User + + updateUser: + path: "/{user_id}" + method: PATCH + request: + name: UpdateUserRequest + body: User + path-parameters: + user_id: string + response: User + + searchUsers: + path: "/{user_id}/search" + method: GET + request: + name: SearchUsersRequest + path-parameters: + user_id: string + query-parameters: + limit: optional + response: list diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/.mock/fern.config.json b/seed/csharp-sdk/path-parameters/no-custom-config/.mock/fern.config.json new file mode 100644 index 00000000000..4c8e54ac313 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/.mock/fern.config.json @@ -0,0 +1 @@ +{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/.mock/generators.yml b/seed/csharp-sdk/path-parameters/no-custom-config/.mock/generators.yml new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/.mock/generators.yml @@ -0,0 +1 @@ +{} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/.mock/ir.json b/seed/csharp-sdk/path-parameters/no-custom-config/.mock/ir.json new file mode 100644 index 00000000000..7e2ee51b45c --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/.mock/ir.json @@ -0,0 +1,6602 @@ +{ + "fdrApiDefinitionId": null, + "apiVersion": null, + "apiName": { + "originalName": "path-parameters", + "camelCase": { + "unsafeName": "pathParameters", + "safeName": "pathParameters" + }, + "snakeCase": { + "unsafeName": "path_parameters", + "safeName": "path_parameters" + }, + "screamingSnakeCase": { + "unsafeName": "PATH_PARAMETERS", + "safeName": "PATH_PARAMETERS" + }, + "pascalCase": { + "unsafeName": "PathParameters", + "safeName": "PathParameters" + } + }, + "apiDisplayName": null, + "apiDocs": null, + "auth": { + "requirement": "ALL", + "schemes": [], + "docs": null + }, + "headers": [], + "idempotencyHeaders": [], + "types": { + "type_organizations:Organization": { + "inline": null, + "name": { + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization" + }, + "shape": { + "_type": "object", + "extends": [], + "properties": [ + { + "name": { + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + }, + "wireValue": "name" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "availability": null, + "docs": null + }, + { + "name": { + "name": { + "originalName": "tags", + "camelCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "snakeCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "screamingSnakeCase": { + "unsafeName": "TAGS", + "safeName": "TAGS" + }, + "pascalCase": { + "unsafeName": "Tags", + "safeName": "Tags" + } + }, + "wireValue": "tags" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "list", + "list": { + "_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_user:User": { + "inline": null, + "name": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + }, + "shape": { + "_type": "object", + "extends": [], + "properties": [ + { + "name": { + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + }, + "wireValue": "name" + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "availability": null, + "docs": null + }, + { + "name": { + "name": { + "originalName": "tags", + "camelCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "snakeCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "screamingSnakeCase": { + "unsafeName": "TAGS", + "safeName": "TAGS" + }, + "pascalCase": { + "unsafeName": "Tags", + "safeName": "Tags" + } + }, + "wireValue": "tags" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "list", + "list": { + "_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 + } + }, + "errors": {}, + "services": { + "service_organizations": { + "availability": null, + "name": { + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + } + }, + "displayName": null, + "basePath": { + "head": "/organizations/", + "parts": [ + { + "pathParameter": "organizationId", + "tail": "" + } + ] + }, + "headers": [], + "pathParameters": [ + { + "name": { + "originalName": "organizationId", + "camelCase": { + "unsafeName": "organizationId", + "safeName": "organizationId" + }, + "snakeCase": { + "unsafeName": "organization_id", + "safeName": "organization_id" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION_ID", + "safeName": "ORGANIZATION_ID" + }, + "pascalCase": { + "unsafeName": "OrganizationId", + "safeName": "OrganizationId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "SERVICE", + "variable": null, + "docs": null + } + ], + "encoding": { + "json": {}, + "proto": null + }, + "transport": { + "type": "http" + }, + "endpoints": [ + { + "id": "endpoint_organizations.getOrganization", + "name": { + "originalName": "getOrganization", + "camelCase": { + "unsafeName": "getOrganization", + "safeName": "getOrganization" + }, + "snakeCase": { + "unsafeName": "get_organization", + "safeName": "get_organization" + }, + "screamingSnakeCase": { + "unsafeName": "GET_ORGANIZATION", + "safeName": "GET_ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "GetOrganization", + "safeName": "GetOrganization" + } + }, + "displayName": null, + "auth": false, + "idempotent": false, + "baseUrl": null, + "method": "GET", + "basePath": null, + "path": { + "head": "/", + "parts": [] + }, + "fullPath": { + "head": "/", + "parts": [ + { + "pathParameter": "tenantId", + "tail": "/organizations/" + }, + { + "pathParameter": "organizationId", + "tail": "/" + } + ] + }, + "pathParameters": [], + "allPathParameters": [ + { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "ROOT", + "variable": null, + "docs": null + }, + { + "name": { + "originalName": "organizationId", + "camelCase": { + "unsafeName": "organizationId", + "safeName": "organizationId" + }, + "snakeCase": { + "unsafeName": "organization_id", + "safeName": "organization_id" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION_ID", + "safeName": "ORGANIZATION_ID" + }, + "pascalCase": { + "unsafeName": "OrganizationId", + "safeName": "OrganizationId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "SERVICE", + "variable": null, + "docs": null + } + ], + "queryParameters": [], + "headers": [], + "requestBody": null, + "sdkRequest": null, + "response": { + "body": { + "type": "json", + "value": { + "type": "response", + "responseBodyType": { + "_type": "named", + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization", + "default": null, + "inline": null + }, + "docs": null + } + }, + "status-code": null + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [ + { + "example": { + "id": "8ea4c9ae", + "url": "/tenantId/organizations/organizationId/", + "name": null, + "endpointHeaders": [], + "endpointPathParameters": [], + "queryParameters": [], + "servicePathParameters": [ + { + "name": { + "originalName": "organizationId", + "camelCase": { + "unsafeName": "organizationId", + "safeName": "organizationId" + }, + "snakeCase": { + "unsafeName": "organization_id", + "safeName": "organization_id" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION_ID", + "safeName": "ORGANIZATION_ID" + }, + "pascalCase": { + "unsafeName": "OrganizationId", + "safeName": "OrganizationId" + } + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "organizationId" + } + } + }, + "jsonExample": "organizationId" + } + } + ], + "serviceHeaders": [], + "rootPathParameters": [ + { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tenantId" + } + } + }, + "jsonExample": "tenantId" + } + } + ], + "request": null, + "response": { + "type": "ok", + "value": { + "type": "body", + "value": { + "shape": { + "type": "named", + "shape": { + "type": "object", + "properties": [ + { + "name": { + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + }, + "wireValue": "name" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization" + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "name" + } + } + }, + "jsonExample": "name" + } + }, + { + "name": { + "name": { + "originalName": "tags", + "camelCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "snakeCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "screamingSnakeCase": { + "unsafeName": "TAGS", + "safeName": "TAGS" + }, + "pascalCase": { + "unsafeName": "Tags", + "safeName": "Tags" + } + }, + "wireValue": "tags" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "list", + "list": [ + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + }, + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + } + ], + "itemType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "jsonExample": [ + "tags", + "tags" + ] + } + } + ] + }, + "typeName": { + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization" + } + }, + "jsonExample": { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + } + } + }, + "docs": null + } + } + ], + "pagination": null, + "transport": null, + "availability": null, + "docs": null + }, + { + "id": "endpoint_organizations.getOrganizationUser", + "name": { + "originalName": "getOrganizationUser", + "camelCase": { + "unsafeName": "getOrganizationUser", + "safeName": "getOrganizationUser" + }, + "snakeCase": { + "unsafeName": "get_organization_user", + "safeName": "get_organization_user" + }, + "screamingSnakeCase": { + "unsafeName": "GET_ORGANIZATION_USER", + "safeName": "GET_ORGANIZATION_USER" + }, + "pascalCase": { + "unsafeName": "GetOrganizationUser", + "safeName": "GetOrganizationUser" + } + }, + "displayName": null, + "auth": false, + "idempotent": false, + "baseUrl": null, + "method": "GET", + "basePath": null, + "path": { + "head": "/users/", + "parts": [ + { + "pathParameter": "userId", + "tail": "" + } + ] + }, + "fullPath": { + "head": "/", + "parts": [ + { + "pathParameter": "tenantId", + "tail": "/organizations/" + }, + { + "pathParameter": "organizationId", + "tail": "/users/" + }, + { + "pathParameter": "userId", + "tail": "" + } + ] + }, + "pathParameters": [ + { + "name": { + "originalName": "userId", + "camelCase": { + "unsafeName": "userId", + "safeName": "userId" + }, + "snakeCase": { + "unsafeName": "user_id", + "safeName": "user_id" + }, + "screamingSnakeCase": { + "unsafeName": "USER_ID", + "safeName": "USER_ID" + }, + "pascalCase": { + "unsafeName": "UserId", + "safeName": "UserId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "ENDPOINT", + "variable": null, + "docs": null + } + ], + "allPathParameters": [ + { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "ROOT", + "variable": null, + "docs": null + }, + { + "name": { + "originalName": "organizationId", + "camelCase": { + "unsafeName": "organizationId", + "safeName": "organizationId" + }, + "snakeCase": { + "unsafeName": "organization_id", + "safeName": "organization_id" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION_ID", + "safeName": "ORGANIZATION_ID" + }, + "pascalCase": { + "unsafeName": "OrganizationId", + "safeName": "OrganizationId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "SERVICE", + "variable": null, + "docs": null + }, + { + "name": { + "originalName": "userId", + "camelCase": { + "unsafeName": "userId", + "safeName": "userId" + }, + "snakeCase": { + "unsafeName": "user_id", + "safeName": "user_id" + }, + "screamingSnakeCase": { + "unsafeName": "USER_ID", + "safeName": "USER_ID" + }, + "pascalCase": { + "unsafeName": "UserId", + "safeName": "UserId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "ENDPOINT", + "variable": null, + "docs": null + } + ], + "queryParameters": [], + "headers": [], + "requestBody": null, + "sdkRequest": { + "shape": { + "type": "wrapper", + "wrapperName": { + "originalName": "GetOrganizationUserRequest", + "camelCase": { + "unsafeName": "getOrganizationUserRequest", + "safeName": "getOrganizationUserRequest" + }, + "snakeCase": { + "unsafeName": "get_organization_user_request", + "safeName": "get_organization_user_request" + }, + "screamingSnakeCase": { + "unsafeName": "GET_ORGANIZATION_USER_REQUEST", + "safeName": "GET_ORGANIZATION_USER_REQUEST" + }, + "pascalCase": { + "unsafeName": "GetOrganizationUserRequest", + "safeName": "GetOrganizationUserRequest" + } + }, + "bodyKey": { + "originalName": "body", + "camelCase": { + "unsafeName": "body", + "safeName": "body" + }, + "snakeCase": { + "unsafeName": "body", + "safeName": "body" + }, + "screamingSnakeCase": { + "unsafeName": "BODY", + "safeName": "BODY" + }, + "pascalCase": { + "unsafeName": "Body", + "safeName": "Body" + } + }, + "includePathParameters": true, + "onlyPathParameters": true + }, + "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": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User", + "default": null, + "inline": null + }, + "docs": null + } + }, + "status-code": null + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [ + { + "example": { + "id": "d0d133d8", + "url": "/tenantId/organizations/organizationId/users/userId", + "name": null, + "endpointHeaders": [], + "endpointPathParameters": [ + { + "name": { + "originalName": "userId", + "camelCase": { + "unsafeName": "userId", + "safeName": "userId" + }, + "snakeCase": { + "unsafeName": "user_id", + "safeName": "user_id" + }, + "screamingSnakeCase": { + "unsafeName": "USER_ID", + "safeName": "USER_ID" + }, + "pascalCase": { + "unsafeName": "UserId", + "safeName": "UserId" + } + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "userId" + } + } + }, + "jsonExample": "userId" + } + } + ], + "queryParameters": [], + "servicePathParameters": [ + { + "name": { + "originalName": "organizationId", + "camelCase": { + "unsafeName": "organizationId", + "safeName": "organizationId" + }, + "snakeCase": { + "unsafeName": "organization_id", + "safeName": "organization_id" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION_ID", + "safeName": "ORGANIZATION_ID" + }, + "pascalCase": { + "unsafeName": "OrganizationId", + "safeName": "OrganizationId" + } + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "organizationId" + } + } + }, + "jsonExample": "organizationId" + } + } + ], + "serviceHeaders": [], + "rootPathParameters": [ + { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tenantId" + } + } + }, + "jsonExample": "tenantId" + } + } + ], + "request": null, + "response": { + "type": "ok", + "value": { + "type": "body", + "value": { + "shape": { + "type": "named", + "shape": { + "type": "object", + "properties": [ + { + "name": { + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + }, + "wireValue": "name" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "name" + } + } + }, + "jsonExample": "name" + } + }, + { + "name": { + "name": { + "originalName": "tags", + "camelCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "snakeCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "screamingSnakeCase": { + "unsafeName": "TAGS", + "safeName": "TAGS" + }, + "pascalCase": { + "unsafeName": "Tags", + "safeName": "Tags" + } + }, + "wireValue": "tags" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "list", + "list": [ + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + }, + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + } + ], + "itemType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "jsonExample": [ + "tags", + "tags" + ] + } + } + ] + }, + "typeName": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + } + }, + "jsonExample": { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + } + } + }, + "docs": null + } + } + ], + "pagination": null, + "transport": null, + "availability": null, + "docs": null + }, + { + "id": "endpoint_organizations.searchOrganizations", + "name": { + "originalName": "searchOrganizations", + "camelCase": { + "unsafeName": "searchOrganizations", + "safeName": "searchOrganizations" + }, + "snakeCase": { + "unsafeName": "search_organizations", + "safeName": "search_organizations" + }, + "screamingSnakeCase": { + "unsafeName": "SEARCH_ORGANIZATIONS", + "safeName": "SEARCH_ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "SearchOrganizations", + "safeName": "SearchOrganizations" + } + }, + "displayName": null, + "auth": false, + "idempotent": false, + "baseUrl": null, + "method": "GET", + "basePath": null, + "path": { + "head": "/search", + "parts": [] + }, + "fullPath": { + "head": "/", + "parts": [ + { + "pathParameter": "tenantId", + "tail": "/organizations/" + }, + { + "pathParameter": "organizationId", + "tail": "/search" + } + ] + }, + "pathParameters": [], + "allPathParameters": [ + { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "ROOT", + "variable": null, + "docs": null + }, + { + "name": { + "originalName": "organizationId", + "camelCase": { + "unsafeName": "organizationId", + "safeName": "organizationId" + }, + "snakeCase": { + "unsafeName": "organization_id", + "safeName": "organization_id" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION_ID", + "safeName": "ORGANIZATION_ID" + }, + "pascalCase": { + "unsafeName": "OrganizationId", + "safeName": "OrganizationId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "SERVICE", + "variable": null, + "docs": null + } + ], + "queryParameters": [ + { + "name": { + "name": { + "originalName": "limit", + "camelCase": { + "unsafeName": "limit", + "safeName": "limit" + }, + "snakeCase": { + "unsafeName": "limit", + "safeName": "limit" + }, + "screamingSnakeCase": { + "unsafeName": "LIMIT", + "safeName": "LIMIT" + }, + "pascalCase": { + "unsafeName": "Limit", + "safeName": "Limit" + } + }, + "wireValue": "limit" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "optional", + "optional": { + "_type": "primitive", + "primitive": { + "v1": "INTEGER", + "v2": { + "type": "integer", + "default": null, + "validation": null + } + } + } + } + }, + "allowMultiple": false, + "availability": null, + "docs": null + } + ], + "headers": [], + "requestBody": null, + "sdkRequest": { + "shape": { + "type": "wrapper", + "wrapperName": { + "originalName": "SearchOrganizationsRequest", + "camelCase": { + "unsafeName": "searchOrganizationsRequest", + "safeName": "searchOrganizationsRequest" + }, + "snakeCase": { + "unsafeName": "search_organizations_request", + "safeName": "search_organizations_request" + }, + "screamingSnakeCase": { + "unsafeName": "SEARCH_ORGANIZATIONS_REQUEST", + "safeName": "SEARCH_ORGANIZATIONS_REQUEST" + }, + "pascalCase": { + "unsafeName": "SearchOrganizationsRequest", + "safeName": "SearchOrganizationsRequest" + } + }, + "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": "container", + "container": { + "_type": "list", + "list": { + "_type": "named", + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization", + "default": null, + "inline": null + } + } + }, + "docs": null + } + }, + "status-code": null + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [ + { + "example": { + "id": "48ead5b3", + "url": "/tenantId/organizations/organizationId/search", + "name": null, + "endpointHeaders": [], + "endpointPathParameters": [], + "queryParameters": [], + "servicePathParameters": [ + { + "name": { + "originalName": "organizationId", + "camelCase": { + "unsafeName": "organizationId", + "safeName": "organizationId" + }, + "snakeCase": { + "unsafeName": "organization_id", + "safeName": "organization_id" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION_ID", + "safeName": "ORGANIZATION_ID" + }, + "pascalCase": { + "unsafeName": "OrganizationId", + "safeName": "OrganizationId" + } + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "organizationId" + } + } + }, + "jsonExample": "organizationId" + } + } + ], + "serviceHeaders": [], + "rootPathParameters": [ + { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tenantId" + } + } + }, + "jsonExample": "tenantId" + } + } + ], + "request": null, + "response": { + "type": "ok", + "value": { + "type": "body", + "value": { + "shape": { + "type": "container", + "container": { + "type": "list", + "list": [ + { + "shape": { + "type": "named", + "shape": { + "type": "object", + "properties": [ + { + "name": { + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + }, + "wireValue": "name" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization" + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "name" + } + } + }, + "jsonExample": "name" + } + }, + { + "name": { + "name": { + "originalName": "tags", + "camelCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "snakeCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "screamingSnakeCase": { + "unsafeName": "TAGS", + "safeName": "TAGS" + }, + "pascalCase": { + "unsafeName": "Tags", + "safeName": "Tags" + } + }, + "wireValue": "tags" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "list", + "list": [ + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + }, + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + } + ], + "itemType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "jsonExample": [ + "tags", + "tags" + ] + } + } + ] + }, + "typeName": { + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization" + } + }, + "jsonExample": { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + }, + { + "shape": { + "type": "named", + "shape": { + "type": "object", + "properties": [ + { + "name": { + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + }, + "wireValue": "name" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization" + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "name" + } + } + }, + "jsonExample": "name" + } + }, + { + "name": { + "name": { + "originalName": "tags", + "camelCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "snakeCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "screamingSnakeCase": { + "unsafeName": "TAGS", + "safeName": "TAGS" + }, + "pascalCase": { + "unsafeName": "Tags", + "safeName": "Tags" + } + }, + "wireValue": "tags" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "list", + "list": [ + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + }, + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + } + ], + "itemType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "jsonExample": [ + "tags", + "tags" + ] + } + } + ] + }, + "typeName": { + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization" + } + }, + "jsonExample": { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + } + ], + "itemType": { + "_type": "named", + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "typeId": "type_organizations:Organization", + "default": null, + "inline": null + } + } + }, + "jsonExample": [ + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + }, + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + ] + } + } + }, + "docs": null + } + } + ], + "pagination": null, + "transport": null, + "availability": null, + "docs": null + } + ] + }, + "service_user": { + "availability": null, + "name": { + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + } + }, + "displayName": null, + "basePath": { + "head": "/user", + "parts": [] + }, + "headers": [], + "pathParameters": [], + "encoding": { + "json": {}, + "proto": null + }, + "transport": { + "type": "http" + }, + "endpoints": [ + { + "id": "endpoint_user.getUser", + "name": { + "originalName": "getUser", + "camelCase": { + "unsafeName": "getUser", + "safeName": "getUser" + }, + "snakeCase": { + "unsafeName": "get_user", + "safeName": "get_user" + }, + "screamingSnakeCase": { + "unsafeName": "GET_USER", + "safeName": "GET_USER" + }, + "pascalCase": { + "unsafeName": "GetUser", + "safeName": "GetUser" + } + }, + "displayName": null, + "auth": false, + "idempotent": false, + "baseUrl": null, + "method": "GET", + "basePath": null, + "path": { + "head": "/", + "parts": [ + { + "pathParameter": "userId", + "tail": "" + } + ] + }, + "fullPath": { + "head": "/", + "parts": [ + { + "pathParameter": "tenantId", + "tail": "/user/" + }, + { + "pathParameter": "userId", + "tail": "" + } + ] + }, + "pathParameters": [ + { + "name": { + "originalName": "userId", + "camelCase": { + "unsafeName": "userId", + "safeName": "userId" + }, + "snakeCase": { + "unsafeName": "user_id", + "safeName": "user_id" + }, + "screamingSnakeCase": { + "unsafeName": "USER_ID", + "safeName": "USER_ID" + }, + "pascalCase": { + "unsafeName": "UserId", + "safeName": "UserId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "ENDPOINT", + "variable": null, + "docs": null + } + ], + "allPathParameters": [ + { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "ROOT", + "variable": null, + "docs": null + }, + { + "name": { + "originalName": "userId", + "camelCase": { + "unsafeName": "userId", + "safeName": "userId" + }, + "snakeCase": { + "unsafeName": "user_id", + "safeName": "user_id" + }, + "screamingSnakeCase": { + "unsafeName": "USER_ID", + "safeName": "USER_ID" + }, + "pascalCase": { + "unsafeName": "UserId", + "safeName": "UserId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "ENDPOINT", + "variable": null, + "docs": null + } + ], + "queryParameters": [], + "headers": [], + "requestBody": null, + "sdkRequest": { + "shape": { + "type": "wrapper", + "wrapperName": { + "originalName": "GetUsersRequest", + "camelCase": { + "unsafeName": "getUsersRequest", + "safeName": "getUsersRequest" + }, + "snakeCase": { + "unsafeName": "get_users_request", + "safeName": "get_users_request" + }, + "screamingSnakeCase": { + "unsafeName": "GET_USERS_REQUEST", + "safeName": "GET_USERS_REQUEST" + }, + "pascalCase": { + "unsafeName": "GetUsersRequest", + "safeName": "GetUsersRequest" + } + }, + "bodyKey": { + "originalName": "body", + "camelCase": { + "unsafeName": "body", + "safeName": "body" + }, + "snakeCase": { + "unsafeName": "body", + "safeName": "body" + }, + "screamingSnakeCase": { + "unsafeName": "BODY", + "safeName": "BODY" + }, + "pascalCase": { + "unsafeName": "Body", + "safeName": "Body" + } + }, + "includePathParameters": true, + "onlyPathParameters": true + }, + "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": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User", + "default": null, + "inline": null + }, + "docs": null + } + }, + "status-code": null + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [ + { + "example": { + "id": "b6b20cb3", + "url": "/tenantId/user/userId", + "name": null, + "endpointHeaders": [], + "endpointPathParameters": [ + { + "name": { + "originalName": "userId", + "camelCase": { + "unsafeName": "userId", + "safeName": "userId" + }, + "snakeCase": { + "unsafeName": "user_id", + "safeName": "user_id" + }, + "screamingSnakeCase": { + "unsafeName": "USER_ID", + "safeName": "USER_ID" + }, + "pascalCase": { + "unsafeName": "UserId", + "safeName": "UserId" + } + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "userId" + } + } + }, + "jsonExample": "userId" + } + } + ], + "queryParameters": [], + "servicePathParameters": [], + "serviceHeaders": [], + "rootPathParameters": [ + { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tenantId" + } + } + }, + "jsonExample": "tenantId" + } + } + ], + "request": null, + "response": { + "type": "ok", + "value": { + "type": "body", + "value": { + "shape": { + "type": "named", + "shape": { + "type": "object", + "properties": [ + { + "name": { + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + }, + "wireValue": "name" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "name" + } + } + }, + "jsonExample": "name" + } + }, + { + "name": { + "name": { + "originalName": "tags", + "camelCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "snakeCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "screamingSnakeCase": { + "unsafeName": "TAGS", + "safeName": "TAGS" + }, + "pascalCase": { + "unsafeName": "Tags", + "safeName": "Tags" + } + }, + "wireValue": "tags" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "list", + "list": [ + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + }, + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + } + ], + "itemType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "jsonExample": [ + "tags", + "tags" + ] + } + } + ] + }, + "typeName": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + } + }, + "jsonExample": { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + } + } + }, + "docs": null + } + } + ], + "pagination": null, + "transport": null, + "availability": null, + "docs": null + }, + { + "id": "endpoint_user.searchUsers", + "name": { + "originalName": "searchUsers", + "camelCase": { + "unsafeName": "searchUsers", + "safeName": "searchUsers" + }, + "snakeCase": { + "unsafeName": "search_users", + "safeName": "search_users" + }, + "screamingSnakeCase": { + "unsafeName": "SEARCH_USERS", + "safeName": "SEARCH_USERS" + }, + "pascalCase": { + "unsafeName": "SearchUsers", + "safeName": "SearchUsers" + } + }, + "displayName": null, + "auth": false, + "idempotent": false, + "baseUrl": null, + "method": "GET", + "basePath": null, + "path": { + "head": "/", + "parts": [ + { + "pathParameter": "userId", + "tail": "/search" + } + ] + }, + "fullPath": { + "head": "/", + "parts": [ + { + "pathParameter": "tenantId", + "tail": "/user/" + }, + { + "pathParameter": "userId", + "tail": "/search" + } + ] + }, + "pathParameters": [ + { + "name": { + "originalName": "userId", + "camelCase": { + "unsafeName": "userId", + "safeName": "userId" + }, + "snakeCase": { + "unsafeName": "user_id", + "safeName": "user_id" + }, + "screamingSnakeCase": { + "unsafeName": "USER_ID", + "safeName": "USER_ID" + }, + "pascalCase": { + "unsafeName": "UserId", + "safeName": "UserId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "ENDPOINT", + "variable": null, + "docs": null + } + ], + "allPathParameters": [ + { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "ROOT", + "variable": null, + "docs": null + }, + { + "name": { + "originalName": "userId", + "camelCase": { + "unsafeName": "userId", + "safeName": "userId" + }, + "snakeCase": { + "unsafeName": "user_id", + "safeName": "user_id" + }, + "screamingSnakeCase": { + "unsafeName": "USER_ID", + "safeName": "USER_ID" + }, + "pascalCase": { + "unsafeName": "UserId", + "safeName": "UserId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "ENDPOINT", + "variable": null, + "docs": null + } + ], + "queryParameters": [ + { + "name": { + "name": { + "originalName": "limit", + "camelCase": { + "unsafeName": "limit", + "safeName": "limit" + }, + "snakeCase": { + "unsafeName": "limit", + "safeName": "limit" + }, + "screamingSnakeCase": { + "unsafeName": "LIMIT", + "safeName": "LIMIT" + }, + "pascalCase": { + "unsafeName": "Limit", + "safeName": "Limit" + } + }, + "wireValue": "limit" + }, + "valueType": { + "_type": "container", + "container": { + "_type": "optional", + "optional": { + "_type": "primitive", + "primitive": { + "v1": "INTEGER", + "v2": { + "type": "integer", + "default": null, + "validation": null + } + } + } + } + }, + "allowMultiple": false, + "availability": null, + "docs": null + } + ], + "headers": [], + "requestBody": null, + "sdkRequest": { + "shape": { + "type": "wrapper", + "wrapperName": { + "originalName": "SearchUsersRequest", + "camelCase": { + "unsafeName": "searchUsersRequest", + "safeName": "searchUsersRequest" + }, + "snakeCase": { + "unsafeName": "search_users_request", + "safeName": "search_users_request" + }, + "screamingSnakeCase": { + "unsafeName": "SEARCH_USERS_REQUEST", + "safeName": "SEARCH_USERS_REQUEST" + }, + "pascalCase": { + "unsafeName": "SearchUsersRequest", + "safeName": "SearchUsersRequest" + } + }, + "bodyKey": { + "originalName": "body", + "camelCase": { + "unsafeName": "body", + "safeName": "body" + }, + "snakeCase": { + "unsafeName": "body", + "safeName": "body" + }, + "screamingSnakeCase": { + "unsafeName": "BODY", + "safeName": "BODY" + }, + "pascalCase": { + "unsafeName": "Body", + "safeName": "Body" + } + }, + "includePathParameters": true, + "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": "container", + "container": { + "_type": "list", + "list": { + "_type": "named", + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User", + "default": null, + "inline": null + } + } + }, + "docs": null + } + }, + "status-code": null + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [ + { + "example": { + "id": "76e96ce6", + "url": "/tenantId/user/userId/search", + "name": null, + "endpointHeaders": [], + "endpointPathParameters": [ + { + "name": { + "originalName": "userId", + "camelCase": { + "unsafeName": "userId", + "safeName": "userId" + }, + "snakeCase": { + "unsafeName": "user_id", + "safeName": "user_id" + }, + "screamingSnakeCase": { + "unsafeName": "USER_ID", + "safeName": "USER_ID" + }, + "pascalCase": { + "unsafeName": "UserId", + "safeName": "UserId" + } + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "userId" + } + } + }, + "jsonExample": "userId" + } + } + ], + "queryParameters": [], + "servicePathParameters": [], + "serviceHeaders": [], + "rootPathParameters": [ + { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tenantId" + } + } + }, + "jsonExample": "tenantId" + } + } + ], + "request": null, + "response": { + "type": "ok", + "value": { + "type": "body", + "value": { + "shape": { + "type": "container", + "container": { + "type": "list", + "list": [ + { + "shape": { + "type": "named", + "shape": { + "type": "object", + "properties": [ + { + "name": { + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + }, + "wireValue": "name" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "name" + } + } + }, + "jsonExample": "name" + } + }, + { + "name": { + "name": { + "originalName": "tags", + "camelCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "snakeCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "screamingSnakeCase": { + "unsafeName": "TAGS", + "safeName": "TAGS" + }, + "pascalCase": { + "unsafeName": "Tags", + "safeName": "Tags" + } + }, + "wireValue": "tags" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "list", + "list": [ + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + }, + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + } + ], + "itemType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "jsonExample": [ + "tags", + "tags" + ] + } + } + ] + }, + "typeName": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + } + }, + "jsonExample": { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + }, + { + "shape": { + "type": "named", + "shape": { + "type": "object", + "properties": [ + { + "name": { + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + }, + "wireValue": "name" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + }, + "value": { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "name" + } + } + }, + "jsonExample": "name" + } + }, + { + "name": { + "name": { + "originalName": "tags", + "camelCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "snakeCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "screamingSnakeCase": { + "unsafeName": "TAGS", + "safeName": "TAGS" + }, + "pascalCase": { + "unsafeName": "Tags", + "safeName": "Tags" + } + }, + "wireValue": "tags" + }, + "originalTypeDeclaration": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + }, + "value": { + "shape": { + "type": "container", + "container": { + "type": "list", + "list": [ + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + }, + { + "shape": { + "type": "primitive", + "primitive": { + "type": "string", + "string": { + "original": "tags" + } + } + }, + "jsonExample": "tags" + } + ], + "itemType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + } + } + }, + "jsonExample": [ + "tags", + "tags" + ] + } + } + ] + }, + "typeName": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User" + } + }, + "jsonExample": { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + } + ], + "itemType": { + "_type": "named", + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "typeId": "type_user:User", + "default": null, + "inline": null + } + } + }, + "jsonExample": [ + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + }, + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + ] + } + } + }, + "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": { + "head": "/", + "parts": [ + { + "pathParameter": "tenantId", + "tail": "" + } + ] + }, + "pathParameters": [ + { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "valueType": { + "_type": "primitive", + "primitive": { + "v1": "STRING", + "v2": { + "type": "string", + "default": null, + "validation": null + } + } + }, + "location": "ROOT", + "variable": null, + "docs": null + } + ], + "variables": [], + "serviceTypeReferenceInfo": { + "typesReferencedOnlyByService": { + "service_organizations": [ + "type_organizations:Organization" + ] + }, + "sharedTypes": [ + "type_user:User" + ] + }, + "webhookGroups": {}, + "websocketChannels": {}, + "readmeConfig": null, + "sourceConfig": null, + "publishConfig": null, + "dynamic": { + "version": "1.0.0", + "types": { + "type_organizations:Organization": { + "type": "object", + "declaration": { + "name": { + "originalName": "Organization", + "camelCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "snakeCase": { + "unsafeName": "organization", + "safeName": "organization" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION", + "safeName": "ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "Organization", + "safeName": "Organization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + }, + "wireValue": "name" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + }, + { + "name": { + "name": { + "originalName": "tags", + "camelCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "snakeCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "screamingSnakeCase": { + "unsafeName": "TAGS", + "safeName": "TAGS" + }, + "pascalCase": { + "unsafeName": "Tags", + "safeName": "Tags" + } + }, + "wireValue": "tags" + }, + "typeReference": { + "type": "list", + "value": { + "type": "primitive", + "value": "STRING" + } + } + } + ] + }, + "type_user:User": { + "type": "object", + "declaration": { + "name": { + "originalName": "User", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + } + }, + "properties": [ + { + "name": { + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + }, + "wireValue": "name" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + }, + { + "name": { + "name": { + "originalName": "tags", + "camelCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "snakeCase": { + "unsafeName": "tags", + "safeName": "tags" + }, + "screamingSnakeCase": { + "unsafeName": "TAGS", + "safeName": "TAGS" + }, + "pascalCase": { + "unsafeName": "Tags", + "safeName": "Tags" + } + }, + "wireValue": "tags" + }, + "typeReference": { + "type": "list", + "value": { + "type": "primitive", + "value": "STRING" + } + } + } + ] + } + }, + "headers": [], + "endpoints": { + "endpoint_organizations.getOrganization": { + "auth": null, + "declaration": { + "name": { + "originalName": "getOrganization", + "camelCase": { + "unsafeName": "getOrganization", + "safeName": "getOrganization" + }, + "snakeCase": { + "unsafeName": "get_organization", + "safeName": "get_organization" + }, + "screamingSnakeCase": { + "unsafeName": "GET_ORGANIZATION", + "safeName": "GET_ORGANIZATION" + }, + "pascalCase": { + "unsafeName": "GetOrganization", + "safeName": "GetOrganization" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + } + }, + "location": { + "method": "GET", + "path": "/{tenantId}/organizations/{organizationId}/" + }, + "request": { + "type": "body", + "pathParameters": [ + { + "name": { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "wireValue": "tenantId" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + }, + { + "name": { + "name": { + "originalName": "organizationId", + "camelCase": { + "unsafeName": "organizationId", + "safeName": "organizationId" + }, + "snakeCase": { + "unsafeName": "organization_id", + "safeName": "organization_id" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION_ID", + "safeName": "ORGANIZATION_ID" + }, + "pascalCase": { + "unsafeName": "OrganizationId", + "safeName": "OrganizationId" + } + }, + "wireValue": "organizationId" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + } + ], + "body": null + }, + "response": { + "type": "json" + } + }, + "endpoint_organizations.getOrganizationUser": { + "auth": null, + "declaration": { + "name": { + "originalName": "getOrganizationUser", + "camelCase": { + "unsafeName": "getOrganizationUser", + "safeName": "getOrganizationUser" + }, + "snakeCase": { + "unsafeName": "get_organization_user", + "safeName": "get_organization_user" + }, + "screamingSnakeCase": { + "unsafeName": "GET_ORGANIZATION_USER", + "safeName": "GET_ORGANIZATION_USER" + }, + "pascalCase": { + "unsafeName": "GetOrganizationUser", + "safeName": "GetOrganizationUser" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + } + }, + "location": { + "method": "GET", + "path": "/{tenantId}/organizations/{organizationId}/users/{userId}" + }, + "request": { + "type": "inlined", + "declaration": { + "name": { + "originalName": "GetOrganizationUserRequest", + "camelCase": { + "unsafeName": "getOrganizationUserRequest", + "safeName": "getOrganizationUserRequest" + }, + "snakeCase": { + "unsafeName": "get_organization_user_request", + "safeName": "get_organization_user_request" + }, + "screamingSnakeCase": { + "unsafeName": "GET_ORGANIZATION_USER_REQUEST", + "safeName": "GET_ORGANIZATION_USER_REQUEST" + }, + "pascalCase": { + "unsafeName": "GetOrganizationUserRequest", + "safeName": "GetOrganizationUserRequest" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + } + }, + "pathParameters": [ + { + "name": { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "wireValue": "tenantId" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + }, + { + "name": { + "name": { + "originalName": "organizationId", + "camelCase": { + "unsafeName": "organizationId", + "safeName": "organizationId" + }, + "snakeCase": { + "unsafeName": "organization_id", + "safeName": "organization_id" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION_ID", + "safeName": "ORGANIZATION_ID" + }, + "pascalCase": { + "unsafeName": "OrganizationId", + "safeName": "OrganizationId" + } + }, + "wireValue": "organizationId" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + }, + { + "name": { + "name": { + "originalName": "userId", + "camelCase": { + "unsafeName": "userId", + "safeName": "userId" + }, + "snakeCase": { + "unsafeName": "user_id", + "safeName": "user_id" + }, + "screamingSnakeCase": { + "unsafeName": "USER_ID", + "safeName": "USER_ID" + }, + "pascalCase": { + "unsafeName": "UserId", + "safeName": "UserId" + } + }, + "wireValue": "userId" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + } + ], + "queryParameters": [], + "headers": [], + "body": null, + "metadata": { + "includePathParameters": true, + "onlyPathParameters": true + } + }, + "response": { + "type": "json" + } + }, + "endpoint_organizations.searchOrganizations": { + "auth": null, + "declaration": { + "name": { + "originalName": "searchOrganizations", + "camelCase": { + "unsafeName": "searchOrganizations", + "safeName": "searchOrganizations" + }, + "snakeCase": { + "unsafeName": "search_organizations", + "safeName": "search_organizations" + }, + "screamingSnakeCase": { + "unsafeName": "SEARCH_ORGANIZATIONS", + "safeName": "SEARCH_ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "SearchOrganizations", + "safeName": "SearchOrganizations" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + } + }, + "location": { + "method": "GET", + "path": "/{tenantId}/organizations/{organizationId}/search" + }, + "request": { + "type": "inlined", + "declaration": { + "name": { + "originalName": "SearchOrganizationsRequest", + "camelCase": { + "unsafeName": "searchOrganizationsRequest", + "safeName": "searchOrganizationsRequest" + }, + "snakeCase": { + "unsafeName": "search_organizations_request", + "safeName": "search_organizations_request" + }, + "screamingSnakeCase": { + "unsafeName": "SEARCH_ORGANIZATIONS_REQUEST", + "safeName": "SEARCH_ORGANIZATIONS_REQUEST" + }, + "pascalCase": { + "unsafeName": "SearchOrganizationsRequest", + "safeName": "SearchOrganizationsRequest" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + } + }, + "pathParameters": [ + { + "name": { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "wireValue": "tenantId" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + }, + { + "name": { + "name": { + "originalName": "organizationId", + "camelCase": { + "unsafeName": "organizationId", + "safeName": "organizationId" + }, + "snakeCase": { + "unsafeName": "organization_id", + "safeName": "organization_id" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATION_ID", + "safeName": "ORGANIZATION_ID" + }, + "pascalCase": { + "unsafeName": "OrganizationId", + "safeName": "OrganizationId" + } + }, + "wireValue": "organizationId" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + } + ], + "queryParameters": [ + { + "name": { + "name": { + "originalName": "limit", + "camelCase": { + "unsafeName": "limit", + "safeName": "limit" + }, + "snakeCase": { + "unsafeName": "limit", + "safeName": "limit" + }, + "screamingSnakeCase": { + "unsafeName": "LIMIT", + "safeName": "LIMIT" + }, + "pascalCase": { + "unsafeName": "Limit", + "safeName": "Limit" + } + }, + "wireValue": "limit" + }, + "typeReference": { + "type": "optional", + "value": { + "type": "primitive", + "value": "INTEGER" + } + } + } + ], + "headers": [], + "body": null, + "metadata": { + "includePathParameters": false, + "onlyPathParameters": false + } + }, + "response": { + "type": "json" + } + }, + "endpoint_user.getUser": { + "auth": null, + "declaration": { + "name": { + "originalName": "getUser", + "camelCase": { + "unsafeName": "getUser", + "safeName": "getUser" + }, + "snakeCase": { + "unsafeName": "get_user", + "safeName": "get_user" + }, + "screamingSnakeCase": { + "unsafeName": "GET_USER", + "safeName": "GET_USER" + }, + "pascalCase": { + "unsafeName": "GetUser", + "safeName": "GetUser" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + } + }, + "location": { + "method": "GET", + "path": "/{tenantId}/user/{userId}" + }, + "request": { + "type": "inlined", + "declaration": { + "name": { + "originalName": "GetUsersRequest", + "camelCase": { + "unsafeName": "getUsersRequest", + "safeName": "getUsersRequest" + }, + "snakeCase": { + "unsafeName": "get_users_request", + "safeName": "get_users_request" + }, + "screamingSnakeCase": { + "unsafeName": "GET_USERS_REQUEST", + "safeName": "GET_USERS_REQUEST" + }, + "pascalCase": { + "unsafeName": "GetUsersRequest", + "safeName": "GetUsersRequest" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + } + }, + "pathParameters": [ + { + "name": { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "wireValue": "tenantId" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + }, + { + "name": { + "name": { + "originalName": "userId", + "camelCase": { + "unsafeName": "userId", + "safeName": "userId" + }, + "snakeCase": { + "unsafeName": "user_id", + "safeName": "user_id" + }, + "screamingSnakeCase": { + "unsafeName": "USER_ID", + "safeName": "USER_ID" + }, + "pascalCase": { + "unsafeName": "UserId", + "safeName": "UserId" + } + }, + "wireValue": "userId" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + } + ], + "queryParameters": [], + "headers": [], + "body": null, + "metadata": { + "includePathParameters": true, + "onlyPathParameters": true + } + }, + "response": { + "type": "json" + } + }, + "endpoint_user.searchUsers": { + "auth": null, + "declaration": { + "name": { + "originalName": "searchUsers", + "camelCase": { + "unsafeName": "searchUsers", + "safeName": "searchUsers" + }, + "snakeCase": { + "unsafeName": "search_users", + "safeName": "search_users" + }, + "screamingSnakeCase": { + "unsafeName": "SEARCH_USERS", + "safeName": "SEARCH_USERS" + }, + "pascalCase": { + "unsafeName": "SearchUsers", + "safeName": "SearchUsers" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + } + }, + "location": { + "method": "GET", + "path": "/{tenantId}/user/{userId}/search" + }, + "request": { + "type": "inlined", + "declaration": { + "name": { + "originalName": "SearchUsersRequest", + "camelCase": { + "unsafeName": "searchUsersRequest", + "safeName": "searchUsersRequest" + }, + "snakeCase": { + "unsafeName": "search_users_request", + "safeName": "search_users_request" + }, + "screamingSnakeCase": { + "unsafeName": "SEARCH_USERS_REQUEST", + "safeName": "SEARCH_USERS_REQUEST" + }, + "pascalCase": { + "unsafeName": "SearchUsersRequest", + "safeName": "SearchUsersRequest" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + } + }, + "pathParameters": [ + { + "name": { + "name": { + "originalName": "tenantId", + "camelCase": { + "unsafeName": "tenantId", + "safeName": "tenantId" + }, + "snakeCase": { + "unsafeName": "tenant_id", + "safeName": "tenant_id" + }, + "screamingSnakeCase": { + "unsafeName": "TENANT_ID", + "safeName": "TENANT_ID" + }, + "pascalCase": { + "unsafeName": "TenantId", + "safeName": "TenantId" + } + }, + "wireValue": "tenantId" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + }, + { + "name": { + "name": { + "originalName": "userId", + "camelCase": { + "unsafeName": "userId", + "safeName": "userId" + }, + "snakeCase": { + "unsafeName": "user_id", + "safeName": "user_id" + }, + "screamingSnakeCase": { + "unsafeName": "USER_ID", + "safeName": "USER_ID" + }, + "pascalCase": { + "unsafeName": "UserId", + "safeName": "UserId" + } + }, + "wireValue": "userId" + }, + "typeReference": { + "type": "primitive", + "value": "STRING" + } + } + ], + "queryParameters": [ + { + "name": { + "name": { + "originalName": "limit", + "camelCase": { + "unsafeName": "limit", + "safeName": "limit" + }, + "snakeCase": { + "unsafeName": "limit", + "safeName": "limit" + }, + "screamingSnakeCase": { + "unsafeName": "LIMIT", + "safeName": "LIMIT" + }, + "pascalCase": { + "unsafeName": "Limit", + "safeName": "Limit" + } + }, + "wireValue": "limit" + }, + "typeReference": { + "type": "optional", + "value": { + "type": "primitive", + "value": "INTEGER" + } + } + } + ], + "headers": [], + "body": null, + "metadata": { + "includePathParameters": true, + "onlyPathParameters": false + } + }, + "response": { + "type": "json" + } + } + }, + "environments": null + }, + "subpackages": { + "subpackage_organizations": { + "name": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + ], + "packagePath": [], + "file": { + "originalName": "organizations", + "camelCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "snakeCase": { + "unsafeName": "organizations", + "safeName": "organizations" + }, + "screamingSnakeCase": { + "unsafeName": "ORGANIZATIONS", + "safeName": "ORGANIZATIONS" + }, + "pascalCase": { + "unsafeName": "Organizations", + "safeName": "Organizations" + } + } + }, + "service": "service_organizations", + "types": [ + "type_organizations:Organization" + ], + "errors": [], + "subpackages": [], + "navigationConfig": null, + "webhooks": null, + "websocket": null, + "hasEndpointsInTree": true, + "docs": null + }, + "subpackage_user": { + "name": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + }, + "fernFilepath": { + "allParts": [ + { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + ], + "packagePath": [], + "file": { + "originalName": "user", + "camelCase": { + "unsafeName": "user", + "safeName": "user" + }, + "snakeCase": { + "unsafeName": "user", + "safeName": "user" + }, + "screamingSnakeCase": { + "unsafeName": "USER", + "safeName": "USER" + }, + "pascalCase": { + "unsafeName": "User", + "safeName": "User" + } + } + }, + "service": "service_user", + "types": [ + "type_user:User" + ], + "errors": [], + "subpackages": [], + "navigationConfig": null, + "webhooks": null, + "websocket": null, + "hasEndpointsInTree": true, + "docs": null + } + }, + "rootPackage": { + "fernFilepath": { + "allParts": [], + "packagePath": [], + "file": null + }, + "websocket": null, + "service": null, + "types": [], + "errors": [], + "subpackages": [ + "subpackage_organizations", + "subpackage_user" + ], + "webhooks": null, + "navigationConfig": null, + "hasEndpointsInTree": true, + "docs": null + }, + "sdkConfig": { + "isAuthMandatory": false, + "hasStreamingEndpoints": false, + "hasPaginatedEndpoints": false, + "hasFileDownloadEndpoints": false, + "platformHeaders": { + "language": "X-Fern-Language", + "sdkName": "X-Fern-SDK-Name", + "sdkVersion": "X-Fern-SDK-Version", + "userAgent": null + } + } +} \ No newline at end of file diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/README.md b/seed/csharp-sdk/path-parameters/no-custom-config/README.md new file mode 100644 index 00000000000..70f2e9050c3 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/README.md @@ -0,0 +1,94 @@ +# 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/SeedPathParameters)](https://nuget.org/packages/SeedPathParameters) + +The Seed C# library provides convenient access to the Seed API from C#. + +## Installation + +```sh +nuget install SeedPathParameters +``` + +## Usage + +Instantiate and use the client with the following: + +```csharp +using SeedPathParameters; + +var client = new SeedPathParametersClient(); +await client.User.CreateUserAsync( + "tenant_id", + new User + { + Name = "name", + Tags = new List() { "tags", "tags" }, + } +); +``` + +## 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 SeedPathParameters; + +try { + var response = await client.User.CreateUserAsync(...); +} catch (SeedPathParametersApiException e) { + System.Console.WriteLine(e.Body); + System.Console.WriteLine(e.StatusCode); +} +``` + +## Advanced + +### Retries + +The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long +as the request is deemed retryable and the number of retry attempts has not grown larger than the configured +retry limit (default: 2). + +A request is deemed retryable when any of the following HTTP status codes is returned: + +- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) +- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) +- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) + +Use the `MaxRetries` request option to configure this behavior. + +```csharp +var response = await client.User.CreateUserAsync( + ..., + 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.User.CreateUserAsync( + ..., + 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/path-parameters/reference.md b/seed/csharp-sdk/path-parameters/no-custom-config/reference.md similarity index 100% rename from seed/csharp-sdk/path-parameters/reference.md rename to seed/csharp-sdk/path-parameters/no-custom-config/reference.md diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/snippet-templates.json b/seed/csharp-sdk/path-parameters/no-custom-config/snippet-templates.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/csharp-sdk/path-parameters/snippet.json b/seed/csharp-sdk/path-parameters/no-custom-config/snippet.json similarity index 100% rename from seed/csharp-sdk/path-parameters/snippet.json rename to seed/csharp-sdk/path-parameters/no-custom-config/snippet.json diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/DateOnlyJsonTests.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/DateOnlyJsonTests.cs new file mode 100644 index 00000000000..c3b97d44252 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/DateOnlyJsonTests.cs @@ -0,0 +1,76 @@ +using NUnit.Framework; +using SeedPathParameters.Core; + +namespace SeedPathParameters.Test.Core.Json; + +[TestFixture] +public class DateOnlyJsonTests +{ + [Test] + public void SerializeDateOnly_ShouldMatchExpectedFormat() + { + (DateOnly dateOnly, string expected)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (new DateOnly(2023, 1, 1), "\"2023-01-01\""), + (new DateOnly(2023, 12, 31), "\"2023-12-31\""), + (new DateOnly(2023, 6, 15), "\"2023-06-15\""), + (new DateOnly(2023, 3, 10), "\"2023-03-10\""), + ]; + foreach (var (dateOnly, expected) in testCases) + { + var json = JsonUtils.Serialize(dateOnly); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeDateOnly_ShouldMatchExpectedDateOnly() + { + (DateOnly expected, string json)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (new DateOnly(2023, 1, 1), "\"2023-01-01\""), + (new DateOnly(2023, 12, 31), "\"2023-12-31\""), + (new DateOnly(2023, 6, 15), "\"2023-06-15\""), + (new DateOnly(2023, 3, 10), "\"2023-03-10\""), + ]; + + foreach (var (expected, json) in testCases) + { + var dateOnly = JsonUtils.Deserialize(json); + Assert.That(dateOnly, Is.EqualTo(expected)); + } + } + + [Test] + public void SerializeNullableDateOnly_ShouldMatchExpectedFormat() + { + (DateOnly? dateOnly, string expected)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (null, "null"), + ]; + foreach (var (dateOnly, expected) in testCases) + { + var json = JsonUtils.Serialize(dateOnly); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeNullableDateOnly_ShouldMatchExpectedDateOnly() + { + (DateOnly? expected, string json)[] testCases = + [ + (new DateOnly(2023, 10, 5), "\"2023-10-05\""), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateOnly = JsonUtils.Deserialize(json); + Assert.That(dateOnly, Is.EqualTo(expected)); + } + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/DateTimeJsonTests.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/DateTimeJsonTests.cs new file mode 100644 index 00000000000..51e62f13ad0 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/DateTimeJsonTests.cs @@ -0,0 +1,110 @@ +using NUnit.Framework; +using SeedPathParameters.Core; + +namespace SeedPathParameters.Test.Core.Json; + +[TestFixture] +public class DateTimeJsonTests +{ + [Test] + public void SerializeDateTime_ShouldMatchExpectedFormat() + { + (DateTime dateTime, string expected)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), "\"2023-01-01T00:00:00.000Z\""), + ( + new DateTime(2023, 12, 31, 23, 59, 59, DateTimeKind.Utc), + "\"2023-12-31T23:59:59.000Z\"" + ), + (new DateTime(2023, 6, 15, 12, 0, 0, DateTimeKind.Utc), "\"2023-06-15T12:00:00.000Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.000Z\"" + ), + ( + new DateTime(2023, 3, 10, 8, 45, 30, 123, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.123Z\"" + ), + ]; + foreach (var (dateTime, expected) in testCases) + { + var json = JsonUtils.Serialize(dateTime); + Assert.That(json, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeDateTime_ShouldMatchExpectedDateTime() + { + (DateTime expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (new DateTime(2023, 1, 1, 0, 0, 0, DateTimeKind.Utc), "\"2023-01-01T00:00:00.000Z\""), + ( + new DateTime(2023, 12, 31, 23, 59, 59, DateTimeKind.Utc), + "\"2023-12-31T23:59:59.000Z\"" + ), + (new DateTime(2023, 6, 15, 12, 0, 0, DateTimeKind.Utc), "\"2023-06-15T12:00:00.000Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.000Z\"" + ), + (new DateTime(2023, 3, 10, 8, 45, 30, DateTimeKind.Utc), "\"2023-03-10T08:45:30Z\""), + ( + new DateTime(2023, 3, 10, 8, 45, 30, 123, DateTimeKind.Utc), + "\"2023-03-10T08:45:30.123Z\"" + ), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } + + [Test] + public void SerializeNullableDateTime_ShouldMatchExpectedFormat() + { + (DateTime? expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } + + [Test] + public void DeserializeNullableDateTime_ShouldMatchExpectedDateTime() + { + (DateTime? expected, string json)[] testCases = + [ + ( + new DateTime(2023, 10, 5, 14, 30, 0, DateTimeKind.Utc), + "\"2023-10-05T14:30:00.000Z\"" + ), + (null, "null"), + ]; + + foreach (var (expected, json) in testCases) + { + var dateTime = JsonUtils.Deserialize(json); + Assert.That(dateTime, Is.EqualTo(expected)); + } + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/EnumSerializerTests.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/EnumSerializerTests.cs new file mode 100644 index 00000000000..b503691bd2d --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/EnumSerializerTests.cs @@ -0,0 +1,60 @@ +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; +using NUnit.Framework; +using SeedPathParameters.Core; + +namespace SeedPathParameters.Test.Core.Json; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class StringEnumSerializerTests +{ + private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true }; + + private const DummyEnum KnownEnumValue2 = DummyEnum.KnownValue2; + private const string KnownEnumValue2String = "known_value2"; + + private const string JsonWithKnownEnum2 = $$""" + { + "enum_property": "{{KnownEnumValue2String}}" + } + """; + + [Test] + public void ShouldParseKnownEnumValue2() + { + var obj = JsonSerializer.Deserialize(JsonWithKnownEnum2, JsonOptions); + Assert.That(obj, Is.Not.Null); + Assert.That(obj.EnumProperty, Is.EqualTo(KnownEnumValue2)); + } + + [Test] + public void ShouldSerializeKnownEnumValue2() + { + var json = JsonSerializer.SerializeToElement( + new DummyObject { EnumProperty = KnownEnumValue2 }, + JsonOptions + ); + TestContext.Out.WriteLine("Serialized JSON: \n" + json); + var enumString = json.GetProperty("enum_property").GetString(); + Assert.That(enumString, Is.Not.Null); + Assert.That(enumString, Is.EqualTo(KnownEnumValue2String)); + } +} + +public class DummyObject +{ + [JsonPropertyName("enum_property")] + public DummyEnum EnumProperty { get; set; } +} + +[JsonConverter(typeof(EnumSerializer))] +public enum DummyEnum +{ + [EnumMember(Value = "known_value1")] + KnownValue1, + + [EnumMember(Value = "known_value2")] + KnownValue2, +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/OneOfSerializerTests.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/OneOfSerializerTests.cs new file mode 100644 index 00000000000..0da45fefa77 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/Json/OneOfSerializerTests.cs @@ -0,0 +1,311 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using NUnit.Framework; +using OneOf; +using SeedPathParameters.Core; + +namespace SeedPathParameters.Test.Core; + +[TestFixture] +[Parallelizable(ParallelScope.All)] +public class OneOfSerializerTests +{ + private class Foo + { + [JsonPropertyName("string_prop")] + public required string StringProp { get; set; } + } + + private class Bar + { + [JsonPropertyName("int_prop")] + public required int IntProp { get; set; } + } + + private static readonly OneOf OneOf1 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT2(new { }); + private const string OneOf1String = "{}"; + + private static readonly OneOf OneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT0("test"); + private const string OneOf2String = "\"test\""; + + private static readonly OneOf OneOf3 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT1(123); + private const string OneOf3String = "123"; + + private static readonly OneOf OneOf4 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT3(new Foo { StringProp = "test" }); + private const string OneOf4String = "{\n \"string_prop\": \"test\"\n}"; + + private static readonly OneOf OneOf5 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string OneOf5String = "{\n \"int_prop\": 5\n}"; + + [Test] + public void Serialize_OneOfs_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected)); + } + }); + } + + [Test] + public void OneOfs_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + (OneOf1, OneOf1String), + (OneOf2, OneOf2String), + (OneOf3, OneOf3String), + (OneOf4, OneOf4String), + (OneOf5, OneOf5String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value))); + } + }); + } + + private static readonly OneOf? NullableOneOf1 = null; + private const string NullableOneOf1String = "null"; + + private static readonly OneOf? NullableOneOf2 = OneOf< + string, + int, + object, + Foo, + Bar + >.FromT4(new Bar { IntProp = 5 }); + private const string NullableOneOf2String = "{\n \"int_prop\": 5\n}"; + + [Test] + public void Serialize_NullableOneOfs_Should_Return_Expected_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected)); + } + }); + } + + [Test] + public void NullableOneOfs_Should_Deserialize_From_String() + { + (OneOf?, string)[] testData = + [ + (NullableOneOf1, NullableOneOf1String), + (NullableOneOf2, NullableOneOf2String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize?>(json); + Assert.That(result?.Index, Is.EqualTo(oneOf?.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result?.Value))); + } + }); + } + + private static readonly OneOf OneOfWithNullable1 = OneOf< + string, + int, + Foo? + >.FromT2(null); + private const string OneOfWithNullable1String = "null"; + + private static readonly OneOf OneOfWithNullable2 = OneOf< + string, + int, + Foo? + >.FromT2(new Foo { StringProp = "test" }); + private const string OneOfWithNullable2String = "{\n \"string_prop\": \"test\"\n}"; + + private static readonly OneOf OneOfWithNullable3 = OneOf< + string, + int, + Foo? + >.FromT0("test"); + private const string OneOfWithNullable3String = "\"test\""; + + [Test] + public void Serialize_OneOfWithNullables_Should_Return_Expected_String() + { + (OneOf, string)[] testData = + [ + (OneOfWithNullable1, OneOfWithNullable1String), + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, expected) in testData) + { + var result = JsonUtils.Serialize(oneOf); + Assert.That(result, Is.EqualTo(expected)); + } + }); + } + + [Test] + public void OneOfWithNullables_Should_Deserialize_From_String() + { + (OneOf, string)[] testData = + [ + // (OneOfWithNullable1, OneOfWithNullable1String), // not possible with .NET's JSON serializer + (OneOfWithNullable2, OneOfWithNullable2String), + (OneOfWithNullable3, OneOfWithNullable3String), + ]; + Assert.Multiple(() => + { + foreach (var (oneOf, json) in testData) + { + var result = JsonUtils.Deserialize>(json); + Assert.That(result.Index, Is.EqualTo(oneOf.Index)); + Assert.That(json, Is.EqualTo(JsonUtils.Serialize(result.Value))); + } + }); + } + + [Test] + public void Serialize_OneOfWithObjectLast_Should_Return_Expected_String() + { + var oneOfWithObjectLast = OneOf.FromT4( + new { random = "data" } + ); + const string oneOfWithObjectLastString = "{\n \"random\": \"data\"\n}"; + + var result = JsonUtils.Serialize(oneOfWithObjectLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectLastString)); + } + + [Test] + public void OneOfWithObjectLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectLastString = "{\n \"random\": \"data\"\n}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(4)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That(JsonUtils.Serialize(result.Value), Is.EqualTo(oneOfWithObjectLastString)); + }); + } + + [Test] + public void Serialize_OneOfWithObjectNotLast_Should_Return_Expected_String() + { + var oneOfWithObjectNotLast = OneOf.FromT1( + new { random = "data" } + ); + const string oneOfWithObjectNotLastString = "{\n \"random\": \"data\"\n}"; + + var result = JsonUtils.Serialize(oneOfWithObjectNotLast); + Assert.That(result, Is.EqualTo(oneOfWithObjectNotLastString)); + } + + [Test] + public void OneOfWithObjectNotLast_Should_Deserialize_From_String() + { + const string oneOfWithObjectNotLastString = "{\n \"random\": \"data\"\n}"; + var result = JsonUtils.Deserialize>( + oneOfWithObjectNotLastString + ); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(1)); + Assert.That(result.Value, Is.InstanceOf()); + Assert.That( + JsonUtils.Serialize(result.Value), + Is.EqualTo(oneOfWithObjectNotLastString) + ); + }); + } + + [Test] + public void Serialize_OneOfSingleType_Should_Return_Expected_String() + { + var oneOfSingle = OneOf.FromT0("single"); + const string oneOfSingleString = "\"single\""; + + var result = JsonUtils.Serialize(oneOfSingle); + Assert.That(result, Is.EqualTo(oneOfSingleString)); + } + + [Test] + public void OneOfSingleType_Should_Deserialize_From_String() + { + const string oneOfSingleString = "\"single\""; + var result = JsonUtils.Deserialize>(oneOfSingleString); + Assert.Multiple(() => + { + Assert.That(result.Index, Is.EqualTo(0)); + Assert.That(result.Value, Is.EqualTo("single")); + }); + } + + [Test] + public void Deserialize_InvalidData_Should_Throw_Exception() + { + const string invalidJson = "{\"invalid\": \"data\"}"; + + Assert.Throws(() => + { + JsonUtils.Deserialize>(invalidJson); + }); + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/RawClientTests.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/RawClientTests.cs new file mode 100644 index 00000000000..ab6cda1b8f2 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Core/RawClientTests.cs @@ -0,0 +1,109 @@ +using NUnit.Framework; +using SeedPathParameters.Core; +using WireMock.Server; +using SystemTask = System.Threading.Tasks.Task; +using WireMockRequest = WireMock.RequestBuilders.Request; +using WireMockResponse = WireMock.ResponseBuilders.Response; + +namespace SeedPathParameters.Test.Core; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class RawClientTests +{ + private const int MaxRetries = 3; + private WireMockServer _server; + private HttpClient _httpClient; + private RawClient _rawClient; + private string _baseUrl; + + [SetUp] + public void SetUp() + { + _server = WireMockServer.Start(); + _baseUrl = _server.Url ?? ""; + _httpClient = new HttpClient { BaseAddress = new Uri(_baseUrl) }; + _rawClient = new RawClient( + new ClientOptions { HttpClient = _httpClient, MaxRetries = MaxRetries } + ) + { + BaseRetryDelay = 0, + }; + } + + [Test] + [TestCase(408)] + [TestCase(429)] + [TestCase(500)] + [TestCase(504)] + public async SystemTask 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/path-parameters/no-custom-config/src/SeedPathParameters.Test/SeedPathParameters.Test.Custom.props b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/SeedPathParameters.Test.Custom.props new file mode 100644 index 00000000000..55e683b0772 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/SeedPathParameters.Test.Custom.props @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/SeedPathParameters.Test.csproj b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/SeedPathParameters.Test.csproj new file mode 100644 index 00000000000..441fc0a8fe8 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/SeedPathParameters.Test.csproj @@ -0,0 +1,38 @@ + + + + net8.0 + 12 + enable + enable + false + true + true + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + \ No newline at end of file diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/TestClient.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/TestClient.cs new file mode 100644 index 00000000000..ec9f333e6ca --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/TestClient.cs @@ -0,0 +1,6 @@ +using NUnit.Framework; + +namespace SeedPathParameters.Test; + +[TestFixture] +public class TestClient; diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/BaseMockServerTest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/BaseMockServerTest.cs new file mode 100644 index 00000000000..cc75dc62f2c --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/BaseMockServerTest.cs @@ -0,0 +1,38 @@ +using NUnit.Framework; +using SeedPathParameters; +using WireMock.Logging; +using WireMock.Server; +using WireMock.Settings; + +namespace SeedPathParameters.Test.Unit.MockServer; + +[SetUpFixture] +public class BaseMockServerTest +{ + protected static WireMockServer Server { get; set; } = null!; + + protected static SeedPathParametersClient 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 SeedPathParametersClient(); + + RequestOptions = new RequestOptions { BaseUrl = Server.Urls[0] }; + } + + [OneTimeTearDown] + public void GlobalTeardown() + { + Server.Stop(); + Server.Dispose(); + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/CreateUserTest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/CreateUserTest.cs new file mode 100644 index 00000000000..de428a679be --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/CreateUserTest.cs @@ -0,0 +1,65 @@ +using FluentAssertions.Json; +using global::System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using NUnit.Framework; +using SeedPathParameters; +using SeedPathParameters.Core; + +namespace SeedPathParameters.Test.Unit.MockServer; + +[TestFixture] +public class CreateUserTest : BaseMockServerTest +{ + [Test] + public async global::System.Threading.Tasks.Task MockServerTest() + { + const string requestJson = """ + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + """; + + const string mockResponse = """ + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/tenant_id/user/") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.User.CreateUserAsync( + "tenant_id", + new User + { + Name = "name", + Tags = new List() { "tags", "tags" }, + }, + RequestOptions + ); + JToken + .Parse(mockResponse) + .Should() + .BeEquivalentTo(JToken.Parse(JsonUtils.Serialize(response))); + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationTest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationTest.cs new file mode 100644 index 00000000000..5a13a515245 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationTest.cs @@ -0,0 +1,49 @@ +using FluentAssertions.Json; +using global::System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using NUnit.Framework; +using SeedPathParameters.Core; + +namespace SeedPathParameters.Test.Unit.MockServer; + +[TestFixture] +public class GetOrganizationTest : BaseMockServerTest +{ + [Test] + public async global::System.Threading.Tasks.Task MockServerTest() + { + const string mockResponse = """ + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/tenant_id/organizations/organization_id/") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Organizations.GetOrganizationAsync( + "tenant_id", + "organization_id", + RequestOptions + ); + JToken + .Parse(mockResponse) + .Should() + .BeEquivalentTo(JToken.Parse(JsonUtils.Serialize(response))); + } +} diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationUserTest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationUserTest.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationUserTest.cs rename to seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/GetOrganizationUserTest.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetUserTest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/GetUserTest.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/GetUserTest.cs rename to seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/GetUserTest.cs diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/SearchOrganizationsTest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/SearchOrganizationsTest.cs new file mode 100644 index 00000000000..72f756bea1b --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/SearchOrganizationsTest.cs @@ -0,0 +1,61 @@ +using FluentAssertions.Json; +using global::System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using NUnit.Framework; +using SeedPathParameters; +using SeedPathParameters.Core; + +namespace SeedPathParameters.Test.Unit.MockServer; + +[TestFixture] +public class SearchOrganizationsTest : BaseMockServerTest +{ + [Test] + public async global::System.Threading.Tasks.Task MockServerTest() + { + const string mockResponse = """ + [ + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + }, + { + "name": "name", + "tags": [ + "tags", + "tags" + ] + } + ] + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/tenant_id/organizations/organization_id/search") + .WithParam("limit", "1") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Organizations.SearchOrganizationsAsync( + "tenant_id", + "organization_id", + new SearchOrganizationsRequest { Limit = 1 }, + RequestOptions + ); + JToken + .Parse(mockResponse) + .Should() + .BeEquivalentTo(JToken.Parse(JsonUtils.Serialize(response))); + } +} diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/SearchUsersTest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/SearchUsersTest.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/SearchUsersTest.cs rename to seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/SearchUsersTest.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/UpdateUserTest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/UpdateUserTest.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters.Test/Unit/MockServer/UpdateUserTest.cs rename to seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters.Test/Unit/MockServer/UpdateUserTest.cs diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/CollectionItemSerializer.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/CollectionItemSerializer.cs new file mode 100644 index 00000000000..21c38b2e787 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/CollectionItemSerializer.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedPathParameters.Core; + +/// +/// Json collection converter. +/// +/// Type of item to convert. +/// Converter to use for individual items. +internal class CollectionItemSerializer + : JsonConverter> + where TConverterType : JsonConverter +{ + /// + /// Reads a json string and deserializes it into an object. + /// + /// Json reader. + /// Type to convert. + /// Serializer options. + /// Created object. + public override IEnumerable? Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType == JsonTokenType.Null) + { + return default; + } + + var jsonSerializerOptions = new JsonSerializerOptions(options); + jsonSerializerOptions.Converters.Clear(); + jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); + + var returnValue = new List(); + + while (reader.TokenType != JsonTokenType.EndArray) + { + if (reader.TokenType != JsonTokenType.StartArray) + { + var item = (TDatatype)( + JsonSerializer.Deserialize(ref reader, typeof(TDatatype), jsonSerializerOptions) + ?? throw new Exception( + $"Failed to deserialize collection item of type {typeof(TDatatype)}" + ) + ); + returnValue.Add(item); + } + + reader.Read(); + } + + return returnValue; + } + + /// + /// Writes a json string. + /// + /// Json writer. + /// Value to write. + /// Serializer options. + public override void Write( + Utf8JsonWriter writer, + IEnumerable? value, + JsonSerializerOptions options + ) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + + var jsonSerializerOptions = new JsonSerializerOptions(options); + jsonSerializerOptions.Converters.Clear(); + jsonSerializerOptions.Converters.Add(Activator.CreateInstance()); + + writer.WriteStartArray(); + + foreach (var data in value) + { + JsonSerializer.Serialize(writer, data, jsonSerializerOptions); + } + + writer.WriteEndArray(); + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Constants.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Constants.cs new file mode 100644 index 00000000000..0c14456a8af --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Constants.cs @@ -0,0 +1,7 @@ +namespace SeedPathParameters.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/path-parameters/no-custom-config/src/SeedPathParameters/Core/DateOnlyConverter.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/DateOnlyConverter.cs new file mode 100644 index 00000000000..ea5482fc4f5 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/DateOnlyConverter.cs @@ -0,0 +1,747 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// ReSharper disable All + +using global::System.Diagnostics; +using global::System.Diagnostics.CodeAnalysis; +using global::System.Globalization; +using global::System.Runtime.CompilerServices; +using global::System.Runtime.InteropServices; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +// ReSharper disable SuggestVarOrType_SimpleTypes +// ReSharper disable SuggestVarOrType_BuiltInTypes + +namespace SeedPathParameters.Core +{ + /// + /// Custom converter for handling the data type with the System.Text.Json library. + /// + /// + /// This class backported from: + /// + /// System.Text.Json.Serialization.Converters.DateOnlyConverter + /// + public sealed class DateOnlyConverter : JsonConverter + { + private const int FormatLength = 10; // YYYY-MM-DD + + private const int MaxEscapedFormatLength = + FormatLength * JsonConstants.MaxExpansionFactorWhileEscaping; + + /// + public override DateOnly Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType != JsonTokenType.String) + { + ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); + } + + return ReadCore(ref reader); + } + + /// + public override DateOnly ReadAsPropertyName( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); + return ReadCore(ref reader); + } + + private static DateOnly ReadCore(ref Utf8JsonReader reader) + { + if ( + !JsonHelpers.IsInRangeInclusive( + reader.ValueLength(), + FormatLength, + MaxEscapedFormatLength + ) + ) + { + ThrowHelper.ThrowFormatException(DataType.DateOnly); + } + + scoped ReadOnlySpan source; + if (!reader.HasValueSequence && !reader.ValueIsEscaped) + { + source = reader.ValueSpan; + } + else + { + Span stackSpan = stackalloc byte[MaxEscapedFormatLength]; + int bytesWritten = reader.CopyString(stackSpan); + source = stackSpan.Slice(0, bytesWritten); + } + + if (!JsonHelpers.TryParseAsIso(source, out DateOnly value)) + { + ThrowHelper.ThrowFormatException(DataType.DateOnly); + } + + return value; + } + + /// + public override void Write( + Utf8JsonWriter writer, + DateOnly value, + JsonSerializerOptions options + ) + { +#if NET8_0_OR_GREATER + Span buffer = stackalloc byte[FormatLength]; +#else + Span buffer = stackalloc char[FormatLength]; +#endif + // ReSharper disable once RedundantAssignment + bool formattedSuccessfully = value.TryFormat( + buffer, + out int charsWritten, + "O".AsSpan(), + CultureInfo.InvariantCulture + ); + Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); + writer.WriteStringValue(buffer); + } + + /// + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DateOnly value, + JsonSerializerOptions options + ) + { +#if NET8_0_OR_GREATER + Span buffer = stackalloc byte[FormatLength]; +#else + Span buffer = stackalloc char[FormatLength]; +#endif + // ReSharper disable once RedundantAssignment + bool formattedSuccessfully = value.TryFormat( + buffer, + out int charsWritten, + "O".AsSpan(), + CultureInfo.InvariantCulture + ); + Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); + writer.WritePropertyName(buffer); + } + } + + internal static class JsonConstants + { + // The maximum number of fraction digits the Json DateTime parser allows + public const int DateTimeParseNumFractionDigits = 16; + + // In the worst case, an ASCII character represented as a single utf-8 byte could expand 6x when escaped. + public const int MaxExpansionFactorWhileEscaping = 6; + + // The largest fraction expressible by TimeSpan and DateTime formats + public const int MaxDateTimeFraction = 9_999_999; + + // TimeSpan and DateTime formats allow exactly up to many digits for specifying the fraction after the seconds. + public const int DateTimeNumFractionDigits = 7; + + public const byte UtcOffsetToken = (byte)'Z'; + + public const byte TimePrefix = (byte)'T'; + + public const byte Period = (byte)'.'; + + public const byte Hyphen = (byte)'-'; + + public const byte Colon = (byte)':'; + + public const byte Plus = (byte)'+'; + } + + // ReSharper disable SuggestVarOrType_Elsewhere + // ReSharper disable SuggestVarOrType_SimpleTypes + // ReSharper disable SuggestVarOrType_BuiltInTypes + + + internal static class JsonHelpers + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsInRangeInclusive(int value, int lowerBound, int upperBound) => + (uint)(value - lowerBound) <= (uint)(upperBound - lowerBound); + + public static bool IsDigit(byte value) => (uint)(value - '0') <= '9' - '0'; + + [StructLayout(LayoutKind.Auto)] + private struct DateTimeParseData + { + public int Year; + public int Month; + public int Day; + public bool IsCalendarDateOnly; + public int Hour; + public int Minute; + public int Second; + public int Fraction; // This value should never be greater than 9_999_999. + public int OffsetHours; + public int OffsetMinutes; + + // ReSharper disable once NotAccessedField.Local + public byte OffsetToken; + } + + public static bool TryParseAsIso(ReadOnlySpan source, out DateOnly value) + { + if ( + TryParseDateTimeOffset(source, out DateTimeParseData parseData) + && parseData.IsCalendarDateOnly + && TryCreateDateTime(parseData, DateTimeKind.Unspecified, out DateTime dateTime) + ) + { + value = DateOnly.FromDateTime(dateTime); + return true; + } + + value = default; + return false; + } + + /// + /// ISO 8601 date time parser (ISO 8601-1:2019). + /// + /// The date/time to parse in UTF-8 format. + /// The parsed for the given . + /// + /// Supports extended calendar date (5.2.2.1) and complete (5.4.2.1) calendar date/time of day + /// representations with optional specification of seconds and fractional seconds. + /// + /// Times can be explicitly specified as UTC ("Z" - 5.3.3) or offsets from UTC ("+/-hh:mm" 5.3.4.2). + /// If unspecified they are considered to be local per spec. + /// + /// Examples: (TZD is either "Z" or hh:mm offset from UTC) + /// + /// YYYY-MM-DD (e.g. 1997-07-16) + /// YYYY-MM-DDThh:mm (e.g. 1997-07-16T19:20) + /// YYYY-MM-DDThh:mm:ss (e.g. 1997-07-16T19:20:30) + /// YYYY-MM-DDThh:mm:ss.s (e.g. 1997-07-16T19:20:30.45) + /// YYYY-MM-DDThh:mmTZD (e.g. 1997-07-16T19:20+01:00) + /// YYYY-MM-DDThh:mm:ssTZD (e.g. 1997-07-16T19:20:3001:00) + /// YYYY-MM-DDThh:mm:ss.sTZD (e.g. 1997-07-16T19:20:30.45Z) + /// + /// Generally speaking we always require the "extended" option when one exists (3.1.3.5). + /// The extended variants have separator characters between components ('-', ':', '.', etc.). + /// Spaces are not permitted. + /// + /// "true" if successfully parsed. + private static bool TryParseDateTimeOffset( + ReadOnlySpan source, + out DateTimeParseData parseData + ) + { + parseData = default; + + // too short datetime + Debug.Assert(source.Length >= 10); + + // Parse the calendar date + // ----------------------- + // ISO 8601-1:2019 5.2.2.1b "Calendar date complete extended format" + // [dateX] = [year]["-"][month]["-"][day] + // [year] = [YYYY] [0000 - 9999] (4.3.2) + // [month] = [MM] [01 - 12] (4.3.3) + // [day] = [DD] [01 - 28, 29, 30, 31] (4.3.4) + // + // Note: 5.2.2.2 "Representations with reduced precision" allows for + // just [year]["-"][month] (a) and just [year] (b), but we currently + // don't permit it. + + { + uint digit1 = source[0] - (uint)'0'; + uint digit2 = source[1] - (uint)'0'; + uint digit3 = source[2] - (uint)'0'; + uint digit4 = source[3] - (uint)'0'; + + if (digit1 > 9 || digit2 > 9 || digit3 > 9 || digit4 > 9) + { + return false; + } + + parseData.Year = (int)(digit1 * 1000 + digit2 * 100 + digit3 * 10 + digit4); + } + + if ( + source[4] != JsonConstants.Hyphen + || !TryGetNextTwoDigits(source.Slice(start: 5, length: 2), ref parseData.Month) + || source[7] != JsonConstants.Hyphen + || !TryGetNextTwoDigits(source.Slice(start: 8, length: 2), ref parseData.Day) + ) + { + return false; + } + + // We now have YYYY-MM-DD [dateX] + // ReSharper disable once ConvertIfStatementToSwitchStatement + if (source.Length == 10) + { + parseData.IsCalendarDateOnly = true; + return true; + } + + // Parse the time of day + // --------------------- + // + // ISO 8601-1:2019 5.3.1.2b "Local time of day complete extended format" + // [timeX] = ["T"][hour][":"][min][":"][sec] + // [hour] = [hh] [00 - 23] (4.3.8a) + // [minute] = [mm] [00 - 59] (4.3.9a) + // [sec] = [ss] [00 - 59, 60 with a leap second] (4.3.10a) + // + // ISO 8601-1:2019 5.3.3 "UTC of day" + // [timeX]["Z"] + // + // ISO 8601-1:2019 5.3.4.2 "Local time of day with the time shift between + // local timescale and UTC" (Extended format) + // + // [shiftX] = ["+"|"-"][hour][":"][min] + // + // Notes: + // + // "T" is optional per spec, but _only_ when times are used alone. In our + // case, we're reading out a complete date & time and as such require "T". + // (5.4.2.1b). + // + // For [timeX] We allow seconds to be omitted per 5.3.1.3a "Representations + // with reduced precision". 5.3.1.3b allows just specifying the hour, but + // we currently don't permit this. + // + // Decimal fractions are allowed for hours, minutes and seconds (5.3.14). + // We only allow fractions for seconds currently. Lower order components + // can't follow, i.e. you can have T23.3, but not T23.3:04. There must be + // one digit, but the max number of digits is implementation defined. We + // currently allow up to 16 digits of fractional seconds only. While we + // support 16 fractional digits we only parse the first seven, anything + // past that is considered a zero. This is to stay compatible with the + // DateTime implementation which is limited to this resolution. + + if (source.Length < 16) + { + // Source does not have enough characters for YYYY-MM-DDThh:mm + return false; + } + + // Parse THH:MM (e.g. "T10:32") + if ( + source[10] != JsonConstants.TimePrefix + || source[13] != JsonConstants.Colon + || !TryGetNextTwoDigits(source.Slice(start: 11, length: 2), ref parseData.Hour) + || !TryGetNextTwoDigits(source.Slice(start: 14, length: 2), ref parseData.Minute) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm + Debug.Assert(source.Length >= 16); + if (source.Length == 16) + { + return true; + } + + byte curByte = source[16]; + int sourceIndex = 17; + + // Either a TZD ['Z'|'+'|'-'] or a seconds separator [':'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + case JsonConstants.Colon: + break; + default: + return false; + } + + // Try reading the seconds + if ( + source.Length < 19 + || !TryGetNextTwoDigits(source.Slice(start: 17, length: 2), ref parseData.Second) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm:ss + Debug.Assert(source.Length >= 19); + if (source.Length == 19) + { + return true; + } + + curByte = source[19]; + sourceIndex = 20; + + // Either a TZD ['Z'|'+'|'-'] or a seconds decimal fraction separator ['.'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + case JsonConstants.Period: + break; + default: + return false; + } + + // Source does not have enough characters for second fractions (i.e. ".s") + // YYYY-MM-DDThh:mm:ss.s + if (source.Length < 21) + { + return false; + } + + // Parse fraction. This value should never be greater than 9_999_999 + int numDigitsRead = 0; + int fractionEnd = Math.Min( + sourceIndex + JsonConstants.DateTimeParseNumFractionDigits, + source.Length + ); + + while (sourceIndex < fractionEnd && IsDigit(curByte = source[sourceIndex])) + { + if (numDigitsRead < JsonConstants.DateTimeNumFractionDigits) + { + parseData.Fraction = parseData.Fraction * 10 + (int)(curByte - (uint)'0'); + numDigitsRead++; + } + + sourceIndex++; + } + + if (parseData.Fraction != 0) + { + while (numDigitsRead < JsonConstants.DateTimeNumFractionDigits) + { + parseData.Fraction *= 10; + numDigitsRead++; + } + } + + // We now have YYYY-MM-DDThh:mm:ss.s + Debug.Assert(sourceIndex <= source.Length); + if (sourceIndex == source.Length) + { + return true; + } + + curByte = source[sourceIndex++]; + + // TZD ['Z'|'+'|'-'] is valid at this point + switch (curByte) + { + case JsonConstants.UtcOffsetToken: + parseData.OffsetToken = JsonConstants.UtcOffsetToken; + return sourceIndex == source.Length; + case JsonConstants.Plus: + case JsonConstants.Hyphen: + parseData.OffsetToken = curByte; + return ParseOffset(ref parseData, source.Slice(sourceIndex)); + default: + return false; + } + + static bool ParseOffset(ref DateTimeParseData parseData, ReadOnlySpan offsetData) + { + // Parse the hours for the offset + if ( + offsetData.Length < 2 + || !TryGetNextTwoDigits(offsetData.Slice(0, 2), ref parseData.OffsetHours) + ) + { + return false; + } + + // We now have YYYY-MM-DDThh:mm:ss.s+|-hh + + if (offsetData.Length == 2) + { + // Just hours offset specified + return true; + } + + // Ensure we have enough for ":mm" + return offsetData.Length == 5 + && offsetData[2] == JsonConstants.Colon + && TryGetNextTwoDigits(offsetData.Slice(3), ref parseData.OffsetMinutes); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + // ReSharper disable once RedundantAssignment + private static bool TryGetNextTwoDigits(ReadOnlySpan source, ref int value) + { + Debug.Assert(source.Length == 2); + + uint digit1 = source[0] - (uint)'0'; + uint digit2 = source[1] - (uint)'0'; + + if (digit1 > 9 || digit2 > 9) + { + value = 0; + return false; + } + + value = (int)(digit1 * 10 + digit2); + return true; + } + + // The following methods are borrowed verbatim from src/Common/src/CoreLib/System/Buffers/Text/Utf8Parser/Utf8Parser.Date.Helpers.cs + + /// + /// Overflow-safe DateTime factory. + /// + private static bool TryCreateDateTime( + DateTimeParseData parseData, + DateTimeKind kind, + out DateTime value + ) + { + if (parseData.Year == 0) + { + value = default; + return false; + } + + Debug.Assert(parseData.Year <= 9999); // All of our callers to date parse the year from fixed 4-digit fields so this value is trusted. + + if ((uint)parseData.Month - 1 >= 12) + { + value = default; + return false; + } + + uint dayMinusOne = (uint)parseData.Day - 1; + if ( + dayMinusOne >= 28 + && dayMinusOne >= DateTime.DaysInMonth(parseData.Year, parseData.Month) + ) + { + value = default; + return false; + } + + if ((uint)parseData.Hour > 23) + { + value = default; + return false; + } + + if ((uint)parseData.Minute > 59) + { + value = default; + return false; + } + + // This needs to allow leap seconds when appropriate. + // See https://github.com/dotnet/runtime/issues/30135. + if ((uint)parseData.Second > 59) + { + value = default; + return false; + } + + Debug.Assert(parseData.Fraction is >= 0 and <= JsonConstants.MaxDateTimeFraction); // All of our callers to date parse the fraction from fixed 7-digit fields so this value is trusted. + + ReadOnlySpan days = DateTime.IsLeapYear(parseData.Year) + ? DaysToMonth366 + : DaysToMonth365; + int yearMinusOne = parseData.Year - 1; + int totalDays = + yearMinusOne * 365 + + yearMinusOne / 4 + - yearMinusOne / 100 + + yearMinusOne / 400 + + days[parseData.Month - 1] + + parseData.Day + - 1; + long ticks = totalDays * TimeSpan.TicksPerDay; + int totalSeconds = parseData.Hour * 3600 + parseData.Minute * 60 + parseData.Second; + ticks += totalSeconds * TimeSpan.TicksPerSecond; + ticks += parseData.Fraction; + value = new DateTime(ticks: ticks, kind: kind); + return true; + } + + private static ReadOnlySpan DaysToMonth365 => + [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; + private static ReadOnlySpan DaysToMonth366 => + [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366]; + } + + internal static class ThrowHelper + { + private const string ExceptionSourceValueToRethrowAsJsonException = + "System.Text.Json.Rethrowable"; + + [DoesNotReturn] + public static void ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType) + { + throw GetInvalidOperationException("string", tokenType); + } + + public static void ThrowFormatException(DataType dataType) + { + throw new FormatException(SR.Format(SR.UnsupportedFormat, dataType)) + { + Source = ExceptionSourceValueToRethrowAsJsonException, + }; + } + + private static Exception GetInvalidOperationException( + string message, + JsonTokenType tokenType + ) + { + return GetInvalidOperationException(SR.Format(SR.InvalidCast, tokenType, message)); + } + + private static InvalidOperationException GetInvalidOperationException(string message) + { + return new InvalidOperationException(message) + { + Source = ExceptionSourceValueToRethrowAsJsonException, + }; + } + } + + internal static class Utf8JsonReaderExtensions + { + internal static int ValueLength(this Utf8JsonReader reader) => + reader.HasValueSequence + ? checked((int)reader.ValueSequence.Length) + : reader.ValueSpan.Length; + } + + internal enum DataType + { + TimeOnly, + DateOnly, + } + + [SuppressMessage("ReSharper", "InconsistentNaming")] + internal static class SR + { + private static readonly bool s_usingResourceKeys = + AppContext.TryGetSwitch( + "System.Resources.UseSystemResourceKeys", + out bool usingResourceKeys + ) && usingResourceKeys; + + public static string UnsupportedFormat => Strings.UnsupportedFormat; + + public static string InvalidCast => Strings.InvalidCast; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static string Format(string resourceFormat, object? p1) => + s_usingResourceKeys + ? string.Join(", ", resourceFormat, p1) + : string.Format(resourceFormat, p1); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static string Format(string resourceFormat, object? p1, object? p2) => + s_usingResourceKeys + ? string.Join(", ", resourceFormat, p1, p2) + : string.Format(resourceFormat, p1, p2); + } + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute( + "System.Resources.Tools.StronglyTypedResourceBuilder", + "17.0.0.0" + )] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Strings + { + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( + "Microsoft.Performance", + "CA1811:AvoidUncalledPrivateCode" + )] + internal Strings() { } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute( + global::System.ComponentModel.EditorBrowsableState.Advanced + )] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = + new global::System.Resources.ResourceManager( + "System.Text.Json.Resources.Strings", + typeof(Strings).Assembly + ); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute( + global::System.ComponentModel.EditorBrowsableState.Advanced + )] + internal static global::System.Globalization.CultureInfo Culture + { + get { return resourceCulture; } + set { resourceCulture = value; } + } + + /// + /// Looks up a localized string similar to Cannot get the value of a token type '{0}' as a {1}.. + /// + internal static string InvalidCast + { + get { return ResourceManager.GetString("InvalidCast", resourceCulture); } + } + + /// + /// Looks up a localized string similar to The JSON value is not in a supported {0} format.. + /// + internal static string UnsupportedFormat + { + get { return ResourceManager.GetString("UnsupportedFormat", resourceCulture); } + } + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/DateTimeSerializer.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/DateTimeSerializer.cs new file mode 100644 index 00000000000..012896874fd --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/DateTimeSerializer.cs @@ -0,0 +1,22 @@ +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedPathParameters.Core; + +internal class DateTimeSerializer : JsonConverter +{ + public override DateTime Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + return DateTime.Parse(reader.GetString()!, null, DateTimeStyles.RoundtripKind); + } + + public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) + { + writer.WriteStringValue(value.ToString(Constants.DateTimeFormat)); + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/EnumSerializer.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/EnumSerializer.cs new file mode 100644 index 00000000000..d8c219f4d55 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/EnumSerializer.cs @@ -0,0 +1,53 @@ +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedPathParameters.Core; + +internal class EnumSerializer : JsonConverter + where TEnum : struct, Enum +{ + private readonly Dictionary _enumToString = new(); + private readonly Dictionary _stringToEnum = new(); + + public EnumSerializer() + { + var type = typeof(TEnum); + var values = Enum.GetValues(type); + + foreach (var value in values) + { + var enumValue = (TEnum)value; + var enumMember = type.GetField(enumValue.ToString())!; + var attr = enumMember + .GetCustomAttributes(typeof(EnumMemberAttribute), false) + .Cast() + .FirstOrDefault(); + + var stringValue = + attr?.Value + ?? value.ToString() + ?? throw new Exception("Unexpected null enum toString value"); + + _enumToString.Add(enumValue, stringValue); + _stringToEnum.Add(stringValue, enumValue); + } + } + + public override TEnum Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new Exception("The JSON value could not be read as a string."); + return _stringToEnum.TryGetValue(stringValue, out var enumValue) ? enumValue : default; + } + + public override void Write(Utf8JsonWriter writer, TEnum value, JsonSerializerOptions options) + { + writer.WriteStringValue(_enumToString[value]); + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Extensions.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Extensions.cs new file mode 100644 index 00000000000..4d1dc541820 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Extensions.cs @@ -0,0 +1,14 @@ +using System.Runtime.Serialization; + +namespace SeedPathParameters.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/path-parameters/no-custom-config/src/SeedPathParameters/Core/HeaderValue.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/HeaderValue.cs new file mode 100644 index 00000000000..a8ecd710806 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/HeaderValue.cs @@ -0,0 +1,17 @@ +using OneOf; + +namespace SeedPathParameters.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/path-parameters/no-custom-config/src/SeedPathParameters/Core/Headers.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Headers.cs new file mode 100644 index 00000000000..ed96fa26787 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Headers.cs @@ -0,0 +1,17 @@ +namespace SeedPathParameters.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/path-parameters/no-custom-config/src/SeedPathParameters/Core/HttpMethodExtensions.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/HttpMethodExtensions.cs new file mode 100644 index 00000000000..b65c14f1765 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/HttpMethodExtensions.cs @@ -0,0 +1,8 @@ +using System.Net.Http; + +namespace SeedPathParameters.Core; + +internal static class HttpMethodExtensions +{ + public static readonly HttpMethod Patch = new("PATCH"); +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/IRequestOptions.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/IRequestOptions.cs new file mode 100644 index 00000000000..e613aff3a39 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/IRequestOptions.cs @@ -0,0 +1,32 @@ +using System; +using System.Net.Http; + +namespace SeedPathParameters.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/path-parameters/no-custom-config/src/SeedPathParameters/Core/JsonConfiguration.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/JsonConfiguration.cs new file mode 100644 index 00000000000..4092c69538f --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/JsonConfiguration.cs @@ -0,0 +1,49 @@ +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace SeedPathParameters.Core; + +internal static partial class JsonOptions +{ + public static readonly JsonSerializerOptions JsonSerializerOptions; + + static JsonOptions() + { + var options = new JsonSerializerOptions + { + Converters = + { + new DateTimeSerializer(), +#if USE_PORTABLE_DATE_ONLY + new DateOnlyConverter(), +#endif + 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 string SerializeAsString(T obj) + { + var json = JsonSerializer.Serialize(obj, JsonOptions.JsonSerializerOptions); + return json.Trim('"'); + } + + public static T Deserialize(string json) + { + return JsonSerializer.Deserialize(json, JsonOptions.JsonSerializerOptions)!; + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/OneOfSerializer.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/OneOfSerializer.cs new file mode 100644 index 00000000000..cf670ab637b --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/OneOfSerializer.cs @@ -0,0 +1,91 @@ +using System.Reflection; +using System.Text.Json; +using System.Text.Json.Serialization; +using OneOf; + +namespace SeedPathParameters.Core; + +internal class OneOfSerializer : JsonConverter +{ + public override IOneOf? Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + if (reader.TokenType is JsonTokenType.Null) + return default; + + foreach (var (type, cast) in GetOneOfTypes(typeToConvert)) + { + try + { + var readerCopy = reader; + var result = JsonSerializer.Deserialize(ref readerCopy, type, options); + reader.Skip(); + return (IOneOf)cast.Invoke(null, [result])!; + } + catch (JsonException) { } + } + + throw new JsonException( + $"Cannot deserialize into one of the supported types for {typeToConvert}" + ); + } + + public override void Write(Utf8JsonWriter writer, IOneOf value, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, value.Value, options); + } + + private static (global::System.Type type, MethodInfo cast)[] GetOneOfTypes( + global::System.Type typeToConvert + ) + { + var type = typeToConvert; + if (Nullable.GetUnderlyingType(type) is { } underlyingType) + { + type = underlyingType; + } + + var casts = type.GetRuntimeMethods() + .Where(m => m.IsSpecialName && m.Name == "op_Implicit") + .ToArray(); + while (type != null) + { + if ( + type.IsGenericType + && (type.Name.StartsWith("OneOf`") || type.Name.StartsWith("OneOfBase`")) + ) + { + var genericArguments = type.GetGenericArguments(); + if (genericArguments.Length == 1) + { + return [(genericArguments[0], casts[0])]; + } + + // if object type is present, make sure it is last + var indexOfObjectType = Array.IndexOf(genericArguments, typeof(object)); + if (indexOfObjectType != -1 && genericArguments.Length - 1 != indexOfObjectType) + { + genericArguments = genericArguments + .OrderBy(t => t == typeof(object) ? 1 : 0) + .ToArray(); + } + + return genericArguments + .Select(t => (t, casts.First(c => c.GetParameters()[0].ParameterType == t))) + .ToArray(); + } + + type = type.BaseType; + } + + throw new InvalidOperationException($"{type} isn't OneOf or OneOfBase"); + } + + public override bool CanConvert(global::System.Type typeToConvert) + { + return typeof(IOneOf).IsAssignableFrom(typeToConvert); + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/ClientOptions.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/ClientOptions.cs new file mode 100644 index 00000000000..d46623dedac --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/ClientOptions.cs @@ -0,0 +1,48 @@ +using System; +using System.Net.Http; +using SeedPathParameters.Core; + +namespace SeedPathParameters; + +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/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/RequestOptions.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/RequestOptions.cs new file mode 100644 index 00000000000..e4970d7d043 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/RequestOptions.cs @@ -0,0 +1,33 @@ +using System; +using System.Net.Http; +using SeedPathParameters.Core; + +namespace SeedPathParameters; + +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/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/SeedPathParametersApiException.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/SeedPathParametersApiException.cs new file mode 100644 index 00000000000..cf73d9b109b --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/SeedPathParametersApiException.cs @@ -0,0 +1,18 @@ +namespace SeedPathParameters; + +/// +/// This exception type will be thrown for any non-2XX API responses. +/// +public class SeedPathParametersApiException(string message, int statusCode, object body) + : SeedPathParametersException(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/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/SeedPathParametersException.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/SeedPathParametersException.cs new file mode 100644 index 00000000000..53fea161ad6 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/SeedPathParametersException.cs @@ -0,0 +1,9 @@ +using System; + +namespace SeedPathParameters; + +/// +/// Base exception class for all exceptions thrown by the SDK. +/// +public class SeedPathParametersException(string message, Exception? innerException = null) + : Exception(message, innerException); diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/Version.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/Version.cs new file mode 100644 index 00000000000..82ce383c0e7 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/Public/Version.cs @@ -0,0 +1,6 @@ +namespace SeedPathParameters; + +internal class Version +{ + public const string Current = "0.0.1"; +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/RawClient.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/RawClient.cs new file mode 100644 index 00000000000..53f89529ebc --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Core/RawClient.cs @@ -0,0 +1,196 @@ +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading; +using SystemTask = System.Threading.Tasks.Task; + +namespace SeedPathParameters.Core; + +/// +/// Utility class for making raw HTTP requests to the API. +/// +internal class RawClient(ClientOptions clientOptions) +{ + private const int MaxRetryDelayMs = 60000; + internal int BaseRetryDelay { get; set; } = 1000; + + /// + /// 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).ConfigureAwait(false); + } + + 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) + .ConfigureAwait(false); + for (var i = 0; i < maxRetries; i++) + { + if (!ShouldRetry(response)) + { + break; + } + var delayMs = Math.Min(BaseRetryDelay * (int)Math.Pow(2, i), MaxRetryDelayMs); + await SystemTask.Delay(delayMs, cancellationToken).ConfigureAwait(false); + response = await httpClient + .SendAsync(BuildHttpRequest(request), cancellationToken) + .ConfigureAwait(false); + } + 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 global::System.Collections.IEnumerable collection + and not string + ) + { + var items = collection + .Cast() + .Select(value => $"{queryItem.Key}={value}") + .ToList(); + if (items.Any()) + { + current += string.Join("&", items) + "&"; + } + } + else + { + current += $"{queryItem.Key}={queryItem.Value}&"; + } + return current; + } + ); + url = url[..^1]; + return url; + } + + private static 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/path-parameters/src/SeedPathParameters/Organizations/OrganizationsClient.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Organizations/OrganizationsClient.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Organizations/OrganizationsClient.cs rename to seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Organizations/OrganizationsClient.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/Organizations/Requests/GetOrganizationUserRequest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Organizations/Requests/GetOrganizationUserRequest.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/Organizations/Requests/GetOrganizationUserRequest.cs rename to seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Organizations/Requests/GetOrganizationUserRequest.cs diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Organizations/Requests/SearchOrganizationsRequest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Organizations/Requests/SearchOrganizationsRequest.cs new file mode 100644 index 00000000000..578f4d3f6e5 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Organizations/Requests/SearchOrganizationsRequest.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Serialization; +using SeedPathParameters.Core; + +namespace SeedPathParameters; + +public record SearchOrganizationsRequest +{ + [JsonIgnore] + public int? Limit { get; set; } + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Organizations/Types/Organization.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Organizations/Types/Organization.cs new file mode 100644 index 00000000000..8eef830d388 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/Organizations/Types/Organization.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; +using SeedPathParameters.Core; + +namespace SeedPathParameters; + +public record Organization +{ + [JsonPropertyName("name")] + public required string Name { get; set; } + + [JsonPropertyName("tags")] + public IEnumerable Tags { get; set; } = new List(); + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParameters.Custom.props b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParameters.Custom.props new file mode 100644 index 00000000000..70df2849401 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParameters.Custom.props @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParameters.csproj b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParameters.csproj new file mode 100644 index 00000000000..a30f0524a30 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParameters.csproj @@ -0,0 +1,53 @@ + + + + net462;net8.0;net7.0;net6.0;netstandard2.0 + enable + 12 + enable + 0.0.1 + $(Version) + $(Version) + README.md + https://github.com/path-parameters/fern + true + + + + false + + + $(DefineConstants);USE_PORTABLE_DATE_ONLY + true + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + + + + <_Parameter1>SeedPathParameters.Test + + + + + diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParametersClient.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParametersClient.cs new file mode 100644 index 00000000000..110d9d7453e --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/SeedPathParametersClient.cs @@ -0,0 +1,36 @@ +using SeedPathParameters.Core; + +namespace SeedPathParameters; + +public partial class SeedPathParametersClient +{ + private readonly RawClient _client; + + public SeedPathParametersClient(ClientOptions? clientOptions = null) + { + var defaultHeaders = new Headers( + new Dictionary() + { + { "X-Fern-Language", "C#" }, + { "X-Fern-SDK-Name", "SeedPathParameters" }, + { "X-Fern-SDK-Version", Version.Current }, + { "User-Agent", "Fernpath-parameters/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); + Organizations = new OrganizationsClient(_client); + User = new UserClient(_client); + } + + public OrganizationsClient Organizations { get; init; } + + public UserClient User { get; init; } +} diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/User/Requests/GetUsersRequest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/Requests/GetUsersRequest.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/User/Requests/GetUsersRequest.cs rename to seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/Requests/GetUsersRequest.cs diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/User/Requests/SearchUsersRequest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/Requests/SearchUsersRequest.cs similarity index 80% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/User/Requests/SearchUsersRequest.cs rename to seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/Requests/SearchUsersRequest.cs index afce355961c..4f7a8b31673 100644 --- a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/User/Requests/SearchUsersRequest.cs +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/Requests/SearchUsersRequest.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedPathParameters.Core; namespace SeedPathParameters; public record SearchUsersRequest { + [JsonIgnore] public int? Limit { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/User/Requests/UpdateUserRequest.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/Requests/UpdateUserRequest.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/User/Requests/UpdateUserRequest.cs rename to seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/Requests/UpdateUserRequest.cs diff --git a/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/Types/User.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/Types/User.cs new file mode 100644 index 00000000000..35651b59fc0 --- /dev/null +++ b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/Types/User.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; +using SeedPathParameters.Core; + +namespace SeedPathParameters; + +public record User +{ + [JsonPropertyName("name")] + public required string Name { get; set; } + + [JsonPropertyName("tags")] + public IEnumerable Tags { get; set; } = new List(); + + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/seed/csharp-sdk/path-parameters/src/SeedPathParameters/User/UserClient.cs b/seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/UserClient.cs similarity index 100% rename from seed/csharp-sdk/path-parameters/src/SeedPathParameters/User/UserClient.cs rename to seed/csharp-sdk/path-parameters/no-custom-config/src/SeedPathParameters/User/UserClient.cs diff --git a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/User/Requests/GetUsersRequest.cs b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/User/Requests/GetUsersRequest.cs index 9fdb6e51d40..2c421f42d68 100644 --- a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/User/Requests/GetUsersRequest.cs +++ b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/User/Requests/GetUsersRequest.cs @@ -1,35 +1,50 @@ +using System.Text.Json.Serialization; using SeedQueryParameters.Core; namespace SeedQueryParameters; public record GetUsersRequest { + [JsonIgnore] public required int Limit { get; set; } + [JsonIgnore] public required string Id { get; set; } + [JsonIgnore] public required DateOnly Date { get; set; } + [JsonIgnore] public required DateTime Deadline { get; set; } + [JsonIgnore] public required string Bytes { get; set; } + [JsonIgnore] public required User User { get; set; } + [JsonIgnore] public IEnumerable UserList { get; set; } = new List(); + [JsonIgnore] public DateTime? OptionalDeadline { get; set; } + [JsonIgnore] public Dictionary KeyValue { get; set; } = new Dictionary(); + [JsonIgnore] public string? OptionalString { get; set; } + [JsonIgnore] public required NestedUser NestedUser { get; set; } + [JsonIgnore] public User? OptionalUser { get; set; } + [JsonIgnore] public IEnumerable ExcludeUser { get; set; } = new List(); + [JsonIgnore] public IEnumerable Filter { get; set; } = new List(); public override string ToString() diff --git a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Package/Requests/TestRequest.cs b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Package/Requests/TestRequest.cs index 0f5659fafb2..2382b2e1610 100644 --- a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Package/Requests/TestRequest.cs +++ b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Package/Requests/TestRequest.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedNurseryApi.Core; namespace SeedNurseryApi; public record TestRequest { + [JsonIgnore] public required string For { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/seed.yml b/seed/csharp-sdk/seed.yml index 36becc2d826..9d8f40c3dc4 100644 --- a/seed/csharp-sdk/seed.yml +++ b/seed/csharp-sdk/seed.yml @@ -93,6 +93,12 @@ fixtures: - customConfig: simplify-object-dictionaries: false outputFolder: no-simplify-object-dictionaries + path-parameters: + - customConfig: null + outputFolder: no-custom-config + - customConfig: + inline-path-parameters: true + outputFolder: inline-path-parameters grpc-proto-exhaustive: - customConfig: null outputFolder: no-custom-config diff --git a/seed/csharp-sdk/trace/src/SeedTrace/Migration/Requests/GetAttemptedMigrationsRequest.cs b/seed/csharp-sdk/trace/src/SeedTrace/Migration/Requests/GetAttemptedMigrationsRequest.cs index 5e931dda564..3e153a5e9d0 100644 --- a/seed/csharp-sdk/trace/src/SeedTrace/Migration/Requests/GetAttemptedMigrationsRequest.cs +++ b/seed/csharp-sdk/trace/src/SeedTrace/Migration/Requests/GetAttemptedMigrationsRequest.cs @@ -1,9 +1,11 @@ +using System.Text.Json.Serialization; using SeedTrace.Core; namespace SeedTrace; public record GetAttemptedMigrationsRequest { + [JsonIgnore] public required string AdminKeyHeader { get; set; } public override string ToString() diff --git a/seed/csharp-sdk/trace/src/SeedTrace/Playlist/Requests/CreatePlaylistRequest.cs b/seed/csharp-sdk/trace/src/SeedTrace/Playlist/Requests/CreatePlaylistRequest.cs index 6a9142c47fb..ff47ed6b14d 100644 --- a/seed/csharp-sdk/trace/src/SeedTrace/Playlist/Requests/CreatePlaylistRequest.cs +++ b/seed/csharp-sdk/trace/src/SeedTrace/Playlist/Requests/CreatePlaylistRequest.cs @@ -1,11 +1,14 @@ +using System.Text.Json.Serialization; using SeedTrace.Core; namespace SeedTrace; public record CreatePlaylistRequest { + [JsonIgnore] public required DateTime Datetime { get; set; } + [JsonIgnore] public DateTime? OptionalDatetime { get; set; } public required PlaylistCreateRequest Body { get; set; } diff --git a/seed/csharp-sdk/trace/src/SeedTrace/Playlist/Requests/GetPlaylistsRequest.cs b/seed/csharp-sdk/trace/src/SeedTrace/Playlist/Requests/GetPlaylistsRequest.cs index 0c73cd0ff84..4cdbc269038 100644 --- a/seed/csharp-sdk/trace/src/SeedTrace/Playlist/Requests/GetPlaylistsRequest.cs +++ b/seed/csharp-sdk/trace/src/SeedTrace/Playlist/Requests/GetPlaylistsRequest.cs @@ -1,24 +1,30 @@ +using System.Text.Json.Serialization; using SeedTrace.Core; namespace SeedTrace; public record GetPlaylistsRequest { + [JsonIgnore] public int? Limit { get; set; } /// /// i'm another field /// + [JsonIgnore] public required string OtherField { get; set; } /// /// I'm a multiline /// description /// + [JsonIgnore] public required string MultiLineDocs { get; set; } + [JsonIgnore] public IEnumerable OptionalMultipleField { get; set; } = new List(); + [JsonIgnore] public IEnumerable MultipleField { get; set; } = new List(); public override string ToString() diff --git a/seed/csharp-sdk/validation/src/SeedValidation/Requests/GetRequest.cs b/seed/csharp-sdk/validation/src/SeedValidation/Requests/GetRequest.cs index f9db14c1f3d..245de237cf2 100644 --- a/seed/csharp-sdk/validation/src/SeedValidation/Requests/GetRequest.cs +++ b/seed/csharp-sdk/validation/src/SeedValidation/Requests/GetRequest.cs @@ -1,13 +1,17 @@ +using System.Text.Json.Serialization; using SeedValidation.Core; namespace SeedValidation; public record GetRequest { + [JsonIgnore] public required double Decimal { get; set; } + [JsonIgnore] public required int Even { get; set; } + [JsonIgnore] public required string Name { get; set; } public override string ToString()