From 4c0a159712fc5e7954b3d12f7175ba24d829e603 Mon Sep 17 00:00:00 2001 From: Dan Burke Date: Thu, 25 Jul 2024 16:36:40 -0400 Subject: [PATCH] c#, improvement: Add header suppliers to `RawClient` constructor parameters (#4119) --- .../codegen/src/asIs/RawClient.Template.cs | 11 +++++++++- generators/csharp/sdk/CHANGELOG.md | 16 +++++++++----- .../src/root-client/RootClientGenerator.ts | 15 +++++++++++++ seed/csharp-sdk/alias/.gitignore | 9 +++++++- seed/csharp-sdk/alias/snippet-templates.json | 0 seed/csharp-sdk/alias/snippet.json | 0 .../alias/src/SeedAlias/Core/RawClient.cs | 11 +++++++++- .../alias/src/SeedAlias/SeedAliasClient.cs | 2 ++ seed/csharp-sdk/api-wide-base-path/.gitignore | 9 +++++++- .../api-wide-base-path/snippet-templates.json | 0 .../api-wide-base-path/snippet.json | 0 .../src/SeedApiWideBasePath/Core/RawClient.cs | 11 +++++++++- .../SeedApiWideBasePathClient.cs | 2 ++ seed/csharp-sdk/audiences/.gitignore | 9 +++++++- .../audiences/snippet-templates.json | 0 seed/csharp-sdk/audiences/snippet.json | 0 .../src/SeedAudiences/Core/RawClient.cs | 11 +++++++++- .../src/SeedAudiences/SeedAudiencesClient.cs | 2 ++ .../auth-environment-variables/.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../auth-environment-variables/snippet.json | 0 .../Core/RawClient.cs | 11 +++++++++- .../SeedAuthEnvironmentVariablesClient.cs | 2 ++ .../.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../snippet.json | 0 .../Core/RawClient.cs | 11 +++++++++- ...SeedBasicAuthEnvironmentVariablesClient.cs | 2 ++ seed/csharp-sdk/basic-auth/.gitignore | 9 +++++++- .../basic-auth/snippet-templates.json | 0 seed/csharp-sdk/basic-auth/snippet.json | 0 .../src/SeedBasicAuth/Core/RawClient.cs | 11 +++++++++- .../src/SeedBasicAuth/SeedBasicAuthClient.cs | 2 ++ .../.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../snippet.json | 0 .../Core/RawClient.cs | 11 +++++++++- ...eedBearerTokenEnvironmentVariableClient.cs | 2 ++ seed/csharp-sdk/bytes/.gitignore | 9 +++++++- seed/csharp-sdk/bytes/snippet-templates.json | 0 seed/csharp-sdk/bytes/snippet.json | 0 .../bytes/src/SeedBytes/Core/RawClient.cs | 11 +++++++++- .../bytes/src/SeedBytes/SeedBytesClient.cs | 2 ++ .../circular-references-advanced/.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../circular-references-advanced/snippet.json | 0 .../src/SeedApi/Core/RawClient.cs | 11 +++++++++- .../src/SeedApi/SeedApiClient.cs | 2 ++ .../csharp-sdk/circular-references/.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../circular-references/snippet.json | 0 .../src/SeedApi/Core/RawClient.cs | 11 +++++++++- .../src/SeedApi/SeedApiClient.cs | 2 ++ seed/csharp-sdk/code-samples/.gitignore | 9 +++++++- .../code-samples/snippet-templates.json | 0 seed/csharp-sdk/code-samples/snippet.json | 0 .../src/SeedCodeSamples/Core/RawClient.cs | 11 +++++++++- .../SeedCodeSamples/SeedCodeSamplesClient.cs | 2 ++ seed/csharp-sdk/custom-auth/.gitignore | 9 +++++++- .../custom-auth/snippet-templates.json | 0 seed/csharp-sdk/custom-auth/snippet.json | 0 .../src/SeedCustomAuth/Core/RawClient.cs | 11 +++++++++- .../SeedCustomAuth/SeedCustomAuthClient.cs | 2 ++ seed/csharp-sdk/enum/.gitignore | 9 +++++++- seed/csharp-sdk/enum/snippet-templates.json | 0 seed/csharp-sdk/enum/snippet.json | 0 .../enum/src/SeedEnum/Core/RawClient.cs | 11 +++++++++- .../enum/src/SeedEnum/SeedEnumClient.cs | 2 ++ seed/csharp-sdk/error-property/.gitignore | 9 +++++++- .../error-property/snippet-templates.json | 0 seed/csharp-sdk/error-property/snippet.json | 0 .../src/SeedErrorProperty/Core/RawClient.cs | 11 +++++++++- .../SeedErrorPropertyClient.cs | 2 ++ seed/csharp-sdk/examples/.gitignore | 9 +++++++- .../examples/snippet-templates.json | 0 seed/csharp-sdk/examples/snippet.json | 0 .../src/SeedExamples/Core/RawClient.cs | 11 +++++++++- .../src/SeedExamples/SeedExamplesClient.cs | 2 ++ seed/csharp-sdk/exhaustive/.gitignore | 9 +++++++- .../exhaustive/snippet-templates.json | 0 seed/csharp-sdk/exhaustive/snippet.json | 0 .../src/SeedExhaustive/Core/RawClient.cs | 11 +++++++++- .../SeedExhaustive/SeedExhaustiveClient.cs | 2 ++ seed/csharp-sdk/extends/.gitignore | 9 +++++++- .../csharp-sdk/extends/snippet-templates.json | 0 seed/csharp-sdk/extends/snippet.json | 0 .../extends/src/SeedExtends/Core/RawClient.cs | 11 +++++++++- .../src/SeedExtends/SeedExtendsClient.cs | 2 ++ seed/csharp-sdk/extra-properties/.gitignore | 9 +++++++- .../extra-properties/snippet-templates.json | 0 seed/csharp-sdk/extra-properties/snippet.json | 0 .../src/SeedExtraProperties/Core/RawClient.cs | 11 +++++++++- .../SeedExtraPropertiesClient.cs | 2 ++ seed/csharp-sdk/file-download/.gitignore | 9 +++++++- .../file-download/snippet-templates.json | 0 seed/csharp-sdk/file-download/snippet.json | 0 .../src/SeedFileDownload/Core/RawClient.cs | 11 +++++++++- .../SeedFileDownloadClient.cs | 2 ++ seed/csharp-sdk/file-upload/.gitignore | 9 +++++++- .../file-upload/snippet-templates.json | 0 seed/csharp-sdk/file-upload/snippet.json | 0 .../src/SeedFileUpload/Core/RawClient.cs | 11 +++++++++- .../SeedFileUpload/SeedFileUploadClient.cs | 2 ++ seed/csharp-sdk/folders/.gitignore | 9 +++++++- .../csharp-sdk/folders/snippet-templates.json | 0 seed/csharp-sdk/folders/snippet.json | 0 .../folders/src/SeedApi/Core/RawClient.cs | 11 +++++++++- .../folders/src/SeedApi/SeedApiClient.cs | 2 ++ .../csharp-sdk/idempotency-headers/.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../idempotency-headers/snippet.json | 0 .../SeedIdempotencyHeaders/Core/RawClient.cs | 11 +++++++++- .../SeedIdempotencyHeadersClient.cs | 2 ++ .../imdb/extra-dependencies/.gitignore | 9 +++++++- .../extra-dependencies/snippet-templates.json | 0 .../imdb/extra-dependencies/snippet.json | 0 .../src/SeedApi/Core/RawClient.cs | 11 +++++++++- .../src/SeedApi/SeedApiClient.cs | 2 ++ .../imdb/no-custom-config/.gitignore | 9 +++++++- .../no-custom-config/snippet-templates.json | 0 .../imdb/no-custom-config/snippet.json | 0 .../src/SeedApi/Core/RawClient.cs | 11 +++++++++- .../src/SeedApi/SeedApiClient.cs | 2 ++ seed/csharp-sdk/literal/.gitignore | 9 +++++++- .../csharp-sdk/literal/snippet-templates.json | 0 seed/csharp-sdk/literal/snippet.json | 0 .../literal/src/SeedLiteral/Core/RawClient.cs | 11 +++++++++- .../src/SeedLiteral/SeedLiteralClient.cs | 2 ++ seed/csharp-sdk/mixed-case/.gitignore | 9 +++++++- .../mixed-case/snippet-templates.json | 0 seed/csharp-sdk/mixed-case/snippet.json | 0 .../src/SeedMixedCase/Core/RawClient.cs | 11 +++++++++- .../src/SeedMixedCase/SeedMixedCaseClient.cs | 2 ++ seed/csharp-sdk/multi-line-docs/.gitignore | 9 +++++++- .../multi-line-docs/snippet-templates.json | 0 seed/csharp-sdk/multi-line-docs/snippet.json | 0 .../src/SeedMultiLineDocs/Core/RawClient.cs | 11 +++++++++- .../SeedMultiLineDocsClient.cs | 2 ++ .../.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../snippet.json | 0 .../Core/RawClient.cs | 11 +++++++++- .../SeedMultiUrlEnvironmentNoDefaultClient.cs | 2 ++ .../multi-url-environment/.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../multi-url-environment/snippet.json | 0 .../SeedMultiUrlEnvironment/Core/RawClient.cs | 11 +++++++++- .../SeedMultiUrlEnvironmentClient.cs | 2 ++ seed/csharp-sdk/no-environment/.gitignore | 9 +++++++- .../no-environment/snippet-templates.json | 0 seed/csharp-sdk/no-environment/snippet.json | 0 .../src/SeedNoEnvironment/Core/RawClient.cs | 11 +++++++++- .../SeedNoEnvironmentClient.cs | 2 ++ .../.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../snippet.json | 0 .../Core/RawClient.cs | 11 +++++++++- ...SeedOauthClientCredentialsDefaultClient.cs | 2 ++ .../.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../snippet.json | 0 .../Core/RawClient.cs | 11 +++++++++- ...ntCredentialsEnvironmentVariablesClient.cs | 2 ++ .../.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../snippet.json | 0 .../Core/RawClient.cs | 11 +++++++++- .../SeedOauthClientCredentialsClient.cs | 2 ++ .../oauth-client-credentials/.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../oauth-client-credentials/snippet.json | 0 .../Core/RawClient.cs | 11 +++++++++- .../SeedOauthClientCredentialsClient.cs | 2 ++ seed/csharp-sdk/object/.gitignore | 9 +++++++- seed/csharp-sdk/object/snippet-templates.json | 0 seed/csharp-sdk/object/snippet.json | 0 .../object/src/SeedObject/Core/RawClient.cs | 11 +++++++++- .../object/src/SeedObject/SeedObjectClient.cs | 2 ++ .../objects-with-imports/.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../objects-with-imports/snippet.json | 0 .../SeedObjectsWithImports/Core/RawClient.cs | 11 +++++++++- .../SeedObjectsWithImportsClient.cs | 2 ++ seed/csharp-sdk/optional/.gitignore | 9 +++++++- .../optional/snippet-templates.json | 0 seed/csharp-sdk/optional/snippet.json | 0 .../SeedObjectsWithImports/Core/RawClient.cs | 11 +++++++++- .../SeedObjectsWithImportsClient.cs | 2 ++ seed/csharp-sdk/package-yml/.gitignore | 9 +++++++- .../package-yml/snippet-templates.json | 0 seed/csharp-sdk/package-yml/snippet.json | 0 .../src/SeedPackageYml/Core/RawClient.cs | 11 +++++++++- .../SeedPackageYml/SeedPackageYmlClient.cs | 2 ++ seed/csharp-sdk/pagination/.gitignore | 9 +++++++- .../pagination/snippet-templates.json | 0 seed/csharp-sdk/pagination/snippet.json | 0 .../src/SeedPagination/Core/RawClient.cs | 11 +++++++++- .../SeedPagination/SeedPaginationClient.cs | 2 ++ seed/csharp-sdk/plain-text/.gitignore | 9 +++++++- .../plain-text/snippet-templates.json | 0 seed/csharp-sdk/plain-text/snippet.json | 0 .../src/SeedPlainText/Core/RawClient.cs | 11 +++++++++- .../src/SeedPlainText/SeedPlainTextClient.cs | 2 ++ seed/csharp-sdk/query-parameters/.gitignore | 9 +++++++- .../query-parameters/snippet-templates.json | 0 seed/csharp-sdk/query-parameters/snippet.json | 0 .../src/SeedQueryParameters/Core/RawClient.cs | 11 +++++++++- .../SeedQueryParametersClient.cs | 2 ++ seed/csharp-sdk/reserved-keywords/.gitignore | 9 +++++++- .../reserved-keywords/snippet-templates.json | 0 .../csharp-sdk/reserved-keywords/snippet.json | 0 .../src/SeedNurseryApi/Core/RawClient.cs | 11 +++++++++- .../SeedNurseryApi/SeedNurseryApiClient.cs | 2 ++ seed/csharp-sdk/response-property/.gitignore | 9 +++++++- .../response-property/snippet-templates.json | 0 .../csharp-sdk/response-property/snippet.json | 0 .../SeedResponseProperty/Core/RawClient.cs | 11 +++++++++- .../SeedResponsePropertyClient.cs | 2 ++ seed/csharp-sdk/server-sent-events/.gitignore | 9 +++++++- .../server-sent-events/snippet-templates.json | 0 .../server-sent-events/snippet.json | 0 .../SeedServerSentEvents/Core/RawClient.cs | 11 +++++++++- .../SeedServerSentEventsClient.cs | 2 ++ .../single-url-environment-default/.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../snippet.json | 0 .../Core/RawClient.cs | 11 +++++++++- .../SeedSingleUrlEnvironmentDefaultClient.cs | 2 ++ .../.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../snippet.json | 0 .../Core/RawClient.cs | 11 +++++++++- ...SeedSingleUrlEnvironmentNoDefaultClient.cs | 2 ++ .../csharp-sdk/streaming-parameter/.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../streaming-parameter/snippet.json | 0 .../src/SeedStreaming/Core/RawClient.cs | 11 +++++++++- .../src/SeedStreaming/SeedStreamingClient.cs | 2 ++ seed/csharp-sdk/streaming/.gitignore | 9 +++++++- .../streaming/snippet-templates.json | 0 seed/csharp-sdk/streaming/snippet.json | 0 .../src/SeedStreaming/Core/RawClient.cs | 11 +++++++++- .../src/SeedStreaming/SeedStreamingClient.cs | 2 ++ seed/csharp-sdk/trace/.gitignore | 9 +++++++- seed/csharp-sdk/trace/snippet-templates.json | 0 seed/csharp-sdk/trace/snippet.json | 0 .../trace/src/SeedTrace/Core/RawClient.cs | 11 +++++++++- .../trace/src/SeedTrace/SeedTraceClient.cs | 2 ++ .../undiscriminated-unions/.gitignore | 9 +++++++- .../snippet-templates.json | 0 .../undiscriminated-unions/snippet.json | 0 .../Core/RawClient.cs | 11 +++++++++- .../SeedUndiscriminatedUnionsClient.cs | 2 ++ seed/csharp-sdk/unions/.gitignore | 9 +++++++- seed/csharp-sdk/unions/snippet-templates.json | 0 seed/csharp-sdk/unions/snippet.json | 0 .../unions/src/SeedUnions/Core/RawClient.cs | 11 +++++++++- .../unions/src/SeedUnions/SeedUnionsClient.cs | 2 ++ seed/csharp-sdk/unknown/.gitignore | 9 +++++++- .../csharp-sdk/unknown/snippet-templates.json | 0 seed/csharp-sdk/unknown/snippet.json | 0 .../src/SeedUnknownAsAny/Core/RawClient.cs | 11 +++++++++- .../SeedUnknownAsAnyClient.cs | 2 ++ seed/csharp-sdk/validation/.gitignore | 9 +++++++- .../.mock/definition/__package__.yml | 14 +++++++++++++ .../validation/snippet-templates.json | 0 seed/csharp-sdk/validation/snippet.json | 0 .../Unit/Serialization/TypeTest.cs | 3 ++- .../src/SeedValidation/Core/RawClient.cs | 11 +++++++++- .../SeedValidation/Requests/CreateRequest.cs | 4 ++++ .../SeedValidation/SeedValidationClient.cs | 2 ++ .../src/SeedValidation/Types/Shape.cs | 21 +++++++++++++++++++ .../src/SeedValidation/Types/Type.cs | 4 ++++ seed/csharp-sdk/variables/.gitignore | 9 +++++++- .../variables/snippet-templates.json | 0 seed/csharp-sdk/variables/snippet.json | 0 .../src/SeedVariables/Core/RawClient.cs | 11 +++++++++- .../src/SeedVariables/SeedVariablesClient.cs | 2 ++ seed/csharp-sdk/version-no-default/.gitignore | 9 +++++++- .../version-no-default/snippet-templates.json | 0 .../version-no-default/snippet.json | 0 .../src/SeedVersion/Core/RawClient.cs | 11 +++++++++- .../src/SeedVersion/SeedVersionClient.cs | 2 ++ seed/csharp-sdk/version/.gitignore | 9 +++++++- .../csharp-sdk/version/snippet-templates.json | 0 seed/csharp-sdk/version/snippet.json | 0 .../version/src/SeedVersion/Core/RawClient.cs | 11 +++++++++- .../src/SeedVersion/SeedVersionClient.cs | 2 ++ seed/csharp-sdk/websocket/.gitignore | 9 +++++++- .../websocket/snippet-templates.json | 0 seed/csharp-sdk/websocket/snippet.json | 0 .../src/SeedWebsocket/Core/RawClient.cs | 11 +++++++++- .../src/SeedWebsocket/SeedWebsocketClient.cs | 2 ++ 293 files changed, 1221 insertions(+), 121 deletions(-) delete mode 100644 seed/csharp-sdk/alias/snippet-templates.json delete mode 100644 seed/csharp-sdk/alias/snippet.json delete mode 100644 seed/csharp-sdk/api-wide-base-path/snippet-templates.json delete mode 100644 seed/csharp-sdk/api-wide-base-path/snippet.json delete mode 100644 seed/csharp-sdk/audiences/snippet-templates.json delete mode 100644 seed/csharp-sdk/audiences/snippet.json delete mode 100644 seed/csharp-sdk/auth-environment-variables/snippet-templates.json delete mode 100644 seed/csharp-sdk/auth-environment-variables/snippet.json delete mode 100644 seed/csharp-sdk/basic-auth-environment-variables/snippet-templates.json delete mode 100644 seed/csharp-sdk/basic-auth-environment-variables/snippet.json delete mode 100644 seed/csharp-sdk/basic-auth/snippet-templates.json delete mode 100644 seed/csharp-sdk/basic-auth/snippet.json delete mode 100644 seed/csharp-sdk/bearer-token-environment-variable/snippet-templates.json delete mode 100644 seed/csharp-sdk/bearer-token-environment-variable/snippet.json delete mode 100644 seed/csharp-sdk/bytes/snippet-templates.json delete mode 100644 seed/csharp-sdk/bytes/snippet.json delete mode 100644 seed/csharp-sdk/circular-references-advanced/snippet-templates.json delete mode 100644 seed/csharp-sdk/circular-references-advanced/snippet.json delete mode 100644 seed/csharp-sdk/circular-references/snippet-templates.json delete mode 100644 seed/csharp-sdk/circular-references/snippet.json delete mode 100644 seed/csharp-sdk/code-samples/snippet-templates.json delete mode 100644 seed/csharp-sdk/code-samples/snippet.json delete mode 100644 seed/csharp-sdk/custom-auth/snippet-templates.json delete mode 100644 seed/csharp-sdk/custom-auth/snippet.json delete mode 100644 seed/csharp-sdk/enum/snippet-templates.json delete mode 100644 seed/csharp-sdk/enum/snippet.json delete mode 100644 seed/csharp-sdk/error-property/snippet-templates.json delete mode 100644 seed/csharp-sdk/error-property/snippet.json delete mode 100644 seed/csharp-sdk/examples/snippet-templates.json delete mode 100644 seed/csharp-sdk/examples/snippet.json delete mode 100644 seed/csharp-sdk/exhaustive/snippet-templates.json delete mode 100644 seed/csharp-sdk/exhaustive/snippet.json delete mode 100644 seed/csharp-sdk/extends/snippet-templates.json delete mode 100644 seed/csharp-sdk/extends/snippet.json delete mode 100644 seed/csharp-sdk/extra-properties/snippet-templates.json delete mode 100644 seed/csharp-sdk/extra-properties/snippet.json delete mode 100644 seed/csharp-sdk/file-download/snippet-templates.json delete mode 100644 seed/csharp-sdk/file-download/snippet.json delete mode 100644 seed/csharp-sdk/file-upload/snippet-templates.json delete mode 100644 seed/csharp-sdk/file-upload/snippet.json delete mode 100644 seed/csharp-sdk/folders/snippet-templates.json delete mode 100644 seed/csharp-sdk/folders/snippet.json delete mode 100644 seed/csharp-sdk/idempotency-headers/snippet-templates.json delete mode 100644 seed/csharp-sdk/idempotency-headers/snippet.json delete mode 100644 seed/csharp-sdk/imdb/extra-dependencies/snippet-templates.json delete mode 100644 seed/csharp-sdk/imdb/extra-dependencies/snippet.json delete mode 100644 seed/csharp-sdk/imdb/no-custom-config/snippet-templates.json delete mode 100644 seed/csharp-sdk/imdb/no-custom-config/snippet.json delete mode 100644 seed/csharp-sdk/literal/snippet-templates.json delete mode 100644 seed/csharp-sdk/literal/snippet.json delete mode 100644 seed/csharp-sdk/mixed-case/snippet-templates.json delete mode 100644 seed/csharp-sdk/mixed-case/snippet.json delete mode 100644 seed/csharp-sdk/multi-line-docs/snippet-templates.json delete mode 100644 seed/csharp-sdk/multi-line-docs/snippet.json delete mode 100644 seed/csharp-sdk/multi-url-environment-no-default/snippet-templates.json delete mode 100644 seed/csharp-sdk/multi-url-environment-no-default/snippet.json delete mode 100644 seed/csharp-sdk/multi-url-environment/snippet-templates.json delete mode 100644 seed/csharp-sdk/multi-url-environment/snippet.json delete mode 100644 seed/csharp-sdk/no-environment/snippet-templates.json delete mode 100644 seed/csharp-sdk/no-environment/snippet.json delete mode 100644 seed/csharp-sdk/oauth-client-credentials-default/snippet-templates.json delete mode 100644 seed/csharp-sdk/oauth-client-credentials-default/snippet.json delete mode 100644 seed/csharp-sdk/oauth-client-credentials-environment-variables/snippet-templates.json delete mode 100644 seed/csharp-sdk/oauth-client-credentials-environment-variables/snippet.json delete mode 100644 seed/csharp-sdk/oauth-client-credentials-nested-root/snippet-templates.json delete mode 100644 seed/csharp-sdk/oauth-client-credentials-nested-root/snippet.json delete mode 100644 seed/csharp-sdk/oauth-client-credentials/snippet-templates.json delete mode 100644 seed/csharp-sdk/oauth-client-credentials/snippet.json delete mode 100644 seed/csharp-sdk/object/snippet-templates.json delete mode 100644 seed/csharp-sdk/object/snippet.json delete mode 100644 seed/csharp-sdk/objects-with-imports/snippet-templates.json delete mode 100644 seed/csharp-sdk/objects-with-imports/snippet.json delete mode 100644 seed/csharp-sdk/optional/snippet-templates.json delete mode 100644 seed/csharp-sdk/optional/snippet.json delete mode 100644 seed/csharp-sdk/package-yml/snippet-templates.json delete mode 100644 seed/csharp-sdk/package-yml/snippet.json delete mode 100644 seed/csharp-sdk/pagination/snippet-templates.json delete mode 100644 seed/csharp-sdk/pagination/snippet.json delete mode 100644 seed/csharp-sdk/plain-text/snippet-templates.json delete mode 100644 seed/csharp-sdk/plain-text/snippet.json delete mode 100644 seed/csharp-sdk/query-parameters/snippet-templates.json delete mode 100644 seed/csharp-sdk/query-parameters/snippet.json delete mode 100644 seed/csharp-sdk/reserved-keywords/snippet-templates.json delete mode 100644 seed/csharp-sdk/reserved-keywords/snippet.json delete mode 100644 seed/csharp-sdk/response-property/snippet-templates.json delete mode 100644 seed/csharp-sdk/response-property/snippet.json delete mode 100644 seed/csharp-sdk/server-sent-events/snippet-templates.json delete mode 100644 seed/csharp-sdk/server-sent-events/snippet.json delete mode 100644 seed/csharp-sdk/single-url-environment-default/snippet-templates.json delete mode 100644 seed/csharp-sdk/single-url-environment-default/snippet.json delete mode 100644 seed/csharp-sdk/single-url-environment-no-default/snippet-templates.json delete mode 100644 seed/csharp-sdk/single-url-environment-no-default/snippet.json delete mode 100644 seed/csharp-sdk/streaming-parameter/snippet-templates.json delete mode 100644 seed/csharp-sdk/streaming-parameter/snippet.json delete mode 100644 seed/csharp-sdk/streaming/snippet-templates.json delete mode 100644 seed/csharp-sdk/streaming/snippet.json delete mode 100644 seed/csharp-sdk/trace/snippet-templates.json delete mode 100644 seed/csharp-sdk/trace/snippet.json delete mode 100644 seed/csharp-sdk/undiscriminated-unions/snippet-templates.json delete mode 100644 seed/csharp-sdk/undiscriminated-unions/snippet.json delete mode 100644 seed/csharp-sdk/unions/snippet-templates.json delete mode 100644 seed/csharp-sdk/unions/snippet.json delete mode 100644 seed/csharp-sdk/unknown/snippet-templates.json delete mode 100644 seed/csharp-sdk/unknown/snippet.json delete mode 100644 seed/csharp-sdk/validation/snippet-templates.json delete mode 100644 seed/csharp-sdk/validation/snippet.json create mode 100644 seed/csharp-sdk/validation/src/SeedValidation/Types/Shape.cs delete mode 100644 seed/csharp-sdk/variables/snippet-templates.json delete mode 100644 seed/csharp-sdk/variables/snippet.json delete mode 100644 seed/csharp-sdk/version-no-default/snippet-templates.json delete mode 100644 seed/csharp-sdk/version-no-default/snippet.json delete mode 100644 seed/csharp-sdk/version/snippet-templates.json delete mode 100644 seed/csharp-sdk/version/snippet.json delete mode 100644 seed/csharp-sdk/websocket/snippet-templates.json delete mode 100644 seed/csharp-sdk/websocket/snippet.json diff --git a/generators/csharp/codegen/src/asIs/RawClient.Template.cs b/generators/csharp/codegen/src/asIs/RawClient.Template.cs index c437652ed35..95077020656 100644 --- a/generators/csharp/codegen/src/asIs/RawClient.Template.cs +++ b/generators/csharp/codegen/src/asIs/RawClient.Template.cs @@ -8,7 +8,11 @@ namespace <%= namespace%>; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/generators/csharp/sdk/CHANGELOG.md b/generators/csharp/sdk/CHANGELOG.md index 161a059668f..ae5a4721a84 100644 --- a/generators/csharp/sdk/CHANGELOG.md +++ b/generators/csharp/sdk/CHANGELOG.md @@ -5,15 +5,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.2 - 2024-07-25] + +- Improvement: Add header suppliers to `RawClient` constructor parameters. + ## [0.2.1 - 2024-07-25] -- Fix: MultURL environment classes now compile, previously there was a fix that broke compilation. + +- Fix: MultURL environment classes now compile, previously there was a fix that broke compilation. ## [0.2.0 - 2024-07-25] - Break: The `Environments.cs` class is now renamed to be `{OrgName}Environment`. For example, if your - org name was Imdb then the environment class would be `ImdbEnvironment`. + org name was Imdb then the environment class would be `ImdbEnvironment`. + +- Feature: If the SDK has endpoints that each hit different URLs then the following class is generated. -- Feature: If the SDK has endpoints that each hit different URLs then the following class is generated. ```csharp public record AWSEnvironment { @@ -22,13 +28,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 S3 = "https://s3.awsamazon.com", EC2 = "https://ec2.awsamazon.com" }; - + public static AWSEnvironment Staging = new AWSEnvironment() { S3 = "https://staging.s3.awsamazon.com", EC2 = "https://stagng.ec2.awsamazon.com" }; - + public required string S3 { get; init; } public required string EC2 { get; init; } } diff --git a/generators/csharp/sdk/src/root-client/RootClientGenerator.ts b/generators/csharp/sdk/src/root-client/RootClientGenerator.ts index cf344fd3a90..baf603406f3 100644 --- a/generators/csharp/sdk/src/root-client/RootClientGenerator.ts +++ b/generators/csharp/sdk/src/root-client/RootClientGenerator.ts @@ -181,6 +181,18 @@ export class RootClientGenerator extends FileGenerator { writer.writeNode(headerDictionary); }), + csharp.codeblock((writer) => { + writer.writeNode(headerSupplierDictionary); + }), csharp.codeblock("clientOptions ?? new ClientOptions()") ] }) diff --git a/seed/csharp-sdk/alias/.gitignore b/seed/csharp-sdk/alias/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/alias/.gitignore +++ b/seed/csharp-sdk/alias/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/alias/snippet-templates.json b/seed/csharp-sdk/alias/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/alias/snippet.json b/seed/csharp-sdk/alias/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/alias/src/SeedAlias/Core/RawClient.cs b/seed/csharp-sdk/alias/src/SeedAlias/Core/RawClient.cs index d66a389d61a..ee51f7cb871 100644 --- a/seed/csharp-sdk/alias/src/SeedAlias/Core/RawClient.cs +++ b/seed/csharp-sdk/alias/src/SeedAlias/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedAlias.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/alias/src/SeedAlias/SeedAliasClient.cs b/seed/csharp-sdk/alias/src/SeedAlias/SeedAliasClient.cs index 0db1c7d3554..20b1118e3d4 100644 --- a/seed/csharp-sdk/alias/src/SeedAlias/SeedAliasClient.cs +++ b/seed/csharp-sdk/alias/src/SeedAlias/SeedAliasClient.cs @@ -1,3 +1,4 @@ +using System; using System.Net.Http; using SeedAlias.Core; @@ -13,6 +14,7 @@ public SeedAliasClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); } diff --git a/seed/csharp-sdk/api-wide-base-path/.gitignore b/seed/csharp-sdk/api-wide-base-path/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/api-wide-base-path/.gitignore +++ b/seed/csharp-sdk/api-wide-base-path/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/api-wide-base-path/snippet-templates.json b/seed/csharp-sdk/api-wide-base-path/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/api-wide-base-path/snippet.json b/seed/csharp-sdk/api-wide-base-path/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/RawClient.cs b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/RawClient.cs index c2b09370f87..41dd0ffaf85 100644 --- a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/RawClient.cs +++ b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedApiWideBasePath.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/SeedApiWideBasePathClient.cs b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/SeedApiWideBasePathClient.cs index a59adb335b3..be2a7d163d6 100644 --- a/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/SeedApiWideBasePathClient.cs +++ b/seed/csharp-sdk/api-wide-base-path/src/SeedApiWideBasePath/SeedApiWideBasePathClient.cs @@ -1,3 +1,4 @@ +using System; using SeedApiWideBasePath; using SeedApiWideBasePath.Core; @@ -13,6 +14,7 @@ public SeedApiWideBasePathClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Service = new ServiceClient(_client); diff --git a/seed/csharp-sdk/audiences/.gitignore b/seed/csharp-sdk/audiences/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/audiences/.gitignore +++ b/seed/csharp-sdk/audiences/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/audiences/snippet-templates.json b/seed/csharp-sdk/audiences/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/audiences/snippet.json b/seed/csharp-sdk/audiences/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/audiences/src/SeedAudiences/Core/RawClient.cs b/seed/csharp-sdk/audiences/src/SeedAudiences/Core/RawClient.cs index 7c27ebce190..80e346af540 100644 --- a/seed/csharp-sdk/audiences/src/SeedAudiences/Core/RawClient.cs +++ b/seed/csharp-sdk/audiences/src/SeedAudiences/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedAudiences.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/audiences/src/SeedAudiences/SeedAudiencesClient.cs b/seed/csharp-sdk/audiences/src/SeedAudiences/SeedAudiencesClient.cs index 2bc70f3a95f..fc07e5e9ef6 100644 --- a/seed/csharp-sdk/audiences/src/SeedAudiences/SeedAudiencesClient.cs +++ b/seed/csharp-sdk/audiences/src/SeedAudiences/SeedAudiencesClient.cs @@ -1,3 +1,4 @@ +using System; using SeedAudiences; using SeedAudiences.Core; using SeedAudiences.FolderA; @@ -16,6 +17,7 @@ public SeedAudiencesClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Commons = new CommonsClient(_client); diff --git a/seed/csharp-sdk/auth-environment-variables/.gitignore b/seed/csharp-sdk/auth-environment-variables/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/auth-environment-variables/.gitignore +++ b/seed/csharp-sdk/auth-environment-variables/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/auth-environment-variables/snippet-templates.json b/seed/csharp-sdk/auth-environment-variables/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/auth-environment-variables/snippet.json b/seed/csharp-sdk/auth-environment-variables/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/RawClient.cs b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/RawClient.cs index d187016467e..6ca6a6c4a3a 100644 --- a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/RawClient.cs +++ b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedAuthEnvironmentVariables.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/SeedAuthEnvironmentVariablesClient.cs b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/SeedAuthEnvironmentVariablesClient.cs index 4f280579bcb..8577c6b6ea3 100644 --- a/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/SeedAuthEnvironmentVariablesClient.cs +++ b/seed/csharp-sdk/auth-environment-variables/src/SeedAuthEnvironmentVariables/SeedAuthEnvironmentVariablesClient.cs @@ -1,3 +1,4 @@ +using System; using SeedAuthEnvironmentVariables; using SeedAuthEnvironmentVariables.Core; @@ -25,6 +26,7 @@ public SeedAuthEnvironmentVariablesClient( { "X-FERN-API-KEY", apiKey }, { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Service = new ServiceClient(_client); diff --git a/seed/csharp-sdk/basic-auth-environment-variables/.gitignore b/seed/csharp-sdk/basic-auth-environment-variables/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/basic-auth-environment-variables/.gitignore +++ b/seed/csharp-sdk/basic-auth-environment-variables/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/basic-auth-environment-variables/snippet-templates.json b/seed/csharp-sdk/basic-auth-environment-variables/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/basic-auth-environment-variables/snippet.json b/seed/csharp-sdk/basic-auth-environment-variables/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/RawClient.cs b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/RawClient.cs index 2b8d87b2814..b18987e641d 100644 --- a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/RawClient.cs +++ b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedBasicAuthEnvironmentVariables.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/SeedBasicAuthEnvironmentVariablesClient.cs b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/SeedBasicAuthEnvironmentVariablesClient.cs index f9e39cd1314..10912fdc329 100644 --- a/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/SeedBasicAuthEnvironmentVariablesClient.cs +++ b/seed/csharp-sdk/basic-auth-environment-variables/src/SeedBasicAuthEnvironmentVariables/SeedBasicAuthEnvironmentVariablesClient.cs @@ -1,3 +1,4 @@ +using System; using SeedBasicAuthEnvironmentVariables; using SeedBasicAuthEnvironmentVariables.Core; @@ -25,6 +26,7 @@ public SeedBasicAuthEnvironmentVariablesClient( ); _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); BasicAuth = new BasicAuthClient(_client); diff --git a/seed/csharp-sdk/basic-auth/.gitignore b/seed/csharp-sdk/basic-auth/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/basic-auth/.gitignore +++ b/seed/csharp-sdk/basic-auth/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/basic-auth/snippet-templates.json b/seed/csharp-sdk/basic-auth/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/basic-auth/snippet.json b/seed/csharp-sdk/basic-auth/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/RawClient.cs b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/RawClient.cs index 5607e429a92..b624d31091e 100644 --- a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/RawClient.cs +++ b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedBasicAuth.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/SeedBasicAuthClient.cs b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/SeedBasicAuthClient.cs index 8b1ec0f0e09..0c24c24f759 100644 --- a/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/SeedBasicAuthClient.cs +++ b/seed/csharp-sdk/basic-auth/src/SeedBasicAuth/SeedBasicAuthClient.cs @@ -1,3 +1,4 @@ +using System; using SeedBasicAuth; using SeedBasicAuth.Core; @@ -17,6 +18,7 @@ public SeedBasicAuthClient( { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); BasicAuth = new BasicAuthClient(_client); diff --git a/seed/csharp-sdk/bearer-token-environment-variable/.gitignore b/seed/csharp-sdk/bearer-token-environment-variable/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/bearer-token-environment-variable/.gitignore +++ b/seed/csharp-sdk/bearer-token-environment-variable/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/bearer-token-environment-variable/snippet-templates.json b/seed/csharp-sdk/bearer-token-environment-variable/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/bearer-token-environment-variable/snippet.json b/seed/csharp-sdk/bearer-token-environment-variable/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/RawClient.cs b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/RawClient.cs index c414e598cd8..cb62bd63349 100644 --- a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/RawClient.cs +++ b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedBearerTokenEnvironmentVariable.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/SeedBearerTokenEnvironmentVariableClient.cs b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/SeedBearerTokenEnvironmentVariableClient.cs index ae19898874a..b717ae6026f 100644 --- a/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/SeedBearerTokenEnvironmentVariableClient.cs +++ b/seed/csharp-sdk/bearer-token-environment-variable/src/SeedBearerTokenEnvironmentVariable/SeedBearerTokenEnvironmentVariableClient.cs @@ -1,3 +1,4 @@ +using System; using SeedBearerTokenEnvironmentVariable; using SeedBearerTokenEnvironmentVariable.Core; @@ -24,6 +25,7 @@ public SeedBearerTokenEnvironmentVariableClient( { "Authorization", $"Bearer {apiKey}" }, { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Service = new ServiceClient(_client); diff --git a/seed/csharp-sdk/bytes/.gitignore b/seed/csharp-sdk/bytes/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/bytes/.gitignore +++ b/seed/csharp-sdk/bytes/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/bytes/snippet-templates.json b/seed/csharp-sdk/bytes/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/bytes/snippet.json b/seed/csharp-sdk/bytes/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/bytes/src/SeedBytes/Core/RawClient.cs b/seed/csharp-sdk/bytes/src/SeedBytes/Core/RawClient.cs index 3b49e486d0f..5d5479a51fc 100644 --- a/seed/csharp-sdk/bytes/src/SeedBytes/Core/RawClient.cs +++ b/seed/csharp-sdk/bytes/src/SeedBytes/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedBytes.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/bytes/src/SeedBytes/SeedBytesClient.cs b/seed/csharp-sdk/bytes/src/SeedBytes/SeedBytesClient.cs index b7aaeb34ecc..33b2ed94902 100644 --- a/seed/csharp-sdk/bytes/src/SeedBytes/SeedBytesClient.cs +++ b/seed/csharp-sdk/bytes/src/SeedBytes/SeedBytesClient.cs @@ -1,3 +1,4 @@ +using System; using SeedBytes; using SeedBytes.Core; @@ -13,6 +14,7 @@ public SeedBytesClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Service = new ServiceClient(_client); diff --git a/seed/csharp-sdk/circular-references-advanced/.gitignore b/seed/csharp-sdk/circular-references-advanced/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/circular-references-advanced/.gitignore +++ b/seed/csharp-sdk/circular-references-advanced/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/circular-references-advanced/snippet-templates.json b/seed/csharp-sdk/circular-references-advanced/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/circular-references-advanced/snippet.json b/seed/csharp-sdk/circular-references-advanced/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/RawClient.cs b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/RawClient.cs index 0777c60aec4..437825ca198 100644 --- a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/RawClient.cs +++ b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedApi.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/SeedApiClient.cs index b7c501fe599..07c8a220620 100644 --- a/seed/csharp-sdk/circular-references-advanced/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/circular-references-advanced/src/SeedApi/SeedApiClient.cs @@ -1,3 +1,4 @@ +using System; using SeedApi; using SeedApi.Core; @@ -13,6 +14,7 @@ public SeedApiClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); A = new AClient(_client); diff --git a/seed/csharp-sdk/circular-references/.gitignore b/seed/csharp-sdk/circular-references/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/circular-references/.gitignore +++ b/seed/csharp-sdk/circular-references/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/circular-references/snippet-templates.json b/seed/csharp-sdk/circular-references/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/circular-references/snippet.json b/seed/csharp-sdk/circular-references/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/circular-references/src/SeedApi/Core/RawClient.cs b/seed/csharp-sdk/circular-references/src/SeedApi/Core/RawClient.cs index 0777c60aec4..437825ca198 100644 --- a/seed/csharp-sdk/circular-references/src/SeedApi/Core/RawClient.cs +++ b/seed/csharp-sdk/circular-references/src/SeedApi/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedApi.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/circular-references/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/circular-references/src/SeedApi/SeedApiClient.cs index b7c501fe599..07c8a220620 100644 --- a/seed/csharp-sdk/circular-references/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/circular-references/src/SeedApi/SeedApiClient.cs @@ -1,3 +1,4 @@ +using System; using SeedApi; using SeedApi.Core; @@ -13,6 +14,7 @@ public SeedApiClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); A = new AClient(_client); diff --git a/seed/csharp-sdk/code-samples/.gitignore b/seed/csharp-sdk/code-samples/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/code-samples/.gitignore +++ b/seed/csharp-sdk/code-samples/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/code-samples/snippet-templates.json b/seed/csharp-sdk/code-samples/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/code-samples/snippet.json b/seed/csharp-sdk/code-samples/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/code-samples/src/SeedCodeSamples/Core/RawClient.cs b/seed/csharp-sdk/code-samples/src/SeedCodeSamples/Core/RawClient.cs index 82b596d9861..12ca26fff72 100644 --- a/seed/csharp-sdk/code-samples/src/SeedCodeSamples/Core/RawClient.cs +++ b/seed/csharp-sdk/code-samples/src/SeedCodeSamples/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedCodeSamples.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/code-samples/src/SeedCodeSamples/SeedCodeSamplesClient.cs b/seed/csharp-sdk/code-samples/src/SeedCodeSamples/SeedCodeSamplesClient.cs index 6a3867c95da..996e545e32a 100644 --- a/seed/csharp-sdk/code-samples/src/SeedCodeSamples/SeedCodeSamplesClient.cs +++ b/seed/csharp-sdk/code-samples/src/SeedCodeSamples/SeedCodeSamplesClient.cs @@ -1,3 +1,4 @@ +using System; using SeedCodeSamples; using SeedCodeSamples.Core; @@ -13,6 +14,7 @@ public SeedCodeSamplesClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Service = new ServiceClient(_client); diff --git a/seed/csharp-sdk/custom-auth/.gitignore b/seed/csharp-sdk/custom-auth/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/custom-auth/.gitignore +++ b/seed/csharp-sdk/custom-auth/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/custom-auth/snippet-templates.json b/seed/csharp-sdk/custom-auth/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/custom-auth/snippet.json b/seed/csharp-sdk/custom-auth/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/RawClient.cs b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/RawClient.cs index 457baad398e..3797dae8236 100644 --- a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/RawClient.cs +++ b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedCustomAuth.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/SeedCustomAuthClient.cs b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/SeedCustomAuthClient.cs index 2904dda57d6..b2073b7f5b2 100644 --- a/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/SeedCustomAuthClient.cs +++ b/seed/csharp-sdk/custom-auth/src/SeedCustomAuth/SeedCustomAuthClient.cs @@ -1,3 +1,4 @@ +using System; using SeedCustomAuth; using SeedCustomAuth.Core; @@ -20,6 +21,7 @@ public SeedCustomAuthClient( { "X-API-KEY", customAuthScheme }, { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); CustomAuth = new CustomAuthClient(_client); diff --git a/seed/csharp-sdk/enum/.gitignore b/seed/csharp-sdk/enum/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/enum/.gitignore +++ b/seed/csharp-sdk/enum/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/enum/snippet-templates.json b/seed/csharp-sdk/enum/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/enum/snippet.json b/seed/csharp-sdk/enum/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/enum/src/SeedEnum/Core/RawClient.cs b/seed/csharp-sdk/enum/src/SeedEnum/Core/RawClient.cs index 23309b2f984..2730fdfe27a 100644 --- a/seed/csharp-sdk/enum/src/SeedEnum/Core/RawClient.cs +++ b/seed/csharp-sdk/enum/src/SeedEnum/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedEnum.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/enum/src/SeedEnum/SeedEnumClient.cs b/seed/csharp-sdk/enum/src/SeedEnum/SeedEnumClient.cs index 1c9a619da7c..a17d755d7a0 100644 --- a/seed/csharp-sdk/enum/src/SeedEnum/SeedEnumClient.cs +++ b/seed/csharp-sdk/enum/src/SeedEnum/SeedEnumClient.cs @@ -1,3 +1,4 @@ +using System; using SeedEnum; using SeedEnum.Core; @@ -13,6 +14,7 @@ public SeedEnumClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); InlinedRequest = new InlinedRequestClient(_client); diff --git a/seed/csharp-sdk/error-property/.gitignore b/seed/csharp-sdk/error-property/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/error-property/.gitignore +++ b/seed/csharp-sdk/error-property/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/error-property/snippet-templates.json b/seed/csharp-sdk/error-property/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/error-property/snippet.json b/seed/csharp-sdk/error-property/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/RawClient.cs b/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/RawClient.cs index ffa2ad6e86b..cd1b07ea53d 100644 --- a/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/RawClient.cs +++ b/seed/csharp-sdk/error-property/src/SeedErrorProperty/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedErrorProperty.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/error-property/src/SeedErrorProperty/SeedErrorPropertyClient.cs b/seed/csharp-sdk/error-property/src/SeedErrorProperty/SeedErrorPropertyClient.cs index 2b91410a945..104457c88dc 100644 --- a/seed/csharp-sdk/error-property/src/SeedErrorProperty/SeedErrorPropertyClient.cs +++ b/seed/csharp-sdk/error-property/src/SeedErrorProperty/SeedErrorPropertyClient.cs @@ -1,3 +1,4 @@ +using System; using SeedErrorProperty; using SeedErrorProperty.Core; @@ -13,6 +14,7 @@ public SeedErrorPropertyClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Errors = new ErrorsClient(_client); diff --git a/seed/csharp-sdk/examples/.gitignore b/seed/csharp-sdk/examples/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/examples/.gitignore +++ b/seed/csharp-sdk/examples/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/examples/snippet-templates.json b/seed/csharp-sdk/examples/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/examples/snippet.json b/seed/csharp-sdk/examples/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/examples/src/SeedExamples/Core/RawClient.cs b/seed/csharp-sdk/examples/src/SeedExamples/Core/RawClient.cs index 674914e8f7f..d0a9f9376c0 100644 --- a/seed/csharp-sdk/examples/src/SeedExamples/Core/RawClient.cs +++ b/seed/csharp-sdk/examples/src/SeedExamples/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedExamples.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/examples/src/SeedExamples/SeedExamplesClient.cs b/seed/csharp-sdk/examples/src/SeedExamples/SeedExamplesClient.cs index a62576575c5..02331060e31 100644 --- a/seed/csharp-sdk/examples/src/SeedExamples/SeedExamplesClient.cs +++ b/seed/csharp-sdk/examples/src/SeedExamples/SeedExamplesClient.cs @@ -1,3 +1,4 @@ +using System; using System.Net.Http; using SeedExamples; using SeedExamples.Commons; @@ -17,6 +18,7 @@ public SeedExamplesClient(string token, ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Commons = new CommonsClient(_client); diff --git a/seed/csharp-sdk/exhaustive/.gitignore b/seed/csharp-sdk/exhaustive/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/exhaustive/.gitignore +++ b/seed/csharp-sdk/exhaustive/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/exhaustive/snippet-templates.json b/seed/csharp-sdk/exhaustive/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/exhaustive/snippet.json b/seed/csharp-sdk/exhaustive/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/exhaustive/src/SeedExhaustive/Core/RawClient.cs b/seed/csharp-sdk/exhaustive/src/SeedExhaustive/Core/RawClient.cs index 01e025c71b7..3d5e0af6ca3 100644 --- a/seed/csharp-sdk/exhaustive/src/SeedExhaustive/Core/RawClient.cs +++ b/seed/csharp-sdk/exhaustive/src/SeedExhaustive/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedExhaustive.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/exhaustive/src/SeedExhaustive/SeedExhaustiveClient.cs b/seed/csharp-sdk/exhaustive/src/SeedExhaustive/SeedExhaustiveClient.cs index 0ccc10de1ad..65dbcc2d7c3 100644 --- a/seed/csharp-sdk/exhaustive/src/SeedExhaustive/SeedExhaustiveClient.cs +++ b/seed/csharp-sdk/exhaustive/src/SeedExhaustive/SeedExhaustiveClient.cs @@ -1,3 +1,4 @@ +using System; using SeedExhaustive; using SeedExhaustive.Core; using SeedExhaustive.Endpoints; @@ -15,6 +16,7 @@ public SeedExhaustiveClient(string token, ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Endpoints = new EndpointsClient(_client); diff --git a/seed/csharp-sdk/extends/.gitignore b/seed/csharp-sdk/extends/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/extends/.gitignore +++ b/seed/csharp-sdk/extends/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/extends/snippet-templates.json b/seed/csharp-sdk/extends/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/extends/snippet.json b/seed/csharp-sdk/extends/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/extends/src/SeedExtends/Core/RawClient.cs b/seed/csharp-sdk/extends/src/SeedExtends/Core/RawClient.cs index 98e1a71d95f..e9d8a36a470 100644 --- a/seed/csharp-sdk/extends/src/SeedExtends/Core/RawClient.cs +++ b/seed/csharp-sdk/extends/src/SeedExtends/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedExtends.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/extends/src/SeedExtends/SeedExtendsClient.cs b/seed/csharp-sdk/extends/src/SeedExtends/SeedExtendsClient.cs index 2297dba49d4..32fdaeafe3f 100644 --- a/seed/csharp-sdk/extends/src/SeedExtends/SeedExtendsClient.cs +++ b/seed/csharp-sdk/extends/src/SeedExtends/SeedExtendsClient.cs @@ -1,3 +1,4 @@ +using System; using SeedExtends.Core; #nullable enable @@ -12,6 +13,7 @@ public SeedExtendsClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); } diff --git a/seed/csharp-sdk/extra-properties/.gitignore b/seed/csharp-sdk/extra-properties/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/extra-properties/.gitignore +++ b/seed/csharp-sdk/extra-properties/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/extra-properties/snippet-templates.json b/seed/csharp-sdk/extra-properties/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/extra-properties/snippet.json b/seed/csharp-sdk/extra-properties/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/RawClient.cs b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/RawClient.cs index e56be5e1175..0a32f70013c 100644 --- a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/RawClient.cs +++ b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedExtraProperties.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/SeedExtraPropertiesClient.cs b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/SeedExtraPropertiesClient.cs index 5640b04f348..7eb491b8cc9 100644 --- a/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/SeedExtraPropertiesClient.cs +++ b/seed/csharp-sdk/extra-properties/src/SeedExtraProperties/SeedExtraPropertiesClient.cs @@ -1,3 +1,4 @@ +using System; using SeedExtraProperties; using SeedExtraProperties.Core; @@ -13,6 +14,7 @@ public SeedExtraPropertiesClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); User = new UserClient(_client); diff --git a/seed/csharp-sdk/file-download/.gitignore b/seed/csharp-sdk/file-download/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/file-download/.gitignore +++ b/seed/csharp-sdk/file-download/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/file-download/snippet-templates.json b/seed/csharp-sdk/file-download/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/file-download/snippet.json b/seed/csharp-sdk/file-download/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/RawClient.cs b/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/RawClient.cs index 7ac00b44aee..8fcb749cf20 100644 --- a/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/RawClient.cs +++ b/seed/csharp-sdk/file-download/src/SeedFileDownload/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedFileDownload.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/file-download/src/SeedFileDownload/SeedFileDownloadClient.cs b/seed/csharp-sdk/file-download/src/SeedFileDownload/SeedFileDownloadClient.cs index 3e88bf96a1a..bdb76837660 100644 --- a/seed/csharp-sdk/file-download/src/SeedFileDownload/SeedFileDownloadClient.cs +++ b/seed/csharp-sdk/file-download/src/SeedFileDownload/SeedFileDownloadClient.cs @@ -1,3 +1,4 @@ +using System; using SeedFileDownload; using SeedFileDownload.Core; @@ -13,6 +14,7 @@ public SeedFileDownloadClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Service = new ServiceClient(_client); diff --git a/seed/csharp-sdk/file-upload/.gitignore b/seed/csharp-sdk/file-upload/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/file-upload/.gitignore +++ b/seed/csharp-sdk/file-upload/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/file-upload/snippet-templates.json b/seed/csharp-sdk/file-upload/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/file-upload/snippet.json b/seed/csharp-sdk/file-upload/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/RawClient.cs b/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/RawClient.cs index 85d112ab4db..a0c9c51c9b9 100644 --- a/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/RawClient.cs +++ b/seed/csharp-sdk/file-upload/src/SeedFileUpload/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedFileUpload.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/file-upload/src/SeedFileUpload/SeedFileUploadClient.cs b/seed/csharp-sdk/file-upload/src/SeedFileUpload/SeedFileUploadClient.cs index a94f179124d..e9c0cae97b4 100644 --- a/seed/csharp-sdk/file-upload/src/SeedFileUpload/SeedFileUploadClient.cs +++ b/seed/csharp-sdk/file-upload/src/SeedFileUpload/SeedFileUploadClient.cs @@ -1,3 +1,4 @@ +using System; using SeedFileUpload; using SeedFileUpload.Core; @@ -13,6 +14,7 @@ public SeedFileUploadClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Service = new ServiceClient(_client); diff --git a/seed/csharp-sdk/folders/.gitignore b/seed/csharp-sdk/folders/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/folders/.gitignore +++ b/seed/csharp-sdk/folders/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/folders/snippet-templates.json b/seed/csharp-sdk/folders/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/folders/snippet.json b/seed/csharp-sdk/folders/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/folders/src/SeedApi/Core/RawClient.cs b/seed/csharp-sdk/folders/src/SeedApi/Core/RawClient.cs index 0777c60aec4..437825ca198 100644 --- a/seed/csharp-sdk/folders/src/SeedApi/Core/RawClient.cs +++ b/seed/csharp-sdk/folders/src/SeedApi/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedApi.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/folders/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/folders/src/SeedApi/SeedApiClient.cs index ae6033128ba..05454c563c4 100644 --- a/seed/csharp-sdk/folders/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/folders/src/SeedApi/SeedApiClient.cs @@ -1,3 +1,4 @@ +using System; using System.Net.Http; using SeedApi.A; using SeedApi.Core; @@ -15,6 +16,7 @@ public SeedApiClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); A = new AClient(_client); diff --git a/seed/csharp-sdk/idempotency-headers/.gitignore b/seed/csharp-sdk/idempotency-headers/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/idempotency-headers/.gitignore +++ b/seed/csharp-sdk/idempotency-headers/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/idempotency-headers/snippet-templates.json b/seed/csharp-sdk/idempotency-headers/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/idempotency-headers/snippet.json b/seed/csharp-sdk/idempotency-headers/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/RawClient.cs b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/RawClient.cs index 6adbb03876a..709fbcddd2c 100644 --- a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/RawClient.cs +++ b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedIdempotencyHeaders.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/SeedIdempotencyHeadersClient.cs b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/SeedIdempotencyHeadersClient.cs index 4ec376b262b..bf957ff7f19 100644 --- a/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/SeedIdempotencyHeadersClient.cs +++ b/seed/csharp-sdk/idempotency-headers/src/SeedIdempotencyHeaders/SeedIdempotencyHeadersClient.cs @@ -1,3 +1,4 @@ +using System; using SeedIdempotencyHeaders; using SeedIdempotencyHeaders.Core; @@ -17,6 +18,7 @@ public SeedIdempotencyHeadersClient(string? token = null, ClientOptions? clientO { "Authorization", $"Bearer {token}" }, { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Payment = new PaymentClient(_client); diff --git a/seed/csharp-sdk/imdb/extra-dependencies/.gitignore b/seed/csharp-sdk/imdb/extra-dependencies/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/imdb/extra-dependencies/.gitignore +++ b/seed/csharp-sdk/imdb/extra-dependencies/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/imdb/extra-dependencies/snippet-templates.json b/seed/csharp-sdk/imdb/extra-dependencies/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/imdb/extra-dependencies/snippet.json b/seed/csharp-sdk/imdb/extra-dependencies/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/RawClient.cs b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/RawClient.cs index 0777c60aec4..437825ca198 100644 --- a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/RawClient.cs +++ b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedApi.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/SeedApiClient.cs index a0be2894837..ec79ca35044 100644 --- a/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/imdb/extra-dependencies/src/SeedApi/SeedApiClient.cs @@ -1,3 +1,4 @@ +using System; using SeedApi; using SeedApi.Core; @@ -13,6 +14,7 @@ public SeedApiClient(string token, ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Imdb = new ImdbClient(_client); diff --git a/seed/csharp-sdk/imdb/no-custom-config/.gitignore b/seed/csharp-sdk/imdb/no-custom-config/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/imdb/no-custom-config/.gitignore +++ b/seed/csharp-sdk/imdb/no-custom-config/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/imdb/no-custom-config/snippet-templates.json b/seed/csharp-sdk/imdb/no-custom-config/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/imdb/no-custom-config/snippet.json b/seed/csharp-sdk/imdb/no-custom-config/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/RawClient.cs b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/RawClient.cs index 0777c60aec4..437825ca198 100644 --- a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/RawClient.cs +++ b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedApi.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/SeedApiClient.cs b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/SeedApiClient.cs index a0be2894837..ec79ca35044 100644 --- a/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/SeedApiClient.cs +++ b/seed/csharp-sdk/imdb/no-custom-config/src/SeedApi/SeedApiClient.cs @@ -1,3 +1,4 @@ +using System; using SeedApi; using SeedApi.Core; @@ -13,6 +14,7 @@ public SeedApiClient(string token, ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Imdb = new ImdbClient(_client); diff --git a/seed/csharp-sdk/literal/.gitignore b/seed/csharp-sdk/literal/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/literal/.gitignore +++ b/seed/csharp-sdk/literal/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/literal/snippet-templates.json b/seed/csharp-sdk/literal/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/literal/snippet.json b/seed/csharp-sdk/literal/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/literal/src/SeedLiteral/Core/RawClient.cs b/seed/csharp-sdk/literal/src/SeedLiteral/Core/RawClient.cs index 5d4853e3499..b10b0919303 100644 --- a/seed/csharp-sdk/literal/src/SeedLiteral/Core/RawClient.cs +++ b/seed/csharp-sdk/literal/src/SeedLiteral/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedLiteral.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/literal/src/SeedLiteral/SeedLiteralClient.cs b/seed/csharp-sdk/literal/src/SeedLiteral/SeedLiteralClient.cs index 43b4280b781..daf56e9cdbb 100644 --- a/seed/csharp-sdk/literal/src/SeedLiteral/SeedLiteralClient.cs +++ b/seed/csharp-sdk/literal/src/SeedLiteral/SeedLiteralClient.cs @@ -1,3 +1,4 @@ +using System; using SeedLiteral; using SeedLiteral.Core; @@ -18,6 +19,7 @@ public SeedLiteralClient(ClientOptions? clientOptions = null) { "X-API-Enable-Audit-Logging", true.ToString() }, { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Headers = new HeadersClient(_client); diff --git a/seed/csharp-sdk/mixed-case/.gitignore b/seed/csharp-sdk/mixed-case/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/mixed-case/.gitignore +++ b/seed/csharp-sdk/mixed-case/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/mixed-case/snippet-templates.json b/seed/csharp-sdk/mixed-case/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/mixed-case/snippet.json b/seed/csharp-sdk/mixed-case/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/RawClient.cs b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/RawClient.cs index b22c8fd10f1..f99078b5dad 100644 --- a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/RawClient.cs +++ b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedMixedCase.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/SeedMixedCaseClient.cs b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/SeedMixedCaseClient.cs index 65f01f58ae3..0dbc32d699e 100644 --- a/seed/csharp-sdk/mixed-case/src/SeedMixedCase/SeedMixedCaseClient.cs +++ b/seed/csharp-sdk/mixed-case/src/SeedMixedCase/SeedMixedCaseClient.cs @@ -1,3 +1,4 @@ +using System; using SeedMixedCase; using SeedMixedCase.Core; @@ -13,6 +14,7 @@ public SeedMixedCaseClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Service = new ServiceClient(_client); diff --git a/seed/csharp-sdk/multi-line-docs/.gitignore b/seed/csharp-sdk/multi-line-docs/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/multi-line-docs/.gitignore +++ b/seed/csharp-sdk/multi-line-docs/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/multi-line-docs/snippet-templates.json b/seed/csharp-sdk/multi-line-docs/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/multi-line-docs/snippet.json b/seed/csharp-sdk/multi-line-docs/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/RawClient.cs b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/RawClient.cs index 99997bcd542..d96906f50c5 100644 --- a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/RawClient.cs +++ b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedMultiLineDocs.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/SeedMultiLineDocsClient.cs b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/SeedMultiLineDocsClient.cs index d25c4835863..9bb22f83b94 100644 --- a/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/SeedMultiLineDocsClient.cs +++ b/seed/csharp-sdk/multi-line-docs/src/SeedMultiLineDocs/SeedMultiLineDocsClient.cs @@ -1,3 +1,4 @@ +using System; using SeedMultiLineDocs; using SeedMultiLineDocs.Core; @@ -13,6 +14,7 @@ public SeedMultiLineDocsClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); User = new UserClient(_client); diff --git a/seed/csharp-sdk/multi-url-environment-no-default/.gitignore b/seed/csharp-sdk/multi-url-environment-no-default/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/multi-url-environment-no-default/.gitignore +++ b/seed/csharp-sdk/multi-url-environment-no-default/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/multi-url-environment-no-default/snippet-templates.json b/seed/csharp-sdk/multi-url-environment-no-default/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/multi-url-environment-no-default/snippet.json b/seed/csharp-sdk/multi-url-environment-no-default/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/RawClient.cs b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/RawClient.cs index 4fbe36ebfda..f65b5b0e62c 100644 --- a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/RawClient.cs +++ b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedMultiUrlEnvironmentNoDefault.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/SeedMultiUrlEnvironmentNoDefaultClient.cs b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/SeedMultiUrlEnvironmentNoDefaultClient.cs index a3483399de1..eec27d2d075 100644 --- a/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/SeedMultiUrlEnvironmentNoDefaultClient.cs +++ b/seed/csharp-sdk/multi-url-environment-no-default/src/SeedMultiUrlEnvironmentNoDefault/SeedMultiUrlEnvironmentNoDefaultClient.cs @@ -1,3 +1,4 @@ +using System; using SeedMultiUrlEnvironmentNoDefault; using SeedMultiUrlEnvironmentNoDefault.Core; @@ -20,6 +21,7 @@ public SeedMultiUrlEnvironmentNoDefaultClient( { "Authorization", $"Bearer {token}" }, { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Ec2 = new Ec2Client(_client); diff --git a/seed/csharp-sdk/multi-url-environment/.gitignore b/seed/csharp-sdk/multi-url-environment/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/multi-url-environment/.gitignore +++ b/seed/csharp-sdk/multi-url-environment/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/multi-url-environment/snippet-templates.json b/seed/csharp-sdk/multi-url-environment/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/multi-url-environment/snippet.json b/seed/csharp-sdk/multi-url-environment/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/multi-url-environment/src/SeedMultiUrlEnvironment/Core/RawClient.cs b/seed/csharp-sdk/multi-url-environment/src/SeedMultiUrlEnvironment/Core/RawClient.cs index 0c9d2ef8320..cba019d03b9 100644 --- a/seed/csharp-sdk/multi-url-environment/src/SeedMultiUrlEnvironment/Core/RawClient.cs +++ b/seed/csharp-sdk/multi-url-environment/src/SeedMultiUrlEnvironment/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedMultiUrlEnvironment.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/multi-url-environment/src/SeedMultiUrlEnvironment/SeedMultiUrlEnvironmentClient.cs b/seed/csharp-sdk/multi-url-environment/src/SeedMultiUrlEnvironment/SeedMultiUrlEnvironmentClient.cs index 0b85c44dbe2..b99d63416d2 100644 --- a/seed/csharp-sdk/multi-url-environment/src/SeedMultiUrlEnvironment/SeedMultiUrlEnvironmentClient.cs +++ b/seed/csharp-sdk/multi-url-environment/src/SeedMultiUrlEnvironment/SeedMultiUrlEnvironmentClient.cs @@ -1,3 +1,4 @@ +using System; using SeedMultiUrlEnvironment; using SeedMultiUrlEnvironment.Core; @@ -17,6 +18,7 @@ public SeedMultiUrlEnvironmentClient(string? token = null, ClientOptions? client { "Authorization", $"Bearer {token}" }, { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Ec2 = new Ec2Client(_client); diff --git a/seed/csharp-sdk/no-environment/.gitignore b/seed/csharp-sdk/no-environment/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/no-environment/.gitignore +++ b/seed/csharp-sdk/no-environment/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/no-environment/snippet-templates.json b/seed/csharp-sdk/no-environment/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/no-environment/snippet.json b/seed/csharp-sdk/no-environment/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/RawClient.cs b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/RawClient.cs index 3f1792242f1..6d8aa8ebce2 100644 --- a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/RawClient.cs +++ b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedNoEnvironment.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/SeedNoEnvironmentClient.cs b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/SeedNoEnvironmentClient.cs index 07e5cecaf33..8d6b8161dc7 100644 --- a/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/SeedNoEnvironmentClient.cs +++ b/seed/csharp-sdk/no-environment/src/SeedNoEnvironment/SeedNoEnvironmentClient.cs @@ -1,3 +1,4 @@ +using System; using SeedNoEnvironment; using SeedNoEnvironment.Core; @@ -17,6 +18,7 @@ public SeedNoEnvironmentClient(string? token = null, ClientOptions? clientOption { "Authorization", $"Bearer {token}" }, { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Dummy = new DummyClient(_client); diff --git a/seed/csharp-sdk/oauth-client-credentials-default/.gitignore b/seed/csharp-sdk/oauth-client-credentials-default/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/oauth-client-credentials-default/.gitignore +++ b/seed/csharp-sdk/oauth-client-credentials-default/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/oauth-client-credentials-default/snippet-templates.json b/seed/csharp-sdk/oauth-client-credentials-default/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/oauth-client-credentials-default/snippet.json b/seed/csharp-sdk/oauth-client-credentials-default/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/RawClient.cs b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/RawClient.cs index 2ec2de91d7c..fc2e981f229 100644 --- a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/RawClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedOauthClientCredentialsDefault.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/SeedOauthClientCredentialsDefaultClient.cs b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/SeedOauthClientCredentialsDefaultClient.cs index a99734f2376..b265cbed91a 100644 --- a/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/SeedOauthClientCredentialsDefaultClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials-default/src/SeedOauthClientCredentialsDefault/SeedOauthClientCredentialsDefaultClient.cs @@ -1,3 +1,4 @@ +using System; using SeedOauthClientCredentialsDefault; using SeedOauthClientCredentialsDefault.Core; @@ -13,6 +14,7 @@ public SeedOauthClientCredentialsDefaultClient(ClientOptions? clientOptions = nu { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Auth = new AuthClient(_client); diff --git a/seed/csharp-sdk/oauth-client-credentials-environment-variables/.gitignore b/seed/csharp-sdk/oauth-client-credentials-environment-variables/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/oauth-client-credentials-environment-variables/.gitignore +++ b/seed/csharp-sdk/oauth-client-credentials-environment-variables/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/oauth-client-credentials-environment-variables/snippet-templates.json b/seed/csharp-sdk/oauth-client-credentials-environment-variables/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/oauth-client-credentials-environment-variables/snippet.json b/seed/csharp-sdk/oauth-client-credentials-environment-variables/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/RawClient.cs b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/RawClient.cs index a7f3b257f28..4116f738375 100644 --- a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/RawClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedOauthClientCredentialsEnvironmentVariables.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/SeedOauthClientCredentialsEnvironmentVariablesClient.cs b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/SeedOauthClientCredentialsEnvironmentVariablesClient.cs index 8dc3459a25d..e32291657e9 100644 --- a/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/SeedOauthClientCredentialsEnvironmentVariablesClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials-environment-variables/src/SeedOauthClientCredentialsEnvironmentVariables/SeedOauthClientCredentialsEnvironmentVariablesClient.cs @@ -1,3 +1,4 @@ +using System; using SeedOauthClientCredentialsEnvironmentVariables; using SeedOauthClientCredentialsEnvironmentVariables.Core; @@ -13,6 +14,7 @@ public SeedOauthClientCredentialsEnvironmentVariablesClient(ClientOptions? clien { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Auth = new AuthClient(_client); diff --git a/seed/csharp-sdk/oauth-client-credentials-nested-root/.gitignore b/seed/csharp-sdk/oauth-client-credentials-nested-root/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/oauth-client-credentials-nested-root/.gitignore +++ b/seed/csharp-sdk/oauth-client-credentials-nested-root/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/oauth-client-credentials-nested-root/snippet-templates.json b/seed/csharp-sdk/oauth-client-credentials-nested-root/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/oauth-client-credentials-nested-root/snippet.json b/seed/csharp-sdk/oauth-client-credentials-nested-root/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/RawClient.cs b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/RawClient.cs index 360707be442..a0b586498ca 100644 --- a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/RawClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedOauthClientCredentials.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs index 4d2c12f5f72..f482b271dff 100644 --- a/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials-nested-root/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs @@ -1,3 +1,4 @@ +using System; using SeedOauthClientCredentials.Auth; using SeedOauthClientCredentials.Core; @@ -13,6 +14,7 @@ public SeedOauthClientCredentialsClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Auth = new AuthClient(_client); diff --git a/seed/csharp-sdk/oauth-client-credentials/.gitignore b/seed/csharp-sdk/oauth-client-credentials/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/oauth-client-credentials/.gitignore +++ b/seed/csharp-sdk/oauth-client-credentials/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/oauth-client-credentials/snippet-templates.json b/seed/csharp-sdk/oauth-client-credentials/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/oauth-client-credentials/snippet.json b/seed/csharp-sdk/oauth-client-credentials/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/oauth-client-credentials/src/SeedOauthClientCredentials/Core/RawClient.cs b/seed/csharp-sdk/oauth-client-credentials/src/SeedOauthClientCredentials/Core/RawClient.cs index 360707be442..a0b586498ca 100644 --- a/seed/csharp-sdk/oauth-client-credentials/src/SeedOauthClientCredentials/Core/RawClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials/src/SeedOauthClientCredentials/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedOauthClientCredentials.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/oauth-client-credentials/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs b/seed/csharp-sdk/oauth-client-credentials/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs index a29ed1297ff..acd8d70300a 100644 --- a/seed/csharp-sdk/oauth-client-credentials/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs +++ b/seed/csharp-sdk/oauth-client-credentials/src/SeedOauthClientCredentials/SeedOauthClientCredentialsClient.cs @@ -1,3 +1,4 @@ +using System; using SeedOauthClientCredentials; using SeedOauthClientCredentials.Core; @@ -13,6 +14,7 @@ public SeedOauthClientCredentialsClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Auth = new AuthClient(_client); diff --git a/seed/csharp-sdk/object/.gitignore b/seed/csharp-sdk/object/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/object/.gitignore +++ b/seed/csharp-sdk/object/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/object/snippet-templates.json b/seed/csharp-sdk/object/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/object/snippet.json b/seed/csharp-sdk/object/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/object/src/SeedObject/Core/RawClient.cs b/seed/csharp-sdk/object/src/SeedObject/Core/RawClient.cs index 261f9b5e2a3..275c025a643 100644 --- a/seed/csharp-sdk/object/src/SeedObject/Core/RawClient.cs +++ b/seed/csharp-sdk/object/src/SeedObject/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedObject.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/object/src/SeedObject/SeedObjectClient.cs b/seed/csharp-sdk/object/src/SeedObject/SeedObjectClient.cs index dbf001d9ee9..29e7e78d210 100644 --- a/seed/csharp-sdk/object/src/SeedObject/SeedObjectClient.cs +++ b/seed/csharp-sdk/object/src/SeedObject/SeedObjectClient.cs @@ -1,3 +1,4 @@ +using System; using SeedObject.Core; #nullable enable @@ -12,6 +13,7 @@ public SeedObjectClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); } diff --git a/seed/csharp-sdk/objects-with-imports/.gitignore b/seed/csharp-sdk/objects-with-imports/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/objects-with-imports/.gitignore +++ b/seed/csharp-sdk/objects-with-imports/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/objects-with-imports/snippet-templates.json b/seed/csharp-sdk/objects-with-imports/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/objects-with-imports/snippet.json b/seed/csharp-sdk/objects-with-imports/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/RawClient.cs b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/RawClient.cs index c78a8c917ea..c3eb5ad5e87 100644 --- a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/RawClient.cs +++ b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedObjectsWithImports.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs index 1e0da9c0e57..7c0f8a0c2f5 100644 --- a/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs +++ b/seed/csharp-sdk/objects-with-imports/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs @@ -1,3 +1,4 @@ +using System; using SeedObjectsWithImports; using SeedObjectsWithImports.Commons; using SeedObjectsWithImports.Core; @@ -14,6 +15,7 @@ public SeedObjectsWithImportsClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Commons = new CommonsClient(_client); diff --git a/seed/csharp-sdk/optional/.gitignore b/seed/csharp-sdk/optional/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/optional/.gitignore +++ b/seed/csharp-sdk/optional/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/optional/snippet-templates.json b/seed/csharp-sdk/optional/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/optional/snippet.json b/seed/csharp-sdk/optional/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/optional/src/SeedObjectsWithImports/Core/RawClient.cs b/seed/csharp-sdk/optional/src/SeedObjectsWithImports/Core/RawClient.cs index c78a8c917ea..c3eb5ad5e87 100644 --- a/seed/csharp-sdk/optional/src/SeedObjectsWithImports/Core/RawClient.cs +++ b/seed/csharp-sdk/optional/src/SeedObjectsWithImports/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedObjectsWithImports.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/optional/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs b/seed/csharp-sdk/optional/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs index 132f73b09df..523241dc4fd 100644 --- a/seed/csharp-sdk/optional/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs +++ b/seed/csharp-sdk/optional/src/SeedObjectsWithImports/SeedObjectsWithImportsClient.cs @@ -1,3 +1,4 @@ +using System; using SeedObjectsWithImports; using SeedObjectsWithImports.Core; @@ -13,6 +14,7 @@ public SeedObjectsWithImportsClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Optional = new OptionalClient(_client); diff --git a/seed/csharp-sdk/package-yml/.gitignore b/seed/csharp-sdk/package-yml/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/package-yml/.gitignore +++ b/seed/csharp-sdk/package-yml/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/package-yml/snippet-templates.json b/seed/csharp-sdk/package-yml/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/package-yml/snippet.json b/seed/csharp-sdk/package-yml/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/RawClient.cs b/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/RawClient.cs index e370129c2b2..e2587b52e75 100644 --- a/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/RawClient.cs +++ b/seed/csharp-sdk/package-yml/src/SeedPackageYml/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedPackageYml.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/package-yml/src/SeedPackageYml/SeedPackageYmlClient.cs b/seed/csharp-sdk/package-yml/src/SeedPackageYml/SeedPackageYmlClient.cs index 19d9491a870..04508399b9a 100644 --- a/seed/csharp-sdk/package-yml/src/SeedPackageYml/SeedPackageYmlClient.cs +++ b/seed/csharp-sdk/package-yml/src/SeedPackageYml/SeedPackageYmlClient.cs @@ -1,3 +1,4 @@ +using System; using System.Net.Http; using SeedPackageYml; using SeedPackageYml.Core; @@ -14,6 +15,7 @@ public SeedPackageYmlClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Service = new ServiceClient(_client); diff --git a/seed/csharp-sdk/pagination/.gitignore b/seed/csharp-sdk/pagination/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/pagination/.gitignore +++ b/seed/csharp-sdk/pagination/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/pagination/snippet-templates.json b/seed/csharp-sdk/pagination/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/pagination/snippet.json b/seed/csharp-sdk/pagination/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/pagination/src/SeedPagination/Core/RawClient.cs b/seed/csharp-sdk/pagination/src/SeedPagination/Core/RawClient.cs index ac82a67beed..545a7dc83cb 100644 --- a/seed/csharp-sdk/pagination/src/SeedPagination/Core/RawClient.cs +++ b/seed/csharp-sdk/pagination/src/SeedPagination/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedPagination.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/pagination/src/SeedPagination/SeedPaginationClient.cs b/seed/csharp-sdk/pagination/src/SeedPagination/SeedPaginationClient.cs index 95b6685a31a..98b6f7349bc 100644 --- a/seed/csharp-sdk/pagination/src/SeedPagination/SeedPaginationClient.cs +++ b/seed/csharp-sdk/pagination/src/SeedPagination/SeedPaginationClient.cs @@ -1,3 +1,4 @@ +using System; using SeedPagination; using SeedPagination.Core; @@ -13,6 +14,7 @@ public SeedPaginationClient(string token, ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Users = new UsersClient(_client); diff --git a/seed/csharp-sdk/plain-text/.gitignore b/seed/csharp-sdk/plain-text/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/plain-text/.gitignore +++ b/seed/csharp-sdk/plain-text/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/plain-text/snippet-templates.json b/seed/csharp-sdk/plain-text/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/plain-text/snippet.json b/seed/csharp-sdk/plain-text/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/RawClient.cs b/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/RawClient.cs index 932b568d3c3..e857412e886 100644 --- a/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/RawClient.cs +++ b/seed/csharp-sdk/plain-text/src/SeedPlainText/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedPlainText.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/plain-text/src/SeedPlainText/SeedPlainTextClient.cs b/seed/csharp-sdk/plain-text/src/SeedPlainText/SeedPlainTextClient.cs index 4889e322b9e..c0284321f36 100644 --- a/seed/csharp-sdk/plain-text/src/SeedPlainText/SeedPlainTextClient.cs +++ b/seed/csharp-sdk/plain-text/src/SeedPlainText/SeedPlainTextClient.cs @@ -1,3 +1,4 @@ +using System; using SeedPlainText; using SeedPlainText.Core; @@ -13,6 +14,7 @@ public SeedPlainTextClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Service = new ServiceClient(_client); diff --git a/seed/csharp-sdk/query-parameters/.gitignore b/seed/csharp-sdk/query-parameters/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/query-parameters/.gitignore +++ b/seed/csharp-sdk/query-parameters/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/query-parameters/snippet-templates.json b/seed/csharp-sdk/query-parameters/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/query-parameters/snippet.json b/seed/csharp-sdk/query-parameters/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/RawClient.cs b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/RawClient.cs index 3276c2362d2..80f41ad985e 100644 --- a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/RawClient.cs +++ b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedQueryParameters.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/SeedQueryParametersClient.cs b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/SeedQueryParametersClient.cs index efe285f2ef8..72a218e9f87 100644 --- a/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/SeedQueryParametersClient.cs +++ b/seed/csharp-sdk/query-parameters/src/SeedQueryParameters/SeedQueryParametersClient.cs @@ -1,3 +1,4 @@ +using System; using SeedQueryParameters; using SeedQueryParameters.Core; @@ -13,6 +14,7 @@ public SeedQueryParametersClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); User = new UserClient(_client); diff --git a/seed/csharp-sdk/reserved-keywords/.gitignore b/seed/csharp-sdk/reserved-keywords/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/reserved-keywords/.gitignore +++ b/seed/csharp-sdk/reserved-keywords/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/reserved-keywords/snippet-templates.json b/seed/csharp-sdk/reserved-keywords/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/reserved-keywords/snippet.json b/seed/csharp-sdk/reserved-keywords/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/RawClient.cs b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/RawClient.cs index 80aca62d44a..5eb90c93383 100644 --- a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/RawClient.cs +++ b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedNurseryApi.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/SeedNurseryApiClient.cs b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/SeedNurseryApiClient.cs index 87ade547ef5..2dd4bdbb3e1 100644 --- a/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/SeedNurseryApiClient.cs +++ b/seed/csharp-sdk/reserved-keywords/src/SeedNurseryApi/SeedNurseryApiClient.cs @@ -1,3 +1,4 @@ +using System; using SeedNurseryApi; using SeedNurseryApi.Core; @@ -13,6 +14,7 @@ public SeedNurseryApiClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Package = new PackageClient(_client); diff --git a/seed/csharp-sdk/response-property/.gitignore b/seed/csharp-sdk/response-property/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/response-property/.gitignore +++ b/seed/csharp-sdk/response-property/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/response-property/snippet-templates.json b/seed/csharp-sdk/response-property/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/response-property/snippet.json b/seed/csharp-sdk/response-property/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/RawClient.cs b/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/RawClient.cs index a29d3c54cd9..69a5cfb63fb 100644 --- a/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/RawClient.cs +++ b/seed/csharp-sdk/response-property/src/SeedResponseProperty/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedResponseProperty.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/response-property/src/SeedResponseProperty/SeedResponsePropertyClient.cs b/seed/csharp-sdk/response-property/src/SeedResponseProperty/SeedResponsePropertyClient.cs index ffbd4e003fb..be458908b44 100644 --- a/seed/csharp-sdk/response-property/src/SeedResponseProperty/SeedResponsePropertyClient.cs +++ b/seed/csharp-sdk/response-property/src/SeedResponseProperty/SeedResponsePropertyClient.cs @@ -1,3 +1,4 @@ +using System; using SeedResponseProperty; using SeedResponseProperty.Core; @@ -13,6 +14,7 @@ public SeedResponsePropertyClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Service = new ServiceClient(_client); diff --git a/seed/csharp-sdk/server-sent-events/.gitignore b/seed/csharp-sdk/server-sent-events/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/server-sent-events/.gitignore +++ b/seed/csharp-sdk/server-sent-events/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/server-sent-events/snippet-templates.json b/seed/csharp-sdk/server-sent-events/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/server-sent-events/snippet.json b/seed/csharp-sdk/server-sent-events/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/RawClient.cs b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/RawClient.cs index 941c28ddbf5..e6c5f91b880 100644 --- a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/RawClient.cs +++ b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedServerSentEvents.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/SeedServerSentEventsClient.cs b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/SeedServerSentEventsClient.cs index ce9cd1bcc08..e91de74227f 100644 --- a/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/SeedServerSentEventsClient.cs +++ b/seed/csharp-sdk/server-sent-events/src/SeedServerSentEvents/SeedServerSentEventsClient.cs @@ -1,3 +1,4 @@ +using System; using SeedServerSentEvents; using SeedServerSentEvents.Core; @@ -13,6 +14,7 @@ public SeedServerSentEventsClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Completions = new CompletionsClient(_client); diff --git a/seed/csharp-sdk/single-url-environment-default/.gitignore b/seed/csharp-sdk/single-url-environment-default/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/single-url-environment-default/.gitignore +++ b/seed/csharp-sdk/single-url-environment-default/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/single-url-environment-default/snippet-templates.json b/seed/csharp-sdk/single-url-environment-default/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/single-url-environment-default/snippet.json b/seed/csharp-sdk/single-url-environment-default/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/RawClient.cs b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/RawClient.cs index 4c4b723641b..eef7fb18f2a 100644 --- a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/RawClient.cs +++ b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedSingleUrlEnvironmentDefault.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/SeedSingleUrlEnvironmentDefaultClient.cs b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/SeedSingleUrlEnvironmentDefaultClient.cs index e140fe05d76..f041a12e761 100644 --- a/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/SeedSingleUrlEnvironmentDefaultClient.cs +++ b/seed/csharp-sdk/single-url-environment-default/src/SeedSingleUrlEnvironmentDefault/SeedSingleUrlEnvironmentDefaultClient.cs @@ -1,3 +1,4 @@ +using System; using SeedSingleUrlEnvironmentDefault; using SeedSingleUrlEnvironmentDefault.Core; @@ -20,6 +21,7 @@ public SeedSingleUrlEnvironmentDefaultClient( { "Authorization", $"Bearer {token}" }, { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Dummy = new DummyClient(_client); diff --git a/seed/csharp-sdk/single-url-environment-no-default/.gitignore b/seed/csharp-sdk/single-url-environment-no-default/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/single-url-environment-no-default/.gitignore +++ b/seed/csharp-sdk/single-url-environment-no-default/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/single-url-environment-no-default/snippet-templates.json b/seed/csharp-sdk/single-url-environment-no-default/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/single-url-environment-no-default/snippet.json b/seed/csharp-sdk/single-url-environment-no-default/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/RawClient.cs b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/RawClient.cs index d2d952961e2..bf74e39aafb 100644 --- a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/RawClient.cs +++ b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedSingleUrlEnvironmentNoDefault.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/SeedSingleUrlEnvironmentNoDefaultClient.cs b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/SeedSingleUrlEnvironmentNoDefaultClient.cs index a6cf6b67751..440bb4890fd 100644 --- a/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/SeedSingleUrlEnvironmentNoDefaultClient.cs +++ b/seed/csharp-sdk/single-url-environment-no-default/src/SeedSingleUrlEnvironmentNoDefault/SeedSingleUrlEnvironmentNoDefaultClient.cs @@ -1,3 +1,4 @@ +using System; using SeedSingleUrlEnvironmentNoDefault; using SeedSingleUrlEnvironmentNoDefault.Core; @@ -20,6 +21,7 @@ public SeedSingleUrlEnvironmentNoDefaultClient( { "Authorization", $"Bearer {token}" }, { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Dummy = new DummyClient(_client); diff --git a/seed/csharp-sdk/streaming-parameter/.gitignore b/seed/csharp-sdk/streaming-parameter/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/streaming-parameter/.gitignore +++ b/seed/csharp-sdk/streaming-parameter/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/streaming-parameter/snippet-templates.json b/seed/csharp-sdk/streaming-parameter/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/streaming-parameter/snippet.json b/seed/csharp-sdk/streaming-parameter/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/RawClient.cs b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/RawClient.cs index 60ae725f857..b2a52b7cbef 100644 --- a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/RawClient.cs +++ b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedStreaming.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/SeedStreamingClient.cs b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/SeedStreamingClient.cs index 3e74e8c6717..41d00fcf6c0 100644 --- a/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/SeedStreamingClient.cs +++ b/seed/csharp-sdk/streaming-parameter/src/SeedStreaming/SeedStreamingClient.cs @@ -1,3 +1,4 @@ +using System; using SeedStreaming; using SeedStreaming.Core; @@ -13,6 +14,7 @@ public SeedStreamingClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Dummy = new DummyClient(_client); diff --git a/seed/csharp-sdk/streaming/.gitignore b/seed/csharp-sdk/streaming/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/streaming/.gitignore +++ b/seed/csharp-sdk/streaming/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/streaming/snippet-templates.json b/seed/csharp-sdk/streaming/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/streaming/snippet.json b/seed/csharp-sdk/streaming/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/streaming/src/SeedStreaming/Core/RawClient.cs b/seed/csharp-sdk/streaming/src/SeedStreaming/Core/RawClient.cs index 60ae725f857..b2a52b7cbef 100644 --- a/seed/csharp-sdk/streaming/src/SeedStreaming/Core/RawClient.cs +++ b/seed/csharp-sdk/streaming/src/SeedStreaming/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedStreaming.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/streaming/src/SeedStreaming/SeedStreamingClient.cs b/seed/csharp-sdk/streaming/src/SeedStreaming/SeedStreamingClient.cs index 3e74e8c6717..41d00fcf6c0 100644 --- a/seed/csharp-sdk/streaming/src/SeedStreaming/SeedStreamingClient.cs +++ b/seed/csharp-sdk/streaming/src/SeedStreaming/SeedStreamingClient.cs @@ -1,3 +1,4 @@ +using System; using SeedStreaming; using SeedStreaming.Core; @@ -13,6 +14,7 @@ public SeedStreamingClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Dummy = new DummyClient(_client); diff --git a/seed/csharp-sdk/trace/.gitignore b/seed/csharp-sdk/trace/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/trace/.gitignore +++ b/seed/csharp-sdk/trace/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/trace/snippet-templates.json b/seed/csharp-sdk/trace/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/trace/snippet.json b/seed/csharp-sdk/trace/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/trace/src/SeedTrace/Core/RawClient.cs b/seed/csharp-sdk/trace/src/SeedTrace/Core/RawClient.cs index d665711889c..2ffd130a237 100644 --- a/seed/csharp-sdk/trace/src/SeedTrace/Core/RawClient.cs +++ b/seed/csharp-sdk/trace/src/SeedTrace/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedTrace.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/trace/src/SeedTrace/SeedTraceClient.cs b/seed/csharp-sdk/trace/src/SeedTrace/SeedTraceClient.cs index b5a468c95c9..280510b6352 100644 --- a/seed/csharp-sdk/trace/src/SeedTrace/SeedTraceClient.cs +++ b/seed/csharp-sdk/trace/src/SeedTrace/SeedTraceClient.cs @@ -1,3 +1,4 @@ +using System; using SeedTrace; using SeedTrace.Core; using SeedTrace.V2; @@ -22,6 +23,7 @@ public SeedTraceClient( { "X-Random-Header", xRandomHeader }, { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); V2 = new V2Client(_client); diff --git a/seed/csharp-sdk/undiscriminated-unions/.gitignore b/seed/csharp-sdk/undiscriminated-unions/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/undiscriminated-unions/.gitignore +++ b/seed/csharp-sdk/undiscriminated-unions/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/undiscriminated-unions/snippet-templates.json b/seed/csharp-sdk/undiscriminated-unions/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/undiscriminated-unions/snippet.json b/seed/csharp-sdk/undiscriminated-unions/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/RawClient.cs b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/RawClient.cs index 7cb0fb02e4e..b8e7dd91094 100644 --- a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/RawClient.cs +++ b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedUndiscriminatedUnions.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/SeedUndiscriminatedUnionsClient.cs b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/SeedUndiscriminatedUnionsClient.cs index a3fda918d61..1e601b36d02 100644 --- a/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/SeedUndiscriminatedUnionsClient.cs +++ b/seed/csharp-sdk/undiscriminated-unions/src/SeedUndiscriminatedUnions/SeedUndiscriminatedUnionsClient.cs @@ -1,3 +1,4 @@ +using System; using SeedUndiscriminatedUnions; using SeedUndiscriminatedUnions.Core; @@ -13,6 +14,7 @@ public SeedUndiscriminatedUnionsClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Union = new UnionClient(_client); diff --git a/seed/csharp-sdk/unions/.gitignore b/seed/csharp-sdk/unions/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/unions/.gitignore +++ b/seed/csharp-sdk/unions/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/unions/snippet-templates.json b/seed/csharp-sdk/unions/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/unions/snippet.json b/seed/csharp-sdk/unions/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/unions/src/SeedUnions/Core/RawClient.cs b/seed/csharp-sdk/unions/src/SeedUnions/Core/RawClient.cs index d81de94b22e..19341c4d6fd 100644 --- a/seed/csharp-sdk/unions/src/SeedUnions/Core/RawClient.cs +++ b/seed/csharp-sdk/unions/src/SeedUnions/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedUnions.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/unions/src/SeedUnions/SeedUnionsClient.cs b/seed/csharp-sdk/unions/src/SeedUnions/SeedUnionsClient.cs index cae0eb2583a..48736c2bc4d 100644 --- a/seed/csharp-sdk/unions/src/SeedUnions/SeedUnionsClient.cs +++ b/seed/csharp-sdk/unions/src/SeedUnions/SeedUnionsClient.cs @@ -1,3 +1,4 @@ +using System; using SeedUnions; using SeedUnions.Core; @@ -13,6 +14,7 @@ public SeedUnionsClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Types = new TypesClient(_client); diff --git a/seed/csharp-sdk/unknown/.gitignore b/seed/csharp-sdk/unknown/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/unknown/.gitignore +++ b/seed/csharp-sdk/unknown/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/unknown/snippet-templates.json b/seed/csharp-sdk/unknown/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/unknown/snippet.json b/seed/csharp-sdk/unknown/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/RawClient.cs b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/RawClient.cs index e65818963c8..91110baf3c6 100644 --- a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/RawClient.cs +++ b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedUnknownAsAny.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/SeedUnknownAsAnyClient.cs b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/SeedUnknownAsAnyClient.cs index 5db7403081a..501f558003e 100644 --- a/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/SeedUnknownAsAnyClient.cs +++ b/seed/csharp-sdk/unknown/src/SeedUnknownAsAny/SeedUnknownAsAnyClient.cs @@ -1,3 +1,4 @@ +using System; using SeedUnknownAsAny; using SeedUnknownAsAny.Core; @@ -13,6 +14,7 @@ public SeedUnknownAsAnyClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Unknown = new UnknownClient(_client); diff --git a/seed/csharp-sdk/validation/.gitignore b/seed/csharp-sdk/validation/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/validation/.gitignore +++ b/seed/csharp-sdk/validation/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/validation/.mock/definition/__package__.yml b/seed/csharp-sdk/validation/.mock/definition/__package__.yml index eaf728964b0..a98f2ba3c08 100644 --- a/seed/csharp-sdk/validation/.mock/definition/__package__.yml +++ b/seed/csharp-sdk/validation/.mock/definition/__package__.yml @@ -32,6 +32,13 @@ types: minLength: 4 maxLength: 256 + Shape: + default: CIRCLE + enum: + - SQUARE + - CIRCLE + - TRIANGLE + Type: docs: | Defines properties with default values and validation rules. @@ -62,12 +69,16 @@ types: maxLength: 10 pattern: "^[a-z]+$" format: custom + shape: + type: Shape + default: TRIANGLE examples: - name: First value: decimal: 1.1 even: 2 name: rules + shape: SQUARE service: auth: false @@ -106,6 +117,9 @@ service: maxLength: 10 pattern: "^[a-z]+$" format: custom + shape: + type: Shape + default: SQUARE response: Type get: diff --git a/seed/csharp-sdk/validation/snippet-templates.json b/seed/csharp-sdk/validation/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/validation/snippet.json b/seed/csharp-sdk/validation/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/validation/src/SeedValidation.Test/Unit/Serialization/TypeTest.cs b/seed/csharp-sdk/validation/src/SeedValidation.Test/Unit/Serialization/TypeTest.cs index 00a6a25cb63..e36614fffc0 100644 --- a/seed/csharp-sdk/validation/src/SeedValidation.Test/Unit/Serialization/TypeTest.cs +++ b/seed/csharp-sdk/validation/src/SeedValidation.Test/Unit/Serialization/TypeTest.cs @@ -19,7 +19,8 @@ public void TestSerialization() { ""decimal"": 1.1, ""even"": 2, - ""name"": ""rules"" + ""name"": ""rules"", + ""shape"": ""SQUARE"" } "; diff --git a/seed/csharp-sdk/validation/src/SeedValidation/Core/RawClient.cs b/seed/csharp-sdk/validation/src/SeedValidation/Core/RawClient.cs index 7a0917ab8aa..d94042a2111 100644 --- a/seed/csharp-sdk/validation/src/SeedValidation/Core/RawClient.cs +++ b/seed/csharp-sdk/validation/src/SeedValidation/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedValidation.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/validation/src/SeedValidation/Requests/CreateRequest.cs b/seed/csharp-sdk/validation/src/SeedValidation/Requests/CreateRequest.cs index 412ef3a8c9c..266c4c51357 100644 --- a/seed/csharp-sdk/validation/src/SeedValidation/Requests/CreateRequest.cs +++ b/seed/csharp-sdk/validation/src/SeedValidation/Requests/CreateRequest.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; +using SeedValidation; #nullable enable @@ -14,4 +15,7 @@ public record CreateRequest [JsonPropertyName("name")] public required string Name { get; init; } + + [JsonPropertyName("shape")] + public required Shape Shape { get; init; } } diff --git a/seed/csharp-sdk/validation/src/SeedValidation/SeedValidationClient.cs b/seed/csharp-sdk/validation/src/SeedValidation/SeedValidationClient.cs index 8351439b14a..216f0b7a2cf 100644 --- a/seed/csharp-sdk/validation/src/SeedValidation/SeedValidationClient.cs +++ b/seed/csharp-sdk/validation/src/SeedValidation/SeedValidationClient.cs @@ -1,3 +1,4 @@ +using System; using System.Net.Http; using SeedValidation; using SeedValidation.Core; @@ -14,6 +15,7 @@ public SeedValidationClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); } diff --git a/seed/csharp-sdk/validation/src/SeedValidation/Types/Shape.cs b/seed/csharp-sdk/validation/src/SeedValidation/Types/Shape.cs new file mode 100644 index 00000000000..b703ec43ed5 --- /dev/null +++ b/seed/csharp-sdk/validation/src/SeedValidation/Types/Shape.cs @@ -0,0 +1,21 @@ +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using SeedValidation; +using SeedValidation.Core; + +#nullable enable + +namespace SeedValidation; + +[JsonConverter(typeof(StringEnumSerializer))] +public enum Shape +{ + [EnumMember(Value = "SQUARE")] + Square, + + [EnumMember(Value = "CIRCLE")] + Circle, + + [EnumMember(Value = "TRIANGLE")] + Triangle +} diff --git a/seed/csharp-sdk/validation/src/SeedValidation/Types/Type.cs b/seed/csharp-sdk/validation/src/SeedValidation/Types/Type.cs index a9e96b564e7..71256c0e109 100644 --- a/seed/csharp-sdk/validation/src/SeedValidation/Types/Type.cs +++ b/seed/csharp-sdk/validation/src/SeedValidation/Types/Type.cs @@ -1,4 +1,5 @@ using System.Text.Json.Serialization; +using SeedValidation; #nullable enable @@ -14,4 +15,7 @@ public record Type [JsonPropertyName("name")] public required string Name { get; init; } + + [JsonPropertyName("shape")] + public required Shape Shape { get; init; } } diff --git a/seed/csharp-sdk/variables/.gitignore b/seed/csharp-sdk/variables/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/variables/.gitignore +++ b/seed/csharp-sdk/variables/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/variables/snippet-templates.json b/seed/csharp-sdk/variables/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/variables/snippet.json b/seed/csharp-sdk/variables/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/variables/src/SeedVariables/Core/RawClient.cs b/seed/csharp-sdk/variables/src/SeedVariables/Core/RawClient.cs index 17c70c3e57f..154bca4c4b9 100644 --- a/seed/csharp-sdk/variables/src/SeedVariables/Core/RawClient.cs +++ b/seed/csharp-sdk/variables/src/SeedVariables/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedVariables.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/variables/src/SeedVariables/SeedVariablesClient.cs b/seed/csharp-sdk/variables/src/SeedVariables/SeedVariablesClient.cs index 398fae96e06..52bf6b70c97 100644 --- a/seed/csharp-sdk/variables/src/SeedVariables/SeedVariablesClient.cs +++ b/seed/csharp-sdk/variables/src/SeedVariables/SeedVariablesClient.cs @@ -1,3 +1,4 @@ +using System; using SeedVariables; using SeedVariables.Core; @@ -13,6 +14,7 @@ public SeedVariablesClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Service = new ServiceClient(_client); diff --git a/seed/csharp-sdk/version-no-default/.gitignore b/seed/csharp-sdk/version-no-default/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/version-no-default/.gitignore +++ b/seed/csharp-sdk/version-no-default/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/version-no-default/snippet-templates.json b/seed/csharp-sdk/version-no-default/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/version-no-default/snippet.json b/seed/csharp-sdk/version-no-default/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/RawClient.cs b/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/RawClient.cs index 6c41d10cc40..db8d12b0d6e 100644 --- a/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/RawClient.cs +++ b/seed/csharp-sdk/version-no-default/src/SeedVersion/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedVersion.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/version-no-default/src/SeedVersion/SeedVersionClient.cs b/seed/csharp-sdk/version-no-default/src/SeedVersion/SeedVersionClient.cs index 6d7d351e5f9..3ac891ba67a 100644 --- a/seed/csharp-sdk/version-no-default/src/SeedVersion/SeedVersionClient.cs +++ b/seed/csharp-sdk/version-no-default/src/SeedVersion/SeedVersionClient.cs @@ -1,3 +1,4 @@ +using System; using SeedVersion; using SeedVersion.Core; @@ -13,6 +14,7 @@ public SeedVersionClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); User = new UserClient(_client); diff --git a/seed/csharp-sdk/version/.gitignore b/seed/csharp-sdk/version/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/version/.gitignore +++ b/seed/csharp-sdk/version/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/version/snippet-templates.json b/seed/csharp-sdk/version/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/version/snippet.json b/seed/csharp-sdk/version/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/version/src/SeedVersion/Core/RawClient.cs b/seed/csharp-sdk/version/src/SeedVersion/Core/RawClient.cs index 6c41d10cc40..db8d12b0d6e 100644 --- a/seed/csharp-sdk/version/src/SeedVersion/Core/RawClient.cs +++ b/seed/csharp-sdk/version/src/SeedVersion/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedVersion.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/version/src/SeedVersion/SeedVersionClient.cs b/seed/csharp-sdk/version/src/SeedVersion/SeedVersionClient.cs index 6d7d351e5f9..3ac891ba67a 100644 --- a/seed/csharp-sdk/version/src/SeedVersion/SeedVersionClient.cs +++ b/seed/csharp-sdk/version/src/SeedVersion/SeedVersionClient.cs @@ -1,3 +1,4 @@ +using System; using SeedVersion; using SeedVersion.Core; @@ -13,6 +14,7 @@ public SeedVersionClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); User = new UserClient(_client); diff --git a/seed/csharp-sdk/websocket/.gitignore b/seed/csharp-sdk/websocket/.gitignore index 9965de29662..5e57f18055d 100644 --- a/seed/csharp-sdk/websocket/.gitignore +++ b/seed/csharp-sdk/websocket/.gitignore @@ -1,7 +1,10 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files *.rsuser @@ -399,6 +402,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +.idea ## ## Visual studio for Mac @@ -475,3 +479,6 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk + +# Vim temporary swap files +*.swp diff --git a/seed/csharp-sdk/websocket/snippet-templates.json b/seed/csharp-sdk/websocket/snippet-templates.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/websocket/snippet.json b/seed/csharp-sdk/websocket/snippet.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/RawClient.cs b/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/RawClient.cs index 8ea90b794cf..6c060ad2cf5 100644 --- a/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/RawClient.cs +++ b/seed/csharp-sdk/websocket/src/SeedWebsocket/Core/RawClient.cs @@ -8,7 +8,11 @@ namespace SeedWebsocket.Core; /// /// Utility class for making raw HTTP requests to the API. /// -public class RawClient(Dictionary headers, ClientOptions clientOptions) +public class RawClient( + Dictionary headers, + Dictionary> headerSuppliers, + ClientOptions clientOptions +) { /// /// The http client used to make requests. @@ -33,6 +37,11 @@ public async Task MakeRequestAsync(BaseApiRequest request) { httpRequest.Headers.Add(header.Key, header.Value); } + // Add global headers to the request from supplier + foreach (var header in headerSuppliers) + { + httpRequest.Headers.Add(header.Key, header.Value.Invoke()); + } // Add request headers to the request foreach (var header in request.Headers) { diff --git a/seed/csharp-sdk/websocket/src/SeedWebsocket/SeedWebsocketClient.cs b/seed/csharp-sdk/websocket/src/SeedWebsocket/SeedWebsocketClient.cs index fcd28ef78d6..3697762b4a0 100644 --- a/seed/csharp-sdk/websocket/src/SeedWebsocket/SeedWebsocketClient.cs +++ b/seed/csharp-sdk/websocket/src/SeedWebsocket/SeedWebsocketClient.cs @@ -1,3 +1,4 @@ +using System; using SeedWebsocket; using SeedWebsocket.Core; @@ -13,6 +14,7 @@ public SeedWebsocketClient(ClientOptions? clientOptions = null) { _client = new RawClient( new Dictionary() { { "X-Fern-Language", "C#" }, }, + new Dictionary>() { }, clientOptions ?? new ClientOptions() ); Realtime = new RealtimeClient(_client);