From 12c221ba649146f01379d83199824d4c27e22750 Mon Sep 17 00:00:00 2001 From: Grzegorz Biernacki Date: Mon, 19 Oct 2026 09:47:36 +0200 Subject: [PATCH 1/4] Upgrade .NET generator to 7.26.0 --- .../.github/workflows/github-actions.yml | 4 +- sdks/dotnet/README.md | 3 +- sdks/dotnet/bin/dotnet | 2 +- sdks/dotnet/openapi-config.yaml | 2 +- sdks/dotnet/run-build | 11 +- .../Dropbox.Sign.Test.csproj | 2 +- .../dotnet/src/Dropbox.Sign/Api/AccountApi.cs | 40 +-- sdks/dotnet/src/Dropbox.Sign/Api/ApiAppApi.cs | 48 +-- .../src/Dropbox.Sign/Api/BulkSendJobApi.cs | 32 +- .../src/Dropbox.Sign/Api/DocumentApi.cs | 8 +- .../src/Dropbox.Sign/Api/EmbeddedApi.cs | 16 +- sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs | 48 +-- .../dotnet/src/Dropbox.Sign/Api/FaxLineApi.cs | 72 ++-- sdks/dotnet/src/Dropbox.Sign/Api/OAuthApi.cs | 16 +- sdks/dotnet/src/Dropbox.Sign/Api/ReportApi.cs | 8 +- .../Dropbox.Sign/Api/SignatureRequestApi.cs | 184 +++++------ sdks/dotnet/src/Dropbox.Sign/Api/TeamApi.cs | 120 +++---- .../src/Dropbox.Sign/Api/TemplateApi.cs | 112 +++---- .../src/Dropbox.Sign/Api/UnclaimedDraftApi.cs | 32 +- .../src/Dropbox.Sign/Client/ApiClient.cs | 8 +- .../src/Dropbox.Sign/Client/ClientUtils.cs | 28 ++ .../src/Dropbox.Sign/Client/Configuration.cs | 4 +- .../Client/IAsynchronousClient.cs | 14 +- .../src/Dropbox.Sign/Dropbox.Sign.csproj | 2 +- sdks/dotnet/templates/ApiClient.mustache | 20 +- sdks/dotnet/templates/ApiClient.v790.mustache | 7 +- sdks/dotnet/templates/AssemblyInfo.mustache | 1 + sdks/dotnet/templates/ClientUtils.mustache | 28 ++ sdks/dotnet/templates/Configuration.mustache | 4 +- .../templates/Configuration.v790.mustache | 2 +- .../HttpSigningConfiguration.mustache | 13 +- .../templates/IAsynchronousClient.mustache | 14 +- sdks/dotnet/templates/README.mustache | 3 + .../templates/RetryConfiguration.mustache | 14 +- sdks/dotnet/templates/api.mustache | 24 +- sdks/dotnet/templates/api_doc.mustache | 2 + ...terOperationDefaultImplementation.mustache | 2 +- .../generichost/ApiException.mustache | 1 + .../libraries/generichost/ApiFactory.mustache | 1 + .../generichost/ApiKeyToken.mustache | 5 +- .../ApiResponseEventArgs`1.mustache | 1 + .../generichost/ApiResponse`1.mustache | 48 +++ .../generichost/ApiTestsBase.mustache | 3 +- .../libraries/generichost/AsModel.mustache | 4 +- .../libraries/generichost/BasicToken.mustache | 5 +- .../generichost/BearerToken.mustache | 5 +- .../generichost/ClientUtils.mustache | 60 ++++ .../generichost/CookieContainer.mustache | 5 +- .../DateOnlyJsonConverter.mustache | 3 +- .../DateOnlyNullableJsonConverter.mustache | 3 +- .../DateTimeJsonConverter.mustache | 1 + .../DateTimeNullableJsonConverter.mustache | 1 + .../DependencyInjectionTests.mustache | 8 +- .../generichost/EnumValueDataType.mustache | 2 +- .../generichost/ExceptionEventArgs.mustache | 1 + .../generichost/HostConfiguration.mustache | 87 ++++- .../HttpSigningConfiguration.mustache | 1 + .../generichost/HttpSigningToken.mustache | 5 +- .../libraries/generichost/IApi.mustache | 3 +- .../IHostBuilderExtensions.mustache | 4 +- .../IServiceCollectionExtensions.mustache | 18 +- .../generichost/JsonConverter.mustache | 135 +++++--- .../JsonSerializerOptionsProvider.mustache | 5 +- .../libraries/generichost/OAuthToken.mustache | 5 +- .../OnDeserializationError.mustache | 2 +- .../OnErrorDefaultImplementation.mustache | 2 +- .../generichost/OperationSignature.mustache | 2 +- .../libraries/generichost/Option.mustache | 1 + .../generichost/README.client.mustache | 276 ++++++---------- .../generichost/README.solution.mustache | 1 + .../generichost/RateLimitProvider`1.mustache | 37 ++- .../libraries/generichost/TokenBase.mustache | 27 +- .../generichost/TokenContainer`1.mustache | 5 +- .../generichost/TokenProvider`1.mustache | 21 +- .../generichost/WriteProperty.mustache | 3 +- .../libraries/generichost/api.mustache | 309 +++++++++++++----- .../libraries/generichost/api_test.mustache | 19 +- .../libraries/generichost/model.mustache | 5 + .../generichost/modelGeneric.mustache | 25 +- .../libraries/httpclient/ApiClient.mustache | 62 ++-- .../libraries/httpclient/api.mustache | 24 +- .../unityWebRequest/ApiClient.mustache | 70 +++- .../ConnectionException.mustache | 36 ++ .../libraries/unityWebRequest/README.mustache | 2 +- .../libraries/unityWebRequest/api.mustache | 24 +- sdks/dotnet/templates/modelEnum.mustache | 168 +++++++++- sdks/dotnet/templates/modelGeneric.mustache | 14 +- sdks/dotnet/templates/modelInnerEnum.mustache | 50 ++- .../dotnet/templates/netcore_project.mustache | 77 ++++- .../templates/netcore_testproject.mustache | 13 +- sdks/dotnet/templates/validatable.mustache | 12 +- 91 files changed, 1729 insertions(+), 928 deletions(-) diff --git a/sdks/dotnet/.github/workflows/github-actions.yml b/sdks/dotnet/.github/workflows/github-actions.yml index fc7e41dee..953915ce1 100644 --- a/sdks/dotnet/.github/workflows/github-actions.yml +++ b/sdks/dotnet/.github/workflows/github-actions.yml @@ -61,7 +61,9 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 8.0.x + dotnet-version: | + 8.0.x + 10.0.x - name: Restore dependencies run: dotnet restore ${SOLUTION}.sln diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index ae722c1ef..be40b552f 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -24,7 +24,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap - API version: 3.0.0 - SDK version: 2.2-dev -- Generator version: 7.12.0 +- Generator version: 7.26.0 - Build package: org.openapitools.codegen.languages.CSharpClientCodegen ### Building @@ -45,6 +45,7 @@ this command. ## Frameworks supported +- .NET 8.0 or later (the package includes `net8.0` and `net10.0` builds) ## Dependencies diff --git a/sdks/dotnet/bin/dotnet b/sdks/dotnet/bin/dotnet index b3e5c445d..c984674c4 100755 --- a/sdks/dotnet/bin/dotnet +++ b/sdks/dotnet/bin/dotnet @@ -12,4 +12,4 @@ docker run --rm \ -v "${ROOT_DIR}:${WORKING_DIR}" \ -w "${WORKING_DIR}" \ -u root:root \ - mcr.microsoft.com/dotnet/sdk:8.0 "$@" + "${DOTNET_IMAGE:-mcr.microsoft.com/dotnet/sdk:10.0}" "$@" diff --git a/sdks/dotnet/openapi-config.yaml b/sdks/dotnet/openapi-config.yaml index 11d2095b9..5142dfac1 100644 --- a/sdks/dotnet/openapi-config.yaml +++ b/sdks/dotnet/openapi-config.yaml @@ -10,7 +10,7 @@ additionalProperties: packageTitle: Dropbox Sign .Net SDK sortModelPropertiesByRequiredFlag: true optionalEmitDefaultValues: true - targetFramework: net8.0 + targetFramework: net8.0;net10.0 library: restsharp packageGuid: "{F8C8232D-7020-4603-8E04-18D060AE530B}" legacyDiscriminatorBehavior: true diff --git a/sdks/dotnet/run-build b/sdks/dotnet/run-build index c4dff86f5..b8bc8b487 100755 --- a/sdks/dotnet/run-build +++ b/sdks/dotnet/run-build @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# see https://github.com/OpenAPITools/openapi-generator/tree/v7.12.0/modules/openapi-generator/src/main/resources/csharp +# see https://github.com/OpenAPITools/openapi-generator/tree/v7.26.0/modules/openapi-generator/src/main/resources/csharp set -e @@ -18,7 +18,7 @@ rm -f "${DIR}/src/Dropbox.Sign/Model/"*.cs docker run --rm \ -v "${DIR}/:/local" \ - openapitools/openapi-generator-cli:v7.12.0 generate \ + openapitools/openapi-generator-cli:v7.26.0 generate \ -i "/local/openapi-sdk.yaml" \ -c "/local/openapi-config.yaml" \ -t "/local/templates" \ @@ -58,7 +58,10 @@ if [[ -z "$GITHUB_ACTIONS" ]]; then find "${DIR}/src/" -type f -exec chmod 644 {} \; fi -printf "Running tests ...\n" -bash "${DIR}/bin/dotnet" dotnet test src/Dropbox.Sign.Test/ +printf "Running tests (net10.0) ...\n" +bash "${DIR}/bin/dotnet" dotnet test src/Dropbox.Sign.Test/ -f net10.0 + +printf "Running tests (net8.0) ...\n" +DOTNET_IMAGE="mcr.microsoft.com/dotnet/sdk:8.0" bash "${DIR}/bin/dotnet" dotnet test src/Dropbox.Sign.Test/ -p:TargetFrameworks=net8.0 printf "Success!\n" diff --git a/sdks/dotnet/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj b/sdks/dotnet/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj index 9f5ba396d..87fcca11f 100644 --- a/sdks/dotnet/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj +++ b/sdks/dotnet/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj @@ -3,7 +3,7 @@ Dropbox.Sign.Test Dropbox.Sign.Test - net8.0 + net8.0;net10.0 false Dropbox.Sign.Test diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/AccountApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/AccountApi.cs index 1a06b0003..71e351e51 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/AccountApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/AccountApi.cs @@ -64,7 +64,7 @@ public interface IAccountApiSync : IApiAccessor /// `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) /// Index associated with the operation. /// AccountGetResponse - AccountGetResponse AccountGet(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0); + AccountGetResponse AccountGet(string? accountId = default, string? emailAddress = default, int operationIndex = 0); /// /// Get Account @@ -78,7 +78,7 @@ public interface IAccountApiSync : IApiAccessor /// `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) /// Index associated with the operation. /// ApiResponse of AccountGetResponse - ApiResponse AccountGetWithHttpInfo(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0); + ApiResponse AccountGetWithHttpInfo(string? accountId = default, string? emailAddress = default, int operationIndex = 0); /// /// Update Account /// @@ -150,7 +150,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountCreateResponse - System.Threading.Tasks.Task AccountCreateAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task AccountCreateAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Account @@ -164,7 +164,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountCreateResponse) - System.Threading.Tasks.Task> AccountCreateWithHttpInfoAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AccountCreateWithHttpInfoAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Account /// @@ -178,7 +178,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountGetResponse - System.Threading.Tasks.Task AccountGetAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task AccountGetAsync(string? accountId = default, string? emailAddress = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Account @@ -193,7 +193,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountGetResponse) - System.Threading.Tasks.Task> AccountGetWithHttpInfoAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AccountGetWithHttpInfoAsync(string? accountId = default, string? emailAddress = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Update Account /// @@ -206,7 +206,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountGetResponse - System.Threading.Tasks.Task AccountUpdateAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task AccountUpdateAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Update Account @@ -220,7 +220,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountGetResponse) - System.Threading.Tasks.Task> AccountUpdateWithHttpInfoAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AccountUpdateWithHttpInfoAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Verify Account /// @@ -233,7 +233,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountVerifyResponse - System.Threading.Tasks.Task AccountVerifyAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task AccountVerifyAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Verify Account @@ -247,7 +247,7 @@ public interface IAccountApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountVerifyResponse) - System.Threading.Tasks.Task> AccountVerifyWithHttpInfoAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> AccountVerifyWithHttpInfoAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -469,7 +469,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountCreateResponse - public async System.Threading.Tasks.Task AccountCreateAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AccountCreateAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await AccountCreateWithHttpInfoAsync(accountCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -484,7 +484,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountCreateResponse) - public async System.Threading.Tasks.Task> AccountCreateWithHttpInfoAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AccountCreateWithHttpInfoAsync(AccountCreateRequest accountCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'accountCreateRequest' is set if (accountCreateRequest == null) @@ -565,7 +565,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) /// Index associated with the operation. /// AccountGetResponse - public AccountGetResponse AccountGet(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0) + public AccountGetResponse AccountGet(string? accountId = default, string? emailAddress = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = AccountGetWithHttpInfo(accountId, emailAddress); return localVarResponse.Data; @@ -580,7 +580,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// `account_id` or `email_address` is required, If both are provided, the account id prevails. The email address of the Account. (optional) /// Index associated with the operation. /// ApiResponse of AccountGetResponse - public Dropbox.Sign.Client.ApiResponse AccountGetWithHttpInfo(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse AccountGetWithHttpInfo(string? accountId = default, string? emailAddress = default, int operationIndex = 0) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -653,7 +653,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountGetResponse - public async System.Threading.Tasks.Task AccountGetAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AccountGetAsync(string? accountId = default, string? emailAddress = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await AccountGetWithHttpInfoAsync(accountId, emailAddress, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -669,7 +669,7 @@ public Dropbox.Sign.Client.ApiResponse AccountCreateWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountGetResponse) - public async System.Threading.Tasks.Task> AccountGetWithHttpInfoAsync(string? accountId = default(string?), string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AccountGetWithHttpInfoAsync(string? accountId = default, string? emailAddress = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -835,7 +835,7 @@ public Dropbox.Sign.Client.ApiResponse AccountUpdateWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountGetResponse - public async System.Threading.Tasks.Task AccountUpdateAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AccountUpdateAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await AccountUpdateWithHttpInfoAsync(accountUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -850,7 +850,7 @@ public Dropbox.Sign.Client.ApiResponse AccountUpdateWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountGetResponse) - public async System.Threading.Tasks.Task> AccountUpdateWithHttpInfoAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AccountUpdateWithHttpInfoAsync(AccountUpdateRequest accountUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'accountUpdateRequest' is set if (accountUpdateRequest == null) @@ -1023,7 +1023,7 @@ public Dropbox.Sign.Client.ApiResponse AccountVerifyWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of AccountVerifyResponse - public async System.Threading.Tasks.Task AccountVerifyAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task AccountVerifyAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await AccountVerifyWithHttpInfoAsync(accountVerifyRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1038,7 +1038,7 @@ public Dropbox.Sign.Client.ApiResponse AccountVerifyWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (AccountVerifyResponse) - public async System.Threading.Tasks.Task> AccountVerifyWithHttpInfoAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> AccountVerifyWithHttpInfoAsync(AccountVerifyRequest accountVerifyRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'accountVerifyRequest' is set if (accountVerifyRequest == null) diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/ApiAppApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/ApiAppApi.cs index 10610c791..f16d47add 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/ApiAppApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/ApiAppApi.cs @@ -114,7 +114,7 @@ public interface IApiAppApiSync : IApiAccessor /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// ApiAppListResponse - ApiAppListResponse ApiAppList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + ApiAppListResponse ApiAppList(int? page = default, int? pageSize = default, int operationIndex = 0); /// /// List API Apps @@ -128,7 +128,7 @@ public interface IApiAppApiSync : IApiAccessor /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of ApiAppListResponse - ApiResponse ApiAppListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + ApiResponse ApiAppListWithHttpInfo(int? page = default, int? pageSize = default, int operationIndex = 0); /// /// Update API App /// @@ -177,7 +177,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - System.Threading.Tasks.Task ApiAppCreateAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppCreateAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create API App @@ -191,7 +191,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - System.Threading.Tasks.Task> ApiAppCreateWithHttpInfoAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppCreateWithHttpInfoAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Delete API App /// @@ -204,7 +204,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task ApiAppDeleteAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppDeleteAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Delete API App @@ -218,7 +218,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> ApiAppDeleteWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppDeleteWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get API App /// @@ -231,7 +231,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - System.Threading.Tasks.Task ApiAppGetAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppGetAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get API App @@ -245,7 +245,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - System.Threading.Tasks.Task> ApiAppGetWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppGetWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List API Apps /// @@ -259,7 +259,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppListResponse - System.Threading.Tasks.Task ApiAppListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppListAsync(int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List API Apps @@ -274,7 +274,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppListResponse) - System.Threading.Tasks.Task> ApiAppListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppListWithHttpInfoAsync(int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Update API App /// @@ -288,7 +288,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - System.Threading.Tasks.Task ApiAppUpdateAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task ApiAppUpdateAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Update API App @@ -303,7 +303,7 @@ public interface IApiAppApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - System.Threading.Tasks.Task> ApiAppUpdateWithHttpInfoAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ApiAppUpdateWithHttpInfoAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -525,7 +525,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppCreateWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - public async System.Threading.Tasks.Task ApiAppCreateAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppCreateAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ApiAppCreateWithHttpInfoAsync(apiAppCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -540,7 +540,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppCreateWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - public async System.Threading.Tasks.Task> ApiAppCreateWithHttpInfoAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppCreateWithHttpInfoAsync(ApiAppCreateRequest apiAppCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'apiAppCreateRequest' is set if (apiAppCreateRequest == null) @@ -704,7 +704,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppDeleteWithHttpInfo(string c /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task ApiAppDeleteAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppDeleteAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { await ApiAppDeleteWithHttpInfoAsync(clientId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -718,7 +718,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppDeleteWithHttpInfo(string c /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> ApiAppDeleteWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppDeleteWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'clientId' is set if (clientId == null) @@ -875,7 +875,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - public async System.Threading.Tasks.Task ApiAppGetAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppGetAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ApiAppGetWithHttpInfoAsync(clientId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -890,7 +890,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - public async System.Threading.Tasks.Task> ApiAppGetWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppGetWithHttpInfoAsync(string clientId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'clientId' is set if (clientId == null) @@ -963,7 +963,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// ApiAppListResponse - public ApiAppListResponse ApiAppList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + public ApiAppListResponse ApiAppList(int? page = default, int? pageSize = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = ApiAppListWithHttpInfo(page, pageSize); return localVarResponse.Data; @@ -978,7 +978,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of ApiAppListResponse - public Dropbox.Sign.Client.ApiResponse ApiAppListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse ApiAppListWithHttpInfo(int? page = default, int? pageSize = default, int operationIndex = 0) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -1051,7 +1051,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppListResponse - public async System.Threading.Tasks.Task ApiAppListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppListAsync(int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ApiAppListWithHttpInfoAsync(page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1067,7 +1067,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppGetWithHttpInfo( /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppListResponse) - public async System.Threading.Tasks.Task> ApiAppListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppListWithHttpInfoAsync(int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -1243,7 +1243,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppUpdateWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiAppGetResponse - public async System.Threading.Tasks.Task ApiAppUpdateAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ApiAppUpdateAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ApiAppUpdateWithHttpInfoAsync(clientId, apiAppUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1259,7 +1259,7 @@ public Dropbox.Sign.Client.ApiResponse ApiAppUpdateWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ApiAppGetResponse) - public async System.Threading.Tasks.Task> ApiAppUpdateWithHttpInfoAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ApiAppUpdateWithHttpInfoAsync(string clientId, ApiAppUpdateRequest apiAppUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'clientId' is set if (clientId == null) diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/BulkSendJobApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/BulkSendJobApi.cs index 80a539517..ef24f5949 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/BulkSendJobApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/BulkSendJobApi.cs @@ -40,7 +40,7 @@ public interface IBulkSendJobApiSync : IApiAccessor /// Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) /// Index associated with the operation. /// BulkSendJobGetResponse - BulkSendJobGetResponse BulkSendJobGet(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + BulkSendJobGetResponse BulkSendJobGet(string bulkSendJobId, int? page = default, int? pageSize = default, int operationIndex = 0); /// /// Get Bulk Send Job @@ -55,7 +55,7 @@ public interface IBulkSendJobApiSync : IApiAccessor /// Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of BulkSendJobGetResponse - ApiResponse BulkSendJobGetWithHttpInfo(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + ApiResponse BulkSendJobGetWithHttpInfo(string bulkSendJobId, int? page = default, int? pageSize = default, int operationIndex = 0); /// /// List Bulk Send Jobs /// @@ -68,7 +68,7 @@ public interface IBulkSendJobApiSync : IApiAccessor /// Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) /// Index associated with the operation. /// BulkSendJobListResponse - BulkSendJobListResponse BulkSendJobList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + BulkSendJobListResponse BulkSendJobList(int? page = default, int? pageSize = default, int operationIndex = 0); /// /// List Bulk Send Jobs @@ -82,7 +82,7 @@ public interface IBulkSendJobApiSync : IApiAccessor /// Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of BulkSendJobListResponse - ApiResponse BulkSendJobListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + ApiResponse BulkSendJobListWithHttpInfo(int? page = default, int? pageSize = default, int operationIndex = 0); #endregion Synchronous Operations } @@ -106,7 +106,7 @@ public interface IBulkSendJobApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobGetResponse - System.Threading.Tasks.Task BulkSendJobGetAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task BulkSendJobGetAsync(string bulkSendJobId, int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Bulk Send Job @@ -122,7 +122,7 @@ public interface IBulkSendJobApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobGetResponse) - System.Threading.Tasks.Task> BulkSendJobGetWithHttpInfoAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BulkSendJobGetWithHttpInfoAsync(string bulkSendJobId, int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Bulk Send Jobs /// @@ -136,7 +136,7 @@ public interface IBulkSendJobApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobListResponse - System.Threading.Tasks.Task BulkSendJobListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task BulkSendJobListAsync(int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Bulk Send Jobs @@ -151,7 +151,7 @@ public interface IBulkSendJobApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobListResponse) - System.Threading.Tasks.Task> BulkSendJobListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BulkSendJobListWithHttpInfoAsync(int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -282,7 +282,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) /// Index associated with the operation. /// BulkSendJobGetResponse - public BulkSendJobGetResponse BulkSendJobGet(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + public BulkSendJobGetResponse BulkSendJobGet(string bulkSendJobId, int? page = default, int? pageSize = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = BulkSendJobGetWithHttpInfo(bulkSendJobId, page, pageSize); return localVarResponse.Data; @@ -298,7 +298,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of BulkSendJobGetResponse - public Dropbox.Sign.Client.ApiResponse BulkSendJobGetWithHttpInfo(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse BulkSendJobGetWithHttpInfo(string bulkSendJobId, int? page = default, int? pageSize = default, int operationIndex = 0) { // verify the required parameter 'bulkSendJobId' is set if (bulkSendJobId == null) @@ -379,7 +379,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobGetResponse - public async System.Threading.Tasks.Task BulkSendJobGetAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task BulkSendJobGetAsync(string bulkSendJobId, int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await BulkSendJobGetWithHttpInfoAsync(bulkSendJobId, page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -396,7 +396,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobGetResponse) - public async System.Threading.Tasks.Task> BulkSendJobGetWithHttpInfoAsync(string bulkSendJobId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BulkSendJobGetWithHttpInfoAsync(string bulkSendJobId, int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'bulkSendJobId' is set if (bulkSendJobId == null) @@ -477,7 +477,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) /// Index associated with the operation. /// BulkSendJobListResponse - public BulkSendJobListResponse BulkSendJobList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + public BulkSendJobListResponse BulkSendJobList(int? page = default, int? pageSize = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = BulkSendJobListWithHttpInfo(page, pageSize); return localVarResponse.Data; @@ -492,7 +492,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Number of objects to be returned per page. Must be between `1` and `100`. Default is 20. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of BulkSendJobListResponse - public Dropbox.Sign.Client.ApiResponse BulkSendJobListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse BulkSendJobListWithHttpInfo(int? page = default, int? pageSize = default, int operationIndex = 0) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -565,7 +565,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobListResponse - public async System.Threading.Tasks.Task BulkSendJobListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task BulkSendJobListAsync(int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await BulkSendJobListWithHttpInfoAsync(page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -581,7 +581,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobListResponse) - public async System.Threading.Tasks.Task> BulkSendJobListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BulkSendJobListWithHttpInfoAsync(int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/DocumentApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/DocumentApi.cs index 3bd7a700a..25fe4e2fe 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/DocumentApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/DocumentApi.cs @@ -73,7 +73,7 @@ public interface IDocumentApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of DocumentFieldDetectionResponse - System.Threading.Tasks.Task DocumentDetectFieldsAsync(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task DocumentDetectFieldsAsync(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Detect Document Fields @@ -87,7 +87,7 @@ public interface IDocumentApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (DocumentFieldDetectionResponse) - System.Threading.Tasks.Task> DocumentDetectFieldsWithHttpInfoAsync(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DocumentDetectFieldsWithHttpInfoAsync(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -309,7 +309,7 @@ public Dropbox.Sign.Client.ApiResponse DocumentD /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of DocumentFieldDetectionResponse - public async System.Threading.Tasks.Task DocumentDetectFieldsAsync(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task DocumentDetectFieldsAsync(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await DocumentDetectFieldsWithHttpInfoAsync(documentFieldDetectionRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -324,7 +324,7 @@ public Dropbox.Sign.Client.ApiResponse DocumentD /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (DocumentFieldDetectionResponse) - public async System.Threading.Tasks.Task> DocumentDetectFieldsWithHttpInfoAsync(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DocumentDetectFieldsWithHttpInfoAsync(DocumentFieldDetectionRequest documentFieldDetectionRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'documentFieldDetectionRequest' is set if (documentFieldDetectionRequest == null) diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/EmbeddedApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/EmbeddedApi.cs index 85ab285a4..4ef668437 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/EmbeddedApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/EmbeddedApi.cs @@ -101,7 +101,7 @@ public interface IEmbeddedApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of EmbeddedEditUrlResponse - System.Threading.Tasks.Task EmbeddedEditUrlAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task EmbeddedEditUrlAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Embedded Template Edit URL @@ -116,7 +116,7 @@ public interface IEmbeddedApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (EmbeddedEditUrlResponse) - System.Threading.Tasks.Task> EmbeddedEditUrlWithHttpInfoAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> EmbeddedEditUrlWithHttpInfoAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Embedded Sign URL /// @@ -129,7 +129,7 @@ public interface IEmbeddedApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of EmbeddedSignUrlResponse - System.Threading.Tasks.Task EmbeddedSignUrlAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task EmbeddedSignUrlAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Embedded Sign URL @@ -143,7 +143,7 @@ public interface IEmbeddedApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (EmbeddedSignUrlResponse) - System.Threading.Tasks.Task> EmbeddedSignUrlWithHttpInfoAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> EmbeddedSignUrlWithHttpInfoAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -375,7 +375,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedEditUrlW /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of EmbeddedEditUrlResponse - public async System.Threading.Tasks.Task EmbeddedEditUrlAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task EmbeddedEditUrlAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await EmbeddedEditUrlWithHttpInfoAsync(templateId, embeddedEditUrlRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -391,7 +391,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedEditUrlW /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (EmbeddedEditUrlResponse) - public async System.Threading.Tasks.Task> EmbeddedEditUrlWithHttpInfoAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> EmbeddedEditUrlWithHttpInfoAsync(string templateId, EmbeddedEditUrlRequest embeddedEditUrlRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -563,7 +563,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedSignUrlW /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of EmbeddedSignUrlResponse - public async System.Threading.Tasks.Task EmbeddedSignUrlAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task EmbeddedSignUrlAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await EmbeddedSignUrlWithHttpInfoAsync(signatureId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -578,7 +578,7 @@ public Dropbox.Sign.Client.ApiResponse EmbeddedSignUrlW /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (EmbeddedSignUrlResponse) - public async System.Threading.Tasks.Task> EmbeddedSignUrlWithHttpInfoAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> EmbeddedSignUrlWithHttpInfoAsync(string signatureId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureId' is set if (signatureId == null) diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs index faa75bbde..197c2b135 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/FaxApi.cs @@ -114,7 +114,7 @@ public interface IFaxApiSync : IApiAccessor /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// FaxListResponse - FaxListResponse FaxList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + FaxListResponse FaxList(int? page = default, int? pageSize = default, int operationIndex = 0); /// /// Lists Faxes @@ -128,7 +128,7 @@ public interface IFaxApiSync : IApiAccessor /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of FaxListResponse - ApiResponse FaxListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + ApiResponse FaxListWithHttpInfo(int? page = default, int? pageSize = default, int operationIndex = 0); /// /// Send Fax /// @@ -175,7 +175,7 @@ public interface IFaxApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task FaxDeleteAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task FaxDeleteAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Delete Fax @@ -189,7 +189,7 @@ public interface IFaxApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> FaxDeleteWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FaxDeleteWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Download Fax Files /// @@ -202,7 +202,7 @@ public interface IFaxApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - System.Threading.Tasks.Task FaxFilesAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task FaxFilesAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Download Fax Files @@ -216,7 +216,7 @@ public interface IFaxApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - System.Threading.Tasks.Task> FaxFilesWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FaxFilesWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Fax /// @@ -229,7 +229,7 @@ public interface IFaxApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxGetResponse - System.Threading.Tasks.Task FaxGetAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task FaxGetAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Fax @@ -243,7 +243,7 @@ public interface IFaxApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxGetResponse) - System.Threading.Tasks.Task> FaxGetWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FaxGetWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Lists Faxes /// @@ -257,7 +257,7 @@ public interface IFaxApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxListResponse - System.Threading.Tasks.Task FaxListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task FaxListAsync(int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Lists Faxes @@ -272,7 +272,7 @@ public interface IFaxApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxListResponse) - System.Threading.Tasks.Task> FaxListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FaxListWithHttpInfoAsync(int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Send Fax /// @@ -285,7 +285,7 @@ public interface IFaxApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxGetResponse - System.Threading.Tasks.Task FaxSendAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task FaxSendAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Send Fax @@ -299,7 +299,7 @@ public interface IFaxApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxGetResponse) - System.Threading.Tasks.Task> FaxSendWithHttpInfoAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FaxSendWithHttpInfoAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -506,7 +506,7 @@ public Dropbox.Sign.Client.ApiResponse FaxDeleteWithHttpInfo(string faxI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task FaxDeleteAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FaxDeleteAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { await FaxDeleteWithHttpInfoAsync(faxId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -520,7 +520,7 @@ public Dropbox.Sign.Client.ApiResponse FaxDeleteWithHttpInfo(string faxI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> FaxDeleteWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FaxDeleteWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'faxId' is set if (faxId == null) @@ -666,7 +666,7 @@ public System.IO.Stream FaxFiles(string faxId, int operationIndex = 0) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - public async System.Threading.Tasks.Task FaxFilesAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FaxFilesAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxFilesWithHttpInfoAsync(faxId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -681,7 +681,7 @@ public System.IO.Stream FaxFiles(string faxId, int operationIndex = 0) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - public async System.Threading.Tasks.Task> FaxFilesWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FaxFilesWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'faxId' is set if (faxId == null) @@ -827,7 +827,7 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxGetResponse - public async System.Threading.Tasks.Task FaxGetAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FaxGetAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxGetWithHttpInfoAsync(faxId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -842,7 +842,7 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxGetResponse) - public async System.Threading.Tasks.Task> FaxGetWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FaxGetWithHttpInfoAsync(string faxId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'faxId' is set if (faxId == null) @@ -909,7 +909,7 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// FaxListResponse - public FaxListResponse FaxList(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + public FaxListResponse FaxList(int? page = default, int? pageSize = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = FaxListWithHttpInfo(page, pageSize); return localVarResponse.Data; @@ -924,7 +924,7 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of FaxListResponse - public Dropbox.Sign.Client.ApiResponse FaxListWithHttpInfo(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse FaxListWithHttpInfo(int? page = default, int? pageSize = default, int operationIndex = 0) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -991,7 +991,7 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxListResponse - public async System.Threading.Tasks.Task FaxListAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FaxListAsync(int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxListWithHttpInfoAsync(page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1007,7 +1007,7 @@ public Dropbox.Sign.Client.ApiResponse FaxGetWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxListResponse) - public async System.Threading.Tasks.Task> FaxListWithHttpInfoAsync(int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FaxListWithHttpInfoAsync(int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -1161,7 +1161,7 @@ public Dropbox.Sign.Client.ApiResponse FaxSendWithHttpInfo(FaxSe /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxGetResponse - public async System.Threading.Tasks.Task FaxSendAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FaxSendAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxSendWithHttpInfoAsync(faxSendRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1176,7 +1176,7 @@ public Dropbox.Sign.Client.ApiResponse FaxSendWithHttpInfo(FaxSe /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxGetResponse) - public async System.Threading.Tasks.Task> FaxSendWithHttpInfoAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FaxSendWithHttpInfoAsync(FaxSendRequest faxSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'faxSendRequest' is set if (faxSendRequest == null) diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/FaxLineApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/FaxLineApi.cs index e756a48f5..9720bc373 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/FaxLineApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/FaxLineApi.cs @@ -66,7 +66,7 @@ public interface IFaxLineApiSync : IApiAccessor /// Filter area codes by city (optional) /// Index associated with the operation. /// FaxLineAreaCodeGetResponse - FaxLineAreaCodeGetResponse FaxLineAreaCodeGet(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0); + FaxLineAreaCodeGetResponse FaxLineAreaCodeGet(string country, string? state = default, string? province = default, string? city = default, int operationIndex = 0); /// /// Get Available Fax Line Area Codes @@ -82,7 +82,7 @@ public interface IFaxLineApiSync : IApiAccessor /// Filter area codes by city (optional) /// Index associated with the operation. /// ApiResponse of FaxLineAreaCodeGetResponse - ApiResponse FaxLineAreaCodeGetWithHttpInfo(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0); + ApiResponse FaxLineAreaCodeGetWithHttpInfo(string country, string? state = default, string? province = default, string? city = default, int operationIndex = 0); /// /// Purchase Fax Line /// @@ -172,7 +172,7 @@ public interface IFaxLineApiSync : IApiAccessor /// Include Fax Lines belonging to team members in the list (optional) /// Index associated with the operation. /// FaxLineListResponse - FaxLineListResponse FaxLineList(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0); + FaxLineListResponse FaxLineList(string? accountId = default, int? page = default, int? pageSize = default, bool? showTeamLines = default, int operationIndex = 0); /// /// List Fax Lines @@ -188,7 +188,7 @@ public interface IFaxLineApiSync : IApiAccessor /// Include Fax Lines belonging to team members in the list (optional) /// Index associated with the operation. /// ApiResponse of FaxLineListResponse - ApiResponse FaxLineListWithHttpInfo(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0); + ApiResponse FaxLineListWithHttpInfo(string? accountId = default, int? page = default, int? pageSize = default, bool? showTeamLines = default, int operationIndex = 0); /// /// Remove Fax Line Access /// @@ -235,7 +235,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineResponse - System.Threading.Tasks.Task FaxLineAddUserAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task FaxLineAddUserAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Add Fax Line User @@ -249,7 +249,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineResponse) - System.Threading.Tasks.Task> FaxLineAddUserWithHttpInfoAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FaxLineAddUserWithHttpInfoAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Available Fax Line Area Codes /// @@ -265,7 +265,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineAreaCodeGetResponse - System.Threading.Tasks.Task FaxLineAreaCodeGetAsync(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task FaxLineAreaCodeGetAsync(string country, string? state = default, string? province = default, string? city = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Available Fax Line Area Codes @@ -282,7 +282,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineAreaCodeGetResponse) - System.Threading.Tasks.Task> FaxLineAreaCodeGetWithHttpInfoAsync(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FaxLineAreaCodeGetWithHttpInfoAsync(string country, string? state = default, string? province = default, string? city = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Purchase Fax Line /// @@ -295,7 +295,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineResponse - System.Threading.Tasks.Task FaxLineCreateAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task FaxLineCreateAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Purchase Fax Line @@ -309,7 +309,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineResponse) - System.Threading.Tasks.Task> FaxLineCreateWithHttpInfoAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FaxLineCreateWithHttpInfoAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Delete Fax Line /// @@ -322,7 +322,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task FaxLineDeleteAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task FaxLineDeleteAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Delete Fax Line @@ -336,7 +336,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> FaxLineDeleteWithHttpInfoAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FaxLineDeleteWithHttpInfoAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Fax Line /// @@ -349,7 +349,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineResponse - System.Threading.Tasks.Task FaxLineGetAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task FaxLineGetAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Fax Line @@ -363,7 +363,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineResponse) - System.Threading.Tasks.Task> FaxLineGetWithHttpInfoAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FaxLineGetWithHttpInfoAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Fax Lines /// @@ -379,7 +379,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineListResponse - System.Threading.Tasks.Task FaxLineListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task FaxLineListAsync(string? accountId = default, int? page = default, int? pageSize = default, bool? showTeamLines = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Fax Lines @@ -396,7 +396,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineListResponse) - System.Threading.Tasks.Task> FaxLineListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FaxLineListWithHttpInfoAsync(string? accountId = default, int? page = default, int? pageSize = default, bool? showTeamLines = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Remove Fax Line Access /// @@ -409,7 +409,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineResponse - System.Threading.Tasks.Task FaxLineRemoveUserAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task FaxLineRemoveUserAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Remove Fax Line Access @@ -423,7 +423,7 @@ public interface IFaxLineApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineResponse) - System.Threading.Tasks.Task> FaxLineRemoveUserWithHttpInfoAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FaxLineRemoveUserWithHttpInfoAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -639,7 +639,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineResponse - public async System.Threading.Tasks.Task FaxLineAddUserAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FaxLineAddUserAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineAddUserWithHttpInfoAsync(faxLineAddUserRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -654,7 +654,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineResponse) - public async System.Threading.Tasks.Task> FaxLineAddUserWithHttpInfoAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FaxLineAddUserWithHttpInfoAsync(FaxLineAddUserRequest faxLineAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'faxLineAddUserRequest' is set if (faxLineAddUserRequest == null) @@ -731,7 +731,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpIn /// Filter area codes by city (optional) /// Index associated with the operation. /// FaxLineAreaCodeGetResponse - public FaxLineAreaCodeGetResponse FaxLineAreaCodeGet(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0) + public FaxLineAreaCodeGetResponse FaxLineAreaCodeGet(string country, string? state = default, string? province = default, string? city = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineAreaCodeGetWithHttpInfo(country, state, province, city); return localVarResponse.Data; @@ -748,7 +748,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpIn /// Filter area codes by city (optional) /// Index associated with the operation. /// ApiResponse of FaxLineAreaCodeGetResponse - public Dropbox.Sign.Client.ApiResponse FaxLineAreaCodeGetWithHttpInfo(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse FaxLineAreaCodeGetWithHttpInfo(string country, string? state = default, string? province = default, string? city = default, int operationIndex = 0) { // verify the required parameter 'country' is set if (country == null) @@ -828,7 +828,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineAreaCodeGetResponse - public async System.Threading.Tasks.Task FaxLineAreaCodeGetAsync(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FaxLineAreaCodeGetAsync(string country, string? state = default, string? province = default, string? city = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineAreaCodeGetWithHttpInfoAsync(country, state, province, city, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -846,7 +846,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineAddUserWithHttpIn /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineAreaCodeGetResponse) - public async System.Threading.Tasks.Task> FaxLineAreaCodeGetWithHttpInfoAsync(string country, string? state = default(string?), string? province = default(string?), string? city = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FaxLineAreaCodeGetWithHttpInfoAsync(string country, string? state = default, string? province = default, string? city = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'country' is set if (country == null) @@ -1011,7 +1011,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineCreateWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineResponse - public async System.Threading.Tasks.Task FaxLineCreateAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FaxLineCreateAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineCreateWithHttpInfoAsync(faxLineCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1026,7 +1026,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineCreateWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineResponse) - public async System.Threading.Tasks.Task> FaxLineCreateWithHttpInfoAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FaxLineCreateWithHttpInfoAsync(FaxLineCreateRequest faxLineCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'faxLineCreateRequest' is set if (faxLineCreateRequest == null) @@ -1186,7 +1186,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineDeleteWithHttpInfo(FaxLine /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task FaxLineDeleteAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FaxLineDeleteAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { await FaxLineDeleteWithHttpInfoAsync(faxLineDeleteRequest, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -1200,7 +1200,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineDeleteWithHttpInfo(FaxLine /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> FaxLineDeleteWithHttpInfoAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FaxLineDeleteWithHttpInfoAsync(FaxLineDeleteRequest faxLineDeleteRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'faxLineDeleteRequest' is set if (faxLineDeleteRequest == null) @@ -1353,7 +1353,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineResponse - public async System.Threading.Tasks.Task FaxLineGetAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FaxLineGetAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineGetWithHttpInfoAsync(number, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1368,7 +1368,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineResponse) - public async System.Threading.Tasks.Task> FaxLineGetWithHttpInfoAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FaxLineGetWithHttpInfoAsync(string number, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'number' is set if (number == null) @@ -1437,7 +1437,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s /// Include Fax Lines belonging to team members in the list (optional) /// Index associated with the operation. /// FaxLineListResponse - public FaxLineListResponse FaxLineList(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0) + public FaxLineListResponse FaxLineList(string? accountId = default, int? page = default, int? pageSize = default, bool? showTeamLines = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = FaxLineListWithHttpInfo(accountId, page, pageSize, showTeamLines); return localVarResponse.Data; @@ -1454,7 +1454,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s /// Include Fax Lines belonging to team members in the list (optional) /// Index associated with the operation. /// ApiResponse of FaxLineListResponse - public Dropbox.Sign.Client.ApiResponse FaxLineListWithHttpInfo(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse FaxLineListWithHttpInfo(string? accountId = default, int? page = default, int? pageSize = default, bool? showTeamLines = default, int operationIndex = 0) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -1531,7 +1531,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineListResponse - public async System.Threading.Tasks.Task FaxLineListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FaxLineListAsync(string? accountId = default, int? page = default, int? pageSize = default, bool? showTeamLines = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineListWithHttpInfoAsync(accountId, page, pageSize, showTeamLines, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1549,7 +1549,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineGetWithHttpInfo(s /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineListResponse) - public async System.Threading.Tasks.Task> FaxLineListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), bool? showTeamLines = default(bool?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FaxLineListWithHttpInfoAsync(string? accountId = default, int? page = default, int? pageSize = default, bool? showTeamLines = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -1711,7 +1711,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineRemoveUserWithHtt /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FaxLineResponse - public async System.Threading.Tasks.Task FaxLineRemoveUserAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FaxLineRemoveUserAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await FaxLineRemoveUserWithHttpInfoAsync(faxLineRemoveUserRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1726,7 +1726,7 @@ public Dropbox.Sign.Client.ApiResponse FaxLineRemoveUserWithHtt /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FaxLineResponse) - public async System.Threading.Tasks.Task> FaxLineRemoveUserWithHttpInfoAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FaxLineRemoveUserWithHttpInfoAsync(FaxLineRemoveUserRequest faxLineRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'faxLineRemoveUserRequest' is set if (faxLineRemoveUserRequest == null) diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/OAuthApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/OAuthApi.cs index bf27a01b4..be5b3072e 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/OAuthApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/OAuthApi.cs @@ -98,7 +98,7 @@ public interface IOAuthApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of OAuthTokenResponse - System.Threading.Tasks.Task OauthTokenGenerateAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task OauthTokenGenerateAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// OAuth Token Generate @@ -112,7 +112,7 @@ public interface IOAuthApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (OAuthTokenResponse) - System.Threading.Tasks.Task> OauthTokenGenerateWithHttpInfoAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> OauthTokenGenerateWithHttpInfoAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// OAuth Token Refresh /// @@ -125,7 +125,7 @@ public interface IOAuthApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of OAuthTokenResponse - System.Threading.Tasks.Task OauthTokenRefreshAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task OauthTokenRefreshAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// OAuth Token Refresh @@ -139,7 +139,7 @@ public interface IOAuthApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (OAuthTokenResponse) - System.Threading.Tasks.Task> OauthTokenRefreshWithHttpInfoAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> OauthTokenRefreshWithHttpInfoAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -349,7 +349,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenGenerateWit /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of OAuthTokenResponse - public async System.Threading.Tasks.Task OauthTokenGenerateAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task OauthTokenGenerateAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await OauthTokenGenerateWithHttpInfoAsync(oAuthTokenGenerateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -364,7 +364,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenGenerateWit /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (OAuthTokenResponse) - public async System.Threading.Tasks.Task> OauthTokenGenerateWithHttpInfoAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> OauthTokenGenerateWithHttpInfoAsync(OAuthTokenGenerateRequest oAuthTokenGenerateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'oAuthTokenGenerateRequest' is set if (oAuthTokenGenerateRequest == null) @@ -513,7 +513,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenRefreshWith /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of OAuthTokenResponse - public async System.Threading.Tasks.Task OauthTokenRefreshAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task OauthTokenRefreshAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await OauthTokenRefreshWithHttpInfoAsync(oAuthTokenRefreshRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -528,7 +528,7 @@ public Dropbox.Sign.Client.ApiResponse OauthTokenRefreshWith /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (OAuthTokenResponse) - public async System.Threading.Tasks.Task> OauthTokenRefreshWithHttpInfoAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> OauthTokenRefreshWithHttpInfoAsync(OAuthTokenRefreshRequest oAuthTokenRefreshRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'oAuthTokenRefreshRequest' is set if (oAuthTokenRefreshRequest == null) diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/ReportApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/ReportApi.cs index 0e075a0e3..81d1351e9 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/ReportApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/ReportApi.cs @@ -73,7 +73,7 @@ public interface IReportApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ReportCreateResponse - System.Threading.Tasks.Task ReportCreateAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task ReportCreateAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Report @@ -87,7 +87,7 @@ public interface IReportApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ReportCreateResponse) - System.Threading.Tasks.Task> ReportCreateWithHttpInfoAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ReportCreateWithHttpInfoAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -303,7 +303,7 @@ public Dropbox.Sign.Client.ApiResponse ReportCreateWithHtt /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ReportCreateResponse - public async System.Threading.Tasks.Task ReportCreateAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ReportCreateAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await ReportCreateWithHttpInfoAsync(reportCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -318,7 +318,7 @@ public Dropbox.Sign.Client.ApiResponse ReportCreateWithHtt /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (ReportCreateResponse) - public async System.Threading.Tasks.Task> ReportCreateWithHttpInfoAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ReportCreateWithHttpInfoAsync(ReportCreateRequest reportCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'reportCreateRequest' is set if (reportCreateRequest == null) diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/SignatureRequestApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/SignatureRequestApi.cs index 05be3bf6d..40607a921 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/SignatureRequestApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/SignatureRequestApi.cs @@ -272,7 +272,7 @@ public interface ISignatureRequestApiSync : IApiAccessor /// Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to pdf) /// Index associated with the operation. /// System.IO.Stream - System.IO.Stream SignatureRequestFiles(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0); + System.IO.Stream SignatureRequestFiles(string signatureRequestId, string? fileType = default, int operationIndex = 0); /// /// Download Files @@ -286,7 +286,7 @@ public interface ISignatureRequestApiSync : IApiAccessor /// Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to pdf) /// Index associated with the operation. /// ApiResponse of System.IO.Stream - ApiResponse SignatureRequestFilesWithHttpInfo(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0); + ApiResponse SignatureRequestFilesWithHttpInfo(string signatureRequestId, string? fileType = default, int operationIndex = 0); /// /// Download Files as Data Uri /// @@ -324,7 +324,7 @@ public interface ISignatureRequestApiSync : IApiAccessor /// By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) /// Index associated with the operation. /// FileResponse - FileResponse SignatureRequestFilesAsFileUrl(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0); + FileResponse SignatureRequestFilesAsFileUrl(string signatureRequestId, int? forceDownload = default, int operationIndex = 0); /// /// Download Files as File Url @@ -338,7 +338,7 @@ public interface ISignatureRequestApiSync : IApiAccessor /// By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) /// Index associated with the operation. /// ApiResponse of FileResponse - ApiResponse SignatureRequestFilesAsFileUrlWithHttpInfo(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0); + ApiResponse SignatureRequestFilesAsFileUrlWithHttpInfo(string signatureRequestId, int? forceDownload = default, int operationIndex = 0); /// /// Get Signature Request /// @@ -378,7 +378,7 @@ public interface ISignatureRequestApiSync : IApiAccessor /// String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) /// Index associated with the operation. /// SignatureRequestListResponse - SignatureRequestListResponse SignatureRequestList(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0); + SignatureRequestListResponse SignatureRequestList(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0); /// /// List Signature Requests @@ -394,7 +394,7 @@ public interface ISignatureRequestApiSync : IApiAccessor /// String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) /// Index associated with the operation. /// ApiResponse of SignatureRequestListResponse - ApiResponse SignatureRequestListWithHttpInfo(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0); + ApiResponse SignatureRequestListWithHttpInfo(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0); /// /// Release On-Hold Signature Request /// @@ -570,7 +570,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobSendResponse - System.Threading.Tasks.Task SignatureRequestBulkCreateEmbeddedWithTemplateAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestBulkCreateEmbeddedWithTemplateAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Embedded Bulk Send with Template @@ -584,7 +584,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobSendResponse) - System.Threading.Tasks.Task> SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Bulk Send with Template /// @@ -597,7 +597,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobSendResponse - System.Threading.Tasks.Task SignatureRequestBulkSendWithTemplateAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestBulkSendWithTemplateAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Bulk Send with Template @@ -611,7 +611,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobSendResponse) - System.Threading.Tasks.Task> SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Cancel Incomplete Signature Request /// @@ -624,7 +624,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task SignatureRequestCancelAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestCancelAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Cancel Incomplete Signature Request @@ -638,7 +638,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> SignatureRequestCancelWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestCancelWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Embedded Signature Request /// @@ -651,7 +651,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestCreateEmbeddedAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestCreateEmbeddedAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Embedded Signature Request @@ -665,7 +665,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithHttpInfoAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithHttpInfoAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Embedded Signature Request with Template /// @@ -678,7 +678,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestCreateEmbeddedWithTemplateAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestCreateEmbeddedWithTemplateAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Embedded Signature Request with Template @@ -692,7 +692,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Edit Signature Request /// @@ -706,7 +706,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestEditAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestEditAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Edit Signature Request @@ -721,7 +721,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestEditWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestEditWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Edit Embedded Signature Request /// @@ -735,7 +735,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestEditEmbeddedAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestEditEmbeddedAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Edit Embedded Signature Request @@ -750,7 +750,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Edit Embedded Signature Request with Template /// @@ -764,7 +764,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestEditEmbeddedWithTemplateAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestEditEmbeddedWithTemplateAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Edit Embedded Signature Request with Template @@ -779,7 +779,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Edit Signature Request With Template /// @@ -793,7 +793,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestEditWithTemplateAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestEditWithTemplateAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Edit Signature Request With Template @@ -808,7 +808,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestEditWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestEditWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Download Files /// @@ -822,7 +822,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - System.Threading.Tasks.Task SignatureRequestFilesAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestFilesAsync(string signatureRequestId, string? fileType = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Download Files @@ -837,7 +837,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - System.Threading.Tasks.Task> SignatureRequestFilesWithHttpInfoAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestFilesWithHttpInfoAsync(string signatureRequestId, string? fileType = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Download Files as Data Uri /// @@ -850,7 +850,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponseDataUri - System.Threading.Tasks.Task SignatureRequestFilesAsDataUriAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestFilesAsDataUriAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Download Files as Data Uri @@ -864,7 +864,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponseDataUri) - System.Threading.Tasks.Task> SignatureRequestFilesAsDataUriWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestFilesAsDataUriWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Download Files as File Url /// @@ -878,7 +878,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponse - System.Threading.Tasks.Task SignatureRequestFilesAsFileUrlAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestFilesAsFileUrlAsync(string signatureRequestId, int? forceDownload = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Download Files as File Url @@ -893,7 +893,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponse) - System.Threading.Tasks.Task> SignatureRequestFilesAsFileUrlWithHttpInfoAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestFilesAsFileUrlWithHttpInfoAsync(string signatureRequestId, int? forceDownload = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Signature Request /// @@ -906,7 +906,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestGetAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestGetAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Signature Request @@ -920,7 +920,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestGetWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestGetWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Signature Requests /// @@ -936,7 +936,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestListResponse - System.Threading.Tasks.Task SignatureRequestListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestListAsync(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Signature Requests @@ -953,7 +953,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestListResponse) - System.Threading.Tasks.Task> SignatureRequestListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestListWithHttpInfoAsync(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Release On-Hold Signature Request /// @@ -966,7 +966,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestReleaseHoldAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestReleaseHoldAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Release On-Hold Signature Request @@ -980,7 +980,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestReleaseHoldWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestReleaseHoldWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Send Request Reminder /// @@ -994,7 +994,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestRemindAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestRemindAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Send Request Reminder @@ -1009,7 +1009,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestRemindWithHttpInfoAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestRemindWithHttpInfoAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Remove Signature Request Access /// @@ -1022,7 +1022,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task SignatureRequestRemoveAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestRemoveAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Remove Signature Request Access @@ -1036,7 +1036,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> SignatureRequestRemoveWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestRemoveWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Send Signature Request /// @@ -1049,7 +1049,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestSendAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestSendAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Send Signature Request @@ -1063,7 +1063,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestSendWithHttpInfoAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestSendWithHttpInfoAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Send with Template /// @@ -1076,7 +1076,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestSendWithTemplateAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestSendWithTemplateAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Send with Template @@ -1090,7 +1090,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestSendWithTemplateWithHttpInfoAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestSendWithTemplateWithHttpInfoAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Update Signature Request /// @@ -1104,7 +1104,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - System.Threading.Tasks.Task SignatureRequestUpdateAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task SignatureRequestUpdateAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Update Signature Request @@ -1119,7 +1119,7 @@ public interface ISignatureRequestApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - System.Threading.Tasks.Task> SignatureRequestUpdateWithHttpInfoAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> SignatureRequestUpdateWithHttpInfoAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -1335,7 +1335,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobSendResponse - public async System.Threading.Tasks.Task SignatureRequestBulkCreateEmbeddedWithTemplateAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestBulkCreateEmbeddedWithTemplateAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(signatureRequestBulkCreateEmbeddedWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1350,7 +1350,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobSendResponse) - public async System.Threading.Tasks.Task> SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestBulkCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestBulkCreateEmbeddedWithTemplateRequest signatureRequestBulkCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestBulkCreateEmbeddedWithTemplateRequest' is set if (signatureRequestBulkCreateEmbeddedWithTemplateRequest == null) @@ -1517,7 +1517,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of BulkSendJobSendResponse - public async System.Threading.Tasks.Task SignatureRequestBulkSendWithTemplateAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestBulkSendWithTemplateAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(signatureRequestBulkSendWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1532,7 +1532,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequest /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (BulkSendJobSendResponse) - public async System.Threading.Tasks.Task> SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestBulkSendWithTemplateWithHttpInfoAsync(SignatureRequestBulkSendWithTemplateRequest signatureRequestBulkSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestBulkSendWithTemplateRequest' is set if (signatureRequestBulkSendWithTemplateRequest == null) @@ -1696,7 +1696,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestCancelWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task SignatureRequestCancelAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestCancelAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { await SignatureRequestCancelWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -1710,7 +1710,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestCancelWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> SignatureRequestCancelWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestCancelWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -1875,7 +1875,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestCreateEmbeddedAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestCreateEmbeddedAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestCreateEmbeddedWithHttpInfoAsync(signatureRequestCreateEmbeddedRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1890,7 +1890,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithHttpInfoAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithHttpInfoAsync(SignatureRequestCreateEmbeddedRequest signatureRequestCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestCreateEmbeddedRequest' is set if (signatureRequestCreateEmbeddedRequest == null) @@ -2063,7 +2063,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestCreateEmbeddedWithTemplateAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestCreateEmbeddedWithTemplateAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(signatureRequestCreateEmbeddedWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2078,7 +2078,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestCreateEmbeddedWithTemplateWithHttpInfoAsync(SignatureRequestCreateEmbeddedWithTemplateRequest signatureRequestCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestCreateEmbeddedWithTemplateRequest' is set if (signatureRequestCreateEmbeddedWithTemplateRequest == null) @@ -2261,7 +2261,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestEditAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestEditAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestEditWithHttpInfoAsync(signatureRequestId, signatureRequestEditRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2277,7 +2277,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestEditWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestEditWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditRequest signatureRequestEditRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -2467,7 +2467,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestEditEmbeddedAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestEditEmbeddedAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestEditEmbeddedWithHttpInfoAsync(signatureRequestId, signatureRequestEditEmbeddedRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2483,7 +2483,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedRequest signatureRequestEditEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -2673,7 +2673,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestEditEmbeddedWithTemplateAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestEditEmbeddedWithTemplateAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestEditEmbeddedWithTemplateWithHttpInfoAsync(signatureRequestId, signatureRequestEditEmbeddedWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2689,7 +2689,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestEditEmbeddedWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditEmbeddedWithTemplateRequest signatureRequestEditEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -2879,7 +2879,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestEditWithTemplateAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestEditWithTemplateAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestEditWithTemplateWithHttpInfoAsync(signatureRequestId, signatureRequestEditWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2895,7 +2895,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestEditWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestEditWithTemplateWithHttpInfoAsync(string signatureRequestId, SignatureRequestEditWithTemplateRequest signatureRequestEditWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -2983,7 +2983,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to pdf) /// Index associated with the operation. /// System.IO.Stream - public System.IO.Stream SignatureRequestFiles(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0) + public System.IO.Stream SignatureRequestFiles(string signatureRequestId, string? fileType = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = SignatureRequestFilesWithHttpInfo(signatureRequestId, fileType); return localVarResponse.Data; @@ -2998,7 +2998,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional, default to pdf) /// Index associated with the operation. /// ApiResponse of System.IO.Stream - public Dropbox.Sign.Client.ApiResponse SignatureRequestFilesWithHttpInfo(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse SignatureRequestFilesWithHttpInfo(string signatureRequestId, string? fileType = default, int operationIndex = 0) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -3076,7 +3076,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - public async System.Threading.Tasks.Task SignatureRequestFilesAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestFilesAsync(string signatureRequestId, string? fileType = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestFilesWithHttpInfoAsync(signatureRequestId, fileType, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3092,7 +3092,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - public async System.Threading.Tasks.Task> SignatureRequestFilesWithHttpInfoAsync(string signatureRequestId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestFilesWithHttpInfoAsync(string signatureRequestId, string? fileType = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -3255,7 +3255,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponseDataUri - public async System.Threading.Tasks.Task SignatureRequestFilesAsDataUriAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestFilesAsDataUriAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestFilesAsDataUriWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3270,7 +3270,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponseDataUri) - public async System.Threading.Tasks.Task> SignatureRequestFilesAsDataUriWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestFilesAsDataUriWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -3343,7 +3343,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) /// Index associated with the operation. /// FileResponse - public FileResponse SignatureRequestFilesAsFileUrl(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0) + public FileResponse SignatureRequestFilesAsFileUrl(string signatureRequestId, int? forceDownload = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = SignatureRequestFilesAsFileUrlWithHttpInfo(signatureRequestId, forceDownload); return localVarResponse.Data; @@ -3358,7 +3358,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) /// Index associated with the operation. /// ApiResponse of FileResponse - public Dropbox.Sign.Client.ApiResponse SignatureRequestFilesAsFileUrlWithHttpInfo(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse SignatureRequestFilesAsFileUrlWithHttpInfo(string signatureRequestId, int? forceDownload = default, int operationIndex = 0) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -3434,7 +3434,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponse - public async System.Threading.Tasks.Task SignatureRequestFilesAsFileUrlAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestFilesAsFileUrlAsync(string signatureRequestId, int? forceDownload = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestFilesAsFileUrlWithHttpInfoAsync(signatureRequestId, forceDownload, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3450,7 +3450,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestFile /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponse) - public async System.Threading.Tasks.Task> SignatureRequestFilesAsFileUrlWithHttpInfoAsync(string signatureRequestId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestFilesAsFileUrlWithHttpInfoAsync(string signatureRequestId, int? forceDownload = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -3611,7 +3611,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestGetAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestGetAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestGetWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3626,7 +3626,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestGetWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestGetWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -3701,7 +3701,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) /// Index associated with the operation. /// SignatureRequestListResponse - public SignatureRequestListResponse SignatureRequestList(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0) + public SignatureRequestListResponse SignatureRequestList(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = SignatureRequestListWithHttpInfo(accountId, page, pageSize, query); return localVarResponse.Data; @@ -3718,7 +3718,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// String that includes search terms and/or fields to be used to filter the SignatureRequest objects. (optional) /// Index associated with the operation. /// ApiResponse of SignatureRequestListResponse - public Dropbox.Sign.Client.ApiResponse SignatureRequestListWithHttpInfo(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse SignatureRequestListWithHttpInfo(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -3801,7 +3801,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestListResponse - public async System.Threading.Tasks.Task SignatureRequestListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestListAsync(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestListWithHttpInfoAsync(accountId, page, pageSize, query, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -3819,7 +3819,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestListResponse) - public async System.Threading.Tasks.Task> SignatureRequestListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestListWithHttpInfoAsync(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -3985,7 +3985,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestReleaseHoldAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestReleaseHoldAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestReleaseHoldWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -4000,7 +4000,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestReleaseHoldWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestReleaseHoldWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -4175,7 +4175,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestRemindAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestRemindAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestRemindWithHttpInfoAsync(signatureRequestId, signatureRequestRemindRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -4191,7 +4191,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestRemindWithHttpInfoAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestRemindWithHttpInfoAsync(string signatureRequestId, SignatureRequestRemindRequest signatureRequestRemindRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -4356,7 +4356,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestRemoveWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task SignatureRequestRemoveAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestRemoveAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { await SignatureRequestRemoveWithHttpInfoAsync(signatureRequestId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -4370,7 +4370,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureRequestRemoveWithHttpInf /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> SignatureRequestRemoveWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestRemoveWithHttpInfoAsync(string signatureRequestId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) @@ -4529,7 +4529,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestSendAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestSendAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestSendWithHttpInfoAsync(signatureRequestSendRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -4544,7 +4544,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestSendWithHttpInfoAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestSendWithHttpInfoAsync(SignatureRequestSendRequest signatureRequestSendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestSendRequest' is set if (signatureRequestSendRequest == null) @@ -4717,7 +4717,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestSendWithTemplateAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestSendWithTemplateAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestSendWithTemplateWithHttpInfoAsync(signatureRequestSendWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -4732,7 +4732,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestSendWithTemplateWithHttpInfoAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestSendWithTemplateWithHttpInfoAsync(SignatureRequestSendWithTemplateRequest signatureRequestSendWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestSendWithTemplateRequest' is set if (signatureRequestSendWithTemplateRequest == null) @@ -4915,7 +4915,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of SignatureRequestGetResponse - public async System.Threading.Tasks.Task SignatureRequestUpdateAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task SignatureRequestUpdateAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await SignatureRequestUpdateWithHttpInfoAsync(signatureRequestId, signatureRequestUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -4931,7 +4931,7 @@ public Dropbox.Sign.Client.ApiResponse SignatureReq /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (SignatureRequestGetResponse) - public async System.Threading.Tasks.Task> SignatureRequestUpdateWithHttpInfoAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> SignatureRequestUpdateWithHttpInfoAsync(string signatureRequestId, SignatureRequestUpdateRequest signatureRequestUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/TeamApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/TeamApi.cs index fd94530dd..b5c42ec53 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/TeamApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/TeamApi.cs @@ -39,7 +39,7 @@ public interface ITeamApiSync : IApiAccessor /// The id of the team. (optional) /// Index associated with the operation. /// TeamGetResponse - TeamGetResponse TeamAddMember(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0); + TeamGetResponse TeamAddMember(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default, int operationIndex = 0); /// /// Add User to Team @@ -53,7 +53,7 @@ public interface ITeamApiSync : IApiAccessor /// The id of the team. (optional) /// Index associated with the operation. /// ApiResponse of TeamGetResponse - ApiResponse TeamAddMemberWithHttpInfo(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0); + ApiResponse TeamAddMemberWithHttpInfo(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default, int operationIndex = 0); /// /// Create Team /// @@ -136,7 +136,7 @@ public interface ITeamApiSync : IApiAccessor /// The id of the team. (optional) /// Index associated with the operation. /// TeamGetInfoResponse - TeamGetInfoResponse TeamInfo(string? teamId = default(string?), int operationIndex = 0); + TeamGetInfoResponse TeamInfo(string? teamId = default, int operationIndex = 0); /// /// Get Team Info @@ -149,7 +149,7 @@ public interface ITeamApiSync : IApiAccessor /// The id of the team. (optional) /// Index associated with the operation. /// ApiResponse of TeamGetInfoResponse - ApiResponse TeamInfoWithHttpInfo(string? teamId = default(string?), int operationIndex = 0); + ApiResponse TeamInfoWithHttpInfo(string? teamId = default, int operationIndex = 0); /// /// List Team Invites /// @@ -161,7 +161,7 @@ public interface ITeamApiSync : IApiAccessor /// The email address for which to display the team invites. (optional) /// Index associated with the operation. /// TeamInvitesResponse - TeamInvitesResponse TeamInvites(string? emailAddress = default(string?), int operationIndex = 0); + TeamInvitesResponse TeamInvites(string? emailAddress = default, int operationIndex = 0); /// /// List Team Invites @@ -174,7 +174,7 @@ public interface ITeamApiSync : IApiAccessor /// The email address for which to display the team invites. (optional) /// Index associated with the operation. /// ApiResponse of TeamInvitesResponse - ApiResponse TeamInvitesWithHttpInfo(string? emailAddress = default(string?), int operationIndex = 0); + ApiResponse TeamInvitesWithHttpInfo(string? emailAddress = default, int operationIndex = 0); /// /// List Team Members /// @@ -188,7 +188,7 @@ public interface ITeamApiSync : IApiAccessor /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// TeamMembersResponse - TeamMembersResponse TeamMembers(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + TeamMembersResponse TeamMembers(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0); /// /// List Team Members @@ -203,7 +203,7 @@ public interface ITeamApiSync : IApiAccessor /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of TeamMembersResponse - ApiResponse TeamMembersWithHttpInfo(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + ApiResponse TeamMembersWithHttpInfo(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0); /// /// Remove User from Team /// @@ -242,7 +242,7 @@ public interface ITeamApiSync : IApiAccessor /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// TeamSubTeamsResponse - TeamSubTeamsResponse TeamSubTeams(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + TeamSubTeamsResponse TeamSubTeams(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0); /// /// List Sub Teams @@ -257,7 +257,7 @@ public interface ITeamApiSync : IApiAccessor /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of TeamSubTeamsResponse - ApiResponse TeamSubTeamsWithHttpInfo(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0); + ApiResponse TeamSubTeamsWithHttpInfo(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0); /// /// Update Team /// @@ -305,7 +305,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamAddMemberAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamAddMemberAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Add User to Team @@ -320,7 +320,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamAddMemberWithHttpInfoAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamAddMemberWithHttpInfoAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Team /// @@ -333,7 +333,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamCreateAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamCreateAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Team @@ -347,7 +347,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamCreateWithHttpInfoAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamCreateWithHttpInfoAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Delete Team /// @@ -359,7 +359,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TeamDeleteAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamDeleteAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Delete Team @@ -372,7 +372,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TeamDeleteWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamDeleteWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Team /// @@ -384,7 +384,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Team @@ -397,7 +397,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Team Info /// @@ -410,7 +410,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetInfoResponse - System.Threading.Tasks.Task TeamInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamInfoAsync(string? teamId = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Team Info @@ -424,7 +424,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetInfoResponse) - System.Threading.Tasks.Task> TeamInfoWithHttpInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamInfoWithHttpInfoAsync(string? teamId = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Team Invites /// @@ -437,7 +437,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamInvitesResponse - System.Threading.Tasks.Task TeamInvitesAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamInvitesAsync(string? emailAddress = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Team Invites @@ -451,7 +451,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamInvitesResponse) - System.Threading.Tasks.Task> TeamInvitesWithHttpInfoAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamInvitesWithHttpInfoAsync(string? emailAddress = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Team Members /// @@ -466,7 +466,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamMembersResponse - System.Threading.Tasks.Task TeamMembersAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamMembersAsync(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Team Members @@ -482,7 +482,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamMembersResponse) - System.Threading.Tasks.Task> TeamMembersWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamMembersWithHttpInfoAsync(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Remove User from Team /// @@ -495,7 +495,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamRemoveMemberAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamRemoveMemberAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Remove User from Team @@ -509,7 +509,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamRemoveMemberWithHttpInfoAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamRemoveMemberWithHttpInfoAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Sub Teams /// @@ -524,7 +524,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamSubTeamsResponse - System.Threading.Tasks.Task TeamSubTeamsAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamSubTeamsAsync(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Sub Teams @@ -540,7 +540,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamSubTeamsResponse) - System.Threading.Tasks.Task> TeamSubTeamsWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamSubTeamsWithHttpInfoAsync(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Update Team /// @@ -553,7 +553,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - System.Threading.Tasks.Task TeamUpdateAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TeamUpdateAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Update Team @@ -567,7 +567,7 @@ public interface ITeamApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - System.Threading.Tasks.Task> TeamUpdateWithHttpInfoAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TeamUpdateWithHttpInfoAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -697,7 +697,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// The id of the team. (optional) /// Index associated with the operation. /// TeamGetResponse - public TeamGetResponse TeamAddMember(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0) + public TeamGetResponse TeamAddMember(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = TeamAddMemberWithHttpInfo(teamAddMemberRequest, teamId); return localVarResponse.Data; @@ -712,7 +712,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// The id of the team. (optional) /// Index associated with the operation. /// ApiResponse of TeamGetResponse - public Dropbox.Sign.Client.ApiResponse TeamAddMemberWithHttpInfo(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse TeamAddMemberWithHttpInfo(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default, int operationIndex = 0) { // verify the required parameter 'teamAddMemberRequest' is set if (teamAddMemberRequest == null) @@ -796,7 +796,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamAddMemberAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamAddMemberAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamAddMemberWithHttpInfoAsync(teamAddMemberRequest, teamId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -812,7 +812,7 @@ public Dropbox.Sign.Client.ExceptionFactory ExceptionFactory /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamAddMemberWithHttpInfoAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamAddMemberWithHttpInfoAsync(TeamAddMemberRequest teamAddMemberRequest, string? teamId = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'teamAddMemberRequest' is set if (teamAddMemberRequest == null) @@ -989,7 +989,7 @@ public Dropbox.Sign.Client.ApiResponse TeamCreateWithHttpInfo(T /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamCreateAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamCreateAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamCreateWithHttpInfoAsync(teamCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1004,7 +1004,7 @@ public Dropbox.Sign.Client.ApiResponse TeamCreateWithHttpInfo(T /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamCreateWithHttpInfoAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamCreateWithHttpInfoAsync(TeamCreateRequest teamCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'teamCreateRequest' is set if (teamCreateRequest == null) @@ -1158,7 +1158,7 @@ public Dropbox.Sign.Client.ApiResponse TeamDeleteWithHttpInfo(int operat /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TeamDeleteAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamDeleteAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { await TeamDeleteWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); } @@ -1171,7 +1171,7 @@ public Dropbox.Sign.Client.ApiResponse TeamDeleteWithHttpInfo(int operat /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TeamDeleteWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamDeleteWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -1311,7 +1311,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamGetAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamGetWithHttpInfoAsync(operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1325,7 +1325,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamGetWithHttpInfoAsync(int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -1390,7 +1390,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// The id of the team. (optional) /// Index associated with the operation. /// TeamGetInfoResponse - public TeamGetInfoResponse TeamInfo(string? teamId = default(string?), int operationIndex = 0) + public TeamGetInfoResponse TeamInfo(string? teamId = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = TeamInfoWithHttpInfo(teamId); return localVarResponse.Data; @@ -1404,7 +1404,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// The id of the team. (optional) /// Index associated with the operation. /// ApiResponse of TeamGetInfoResponse - public Dropbox.Sign.Client.ApiResponse TeamInfoWithHttpInfo(string? teamId = default(string?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse TeamInfoWithHttpInfo(string? teamId = default, int operationIndex = 0) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -1472,7 +1472,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetInfoResponse - public async System.Threading.Tasks.Task TeamInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamInfoAsync(string? teamId = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamInfoWithHttpInfoAsync(teamId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1487,7 +1487,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetInfoResponse) - public async System.Threading.Tasks.Task> TeamInfoWithHttpInfoAsync(string? teamId = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamInfoWithHttpInfoAsync(string? teamId = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -1556,7 +1556,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// The email address for which to display the team invites. (optional) /// Index associated with the operation. /// TeamInvitesResponse - public TeamInvitesResponse TeamInvites(string? emailAddress = default(string?), int operationIndex = 0) + public TeamInvitesResponse TeamInvites(string? emailAddress = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = TeamInvitesWithHttpInfo(emailAddress); return localVarResponse.Data; @@ -1570,7 +1570,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// The email address for which to display the team invites. (optional) /// Index associated with the operation. /// ApiResponse of TeamInvitesResponse - public Dropbox.Sign.Client.ApiResponse TeamInvitesWithHttpInfo(string? emailAddress = default(string?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse TeamInvitesWithHttpInfo(string? emailAddress = default, int operationIndex = 0) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -1638,7 +1638,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamInvitesResponse - public async System.Threading.Tasks.Task TeamInvitesAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamInvitesAsync(string? emailAddress = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamInvitesWithHttpInfoAsync(emailAddress, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1653,7 +1653,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamInvitesResponse) - public async System.Threading.Tasks.Task> TeamInvitesWithHttpInfoAsync(string? emailAddress = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamInvitesWithHttpInfoAsync(string? emailAddress = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -1724,7 +1724,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// TeamMembersResponse - public TeamMembersResponse TeamMembers(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + public TeamMembersResponse TeamMembers(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = TeamMembersWithHttpInfo(teamId, page, pageSize); return localVarResponse.Data; @@ -1740,7 +1740,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of TeamMembersResponse - public Dropbox.Sign.Client.ApiResponse TeamMembersWithHttpInfo(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse TeamMembersWithHttpInfo(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0) { // verify the required parameter 'teamId' is set if (teamId == null) @@ -1821,7 +1821,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamMembersResponse - public async System.Threading.Tasks.Task TeamMembersAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamMembersAsync(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamMembersWithHttpInfoAsync(teamId, page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1838,7 +1838,7 @@ public Dropbox.Sign.Client.ApiResponse TeamGetWithHttpInfo(int /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamMembersResponse) - public async System.Threading.Tasks.Task> TeamMembersWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamMembersWithHttpInfoAsync(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'teamId' is set if (teamId == null) @@ -2011,7 +2011,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamRemoveMemberAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamRemoveMemberAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamRemoveMemberWithHttpInfoAsync(teamRemoveMemberRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2026,7 +2026,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamRemoveMemberWithHttpInfoAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamRemoveMemberWithHttpInfoAsync(TeamRemoveMemberRequest teamRemoveMemberRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'teamRemoveMemberRequest' is set if (teamRemoveMemberRequest == null) @@ -2108,7 +2108,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// TeamSubTeamsResponse - public TeamSubTeamsResponse TeamSubTeams(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + public TeamSubTeamsResponse TeamSubTeams(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = TeamSubTeamsWithHttpInfo(teamId, page, pageSize); return localVarResponse.Data; @@ -2124,7 +2124,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (optional, default to 20) /// Index associated with the operation. /// ApiResponse of TeamSubTeamsResponse - public Dropbox.Sign.Client.ApiResponse TeamSubTeamsWithHttpInfo(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse TeamSubTeamsWithHttpInfo(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0) { // verify the required parameter 'teamId' is set if (teamId == null) @@ -2205,7 +2205,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamSubTeamsResponse - public async System.Threading.Tasks.Task TeamSubTeamsAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamSubTeamsAsync(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamSubTeamsWithHttpInfoAsync(teamId, page, pageSize, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2222,7 +2222,7 @@ public Dropbox.Sign.Client.ApiResponse TeamRemoveMemberWithHttp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamSubTeamsResponse) - public async System.Threading.Tasks.Task> TeamSubTeamsWithHttpInfoAsync(string teamId, int? page = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamSubTeamsWithHttpInfoAsync(string teamId, int? page = default, int? pageSize = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'teamId' is set if (teamId == null) @@ -2395,7 +2395,7 @@ public Dropbox.Sign.Client.ApiResponse TeamUpdateWithHttpInfo(T /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TeamGetResponse - public async System.Threading.Tasks.Task TeamUpdateAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TeamUpdateAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TeamUpdateWithHttpInfoAsync(teamUpdateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2410,7 +2410,7 @@ public Dropbox.Sign.Client.ApiResponse TeamUpdateWithHttpInfo(T /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TeamGetResponse) - public async System.Threading.Tasks.Task> TeamUpdateWithHttpInfoAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TeamUpdateWithHttpInfoAsync(TeamUpdateRequest teamUpdateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'teamUpdateRequest' is set if (teamUpdateRequest == null) diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs index b80bdffd5..7db3e1d07 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/TemplateApi.cs @@ -141,7 +141,7 @@ public interface ITemplateApiSync : IApiAccessor /// Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) /// Index associated with the operation. /// System.IO.Stream - System.IO.Stream TemplateFiles(string templateId, string? fileType = default(string?), int operationIndex = 0); + System.IO.Stream TemplateFiles(string templateId, string? fileType = default, int operationIndex = 0); /// /// Get Template Files @@ -155,7 +155,7 @@ public interface ITemplateApiSync : IApiAccessor /// Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) /// Index associated with the operation. /// ApiResponse of System.IO.Stream - ApiResponse TemplateFilesWithHttpInfo(string templateId, string? fileType = default(string?), int operationIndex = 0); + ApiResponse TemplateFilesWithHttpInfo(string templateId, string? fileType = default, int operationIndex = 0); /// /// Get Template Files as Data Uri /// @@ -193,7 +193,7 @@ public interface ITemplateApiSync : IApiAccessor /// By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) /// Index associated with the operation. /// FileResponse - FileResponse TemplateFilesAsFileUrl(string templateId, int? forceDownload = default(int?), int operationIndex = 0); + FileResponse TemplateFilesAsFileUrl(string templateId, int? forceDownload = default, int operationIndex = 0); /// /// Get Template Files as File Url @@ -207,7 +207,7 @@ public interface ITemplateApiSync : IApiAccessor /// By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) /// Index associated with the operation. /// ApiResponse of FileResponse - ApiResponse TemplateFilesAsFileUrlWithHttpInfo(string templateId, int? forceDownload = default(int?), int operationIndex = 0); + ApiResponse TemplateFilesAsFileUrlWithHttpInfo(string templateId, int? forceDownload = default, int operationIndex = 0); /// /// Get Template /// @@ -247,7 +247,7 @@ public interface ITemplateApiSync : IApiAccessor /// String that includes search terms and/or fields to be used to filter the Template objects. (optional) /// Index associated with the operation. /// TemplateListResponse - TemplateListResponse TemplateList(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0); + TemplateListResponse TemplateList(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0); /// /// List Templates @@ -263,7 +263,7 @@ public interface ITemplateApiSync : IApiAccessor /// String that includes search terms and/or fields to be used to filter the Template objects. (optional) /// Index associated with the operation. /// ApiResponse of TemplateListResponse - ApiResponse TemplateListWithHttpInfo(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0); + ApiResponse TemplateListWithHttpInfo(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0); /// /// Remove User from Template /// @@ -340,7 +340,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - System.Threading.Tasks.Task TemplateAddUserAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateAddUserAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Add User to Template @@ -355,7 +355,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - System.Threading.Tasks.Task> TemplateAddUserWithHttpInfoAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateAddUserWithHttpInfoAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Template /// @@ -368,7 +368,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateCreateResponse - System.Threading.Tasks.Task TemplateCreateAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateCreateAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Template @@ -382,7 +382,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateCreateResponse) - System.Threading.Tasks.Task> TemplateCreateWithHttpInfoAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateCreateWithHttpInfoAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Embedded Template Draft /// @@ -395,7 +395,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateCreateEmbeddedDraftResponse - System.Threading.Tasks.Task TemplateCreateEmbeddedDraftAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateCreateEmbeddedDraftAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Embedded Template Draft @@ -409,7 +409,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateCreateEmbeddedDraftResponse) - System.Threading.Tasks.Task> TemplateCreateEmbeddedDraftWithHttpInfoAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateCreateEmbeddedDraftWithHttpInfoAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Delete Template /// @@ -422,7 +422,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - System.Threading.Tasks.Task TemplateDeleteAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateDeleteAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Delete Template @@ -436,7 +436,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Template Files /// @@ -450,7 +450,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - System.Threading.Tasks.Task TemplateFilesAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateFilesAsync(string templateId, string? fileType = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Template Files @@ -465,7 +465,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - System.Threading.Tasks.Task> TemplateFilesWithHttpInfoAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateFilesWithHttpInfoAsync(string templateId, string? fileType = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Template Files as Data Uri /// @@ -478,7 +478,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponseDataUri - System.Threading.Tasks.Task TemplateFilesAsDataUriAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateFilesAsDataUriAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Template Files as Data Uri @@ -492,7 +492,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponseDataUri) - System.Threading.Tasks.Task> TemplateFilesAsDataUriWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateFilesAsDataUriWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Template Files as File Url /// @@ -506,7 +506,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponse - System.Threading.Tasks.Task TemplateFilesAsFileUrlAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateFilesAsFileUrlAsync(string templateId, int? forceDownload = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Template Files as File Url @@ -521,7 +521,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponse) - System.Threading.Tasks.Task> TemplateFilesAsFileUrlWithHttpInfoAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateFilesAsFileUrlWithHttpInfoAsync(string templateId, int? forceDownload = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Template /// @@ -534,7 +534,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - System.Threading.Tasks.Task TemplateGetAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateGetAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Get Template @@ -548,7 +548,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - System.Threading.Tasks.Task> TemplateGetWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateGetWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Templates /// @@ -564,7 +564,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateListResponse - System.Threading.Tasks.Task TemplateListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateListAsync(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// List Templates @@ -581,7 +581,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateListResponse) - System.Threading.Tasks.Task> TemplateListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateListWithHttpInfoAsync(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Remove User from Template /// @@ -595,7 +595,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - System.Threading.Tasks.Task TemplateRemoveUserAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateRemoveUserAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Remove User from Template @@ -610,7 +610,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Update Template Files /// @@ -624,7 +624,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateUpdateFilesResponse - System.Threading.Tasks.Task TemplateUpdateFilesAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task TemplateUpdateFilesAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Update Template Files @@ -639,7 +639,7 @@ public interface ITemplateApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateUpdateFilesResponse) - System.Threading.Tasks.Task> TemplateUpdateFilesWithHttpInfoAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TemplateUpdateFilesWithHttpInfoAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -871,7 +871,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateAddUserWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - public async System.Threading.Tasks.Task TemplateAddUserAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateAddUserAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateAddUserWithHttpInfoAsync(templateId, templateAddUserRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -887,7 +887,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateAddUserWithH /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - public async System.Threading.Tasks.Task> TemplateAddUserWithHttpInfoAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateAddUserWithHttpInfoAsync(string templateId, TemplateAddUserRequest templateAddUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1067,7 +1067,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateCreateWit /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateCreateResponse - public async System.Threading.Tasks.Task TemplateCreateAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateCreateAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateCreateWithHttpInfoAsync(templateCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1082,7 +1082,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateCreateWit /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateCreateResponse) - public async System.Threading.Tasks.Task> TemplateCreateWithHttpInfoAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateCreateWithHttpInfoAsync(TemplateCreateRequest templateCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'templateCreateRequest' is set if (templateCreateRequest == null) @@ -1255,7 +1255,7 @@ public Dropbox.Sign.Client.ApiResponse Temp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateCreateEmbeddedDraftResponse - public async System.Threading.Tasks.Task TemplateCreateEmbeddedDraftAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateCreateEmbeddedDraftAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateCreateEmbeddedDraftWithHttpInfoAsync(templateCreateEmbeddedDraftRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1270,7 +1270,7 @@ public Dropbox.Sign.Client.ApiResponse Temp /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateCreateEmbeddedDraftResponse) - public async System.Threading.Tasks.Task> TemplateCreateEmbeddedDraftWithHttpInfoAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateCreateEmbeddedDraftWithHttpInfoAsync(TemplateCreateEmbeddedDraftRequest templateCreateEmbeddedDraftRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'templateCreateEmbeddedDraftRequest' is set if (templateCreateEmbeddedDraftRequest == null) @@ -1434,7 +1434,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of void - public async System.Threading.Tasks.Task TemplateDeleteAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateDeleteAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { await TemplateDeleteWithHttpInfoAsync(templateId, operationIndex, cancellationToken).ConfigureAwait(false); } @@ -1448,7 +1448,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse - public async System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateDeleteWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1521,7 +1521,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) /// Index associated with the operation. /// System.IO.Stream - public System.IO.Stream TemplateFiles(string templateId, string? fileType = default(string?), int operationIndex = 0) + public System.IO.Stream TemplateFiles(string templateId, string? fileType = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = TemplateFilesWithHttpInfo(templateId, fileType); return localVarResponse.Data; @@ -1536,7 +1536,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (optional) /// Index associated with the operation. /// ApiResponse of System.IO.Stream - public Dropbox.Sign.Client.ApiResponse TemplateFilesWithHttpInfo(string templateId, string? fileType = default(string?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse TemplateFilesWithHttpInfo(string templateId, string? fileType = default, int operationIndex = 0) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1614,7 +1614,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of System.IO.Stream - public async System.Threading.Tasks.Task TemplateFilesAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateFilesAsync(string templateId, string? fileType = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateFilesWithHttpInfoAsync(templateId, fileType, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1630,7 +1630,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateDeleteWithHttpInfo(string /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (System.IO.Stream) - public async System.Threading.Tasks.Task> TemplateFilesWithHttpInfoAsync(string templateId, string? fileType = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateFilesWithHttpInfoAsync(string templateId, string? fileType = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1793,7 +1793,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponseDataUri - public async System.Threading.Tasks.Task TemplateFilesAsDataUriAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateFilesAsDataUriAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateFilesAsDataUriWithHttpInfoAsync(templateId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1808,7 +1808,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponseDataUri) - public async System.Threading.Tasks.Task> TemplateFilesAsDataUriWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateFilesAsDataUriWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1881,7 +1881,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) /// Index associated with the operation. /// FileResponse - public FileResponse TemplateFilesAsFileUrl(string templateId, int? forceDownload = default(int?), int operationIndex = 0) + public FileResponse TemplateFilesAsFileUrl(string templateId, int? forceDownload = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = TemplateFilesAsFileUrlWithHttpInfo(templateId, forceDownload); return localVarResponse.Data; @@ -1896,7 +1896,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// By default when opening the `file_url` a browser will download the PDF and save it locally. When set to `0` the PDF file will be displayed in the browser. (optional, default to 1) /// Index associated with the operation. /// ApiResponse of FileResponse - public Dropbox.Sign.Client.ApiResponse TemplateFilesAsFileUrlWithHttpInfo(string templateId, int? forceDownload = default(int?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse TemplateFilesAsFileUrlWithHttpInfo(string templateId, int? forceDownload = default, int operationIndex = 0) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -1972,7 +1972,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of FileResponse - public async System.Threading.Tasks.Task TemplateFilesAsFileUrlAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateFilesAsFileUrlAsync(string templateId, int? forceDownload = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateFilesAsFileUrlWithHttpInfoAsync(templateId, forceDownload, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1988,7 +1988,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateFilesAsDataU /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (FileResponse) - public async System.Threading.Tasks.Task> TemplateFilesAsFileUrlWithHttpInfoAsync(string templateId, int? forceDownload = default(int?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateFilesAsFileUrlWithHttpInfoAsync(string templateId, int? forceDownload = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -2149,7 +2149,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - public async System.Threading.Tasks.Task TemplateGetAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateGetAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateGetWithHttpInfoAsync(templateId, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2164,7 +2164,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - public async System.Threading.Tasks.Task> TemplateGetWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateGetWithHttpInfoAsync(string templateId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -2239,7 +2239,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// String that includes search terms and/or fields to be used to filter the Template objects. (optional) /// Index associated with the operation. /// TemplateListResponse - public TemplateListResponse TemplateList(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0) + public TemplateListResponse TemplateList(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0) { Dropbox.Sign.Client.ApiResponse localVarResponse = TemplateListWithHttpInfo(accountId, page, pageSize, query); return localVarResponse.Data; @@ -2256,7 +2256,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// String that includes search terms and/or fields to be used to filter the Template objects. (optional) /// Index associated with the operation. /// ApiResponse of TemplateListResponse - public Dropbox.Sign.Client.ApiResponse TemplateListWithHttpInfo(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0) + public Dropbox.Sign.Client.ApiResponse TemplateListWithHttpInfo(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -2339,7 +2339,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateListResponse - public async System.Threading.Tasks.Task TemplateListAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateListAsync(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateListWithHttpInfoAsync(accountId, page, pageSize, query, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2357,7 +2357,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateGetWithHttpI /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateListResponse) - public async System.Threading.Tasks.Task> TemplateListWithHttpInfoAsync(string? accountId = default(string?), int? page = default(int?), int? pageSize = default(int?), string? query = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateListWithHttpInfoAsync(string? accountId = default, int? page = default, int? pageSize = default, string? query = default, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.RequestOptions localVarRequestOptions = new Dropbox.Sign.Client.RequestOptions(); @@ -2541,7 +2541,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateRemoveUserWi /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateGetResponse - public async System.Threading.Tasks.Task TemplateRemoveUserAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateRemoveUserAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateRemoveUserWithHttpInfoAsync(templateId, templateRemoveUserRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2557,7 +2557,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateRemoveUserWi /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateGetResponse) - public async System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateRemoveUserWithHttpInfoAsync(string templateId, TemplateRemoveUserRequest templateRemoveUserRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'templateId' is set if (templateId == null) @@ -2747,7 +2747,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateUpda /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of TemplateUpdateFilesResponse - public async System.Threading.Tasks.Task TemplateUpdateFilesAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TemplateUpdateFilesAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await TemplateUpdateFilesWithHttpInfoAsync(templateId, templateUpdateFilesRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -2763,7 +2763,7 @@ public Dropbox.Sign.Client.ApiResponse TemplateUpda /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (TemplateUpdateFilesResponse) - public async System.Threading.Tasks.Task> TemplateUpdateFilesWithHttpInfoAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TemplateUpdateFilesWithHttpInfoAsync(string templateId, TemplateUpdateFilesRequest templateUpdateFilesRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'templateId' is set if (templateId == null) diff --git a/sdks/dotnet/src/Dropbox.Sign/Api/UnclaimedDraftApi.cs b/sdks/dotnet/src/Dropbox.Sign/Api/UnclaimedDraftApi.cs index a41df498f..4fc917ffd 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Api/UnclaimedDraftApi.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Api/UnclaimedDraftApi.cs @@ -150,7 +150,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - System.Threading.Tasks.Task UnclaimedDraftCreateAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnclaimedDraftCreateAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Unclaimed Draft @@ -164,7 +164,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - System.Threading.Tasks.Task> UnclaimedDraftCreateWithHttpInfoAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnclaimedDraftCreateWithHttpInfoAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Embedded Unclaimed Draft /// @@ -177,7 +177,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Embedded Unclaimed Draft @@ -191,7 +191,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Embedded Unclaimed Draft with Template /// @@ -204,7 +204,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedWithTemplateAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedWithTemplateAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Create Embedded Unclaimed Draft with Template @@ -218,7 +218,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Edit and Resend Unclaimed Draft /// @@ -232,7 +232,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - System.Threading.Tasks.Task UnclaimedDraftEditAndResendAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnclaimedDraftEditAndResendAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// Edit and Resend Unclaimed Draft @@ -247,7 +247,7 @@ public interface IUnclaimedDraftApiAsync : IApiAccessor /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - System.Threading.Tasks.Task> UnclaimedDraftEditAndResendWithHttpInfoAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnclaimedDraftEditAndResendWithHttpInfoAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); #endregion Asynchronous Operations } @@ -469,7 +469,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - public async System.Threading.Tasks.Task UnclaimedDraftCreateAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnclaimedDraftCreateAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await UnclaimedDraftCreateWithHttpInfoAsync(unclaimedDraftCreateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -484,7 +484,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - public async System.Threading.Tasks.Task> UnclaimedDraftCreateWithHttpInfoAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnclaimedDraftCreateWithHttpInfoAsync(UnclaimedDraftCreateRequest unclaimedDraftCreateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'unclaimedDraftCreateRequest' is set if (unclaimedDraftCreateRequest == null) @@ -657,7 +657,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - public async System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(unclaimedDraftCreateEmbeddedRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -672,7 +672,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - public async System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedRequest unclaimedDraftCreateEmbeddedRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'unclaimedDraftCreateEmbeddedRequest' is set if (unclaimedDraftCreateEmbeddedRequest == null) @@ -845,7 +845,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - public async System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedWithTemplateAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnclaimedDraftCreateEmbeddedWithTemplateAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(unclaimedDraftCreateEmbeddedWithTemplateRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -860,7 +860,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - public async System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnclaimedDraftCreateEmbeddedWithTemplateWithHttpInfoAsync(UnclaimedDraftCreateEmbeddedWithTemplateRequest unclaimedDraftCreateEmbeddedWithTemplateRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'unclaimedDraftCreateEmbeddedWithTemplateRequest' is set if (unclaimedDraftCreateEmbeddedWithTemplateRequest == null) @@ -1043,7 +1043,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of UnclaimedDraftCreateResponse - public async System.Threading.Tasks.Task UnclaimedDraftEditAndResendAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnclaimedDraftEditAndResendAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { Dropbox.Sign.Client.ApiResponse localVarResponse = await UnclaimedDraftEditAndResendWithHttpInfoAsync(signatureRequestId, unclaimedDraftEditAndResendRequest, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; @@ -1059,7 +1059,7 @@ public Dropbox.Sign.Client.ApiResponse UnclaimedDr /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (UnclaimedDraftCreateResponse) - public async System.Threading.Tasks.Task> UnclaimedDraftEditAndResendWithHttpInfoAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnclaimedDraftEditAndResendWithHttpInfoAsync(string signatureRequestId, UnclaimedDraftEditAndResendRequest unclaimedDraftEditAndResendRequest, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { // verify the required parameter 'signatureRequestId' is set if (signatureRequestId == null) diff --git a/sdks/dotnet/src/Dropbox.Sign/Client/ApiClient.cs b/sdks/dotnet/src/Dropbox.Sign/Client/ApiClient.cs index 72c26631b..3165d7f81 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Client/ApiClient.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Client/ApiClient.cs @@ -500,7 +500,7 @@ private async Task> ExecClientAsync(Func response = await getResponse(client); + RestResponse response = await getResponse(client).ConfigureAwait(false); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) @@ -569,7 +569,7 @@ private async Task> DeserializeRestResponseFromPolicyAsync(Re { if (policyResult.Outcome == OutcomeType.Successful) { - return await client.Deserialize(policyResult.Result, cancellationToken); + return await client.Deserialize(policyResult.Result, cancellationToken).ConfigureAwait(false); } else { @@ -613,7 +613,7 @@ private ApiResponse Exec(RestRequest request, RequestOptions options, IRea return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult(); } - private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default) { Action setOptions = (clientOptions) => { @@ -626,7 +626,7 @@ private ApiResponse Exec(RestRequest request, RequestOptions options, IRea { var policy = RetryConfiguration.AsyncRetryPolicy; var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken); + return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken).ConfigureAwait(false); } else { diff --git a/sdks/dotnet/src/Dropbox.Sign/Client/ClientUtils.cs b/sdks/dotnet/src/Dropbox.Sign/Client/ClientUtils.cs index ec20198ca..237e86dbc 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Client/ClientUtils.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Client/ClientUtils.cs @@ -136,6 +136,34 @@ public static string Serialize(object obj) return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; } + /// + /// Serializes the given object as an ASCII-safe JSON string. Used to serialize the value of + /// a header parameter whose content type is JSON (e.g. content: application/json), + /// so model objects are rendered as JSON instead of their debug ToString() representation. + /// + /// The object to serialize. + /// JSON representation of the object with every C0 control character (including CR and LF), DEL, and non-ASCII character escaped as \uXXXX, so raw control bytes can never reach the header value. + public static string ParameterToJsonString(object obj) + { + // JsonConvert renders a null reference as the JSON literal "null" (not a null string). + string json = Newtonsoft.Json.JsonConvert.SerializeObject(obj); + + // Escape everything that is not printable ASCII: C0 controls (including CR and LF), DEL, + // and all non-ASCII characters, as \uXXXX. Because this runs over the final serialized + // string, the result is safe to use as an HTTP header value even if a custom converter + // emitted raw control characters or non-ASCII text (preventing header splitting/injection). + StringBuilder escaped = new StringBuilder(json.Length); + foreach (char c in json) + { + if (c < 0x20 || c >= 0x7f) + escaped.Append("\\u").Append(((int)c).ToString("x4", CultureInfo.InvariantCulture)); + else + escaped.Append(c); + } + + return escaped.ToString(); + } + /// /// Encode string in base64 format. /// diff --git a/sdks/dotnet/src/Dropbox.Sign/Client/Configuration.cs b/sdks/dotnet/src/Dropbox.Sign/Client/Configuration.cs index 0903fe5c0..f91e2db34 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Client/Configuration.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Client/Configuration.cs @@ -120,7 +120,7 @@ public class Configuration : IReadableConfiguration public Configuration() { Proxy = null; - UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/2.2-dev/csharp"); + UserAgent = "OpenAPI-Generator/2.2-dev/csharp"; BasePath = "https://api.hellosign.com/v3"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); @@ -529,7 +529,7 @@ private string GetServerUrl(IList> servers, if (inputVariables.ContainsKey(variable.Key)) { - if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + if (!serverVariables.ContainsKey("enum_values") || ((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) { url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); } diff --git a/sdks/dotnet/src/Dropbox.Sign/Client/IAsynchronousClient.cs b/sdks/dotnet/src/Dropbox.Sign/Client/IAsynchronousClient.cs index 66e347c5b..de0adb753 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Client/IAsynchronousClient.cs +++ b/sdks/dotnet/src/Dropbox.Sign/Client/IAsynchronousClient.cs @@ -30,7 +30,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the POST http verb. @@ -41,7 +41,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -52,7 +52,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -63,7 +63,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -74,7 +74,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -85,7 +85,7 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -96,6 +96,6 @@ public interface IAsynchronousClient /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); } } diff --git a/sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj b/sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj index da6c57dc7..67a48582c 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj +++ b/sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj @@ -2,7 +2,7 @@ false - net8.0 + net8.0;net10.0 Dropbox.Sign Dropbox.Sign Library diff --git a/sdks/dotnet/templates/ApiClient.mustache b/sdks/dotnet/templates/ApiClient.mustache index bd0a31747..5103e0675 100644 --- a/sdks/dotnet/templates/ApiClient.mustache +++ b/sdks/dotnet/templates/ApiClient.mustache @@ -195,14 +195,14 @@ namespace {{packageName}}.Client /// Allows for extending request processing for generated code. /// /// The RestSharp request object - partial void InterceptRequest(RestRequest request); + {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptRequest(RestRequest request){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} /// /// Allows for extending response processing for generated code. /// /// The RestSharp request object /// The RestSharp response object - partial void InterceptResponse(RestRequest request, RestResponse response); + {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptResponse(RestRequest request, RestResponse response){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} /// /// Initializes a new instance of the , defaulting to the global configurations' base url. @@ -488,7 +488,8 @@ namespace {{packageName}}.Client Proxy = configuration.Proxy, UserAgent = configuration.UserAgent, UseDefaultCredentials = configuration.UseDefaultCredentials, - RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback + RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback{{#throwOnAnyError}}, + ThrowOnAnyError = true{{/throwOnAnyError}} }; setOptions(clientOptions); @@ -528,7 +529,7 @@ namespace {{packageName}}.Client { InterceptRequest(request); - RestResponse response = await getResponse(client); + RestResponse response = await getResponse(client).ConfigureAwait(false); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) @@ -597,14 +598,19 @@ namespace {{packageName}}.Client { if (policyResult.Outcome == OutcomeType.Successful) { - return await client.Deserialize(policyResult.Result, cancellationToken); + return await client.Deserialize(policyResult.Result, cancellationToken).ConfigureAwait(false); } else { + {{#throwOnAnyError}} + throw policyResult.FinalException ?? new InvalidOperationException("The retry policy failed without an exception."); + {{/throwOnAnyError}} + {{^throwOnAnyError}} return new RestResponse(request) { ErrorException = policyResult.FinalException }; + {{/throwOnAnyError}} } } @@ -642,7 +648,7 @@ namespace {{packageName}}.Client } {{#supportsAsync}} - private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default) { Action setOptions = (clientOptions) => { @@ -656,7 +662,7 @@ namespace {{packageName}}.Client { var policy = RetryConfiguration.AsyncRetryPolicy; var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false); - return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken); + return await DeserializeRestResponseFromPolicyAsync(client, request, policyResult, cancellationToken).ConfigureAwait(false); } else { diff --git a/sdks/dotnet/templates/ApiClient.v790.mustache b/sdks/dotnet/templates/ApiClient.v790.mustache index a63d1c2be..6eb294e1a 100644 --- a/sdks/dotnet/templates/ApiClient.v790.mustache +++ b/sdks/dotnet/templates/ApiClient.v790.mustache @@ -558,10 +558,15 @@ namespace {{packageName}}.Client } else { + {{#throwOnAnyError}} + throw policyResult.FinalException ?? new InvalidOperationException("The retry policy failed without an exception."); + {{/throwOnAnyError}} + {{^throwOnAnyError}} return new RestResponse(request) { ErrorException = policyResult.FinalException }; + {{/throwOnAnyError}} } } @@ -599,7 +604,7 @@ namespace {{packageName}}.Client } {{#supportsAsync}} - private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken)) + private Task> ExecAsync(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default) { Action setOptions = (clientOptions) => { diff --git a/sdks/dotnet/templates/AssemblyInfo.mustache b/sdks/dotnet/templates/AssemblyInfo.mustache index d5d937dc1..4f66e0398 100644 --- a/sdks/dotnet/templates/AssemblyInfo.mustache +++ b/sdks/dotnet/templates/AssemblyInfo.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/sdks/dotnet/templates/ClientUtils.mustache b/sdks/dotnet/templates/ClientUtils.mustache index f8481e37f..7ff08f0b2 100644 --- a/sdks/dotnet/templates/ClientUtils.mustache +++ b/sdks/dotnet/templates/ClientUtils.mustache @@ -150,6 +150,34 @@ namespace {{packageName}}.Client return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null; } + /// + /// Serializes the given object as an ASCII-safe JSON string. Used to serialize the value of + /// a header parameter whose content type is JSON (e.g. content: application/json), + /// so model objects are rendered as JSON instead of their debug ToString() representation. + /// + /// The object to serialize. + /// JSON representation of the object with every C0 control character (including CR and LF), DEL, and non-ASCII character escaped as \uXXXX, so raw control bytes can never reach the header value. + public static string ParameterToJsonString(object obj) + { + // JsonConvert renders a null reference as the JSON literal "null" (not a null string). + string json = Newtonsoft.Json.JsonConvert.SerializeObject(obj); + + // Escape everything that is not printable ASCII: C0 controls (including CR and LF), DEL, + // and all non-ASCII characters, as \uXXXX. Because this runs over the final serialized + // string, the result is safe to use as an HTTP header value even if a custom converter + // emitted raw control characters or non-ASCII text (preventing header splitting/injection). + StringBuilder escaped = new StringBuilder(json.Length); + foreach (char c in json) + { + if (c < 0x20 || c >= 0x7f) + escaped.Append("\\u").Append(((int)c).ToString("x4", CultureInfo.InvariantCulture)); + else + escaped.Append(c); + } + + return escaped.ToString(); + } + /// /// Encode string in base64 format. /// diff --git a/sdks/dotnet/templates/Configuration.mustache b/sdks/dotnet/templates/Configuration.mustache index c81ca2623..932af27cf 100644 --- a/sdks/dotnet/templates/Configuration.mustache +++ b/sdks/dotnet/templates/Configuration.mustache @@ -140,7 +140,7 @@ namespace {{packageName}}.Client public Configuration() { Proxy = null; - UserAgent = WebUtility.UrlEncode("{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"); + UserAgent = "{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"; BasePath = "{{{basePath}}}"; DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); @@ -617,7 +617,7 @@ namespace {{packageName}}.Client if (inputVariables.ContainsKey(variable.Key)) { - if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) + if (!serverVariables.ContainsKey("enum_values") || ((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) { url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]); } diff --git a/sdks/dotnet/templates/Configuration.v790.mustache b/sdks/dotnet/templates/Configuration.v790.mustache index 2753aafb3..5a57dd31c 100644 --- a/sdks/dotnet/templates/Configuration.v790.mustache +++ b/sdks/dotnet/templates/Configuration.v790.mustache @@ -126,7 +126,7 @@ namespace {{packageName}}.Client public Configuration() { Proxy = null; - UserAgent = WebUtility.UrlEncode("{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"); + UserAgent = "{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"; BasePath = "{{{basePath}}}"; DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); diff --git a/sdks/dotnet/templates/HttpSigningConfiguration.mustache b/sdks/dotnet/templates/HttpSigningConfiguration.mustache index 97b855dc5..88489f886 100644 --- a/sdks/dotnet/templates/HttpSigningConfiguration.mustache +++ b/sdks/dotnet/templates/HttpSigningConfiguration.mustache @@ -25,6 +25,8 @@ namespace {{packageName}}.Client { HashAlgorithm = HashAlgorithmName.SHA256; SigningAlgorithm = "PKCS1-v15"; + _skipUrlEncode = RuntimeInformation.FrameworkDescription.StartsWith(".NET ") && + int.TryParse(RuntimeInformation.FrameworkDescription.Substring(5).Split('.')[0], out int fwMajor) && fwMajor >= 9; } /// @@ -67,6 +69,14 @@ namespace {{packageName}}.Client /// public int SignatureValidityPeriod { get; set; } + // On .NET 9+, HttpUtility.ParseQueryString already URL-encodes keys internally, + // so calling UrlEncode again would cause double-encoding and produce a signature + // that does not match the actual request sent by RestSharp 112+. + // On .NET 8 and earlier, keys must be explicitly URL-encoded so that special + // characters (e.g. '$' in OData params like $filter) are encoded the same way + // in the signature as they are in the outgoing HTTP request. + private readonly bool _skipUrlEncode; + private enum PrivateKeyType { None = 0, @@ -133,8 +143,7 @@ namespace {{packageName}}.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) - string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = _skipUrlEncode ? parameter.Key : HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) diff --git a/sdks/dotnet/templates/IAsynchronousClient.mustache b/sdks/dotnet/templates/IAsynchronousClient.mustache index 76ddd4adb..d68e87bb9 100644 --- a/sdks/dotnet/templates/IAsynchronousClient.mustache +++ b/sdks/dotnet/templates/IAsynchronousClient.mustache @@ -21,7 +21,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the POST http verb. @@ -32,7 +32,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the PUT http verb. @@ -43,7 +43,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the DELETE http verb. @@ -54,7 +54,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the HEAD http verb. @@ -65,7 +65,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the OPTIONS http verb. @@ -76,7 +76,7 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); /// /// Executes a non-blocking call to some using the PATCH http verb. @@ -87,6 +87,6 @@ namespace {{packageName}}.Client /// Cancellation Token to cancel the request. /// The return type. /// A task eventually representing the response data, decorated with - Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default); } } diff --git a/sdks/dotnet/templates/README.mustache b/sdks/dotnet/templates/README.mustache index 7455a8f95..c160b0b50 100644 --- a/sdks/dotnet/templates/README.mustache +++ b/sdks/dotnet/templates/README.mustache @@ -62,6 +62,9 @@ this command. - .NET Framework >=4.6 - Mono/Xamarin >=vNext {{/netStandard}} +{{#useCustomTemplateCode}} +- .NET 8.0 or later (the package includes `net8.0` and `net10.0` builds) +{{/useCustomTemplateCode}} ## Dependencies diff --git a/sdks/dotnet/templates/RetryConfiguration.mustache b/sdks/dotnet/templates/RetryConfiguration.mustache index 93ba14d93..887985bc5 100644 --- a/sdks/dotnet/templates/RetryConfiguration.mustache +++ b/sdks/dotnet/templates/RetryConfiguration.mustache @@ -19,23 +19,33 @@ namespace {{packageName}}.Client /// /// Retry policy /// +{{^useCustomTemplateCode}} + public static ISyncPolicy RetryPolicy { get; set; } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} public static Policy RetryPolicy { get; set; } +{{/useCustomTemplateCode}} /// /// Async retry policy /// +{{^useCustomTemplateCode}} + public static IAsyncPolicy AsyncRetryPolicy { get; set; } +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} public static AsyncPolicy AsyncRetryPolicy { get; set; } +{{/useCustomTemplateCode}} {{/useRestSharp}} {{#useHttpClient}} /// /// Retry policy /// - public static Policy RetryPolicy { get; set; } + public static ISyncPolicy RetryPolicy { get; set; } /// /// Async retry policy /// - public static AsyncPolicy AsyncRetryPolicy { get; set; } + public static IAsyncPolicy AsyncRetryPolicy { get; set; } {{/useHttpClient}} } } diff --git a/sdks/dotnet/templates/api.mustache b/sdks/dotnet/templates/api.mustache index 804b98767..1ecb686e3 100644 --- a/sdks/dotnet/templates/api.mustache +++ b/sdks/dotnet/templates/api.mustache @@ -39,7 +39,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); /// /// {{summary}} @@ -55,7 +55,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0); {{/operation}} #endregion Synchronous Operations } @@ -85,7 +85,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); /// /// {{summary}} @@ -104,7 +104,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default); {{/operation}} #endregion Asynchronous Operations } @@ -249,7 +249,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} @@ -266,7 +266,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0) { {{#allParams}} {{#required}} @@ -383,12 +383,12 @@ namespace {{packageName}}.{{apiPackage}} {{/queryParams}} {{#headerParams}} {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#headerIsJsonMimeType}}ParameterToJsonString{{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ParameterToString{{/headerIsJsonMimeType}}({{paramName}})); // header parameter {{/required}} {{^required}} if ({{paramName}} != null) { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#headerIsJsonMimeType}}ParameterToJsonString{{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ParameterToString{{/headerIsJsonMimeType}}({{paramName}})); // header parameter } {{/required}} {{/headerParams}} @@ -550,7 +550,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}operationIndex, cancellationToken).ConfigureAwait(false);{{/returnType}} @@ -570,7 +570,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default) { {{#allParams}} {{#required}} @@ -705,12 +705,12 @@ namespace {{packageName}}.{{apiPackage}} {{/constantParams}} {{#headerParams}} {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#headerIsJsonMimeType}}ParameterToJsonString{{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ParameterToString{{/headerIsJsonMimeType}}({{paramName}})); // header parameter {{/required}} {{^required}} if ({{paramName}} != null) { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#headerIsJsonMimeType}}ParameterToJsonString{{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ParameterToString{{/headerIsJsonMimeType}}({{paramName}})); // header parameter } {{/required}} {{/headerParams}} diff --git a/sdks/dotnet/templates/api_doc.mustache b/sdks/dotnet/templates/api_doc.mustache index 341bd79d7..b3e981d98 100644 --- a/sdks/dotnet/templates/api_doc.mustache +++ b/sdks/dotnet/templates/api_doc.mustache @@ -21,6 +21,7 @@ All URIs are relative to *{{{basePath}}}* {{{.}}}{{/notes}} +{{^useGenericHost}} ### Example {{^useCustomTemplateCode}} ```csharp @@ -129,6 +130,7 @@ catch (ApiException e) Debug.Print(e.StackTrace); } ``` +{{/useGenericHost}} ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} diff --git a/sdks/dotnet/templates/libraries/generichost/AfterOperationDefaultImplementation.mustache b/sdks/dotnet/templates/libraries/generichost/AfterOperationDefaultImplementation.mustache index 394c65720..c55f302b2 100644 --- a/sdks/dotnet/templates/libraries/generichost/AfterOperationDefaultImplementation.mustache +++ b/sdks/dotnet/templates/libraries/generichost/AfterOperationDefaultImplementation.mustache @@ -1,2 +1,2 @@ if (!suppressDefaultLog) - Logger.LogInformation("{0,-9} | {1} | {3}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); \ No newline at end of file + Logger.LogInformation(RestLogEvents.ApiRequestCompleted, "{0,-9} | {1} | {2}", (apiResponseLocalVar.DownloadedAt - apiResponseLocalVar.RequestedAt).TotalSeconds, apiResponseLocalVar.StatusCode, apiResponseLocalVar.Path); diff --git a/sdks/dotnet/templates/libraries/generichost/ApiException.mustache b/sdks/dotnet/templates/libraries/generichost/ApiException.mustache index c14c1010f..ffc90cf11 100644 --- a/sdks/dotnet/templates/libraries/generichost/ApiException.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ApiException.mustache @@ -1,5 +1,6 @@ // {{>partial_header}} + {{#nrt}} #nullable enable diff --git a/sdks/dotnet/templates/libraries/generichost/ApiFactory.mustache b/sdks/dotnet/templates/libraries/generichost/ApiFactory.mustache index a445d2169..d8aa27040 100644 --- a/sdks/dotnet/templates/libraries/generichost/ApiFactory.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ApiFactory.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} using System; using Microsoft.Extensions.DependencyInjection; using {{packageName}}.{{apiPackage}}; diff --git a/sdks/dotnet/templates/libraries/generichost/ApiKeyToken.mustache b/sdks/dotnet/templates/libraries/generichost/ApiKeyToken.mustache index d3f1f5214..ca9a9e36f 100644 --- a/sdks/dotnet/templates/libraries/generichost/ApiKeyToken.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ApiKeyToken.mustache @@ -1,5 +1,6 @@ // -{{partial_header}} +{{>partial_header}} + {{#nrt}} #nullable enable @@ -53,4 +54,4 @@ namespace {{packageName}}.{{clientPackage}} parseQueryString[ClientUtils.ApiKeyHeaderToString(Header)] = Uri.EscapeDataString(_raw).ToString(){{nrt!}}; } } -} \ No newline at end of file +} diff --git a/sdks/dotnet/templates/libraries/generichost/ApiResponseEventArgs`1.mustache b/sdks/dotnet/templates/libraries/generichost/ApiResponseEventArgs`1.mustache index aea35fae1..e50a15c7c 100644 --- a/sdks/dotnet/templates/libraries/generichost/ApiResponseEventArgs`1.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ApiResponseEventArgs`1.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} using System; namespace {{packageName}}.{{clientPackage}} diff --git a/sdks/dotnet/templates/libraries/generichost/ApiResponse`1.mustache b/sdks/dotnet/templates/libraries/generichost/ApiResponse`1.mustache index 1b12e4173..3cd0aaf7d 100644 --- a/sdks/dotnet/templates/libraries/generichost/ApiResponse`1.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ApiResponse`1.mustache @@ -1,5 +1,6 @@ // {{>partial_header}} + {{#nrt}} #nullable enable @@ -32,6 +33,11 @@ namespace {{packageName}}.{{clientPackage}} /// The raw content of this response. /// string RawContent { get; } + + /// + /// The raw binary stream (only set for binary responses) + /// + System.IO.Stream{{nrt?}} ContentStream { get; } /// /// The DateTime when the request was retrieved. @@ -43,6 +49,11 @@ namespace {{packageName}}.{{clientPackage}} /// System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + /// + /// The headers contained in the api response related to the content + /// + System.Net.Http.Headers.HttpContentHeaders ContentHeaders { get; } + /// /// The path used when making the request. /// @@ -80,6 +91,11 @@ namespace {{packageName}}.{{clientPackage}} /// public string RawContent { get; protected set; } + /// + /// The raw binary stream (only set for binary responses) + /// + public System.IO.Stream{{nrt?}} ContentStream { get; protected set; } + /// /// The IsSuccessStatusCode from the api response /// @@ -95,6 +111,11 @@ namespace {{packageName}}.{{clientPackage}} /// public System.Net.Http.Headers.HttpResponseHeaders Headers { get; } + /// + /// The headers contained in the api response related to the content + /// + public System.Net.Http.Headers.HttpContentHeaders ContentHeaders { get; } + /// /// The DateTime when the request was retrieved. /// @@ -133,6 +154,7 @@ namespace {{packageName}}.{{clientPackage}} { StatusCode = httpResponseMessage.StatusCode; Headers = httpResponseMessage.Headers; + ContentHeaders = httpResponseMessage.Content.Headers; IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; ReasonPhrase = httpResponseMessage.ReasonPhrase; RawContent = rawContent; @@ -143,6 +165,32 @@ namespace {{packageName}}.{{clientPackage}} OnCreated(httpRequestMessage, httpResponseMessage); } + /// + /// Construct the response using an HttpResponseMessage + /// + /// + /// + /// + /// + /// + /// + public ApiResponse(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) + { + StatusCode = httpResponseMessage.StatusCode; + Headers = httpResponseMessage.Headers; + ContentHeaders = httpResponseMessage.Content.Headers; + IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode; + ReasonPhrase = httpResponseMessage.ReasonPhrase; + ContentStream = contentStream; + RawContent = string.Empty; + Path = path; + RequestUri = httpRequestMessage.RequestUri; + RequestedAt = requestedAt; + _jsonSerializerOptions = jsonSerializerOptions; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + partial void OnCreated(global::System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage); } {{#x-http-statuses-with-return}} diff --git a/sdks/dotnet/templates/libraries/generichost/ApiTestsBase.mustache b/sdks/dotnet/templates/libraries/generichost/ApiTestsBase.mustache index c71bc79b9..e085cc1b3 100644 --- a/sdks/dotnet/templates/libraries/generichost/ApiTestsBase.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ApiTestsBase.mustache @@ -11,6 +11,7 @@ using {{packageName}}.Extensions; {{>testInstructions}} + namespace {{packageName}}.Test.{{apiPackage}} { /// @@ -26,7 +27,7 @@ namespace {{packageName}}.Test.{{apiPackage}} } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) - .Configure{{apiName}}((context, services, options) => + .Configure{{apiName}}((context, options) => { {{#lambda.trimTrailingWithNewLine}} {{#apiKeyMethods}} diff --git a/sdks/dotnet/templates/libraries/generichost/AsModel.mustache b/sdks/dotnet/templates/libraries/generichost/AsModel.mustache index 96bedfa46..2cc3ef759 100644 --- a/sdks/dotnet/templates/libraries/generichost/AsModel.mustache +++ b/sdks/dotnet/templates/libraries/generichost/AsModel.mustache @@ -1,4 +1,4 @@ -// This logic may be modified with the AsModel.mustache template +// NOTICE: Consider this AsModel template deprecated. Implement the appropriate partial method instead return Is{{vendorExtensions.x-http-status}} - ? System.Text.Json.JsonSerializer.Deserialize<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}>(RawContent, _jsonSerializerOptions) + ? {{#isBinary}}ContentStream{{/isBinary}}{{^isBinary}}System.Text.Json.JsonSerializer.Deserialize<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}>(RawContent, _jsonSerializerOptions){{/isBinary}} : {{#net60OrLater}}null{{/net60OrLater}}{{^net60OrLater}}default{{/net60OrLater}}; diff --git a/sdks/dotnet/templates/libraries/generichost/BasicToken.mustache b/sdks/dotnet/templates/libraries/generichost/BasicToken.mustache index ed6f53e54..c35e95b44 100644 --- a/sdks/dotnet/templates/libraries/generichost/BasicToken.mustache +++ b/sdks/dotnet/templates/libraries/generichost/BasicToken.mustache @@ -1,5 +1,6 @@ // -{{partial_header}} +{{>partial_header}} + {{#nrt}} #nullable enable @@ -43,4 +44,4 @@ namespace {{packageName}}.{{clientPackage}} request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", {{packageName}}.Client.ClientUtils.Base64Encode(_username + ":" + _password)); } } -} \ No newline at end of file +} diff --git a/sdks/dotnet/templates/libraries/generichost/BearerToken.mustache b/sdks/dotnet/templates/libraries/generichost/BearerToken.mustache index 761f598d8..de33b602a 100644 --- a/sdks/dotnet/templates/libraries/generichost/BearerToken.mustache +++ b/sdks/dotnet/templates/libraries/generichost/BearerToken.mustache @@ -1,5 +1,6 @@ // -{{partial_header}} +{{>partial_header}} + {{#nrt}} #nullable enable @@ -38,4 +39,4 @@ namespace {{packageName}}.{{clientPackage}} request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); } } -} \ No newline at end of file +} diff --git a/sdks/dotnet/templates/libraries/generichost/ClientUtils.mustache b/sdks/dotnet/templates/libraries/generichost/ClientUtils.mustache index 357d2197c..29043e9ca 100644 --- a/sdks/dotnet/templates/libraries/generichost/ClientUtils.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ClientUtils.mustache @@ -18,6 +18,7 @@ using {{packageName}}.{{modelPackage}}; {{/-first}} {{/models}} using System.Runtime.CompilerServices; +using System.Net.Http.Headers; {{>Assembly}}namespace {{packageName}}.{{clientPackage}} { @@ -311,6 +312,36 @@ using System.Runtime.CompilerServices; return string.Join(",", accepts); } + + + /// + /// Select the Accept header's value from the given accepts array: + /// if JSON exists in the given array, use it; + /// otherwise use all of them. + /// + /// The accepts array to select from. + /// The Accept header values to use. + public static IEnumerable SelectHeaderAcceptArray(string[] accepts) + { + if (accepts.Length == 0) + {{#net80OrLater}} + return []; + {{/net80OrLater}} + {{^net80OrLater}} + return Enumerable.Empty(); + {{/net80OrLater}} + + if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + {{#net80OrLater}} + return [MediaTypeWithQualityHeaderValue.Parse("application/json")]; + {{/net80OrLater}} + {{^net80OrLater}} + return new [] { MediaTypeWithQualityHeaderValue.Parse("application/json") }; + {{/net80OrLater}} + + return accepts.Select(MediaTypeWithQualityHeaderValue.Parse); + } + /// /// Provides a case-insensitive check that a provided content type is a known JSON-like content type. /// @@ -376,6 +407,35 @@ using System.Runtime.CompilerServices; throw new JsonException("The specified discriminator was not found."); } + /// + /// Determines if the provided header is a content header + /// + /// The header to check + /// True if a content header; False otherwise + public static bool IsContentHeader(string header) + { + return ContentHeaders.Contains(header.ToLowerInvariant()); + } + + /// + /// The collection of content headers as per + /// https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpcontent.headers + /// + private static readonly string[] ContentHeaders = new String[] + { + "allow", + "content-encoding", + "content-disposition", + "content-language", + "content-length", + "content-location", + "content-md5", + "content-range", + "content-type", + "expires", + "last-modified" + }; + /// /// The base path of the API /// diff --git a/sdks/dotnet/templates/libraries/generichost/CookieContainer.mustache b/sdks/dotnet/templates/libraries/generichost/CookieContainer.mustache index f96d4fb41..3b7c10b75 100644 --- a/sdks/dotnet/templates/libraries/generichost/CookieContainer.mustache +++ b/sdks/dotnet/templates/libraries/generichost/CookieContainer.mustache @@ -1,5 +1,6 @@ // -{{partial_header}} +{{>partial_header}} + {{#nrt}} #nullable enable @@ -19,4 +20,4 @@ namespace {{packageName}}.{{clientPackage}} /// public System.Net.CookieContainer Value { get; } = new System.Net.CookieContainer(); } -} \ No newline at end of file +} diff --git a/sdks/dotnet/templates/libraries/generichost/DateOnlyJsonConverter.mustache b/sdks/dotnet/templates/libraries/generichost/DateOnlyJsonConverter.mustache index 209979c8d..94388357c 100644 --- a/sdks/dotnet/templates/libraries/generichost/DateOnlyJsonConverter.mustache +++ b/sdks/dotnet/templates/libraries/generichost/DateOnlyJsonConverter.mustache @@ -17,6 +17,7 @@ namespace {{packageName}}.{{clientPackage}} /// public static string[] Formats { get; } = { {{>DateFormats}} + }; /// @@ -33,7 +34,7 @@ namespace {{packageName}}.{{clientPackage}} string value = reader.GetString(){{nrt!}}; foreach(string format in Formats) - if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateOnly result)) return result; throw new NotSupportedException(); diff --git a/sdks/dotnet/templates/libraries/generichost/DateOnlyNullableJsonConverter.mustache b/sdks/dotnet/templates/libraries/generichost/DateOnlyNullableJsonConverter.mustache index 17c847365..11e0de144 100644 --- a/sdks/dotnet/templates/libraries/generichost/DateOnlyNullableJsonConverter.mustache +++ b/sdks/dotnet/templates/libraries/generichost/DateOnlyNullableJsonConverter.mustache @@ -17,6 +17,7 @@ namespace {{packageName}}.{{clientPackage}} /// public static string[] Formats { get; } = { {{>DateFormats}} + }; /// @@ -33,7 +34,7 @@ namespace {{packageName}}.{{clientPackage}} string value = reader.GetString(){{nrt!}}; foreach(string format in Formats) - if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateOnly result)) + if (DateOnly.TryParseExact(value, format, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateOnly result)) return result; throw new NotSupportedException(); diff --git a/sdks/dotnet/templates/libraries/generichost/DateTimeJsonConverter.mustache b/sdks/dotnet/templates/libraries/generichost/DateTimeJsonConverter.mustache index c5187f508..bf5059fca 100644 --- a/sdks/dotnet/templates/libraries/generichost/DateTimeJsonConverter.mustache +++ b/sdks/dotnet/templates/libraries/generichost/DateTimeJsonConverter.mustache @@ -17,6 +17,7 @@ namespace {{packageName}}.{{clientPackage}} /// public static string[] Formats { get; } = { {{>DateTimeFormats}} + }; /// diff --git a/sdks/dotnet/templates/libraries/generichost/DateTimeNullableJsonConverter.mustache b/sdks/dotnet/templates/libraries/generichost/DateTimeNullableJsonConverter.mustache index 646c72947..bbc036490 100644 --- a/sdks/dotnet/templates/libraries/generichost/DateTimeNullableJsonConverter.mustache +++ b/sdks/dotnet/templates/libraries/generichost/DateTimeNullableJsonConverter.mustache @@ -17,6 +17,7 @@ namespace {{packageName}}.{{clientPackage}} /// public static string[] Formats { get; } = { {{>DateTimeFormats}} + }; /// diff --git a/sdks/dotnet/templates/libraries/generichost/DependencyInjectionTests.mustache b/sdks/dotnet/templates/libraries/generichost/DependencyInjectionTests.mustache index 6085b51e5..0696a3210 100644 --- a/sdks/dotnet/templates/libraries/generichost/DependencyInjectionTests.mustache +++ b/sdks/dotnet/templates/libraries/generichost/DependencyInjectionTests.mustache @@ -17,7 +17,7 @@ namespace {{packageName}}.Test.{{apiPackage}} public class DependencyInjectionTest { private readonly IHost _hostUsingConfigureWithoutAClient = - Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).Configure{{apiName}}((context, services, options) => + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).Configure{{apiName}}((context, options) => { {{#lambda.trimTrailingWithNewLine}} {{#apiKeyMethods}} @@ -51,7 +51,7 @@ namespace {{packageName}}.Test.{{apiPackage}} .Build(); private readonly IHost _hostUsingConfigureWithAClient = - Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).Configure{{apiName}}((context, services, options) => + Host.CreateDefaultBuilder({{#net80OrLater}}[]{{/net80OrLater}}{{^net80OrLater}}Array.Empty(){{/net80OrLater}}).Configure{{apiName}}((context, options) => { {{#lambda.trimTrailingWithNewLine}} {{#apiKeyMethods}} @@ -76,8 +76,8 @@ namespace {{packageName}}.Test.{{apiPackage}} {{/httpSignatureMethods}} {{#oauthMethods}} - OAuthToken oauthToken = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); - options.AddTokens(oauthToken); + OAuthToken oauthToken{{-index}} = new{{^net70OrLater}} OAuthToken{{/net70OrLater}}("token", timeout: TimeSpan.FromSeconds(1)); + options.AddTokens(oauthToken{{-index}}); {{/oauthMethods}} {{/lambda.trimTrailingWithNewLine}} diff --git a/sdks/dotnet/templates/libraries/generichost/EnumValueDataType.mustache b/sdks/dotnet/templates/libraries/generichost/EnumValueDataType.mustache index e92e67b36..e8941874d 100644 --- a/sdks/dotnet/templates/libraries/generichost/EnumValueDataType.mustache +++ b/sdks/dotnet/templates/libraries/generichost/EnumValueDataType.mustache @@ -1 +1 @@ -{{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}{{^isNumeric}}string{{/isNumeric}}{{/isString}}{{#isNumeric}}{{#isLong}}long{{/isLong}}{{#isFloat}}float{{/isFloat}}{{#isDouble}}double{{/isDouble}}{{#isDecimal}}decimal{{/isDecimal}}{{^isLong}}{{^isFloat}}{{^isDouble}}{{^isDecimal}}int{{/isDecimal}}{{/isDouble}}{{/isFloat}}{{/isLong}}{{/isNumeric}}{{/-first}}{{/enumVars}}{{/allowableValues}} \ No newline at end of file +{{#vendorExtensions.x-enum-byte}}byte{{/vendorExtensions.x-enum-byte}}{{^vendorExtensions.x-enum-byte}}{{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}{{^isNumeric}}string{{/isNumeric}}{{/isString}}{{#isNumeric}}{{#isLong}}long{{/isLong}}{{#isFloat}}float{{/isFloat}}{{#isDouble}}double{{/isDouble}}{{#isDecimal}}decimal{{/isDecimal}}{{^isLong}}{{^isFloat}}{{^isDouble}}{{^isDecimal}}int{{/isDecimal}}{{/isDouble}}{{/isFloat}}{{/isLong}}{{/isNumeric}}{{/-first}}{{/enumVars}}{{/allowableValues}}{{/vendorExtensions.x-enum-byte}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/ExceptionEventArgs.mustache b/sdks/dotnet/templates/libraries/generichost/ExceptionEventArgs.mustache index b74fcfa0a..aa0937189 100644 --- a/sdks/dotnet/templates/libraries/generichost/ExceptionEventArgs.mustache +++ b/sdks/dotnet/templates/libraries/generichost/ExceptionEventArgs.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} using System; namespace {{packageName}}.{{clientPackage}} diff --git a/sdks/dotnet/templates/libraries/generichost/HostConfiguration.mustache b/sdks/dotnet/templates/libraries/generichost/HostConfiguration.mustache index 1333f0e67..c4a9431d1 100644 --- a/sdks/dotnet/templates/libraries/generichost/HostConfiguration.mustache +++ b/sdks/dotnet/templates/libraries/generichost/HostConfiguration.mustache @@ -22,7 +22,7 @@ namespace {{packageName}}.{{clientPackage}} /// /// Provides hosting configuration for {{packageName}} /// - {{>visibility}} class HostConfiguration + {{>visibility}} partial class HostConfiguration { private readonly IServiceCollection _services; private readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions(); @@ -80,8 +80,18 @@ namespace {{packageName}}.{{clientPackage}} {{/useSourceGeneration}} _services.AddSingleton();{{#apiInfo}}{{#apis}} - _services.AddSingleton<{{classname}}Events>(); - _services.AddTransient<{{interfacePrefix}}{{classname}}, {{classname}}>();{{/apis}}{{/apiInfo}} + _services.AddSingleton<{{classname}}Events>();{{/apis}}{{/apiInfo}} + OnHostConfigurationCreated(); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + public HostConfiguration Add{{apiName}}HttpClients(Action{{nrt?}} builder = null) + { + return Add{{apiName}}HttpClients((Action{{nrt?}})null, builder); } /// @@ -90,26 +100,79 @@ namespace {{packageName}}.{{clientPackage}} /// /// /// - public HostConfiguration Add{{apiName}}HttpClients - ( - Action{{nrt?}} client = null, Action{{nrt?}} builder = null) + public HostConfiguration Add{{apiName}}HttpClients( + Action{{nrt?}} client, + Action{{nrt?}} builder = null) + { + var wrapped = client != null ? new Action((_, httpClient) => + { + client(httpClient); + }) : null; + return Add{{apiName}}HttpClients(wrapped, builder); + } + + /// + /// Configures the HttpClients. + /// + /// + /// + /// + public HostConfiguration Add{{apiName}}HttpClients( + Action{{nrt?}} client, + Action{{nrt?}} builder = null) { if (client == null) - client = c => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); + client = (_, c) => c.BaseAddress = new Uri(ClientUtils.BASE_ADDRESS); List builders = new List(); - {{#apiInfo}}{{#apis}}builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>(client)); - {{/apis}}{{/apiInfo}} - if (builder != null) - foreach (IHttpClientBuilder instance in builders) - builder(instance); + {{#apiInfo}} + {{#apis}} + builders.Add(_services.AddHttpClient<{{interfacePrefix}}{{classname}}, {{classname}}>("{{packageName}}.{{apiPackage}}.{{interfacePrefix}}{{classname}}", client)); + {{/apis}} + {{/apiInfo}} + + foreach (IHttpClientBuilder instance in builders) + { + bool suppressDefault = false; + OnAdd{{apiName}}HttpClientBuilder(instance, builder, ref suppressDefault); + if (!suppressDefault) + builder?.Invoke(instance); + } HttpClientsAdded = true; return this; } + /// + /// Applies configuration to each HttpClient. + /// Implement this partial method to prepend configuration, invoke at the + /// desired position, and append further configuration. Set to + /// true when you invoke yourself to prevent a second invocation, + /// or to ignore the user's builder entirely. + /// If this method is not implemented, is invoked automatically. + /// + /// The to configure. + /// The caller-supplied builder action, or null if none was provided. + /// Set to true to prevent the default invocation of . + partial void OnAdd{{apiName}}HttpClientBuilder(IHttpClientBuilder builder, Action{{nrt?}} userBuilder, ref bool suppressDefault); + + /// + /// Called at the end of the constructor after all JSON converters and services are registered. + /// Implement this partial method to further configure _jsonOptions or register additional singletons via _services. + /// + partial void OnHostConfigurationCreated(); + + /// + /// Called after all services have been registered. + /// Implement this partial method to register additional services. + /// + /// + partial void OnServicesAdded(IServiceCollection services); + + internal void NotifyServicesAdded(IServiceCollection services) => OnServicesAdded(services); + /// /// Configures the JsonSerializerSettings /// diff --git a/sdks/dotnet/templates/libraries/generichost/HttpSigningConfiguration.mustache b/sdks/dotnet/templates/libraries/generichost/HttpSigningConfiguration.mustache index 357626fcc..8b69a8c0b 100644 --- a/sdks/dotnet/templates/libraries/generichost/HttpSigningConfiguration.mustache +++ b/sdks/dotnet/templates/libraries/generichost/HttpSigningConfiguration.mustache @@ -1,5 +1,6 @@ // {{>partial_header}} + {{#nrt}} #nullable enable diff --git a/sdks/dotnet/templates/libraries/generichost/HttpSigningToken.mustache b/sdks/dotnet/templates/libraries/generichost/HttpSigningToken.mustache index 881682e89..e07345d2d 100644 --- a/sdks/dotnet/templates/libraries/generichost/HttpSigningToken.mustache +++ b/sdks/dotnet/templates/libraries/generichost/HttpSigningToken.mustache @@ -1,5 +1,6 @@ // -{{partial_header}} +{{>partial_header}} + {{#nrt}} #nullable enable @@ -42,4 +43,4 @@ namespace {{packageName}}.{{clientPackage}} request.Headers.Add(signedHeader.Key, signedHeader.Value); } } -} \ No newline at end of file +} diff --git a/sdks/dotnet/templates/libraries/generichost/IApi.mustache b/sdks/dotnet/templates/libraries/generichost/IApi.mustache index af31cffe9..a3524bac5 100644 --- a/sdks/dotnet/templates/libraries/generichost/IApi.mustache +++ b/sdks/dotnet/templates/libraries/generichost/IApi.mustache @@ -1,3 +1,4 @@ +{{>partial_header}} using System.Net.Http; namespace {{packageName}}.{{apiPackage}} @@ -12,4 +13,4 @@ namespace {{packageName}}.{{apiPackage}} /// HttpClient HttpClient { get; } } -} \ No newline at end of file +} diff --git a/sdks/dotnet/templates/libraries/generichost/IHostBuilderExtensions.mustache b/sdks/dotnet/templates/libraries/generichost/IHostBuilderExtensions.mustache index 948f06648..19c24564d 100644 --- a/sdks/dotnet/templates/libraries/generichost/IHostBuilderExtensions.mustache +++ b/sdks/dotnet/templates/libraries/generichost/IHostBuilderExtensions.mustache @@ -38,13 +38,13 @@ namespace {{packageName}}.Extensions /// /// /// - public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder, Action options) + public static IHostBuilder Configure{{apiName}}(this IHostBuilder builder, Action{{nrt?}} options = null) { builder.ConfigureServices((context, services) => { HostConfiguration config = new HostConfiguration(services); - options(context, services, config); + options?.Invoke(context, config); IServiceCollectionExtensions.Add{{apiName}}(services, config); }); diff --git a/sdks/dotnet/templates/libraries/generichost/IServiceCollectionExtensions.mustache b/sdks/dotnet/templates/libraries/generichost/IServiceCollectionExtensions.mustache index 14184ac4a..eacc5d122 100644 --- a/sdks/dotnet/templates/libraries/generichost/IServiceCollectionExtensions.mustache +++ b/sdks/dotnet/templates/libraries/generichost/IServiceCollectionExtensions.mustache @@ -15,27 +15,15 @@ namespace {{packageName}}.Extensions /// {{>visibility}} static class IServiceCollectionExtensions { - {{^hasAuthMethods}} - /// - /// Add the api to your host builder. - /// - /// - public static void Add{{apiName}}(this IServiceCollection services) - { - HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); - Add{{apiName}}(services, config); - } - - {{/hasAuthMethods}} /// /// Add the api to your host builder. /// /// /// - public static void Add{{apiName}}(this IServiceCollection services, Action options) + public static void Add{{apiName}}(this IServiceCollection services, Action{{#nrt}}?{{/nrt}} options = null) { HostConfiguration config = new{{^net70OrLater}} HostConfiguration{{/net70OrLater}}(services); - options(config); + options?.Invoke(config); Add{{apiName}}(services, config); } @@ -64,6 +52,8 @@ namespace {{packageName}}.Extensions s => s.GetRequiredService(typeof(RateLimitProvider<>).MakeGenericType(tokenType))); } } + + host.NotifyServicesAdded(services); } } } diff --git a/sdks/dotnet/templates/libraries/generichost/JsonConverter.mustache b/sdks/dotnet/templates/libraries/generichost/JsonConverter.mustache index 0ff2753e3..1b01865c5 100644 --- a/sdks/dotnet/templates/libraries/generichost/JsonConverter.mustache +++ b/sdks/dotnet/templates/libraries/generichost/JsonConverter.mustache @@ -1,21 +1,31 @@ /// /// A Json converter for type /// - {{>visibility}} class {{classname}}JsonConverter : JsonConverter<{{classname}}> + {{>visibility}} partial class {{classname}}JsonConverter : JsonConverter<{{classname}}> { + partial void OnCreated(); + + /// + /// Initializes a new instance of the class. + /// + public {{classname}}JsonConverter() + { + OnCreated(); + } + {{#allVars}} {{#isDateTime}} /// /// The format to use to serialize {{name}} /// - public static string {{name}}Format { get; set; } = "{{{dateTimeFormat}}}"; + public string {{name}}Format { get; private set; } = "{{{dateTimeFormat}}}"; {{/isDateTime}} {{#isDate}} /// /// The format to use to serialize {{name}} /// - public static string {{name}}Format { get; set; } = "{{{dateFormat}}}"; + public string {{name}}Format { get; private set; } = "{{{dateFormat}}}"; {{/isDate}} {{/allVars}} @@ -179,39 +189,38 @@ {{^isMap}} {{^isEnum}} {{^isUuid}} + {{#isDecimal}} + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDecimal()); + {{/isDecimal}} + {{^isDecimal}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetString(){{^isNullable}}{{nrt!}}{{/isNullable}}); + {{/isDecimal}} {{/isUuid}} {{/isEnum}} {{/isMap}} {{/isString}} {{#isBoolean}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetBoolean()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); {{/isBoolean}} {{#isNumeric}} {{^isEnum}} {{#isDouble}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDouble()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); {{/isDouble}} {{#isDecimal}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDecimal()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); {{/isDecimal}} {{#isFloat}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}(float)utf8JsonReader.GetDouble()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); {{/isFloat}} {{#isLong}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? ({{#vendorExtensions.x-unsigned}}u{{/vendorExtensions.x-unsigned}}long?)null : utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64()); {{/isLong}} {{^isLong}} {{^isFloat}} {{^isDecimal}} {{^isDouble}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? ({{#vendorExtensions.x-unsigned}}u{{/vendorExtensions.x-unsigned}}int?)null : utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); {{/isDouble}} {{/isDecimal}} {{/isFloat}} @@ -219,35 +228,47 @@ {{/isEnum}} {{/isNumeric}} {{#isDate}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{#supportsDateOnly}}DateOnly{{/supportsDateOnly}}{{^supportsDateOnly}}DateTime{{/supportsDateOnly}}{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions)); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{#supportsDateOnly}}DateOnly{{/supportsDateOnly}}{{^supportsDateOnly}}DateTime{{/supportsDateOnly}}{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions)); {{/isDate}} {{#isDateTime}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); {{/isDateTime}} {{#isEnum}} {{^isMap}} + {{#isInnerEnum}} + {{#vendorExtensions.x-enum-byte}} + {{>NumericInnerEnumJsonRead}} + {{/vendorExtensions.x-enum-byte}} + {{^vendorExtensions.x-enum-byte}} {{#isNumeric}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}})utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32()); + {{>NumericInnerEnumJsonRead}} {{/isNumeric}} {{^isNumeric}} string{{nrt?}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = utf8JsonReader.GetString(); - {{^isInnerEnum}} - if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}{{{datatypeWithEnum}}}ValueConverter.FromStringOrDefault({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue)); - {{/isInnerEnum}} - {{#isInnerEnum}} + {{#isNullable}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue == null) + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}null); + else + {{/isNullable}} + {{^isNullable}} if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue != null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}{{classname}}.{{{datatypeWithEnum}}}FromStringOrDefault({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue)); - {{/isInnerEnum}} + {{/isNullable}} + { + {{classname}}.{{{datatypeWithEnum}}}? {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}Value = {{classname}}.{{{datatypeWithEnum}}}FromStringOrDefault({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue); + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}Value == null) + throw new JsonException(); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}Value); + } {{/isNumeric}} + {{/vendorExtensions.x-enum-byte}} + {{/isInnerEnum}} + {{^isInnerEnum}} + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{{datatypeWithEnum}}}?>(ref utf8JsonReader, jsonSerializerOptions)); + {{/isInnerEnum}} {{/isMap}} {{/isEnum}} {{#isUuid}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetGuid()); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); {{/isUuid}} {{^isUuid}} {{^isEnum}} @@ -256,8 +277,7 @@ {{^isNumeric}} {{^isDate}} {{^isDateTime}} - if (utf8JsonReader.TokenType != JsonTokenType.Null) - {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions){{^isNullable}}{{nrt!}}{{/isNullable}}); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions){{^isNullable}}{{nrt!}}{{/isNullable}}); {{/isDateTime}} {{/isDate}} {{/isNumeric}} @@ -276,20 +296,21 @@ {{#allVars}} {{#required}} if (!{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.IsSet) - throw new ArgumentException("Property is required for class {{classname}}.", nameof({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}})); + throw new JsonException("Property is required for class {{classname}}: {{baseName}}."); {{/required}} {{/allVars}} {{#allVars}} {{^isNullable}} if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.IsSet && {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.Value == null) - throw new ArgumentNullException(nameof({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}), "Property is not nullable for class {{classname}}."); + throw new JsonException("Property is not nullable for class {{classname}}: {{baseName}}."); {{/isNullable}} {{/allVars}} {{^vendorExtensions.x-duplicated-data-type}} {{#model.discriminator}} {{#model.hasDiscriminatorWithNonEmptyMapping}} + {{^model.composedSchemas.anyOf}} {{#mappedModels}} if ({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}} != null) return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); @@ -298,14 +319,15 @@ throw new JsonException(); {{/-last}} {{/mappedModels}} + {{/model.composedSchemas.anyOf}} {{/model.hasDiscriminatorWithNonEmptyMapping}} {{/model.discriminator}} {{^composedSchemas.oneOf}} {{^required}} {{#model.composedSchemas.anyOf}} - Option<{{baseType}}{{>NullConditionalProperty}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null + Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null ? default - : new Option<{{baseType}}{{>NullConditionalProperty}}>({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + : new Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); {{/model.composedSchemas.anyOf}} {{#-last}} @@ -338,7 +360,6 @@ /// /// /// - /// public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) { {{#lambda.trimLineBreaks}} @@ -397,11 +418,17 @@ {{#isNumeric}} writer.WriteNumber("{{vendorExtensions.x-base-name}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.Value.Value); {{/isNumeric}} + {{#isEnum}} + { + {{datatypeWithEnum}}JsonConverter {{#lambda.camelcase}}{{datatypeWithEnum}}{{/lambda.camelcase}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); + {{#lambda.camelcase}}{{datatypeWithEnum}}{{/lambda.camelcase}}JsonConverter.Write{{^isEnumRef}}Properties{{/isEnumRef}}(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}, jsonSerializerOptions); + } + {{/isEnum}} {{/isPrimitiveType}} {{^isPrimitiveType}} { - {{datatypeWithEnum}}JsonConverter {{datatypeWithEnum}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); - {{datatypeWithEnum}}JsonConverter.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}, jsonSerializerOptions); + {{datatypeWithEnum}}JsonConverter {{#lambda.camelcase}}{{datatypeWithEnum}}{{/lambda.camelcase}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); + {{#lambda.camelcase}}{{datatypeWithEnum}}{{/lambda.camelcase}}JsonConverter.Write{{^isEnumRef}}Properties{{/isEnumRef}}(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}, jsonSerializerOptions); } {{/isPrimitiveType}} @@ -419,7 +446,6 @@ /// /// /// - /// public void WriteProperties(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) { {{#lambda.trimTrailingWithNewLine}} @@ -427,11 +453,11 @@ {{#allVars}} {{^isDiscriminator}} {{^isNullable}} - {{#vendorExtensions.x-is-reference-type}} - if ({{^required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet && {{/required}}{{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) - throw new ArgumentNullException(nameof({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}), "Property is required for class {{classname}}."); + {{^required}} + if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet && {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}} == null) + throw new JsonException("Cannot write null property {{classname}}.{{name}} to non-nullable JSON property '{{baseName}}'."); - {{/vendorExtensions.x-is-reference-type}} + {{/required}} {{/isNullable}} {{/isDiscriminator}} {{/allVars}} @@ -450,10 +476,15 @@ {{^isEnum}} {{^isUuid}} {{#lambda.copyText}} + {{#isDecimal}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.ToString()); + {{/isDecimal}} + {{^isDecimal}} writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}); + {{/isDecimal}} {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isUuid}} {{/isEnum}} @@ -464,7 +495,7 @@ writer.WriteBoolean("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isBoolean}} {{^isEnum}} @@ -473,7 +504,7 @@ writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isNumeric}} {{/isEnum}} @@ -482,7 +513,7 @@ writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isDate}} {{#isDateTime}} @@ -490,16 +521,16 @@ writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}.ToString({{name}}Format)); {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isDateTime}} {{#isEnum}} {{#isNumeric}} {{#lambda.copyText}} - writer.WriteNumber("{{baseName}}", {{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}ToJsonValue({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}})); + writer.WriteNumber("{{baseName}}", {{#isInnerEnum}}{{classname}}.{{{datatypeWithEnum}}}ToJsonValue{{/isInnerEnum}}{{^isInnerEnum}}{{{datatypeWithEnum}}}ValueConverter.ToJsonValue{{/isInnerEnum}}({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}})); {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isNumeric}} {{^isMap}} @@ -590,7 +621,7 @@ writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{/vendorExtensions.x-is-value-type}}{{/required}}{{#required}}{{#isNullable}}.Value{{/isNullable}}{{/required}}); {{/lambda.copyText}} {{#lambda.indent3}} - {{>WriteProperty}} + {{>WriteProperty}}{{! prevent indent}} {{/lambda.indent3}} {{/isUuid}} {{^isUuid}} diff --git a/sdks/dotnet/templates/libraries/generichost/JsonSerializerOptionsProvider.mustache b/sdks/dotnet/templates/libraries/generichost/JsonSerializerOptionsProvider.mustache index 93f805403..2f74d3367 100644 --- a/sdks/dotnet/templates/libraries/generichost/JsonSerializerOptionsProvider.mustache +++ b/sdks/dotnet/templates/libraries/generichost/JsonSerializerOptionsProvider.mustache @@ -1,5 +1,6 @@ // -{{partial_header}} +{{>partial_header}} + {{#nrt}} #nullable enable @@ -26,4 +27,4 @@ namespace {{packageName}}.{{clientPackage}} Options = options; } } -} \ No newline at end of file +} diff --git a/sdks/dotnet/templates/libraries/generichost/OAuthToken.mustache b/sdks/dotnet/templates/libraries/generichost/OAuthToken.mustache index 23b3cab91..26ee25490 100644 --- a/sdks/dotnet/templates/libraries/generichost/OAuthToken.mustache +++ b/sdks/dotnet/templates/libraries/generichost/OAuthToken.mustache @@ -1,5 +1,6 @@ // -{{partial_header}} +{{>partial_header}} + {{#nrt}} #nullable enable @@ -38,4 +39,4 @@ namespace {{packageName}}.{{clientPackage}} request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _raw); } } -} \ No newline at end of file +} diff --git a/sdks/dotnet/templates/libraries/generichost/OnDeserializationError.mustache b/sdks/dotnet/templates/libraries/generichost/OnDeserializationError.mustache index ff83a5076..43ed983a6 100644 --- a/sdks/dotnet/templates/libraries/generichost/OnDeserializationError.mustache +++ b/sdks/dotnet/templates/libraries/generichost/OnDeserializationError.mustache @@ -1,2 +1,2 @@ if (!suppressDefaultLog) - Logger.LogError(exception, "An error occurred while deserializing the {code} response.", httpStatusCode); \ No newline at end of file + Logger.LogError(RestLogEvents.ApiDeserializationFailed, exception, "An error occurred while deserializing the {code} response.", httpStatusCode); \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/OnErrorDefaultImplementation.mustache b/sdks/dotnet/templates/libraries/generichost/OnErrorDefaultImplementation.mustache index a1a9fa976..7e7166c4a 100644 --- a/sdks/dotnet/templates/libraries/generichost/OnErrorDefaultImplementation.mustache +++ b/sdks/dotnet/templates/libraries/generichost/OnErrorDefaultImplementation.mustache @@ -1,2 +1,2 @@ if (!suppressDefaultLogLocalVar) - Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server."); \ No newline at end of file + Logger.LogError(RestLogEvents.ApiRequestFailed, exceptionLocalVar, "An error occurred while sending the request to the server."); \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/OperationSignature.mustache b/sdks/dotnet/templates/libraries/generichost/OperationSignature.mustache index caa9d144c..1d03c47e3 100644 --- a/sdks/dotnet/templates/libraries/generichost/OperationSignature.mustache +++ b/sdks/dotnet/templates/libraries/generichost/OperationSignature.mustache @@ -1 +1 @@ -{{#lambda.joinWithComma}}{{#allParams}}{{#required}}{{{dataType}}}{{>NullConditionalParameter}}{{/required}}{{^required}}Option<{{{dataType}}}{{>NullConditionalParameter}}>{{/required}} {{paramName}}{{#notRequiredOrIsNullable}} = default{{/notRequiredOrIsNullable}} {{/allParams}}System.Threading.CancellationToken cancellationToken = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}{{/lambda.joinWithComma}} \ No newline at end of file +{{#lambda.joinWithComma}}{{#allParams}}{{#required}}{{>OperationDataType}}{{/required}}{{^required}}Option<{{>OperationDataType}}>{{/required}} {{paramName}}{{#notRequiredOrIsNullable}} = default{{/notRequiredOrIsNullable}} {{/allParams}}System.Threading.CancellationToken cancellationToken = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}{{/lambda.joinWithComma}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/Option.mustache b/sdks/dotnet/templates/libraries/generichost/Option.mustache index eed49143e..8b33bdb51 100644 --- a/sdks/dotnet/templates/libraries/generichost/Option.mustache +++ b/sdks/dotnet/templates/libraries/generichost/Option.mustache @@ -1,5 +1,6 @@ // {{>partial_header}} + {{#nrt}} #nullable enable diff --git a/sdks/dotnet/templates/libraries/generichost/README.client.mustache b/sdks/dotnet/templates/libraries/generichost/README.client.mustache index 371b9daa9..e057ef28b 100644 --- a/sdks/dotnet/templates/libraries/generichost/README.client.mustache +++ b/sdks/dotnet/templates/libraries/generichost/README.client.mustache @@ -1,58 +1,51 @@ # Created with Openapi Generator -## Run the following powershell command to generate the library - -```ps1 -$properties = @( - 'apiName={{apiName}}', - 'targetFramework={{targetFramework}}', - 'validatable={{validatable}}', - 'nullableReferenceTypes={{nullableReferenceTypes}}', - 'hideGenerationTimestamp={{hideGenerationTimestamp}}', - 'packageVersion={{packageVersion}}', - 'packageAuthors={{packageAuthors}}', - 'packageCompany={{packageCompany}}', - 'packageCopyright={{packageCopyright}}', - 'packageDescription={{packageDescription}}',{{#licenseId}} - 'licenseId={{.}}',{{/licenseId}} - 'packageName={{packageName}}', - 'packageTags={{packageTags}}', - 'packageTitle={{packageTitle}}' -) -join "," - -$global = @( - 'apiDocs={{generateApiDocs}}', - 'modelDocs={{generateModelDocs}}', - 'apiTests={{generateApiTests}}', - 'modelTests={{generateModelTests}}' -) -join "," - -java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate ` - -g csharp-netcore ` - -i .yaml ` - -o ` - --library generichost ` - --additional-properties $properties ` - --global-property $global ` - --git-host "{{gitHost}}" ` - --git-repo-id "{{gitRepoId}}" ` - --git-user-id "{{gitUserId}}" ` - --release-note "{{releaseNote}}" - # -t templates +## Creating the library +Create a config.yaml file similar to what is below, then run the following powershell command to generate the library `java -jar "/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar" generate -c config.yaml` + +```yaml +generatorName: csharp +inputSpec: {{inputSpec}} +outputDir: out + +# https://openapi-generator.tech/docs/generators/csharp +additionalProperties: + packageGuid: '{{packageGuid}}' + +# https://openapi-generator.tech/docs/integrations/#github-integration +# gitHost: +# gitUserId: +# gitRepoId: + +# https://openapi-generator.tech/docs/globals +# globalProperties: + +# https://openapi-generator.tech/docs/customization/#inline-schema-naming +# inlineSchemaOptions: + +# https://openapi-generator.tech/docs/customization/#name-mapping +# modelNameMappings: +# nameMappings: + +# https://openapi-generator.tech/docs/customization/#openapi-normalizer +# openapiNormalizer: + +# templateDir: https://openapi-generator.tech/docs/templating/#modifying-templates + +# releaseNote: ``` ## Using the library in your project ```cs -using System; -using System.Threading.Tasks; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.DependencyInjection; using {{packageName}}.Api; using {{packageName}}.Client; using {{packageName}}.Model; +using {{packageName}}.Extensions; namespace YourProject { @@ -60,14 +53,56 @@ namespace YourProject { public static async Task Main(string[] args) { - var host = CreateHostBuilder(args).Build();{{#apiInfo}}{{#apis}}{{#-first}} + {{#net80OrLater}} + HostApplicationBuilder builder = Host.CreateApplicationBuilder(args); + + builder.Configure{{apiName}}(options => + { + {{#authMethods}} + {{#-first}} + // The type of token here depends on the api security specifications + // Available token types are ApiKeyToken, BasicToken, BearerToken, HttpSigningToken, and OAuthToken. + BearerToken token = new(""); + options.AddTokens(token); + + // optionally choose the method the tokens will be provided with, default is RateLimitProvider + options.UseProvider, BearerToken>(); + + {{/-first}} + {{/authMethods}} + options.ConfigureJsonOptions(jsonOptions => + { + // your custom converters if any + }); + + options.Add{{apiName}}HttpClients(client => + { + // client configuration + }, clientBuilder => + { + clientBuilder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)); + // add whatever middleware you prefer + }); + }); + + IHost host = builder.Build(); + {{/net80OrLater}} + {{^net80OrLater}} + var host = CreateHostBuilder(args).Build(); + {{/net80OrLater}} + {{#apiInfo}} + {{#apis}} + {{#-first}} var api = host.Services.GetRequiredService<{{interfacePrefix}}{{classname}}>(); {{#operations}} {{#-first}} {{#operation}} {{#-first}} - {{operationId}}ApiResponse apiResponse = await api.{{operationId}}Async("todo"); - {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}} model = apiResponse.Ok(); + {{interfacePrefix}}{{operationId}}ApiResponse apiResponse = await api.{{operationId}}Async("todo"); + {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}object{{/returnType}}{{nrt?}} model = apiResponse.Ok(); {{/-first}} {{/operation}} {{/-first}} @@ -76,18 +111,20 @@ namespace YourProject {{/apis}} {{/apiInfo}} } + {{^net80OrLater}} public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .Configure{{apiName}}((context, options) => { {{#authMethods}} {{#-first}} - // the type of token here depends on the api security specifications - ApiKeyToken token = new("", ClientUtils.ApiKeyHeader.Authorization); + // The type of token here depends on the api security specifications + // Available token types are ApiKeyToken, BasicToken, BearerToken, HttpSigningToken, and OAuthToken. + BearerToken token = new(""); options.AddTokens(token); // optionally choose the method the tokens will be provided with, default is RateLimitProvider - options.UseProvider, ApiKeyToken>(); + options.UseProvider, BearerToken>(); {{/-first}} {{/authMethods}} @@ -96,13 +133,20 @@ namespace YourProject // your custom converters if any }); - options.Add{{apiName}}HttpClients(builder: builder => builder - .AddRetryPolicy(2) - .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) - .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)) - // add whatever middleware you prefer + options.Add{{apiName}}HttpClients(client => + { + // client configuration + }, builder => + { + builder + .AddRetryPolicy(2) + .AddTimeoutPolicy(TimeSpan.FromSeconds(5)) + .AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)); + // add whatever middleware you prefer + } ); }); + {{/net80OrLater}} } } ``` @@ -110,136 +154,28 @@ namespace YourProject ## Questions - What about HttpRequest failures and retries? - If supportsRetry is enabled, you can configure Polly in the ConfigureClients method. + Configure Polly in the IHttpClientBuilder - How are tokens used? Tokens are provided by a TokenProvider class. The default is RateLimitProvider which will perform client side rate limiting. Other providers can be used with the UseProvider method. - Does an HttpRequest throw an error when the server response is not Ok? - It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. + It depends how you made the request. If the return type is ApiResponse no error will be thrown, though the Content property will be null. StatusCode and ReasonPhrase will contain information about the error. If the return type is T, then it will throw. If the return type is TOrDefault, it will return null. - How do I validate requests and process responses? - Use the provided On and After methods in the Api class from the namespace {{packageName}}.Rest.DefaultApi. - Or provide your own class by using the generic Configure{{apiName}} method. - - -## Dependencies - -- [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) - 5.0.0 or later -- [Microsoft.Extensions.Http](https://www.nuget.org/packages/Microsoft.Extensions.Http/) - 5.0.0 or later{{#supportsRetry}} -- [Microsoft.Extensions.Http.Polly](https://www.nuget.org/packages/Microsoft.Extensions.Http.Polly/) - 5.0.1 or later{{/supportsRetry}}{{#useCompareNetObjects}} -- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.61.0 or later{{/useCompareNetObjects}}{{#validatable}} -- [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) - 4.7.0 or later{{/validatable}}{{#apiDocs}} - - -## Documentation for API Endpoints - -All URIs are relative to *{{{basePath}}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | -------------{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} -*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}{{/apiDocs}}{{#modelDocs}} - - -## Documentation for Models - -{{#modelPackage}}{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md){{/model}}{{/models}}{{/modelPackage}} -{{^modelPackage}}No model defined in this package{{/modelPackage}}{{/modelDocs}} - - -## Documentation for Authorization - -{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} -{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} -{{#authMethods}} - -### {{name}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{keyParamName}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasicBasic}} -- **Type**: HTTP basic authentication -{{/isBasicBasic}} -{{#isBasicBearer}} -- **Type**: Bearer Authentication -{{/isBasicBearer}} -{{#isHttpSignature}} -- **Type**: HTTP signature authentication -{{/isHttpSignature}} -{{#isOAuth}} -- **Type**: OAuth -- **Flow**: {{flow}} -- **Authorization URL**: {{authorizationUrl}} -- **Scopes**: {{^scopes}}N/A{{/scopes}}{{#scopes}} -- {{scope}}: {{description}}{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} + Use the provided On and After partial methods in the api classes. + +## Api Information +- appName: {{appName}} +- appVersion: {{appVersion}} +- appDescription: {{appDescription}} ## Build +This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. + - SDK version: {{packageVersion}} {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} - Generator version: {{generatorVersion}} - Build package: {{generatorClass}} - -## Api Information -- appName: {{appName}} -- appVersion: {{appVersion}} -- appDescription: {{appDescription}} - -## [OpenApi Global properties](https://openapi-generator.tech/docs/globals) -- generateAliasAsModel: {{generateAliasAsModel}} -- supportingFiles: {{supportingFiles}} -- models: omitted for brevity -- apis: omitted for brevity -- apiDocs: {{generateApiDocs}} -- modelDocs: {{generateModelDocs}} -- apiTests: {{generateApiTests}} -- modelTests: {{generateModelTests}} - -## [OpenApi Generator Parameters](https://openapi-generator.tech/docs/generators/csharp-netcore) -- allowUnicodeIdentifiers: {{allowUnicodeIdentifiers}} -- apiName: {{apiName}} -- caseInsensitiveResponseHeaders: {{caseInsensitiveResponseHeaders}} -- conditionalSerialization: {{conditionalSerialization}} -- disallowAdditionalPropertiesIfNotPresent: {{disallowAdditionalPropertiesIfNotPresent}} -- gitHost: {{gitHost}} -- gitRepoId: {{gitRepoId}} -- gitUserId: {{gitUserId}} -- hideGenerationTimestamp: {{hideGenerationTimestamp}} -- interfacePrefix: {{interfacePrefix}} -- library: {{library}} -- licenseId: {{licenseId}} -- modelPropertyNaming: {{modelPropertyNaming}} -- netCoreProjectFile: {{netCoreProjectFile}} -- nonPublicApi: {{nonPublicApi}} -- nullableReferenceTypes: {{nullableReferenceTypes}} -- optionalAssemblyInfo: {{optionalAssemblyInfo}} -- optionalEmitDefaultValues: {{optionalEmitDefaultValues}} -- optionalMethodArgument: {{optionalMethodArgument}} -- optionalProjectFile: {{optionalProjectFile}} -- packageAuthors: {{packageAuthors}} -- packageCompany: {{packageCompany}} -- packageCopyright: {{packageCopyright}} -- packageDescription: {{packageDescription}} -- packageGuid: {{packageGuid}} -- packageName: {{packageName}} -- packageTags: {{packageTags}} -- packageTitle: {{packageTitle}} -- packageVersion: {{packageVersion}} -- releaseNote: {{releaseNote}} -- returnICollection: {{returnICollection}} -- sortParamsByRequiredFlag: {{sortParamsByRequiredFlag}} -- sourceFolder: {{sourceFolder}} -- targetFramework: {{targetFramework}} -- useCollection: {{useCollection}} -- useDateTimeOffset: {{useDateTimeOffset}} -- useOneOfDiscriminatorLookup: {{useOneOfDiscriminatorLookup}} -- validatable: {{validatable}}{{#infoUrl}} -For more information, please visit [{{{.}}}]({{{.}}}){{/infoUrl}} - -This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project. diff --git a/sdks/dotnet/templates/libraries/generichost/README.solution.mustache b/sdks/dotnet/templates/libraries/generichost/README.solution.mustache index f9c1c7f74..cfe8a2c98 100644 --- a/sdks/dotnet/templates/libraries/generichost/README.solution.mustache +++ b/sdks/dotnet/templates/libraries/generichost/README.solution.mustache @@ -1 +1,2 @@ # Created with Openapi Generator +See the project's [REAMDE](src/{{packageName}}/README.md) \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/RateLimitProvider`1.mustache b/sdks/dotnet/templates/libraries/generichost/RateLimitProvider`1.mustache index bafe525c0..1d3d25fe6 100644 --- a/sdks/dotnet/templates/libraries/generichost/RateLimitProvider`1.mustache +++ b/sdks/dotnet/templates/libraries/generichost/RateLimitProvider`1.mustache @@ -16,19 +16,23 @@ namespace {{packageName}}.{{clientPackage}} /// {{>visibility}} class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - internal Dictionary> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary>{{/net70OrLater}}(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary>{{/net70OrLater}}(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. /// /// - public RateLimitProvider(TokenContainer container) : base(container.Tokens) + public RateLimitProvider(TokenContainer container) : base() { - foreach(TTokenBase token in _tokens) + foreach(TTokenBase token in container.Tokens) token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40)); {{#lambda.copy}} - global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length) + global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(container.Tokens.Count) { FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite }; @@ -63,12 +67,29 @@ namespace {{packageName}}.{{clientPackage}} {{/lambda.paste}} {{/hasApiKeyMethods}} - foreach(global::System.Threading.Channels.Channel tokens in AvailableTokens.Values) - for (int i = 0; i < _tokens.Length; i++) - _tokens[i].TokenBecameAvailable += ((sender) => tokens.Writer.TryWrite((TTokenBase) sender)); + foreach (var availableToken in AvailableTokens) + foreach(TTokenBase token in container.Tokens) + { + {{#hasApiKeyMethods}} + if (token is ApiKeyToken apiKeyToken) + { + if (ClientUtils.ApiKeyHeaderToString(apiKeyToken.Header) == availableToken.Key) + { + token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); + } + } else + { + token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); + } + {{/hasApiKeyMethods}} + {{^hasApiKeyMethods}} + token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender)); + {{/hasApiKeyMethods}} + } } - internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) + /// + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel{{nrt?}} tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/sdks/dotnet/templates/libraries/generichost/TokenBase.mustache b/sdks/dotnet/templates/libraries/generichost/TokenBase.mustache index 05f06b4a7..3384bd4dc 100644 --- a/sdks/dotnet/templates/libraries/generichost/TokenBase.mustache +++ b/sdks/dotnet/templates/libraries/generichost/TokenBase.mustache @@ -1,5 +1,6 @@ // -{{partial_header}} +{{>partial_header}} + {{#nrt}} #nullable enable @@ -14,14 +15,21 @@ namespace {{packageName}}.{{clientPackage}} {{>visibility}} abstract class TokenBase { private DateTime _nextAvailable = DateTime.UtcNow; - private object _nextAvailableLock = new object(); + private readonly object _nextAvailableLock = new object(); private readonly System.Timers.Timer _timer = new System.Timers.Timer(); - internal TimeSpan? Timeout { get; set; } - internal delegate void TokenBecameAvailableEventHandler(object sender); - internal event TokenBecameAvailableEventHandler{{nrt?}} TokenBecameAvailable; + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. + public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// + public event TokenBecameAvailableEventHandler{{nrt?}} TokenBecameAvailable; /// /// Initialize a TokenBase object. @@ -35,7 +43,6 @@ namespace {{packageName}}.{{clientPackage}} StartTimer(Timeout.Value); } - /// /// Starts the token's timer /// @@ -52,7 +59,7 @@ namespace {{packageName}}.{{clientPackage}} /// /// Returns true while the token is rate limited. /// - public bool IsRateLimited => _nextAvailable > DateTime.UtcNow; + public bool IsRateLimited { get { lock (_nextAvailableLock) return _nextAvailable > DateTime.UtcNow; } } /// /// Triggered when the server returns status code TooManyRequests @@ -66,8 +73,8 @@ namespace {{packageName}}.{{clientPackage}} private void OnTimer(object{{nrt?}} sender, System.Timers.ElapsedEventArgs e) { - if (TokenBecameAvailable != null && !IsRateLimited) - TokenBecameAvailable.Invoke(this); + if (!IsRateLimited) + TokenBecameAvailable?.Invoke(this); } } -} \ No newline at end of file +} diff --git a/sdks/dotnet/templates/libraries/generichost/TokenContainer`1.mustache b/sdks/dotnet/templates/libraries/generichost/TokenContainer`1.mustache index 24c84a551..3c3546f68 100644 --- a/sdks/dotnet/templates/libraries/generichost/TokenContainer`1.mustache +++ b/sdks/dotnet/templates/libraries/generichost/TokenContainer`1.mustache @@ -1,5 +1,6 @@ // -{{partial_header}} +{{>partial_header}} + {{#nrt}} #nullable enable @@ -36,4 +37,4 @@ namespace {{packageName}}.{{clientPackage}} Tokens = tokens.ToList(); } } -} \ No newline at end of file +} diff --git a/sdks/dotnet/templates/libraries/generichost/TokenProvider`1.mustache b/sdks/dotnet/templates/libraries/generichost/TokenProvider`1.mustache index 7226551b7..55743224c 100644 --- a/sdks/dotnet/templates/libraries/generichost/TokenProvider`1.mustache +++ b/sdks/dotnet/templates/libraries/generichost/TokenProvider`1.mustache @@ -17,22 +17,11 @@ namespace {{packageName}} {{>visibility}} abstract class TokenProvider where TTokenBase : TokenBase { /// - /// The array of tokens. + /// Gets a token asynchronously for the specified header. /// - protected TTokenBase[] _tokens; - - internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}); - - /// - /// Instantiates a TokenProvider. - /// - /// - public TokenProvider(IEnumerable tokens) - { - _tokens = tokens.ToArray(); - - if (_tokens.Length == 0) - throw new ArgumentException("You did not provide any tokens."); - } + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}); } } \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/WriteProperty.mustache b/sdks/dotnet/templates/libraries/generichost/WriteProperty.mustache index 99659ac26..03b036f9a 100644 --- a/sdks/dotnet/templates/libraries/generichost/WriteProperty.mustache +++ b/sdks/dotnet/templates/libraries/generichost/WriteProperty.mustache @@ -1,9 +1,10 @@ {{#required}} {{>WritePropertyHelper}} + {{/required}} {{^required}} if ({{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}Option.IsSet) {{#lambda.indent1}} - {{>WritePropertyHelper}} + {{>WritePropertyHelper}}{{! prevent indent}} {{/lambda.indent1}} {{/required}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/api.mustache b/sdks/dotnet/templates/libraries/generichost/api.mustache index b33115f0a..e44ba3021 100644 --- a/sdks/dotnet/templates/libraries/generichost/api.mustache +++ b/sdks/dotnet/templates/libraries/generichost/api.mustache @@ -1,12 +1,14 @@ {{#lambda.trimLineBreaks}} // {{>partial_header}} + {{#nrt}} #nullable enable {{/nrt}} using System; using System.Collections.Generic; +using System.Collections.ObjectModel; {{#net80OrLater}} {{#lambda.uniqueLines}} {{#operations}} @@ -19,12 +21,14 @@ using System.Linq; {{/lambda.uniqueLines}} {{/net80OrLater}} using System.Net; +using System.IO; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using System.Net.Http; using System.Net.Http.Headers; using System.Text.Json; using {{packageName}}.{{clientPackage}}; +using {{packageName}}.Logging; {{#hasImport}} using {{packageName}}.{{modelPackage}}; {{/hasImport}} @@ -58,11 +62,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// <> + /// <> {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}); + Task<{{interfacePrefix}}{{#vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}); /// /// {{summary}} @@ -74,25 +78,31 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// <{{nrt?}}> + /// <{{nrt?}}> {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - Task<{{interfacePrefix}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}); + Task<{{interfacePrefix}}{{#vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}); {{^-last}} {{/-last}} {{/operation}} } {{#operation}} - {{^vendorExtensions.x-duplicates}} + {{#lambda.copy}} + {{#lambda.trim}} + {{#vendorExtensions.x-duplicates}} + {{classname}} + {{/vendorExtensions.x-duplicates}} + {{/lambda.trim}} + {{/lambda.copy}} {{#responses}} {{#-first}} /// - /// The + /// The /// - {{>visibility}} interface {{interfacePrefix}}{{operationId}}ApiResponse : {{#lambda.joinWithComma}}{{packageName}}.{{clientPackage}}.{{interfacePrefix}}ApiResponse {{#responses}}{{#dataType}}{{interfacePrefix}}{{vendorExtensions.x-http-status}}<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{/dataType}}{{/responses}}{{/lambda.joinWithComma}} + {{>visibility}} interface {{interfacePrefix}}{{#lambda.paste}}{{/lambda.paste}}{{operationId}}ApiResponse : {{#lambda.joinWithComma}}{{packageName}}.{{clientPackage}}.{{interfacePrefix}}ApiResponse {{#responses}}{{#dataType}}{{interfacePrefix}}{{vendorExtensions.x-http-status}}<{{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}}> {{/dataType}}{{/responses}}{{/lambda.joinWithComma}} { {{#responses}} {{#vendorExtensions.x-http-status-is-default}} @@ -116,7 +126,6 @@ namespace {{packageName}}.{{apiPackage}} } {{/-first}} {{/responses}} - {{/vendorExtensions.x-duplicates}} {{/operation}} /// @@ -136,7 +145,7 @@ namespace {{packageName}}.{{apiPackage}} /// public event EventHandler{{nrt?}} OnError{{operationId}}; - internal void ExecuteOn{{operationId}}({{#vendorExtensions.x-duplicates}}{{.}}{{/vendorExtensions.x-duplicates}}{{^vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}.{{operationId}}ApiResponse apiResponse) + internal void ExecuteOn{{operationId}}({{classname}}.{{#vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse apiResponse) { On{{operationId}}?.Invoke(this, new ApiResponseEventArgs(apiResponse)); } @@ -157,11 +166,6 @@ namespace {{packageName}}.{{apiPackage}} { private JsonSerializerOptions _jsonSerializerOptions; - /// - /// The logger factory - /// - public ILoggerFactory LoggerFactory { get; } - /// /// The logger /// @@ -219,7 +223,7 @@ namespace {{packageName}}.{{apiPackage}} /// Initializes a new instance of the class. /// /// - public {{classname}}(ILogger<{{classname}}> logger, ILoggerFactory loggerFactory, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, + public {{classname}}(ILogger<{{classname}}> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}}{{#hasApiKeyMethods}}, TokenProvider apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}}, TokenProvider bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}}, TokenProvider basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}}, @@ -228,8 +232,7 @@ namespace {{packageName}}.{{apiPackage}} {{packageName}}.{{clientPackage}}.CookieContainer cookieContainer{{/vendorExtensions.x-set-cookie}}{{/lambda.uniqueLines}}{{/operation}}{{/net80OrLater}}) { _jsonSerializerOptions = jsonSerializerOptionsProvider.Options; - LoggerFactory = loggerFactory; - Logger = LoggerFactory.CreateLogger<{{classname}}>(); + Logger = logger; HttpClient = httpClient; Events = {{#lambda.camelcase_sanitize_param}}{{classname}}Events{{/lambda.camelcase_sanitize_param}};{{#hasApiKeyMethods}} ApiKeyProvider = apiKeyProvider;{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}} @@ -243,7 +246,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} {{#-first}} - partial void Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + partial void Format{{operationId}}({{#allParams}}{{#isPrimitiveType}}ref {{/isPrimitiveType}}{{^required}}Option<{{/required}}{{>OperationDataType}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{/-first}} {{/allParams}} @@ -255,7 +258,7 @@ namespace {{packageName}}.{{apiPackage}} /// {{/vendorExtensions.x-not-nullable-reference-types}} /// - private void Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}) + private void Validate{{operationId}}({{#vendorExtensions.x-not-nullable-reference-types}}{{^required}}Option<{{/required}}{{>OperationDataType}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-not-nullable-reference-types}}) { {{#lambda.trimTrailingWithNewLine}} {{#vendorExtensions.x-not-nullable-reference-types}} @@ -285,7 +288,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + private void After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}{{interfacePrefix}}{{#vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{>OperationDataType}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) { bool suppressDefaultLog = false; After{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); @@ -300,7 +303,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + partial void After{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog {{interfacePrefix}}{{#vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse apiResponseLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{>OperationDataType}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); /// /// Logs exceptions that occur while retrieving the server response @@ -311,11 +314,12 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) + private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{>OperationDataType}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}) { bool suppressDefaultLogLocalVar = false; OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLogLocalVar exceptionLocalVar pathFormatLocalVar pathLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); {{>OnErrorDefaultImplementation}} + } /// @@ -328,7 +332,7 @@ namespace {{packageName}}.{{apiPackage}} {{#allParams}} /// {{/allParams}} - partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLogLocalVar Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); + partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLogLocalVar Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{>OperationDataType}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); /// /// {{summary}} {{notes}} @@ -337,8 +341,8 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} /// Cancellation Token to cancel the request. - /// <> - public async Task<{{interfacePrefix}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}) + /// <> + public async Task<{{interfacePrefix}}{{#vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse{{nrt?}}> {{operationId}}OrDefaultAsync({{>OperationSignature}}) { try { @@ -358,8 +362,8 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} /// Cancellation Token to cancel the request. - /// <> - public async Task<{{interfacePrefix}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}) + /// <> + public async Task<{{interfacePrefix}}{{#vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse> {{operationId}}Async({{>OperationSignature}}) { {{#lambda.trimLineBreaks}} UriBuilder uriBuilderLocalVar = new UriBuilder(); @@ -382,7 +386,9 @@ namespace {{packageName}}.{{apiPackage}} uriBuilderLocalVar.Host = HttpClient.BaseAddress{{nrt!}}.Host; uriBuilderLocalVar.Port = HttpClient.BaseAddress.Port; uriBuilderLocalVar.Scheme = HttpClient.BaseAddress.Scheme; - uriBuilderLocalVar.Path = ClientUtils.CONTEXT_PATH + "{{{path}}}"; + uriBuilderLocalVar.Path = HttpClient.BaseAddress.AbsolutePath == "/" + ? "{{{path}}}" + : string.Concat(HttpClient.BaseAddress.AbsolutePath.TrimEnd('/'), "{{{path}}}"); {{/servers}} {{#servers}} {{#-first}} @@ -446,68 +452,157 @@ namespace {{packageName}}.{{apiPackage}} {{/-last}} {{/queryParams}} - {{#constantParams}} - {{#isHeaderParam}} - // Set client side default value of Header Param "{{baseName}}". - httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter - {{/isHeaderParam}} - {{/constantParams}} - {{#headerParams}} - {{#required}} - httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}})); - - {{/required}} - {{^required}} - if ({{paramName}}.IsSet) - httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value)); - - {{/required}} - {{/headerParams}} {{#formParams}} {{#-first}} - MultipartContent multipartContentLocalVar = new MultipartContent(); + {{#isMultipart}} + MultipartFormDataContent multipartContentLocalVar = new MultipartFormDataContent(); httpRequestMessageLocalVar.Content = multipartContentLocalVar; - List> formParameterLocalVars = new List>(); - - multipartContentLocalVar.Add(new FormUrlEncodedContent(formParameterLocalVars));{{/-first}}{{^isFile}}{{#required}} + {{/isMultipart}} + List> formParameterLocalVars = new List>(); - formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}))); + {{/-first}} + {{^isFile}} + {{#required}} + formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}))); {{/required}} {{^required}} if ({{paramName}}.IsSet) - formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value))); + formParameterLocalVars.Add(new KeyValuePair("{{baseName}}", ClientUtils.ParameterToString({{paramName}}.Value))); {{/required}} {{/isFile}} {{#isFile}} + {{^isMultipart}} + {{! application/x-www-form-urlencoded encodes everything as text key=value pairs and has no mechanism to carry binary data. File params require multipart/form-data.}} {{#required}} - multipartContentLocalVar.Add(new StreamContent({{paramName}})); + throw new NotSupportedException("File parameters cannot be sent with application/x-www-form-urlencoded. Change the operation's content type to multipart/form-data."); {{/required}} {{^required}} if ({{paramName}}.IsSet) - multipartContentLocalVar.Add(new StreamContent({{paramName}}.Value)); + throw new NotSupportedException("File parameters cannot be sent with application/x-www-form-urlencoded. Change the operation's content type to multipart/form-data."); {{/required}} + {{/isMultipart}} + {{#isMultipart}} + {{#required}} + {{#isContainer}} + foreach ({{packageName}}.{{clientPackage}}.FileParameter fileParameterLocalVar in {{paramName}}) + { + var streamContentLocalVar = new StreamContent(fileParameterLocalVar.Content); + streamContentLocalVar.Headers.ContentType = new MediaTypeHeaderValue(fileParameterLocalVar.ContentType); + multipartContentLocalVar.Add(streamContentLocalVar, "{{baseName}}", fileParameterLocalVar.FileName ?? "{{baseName}}"); + } + + {{/isContainer}} + {{^isContainer}} + { + var streamContentLocalVar = new StreamContent({{paramName}}.Content); + streamContentLocalVar.Headers.ContentType = new MediaTypeHeaderValue({{paramName}}.ContentType); + multipartContentLocalVar.Add(streamContentLocalVar, "{{baseName}}", {{paramName}}.FileName ?? "{{baseName}}"); + } + + {{/isContainer}} + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + { + {{#isContainer}} + foreach ({{packageName}}.{{clientPackage}}.FileParameter fileParameterLocalVar in {{paramName}}.Value) + { + var streamContentLocalVar = new StreamContent(fileParameterLocalVar.Content); + streamContentLocalVar.Headers.ContentType = new MediaTypeHeaderValue(fileParameterLocalVar.ContentType); + multipartContentLocalVar.Add(streamContentLocalVar, "{{baseName}}", fileParameterLocalVar.FileName ?? "{{baseName}}"); + } + {{/isContainer}} + {{^isContainer}} + var streamContentLocalVar = new StreamContent({{paramName}}.Value.Content); + streamContentLocalVar.Headers.ContentType = new MediaTypeHeaderValue({{paramName}}.Value.ContentType); + multipartContentLocalVar.Add(streamContentLocalVar, "{{baseName}}", {{paramName}}.Value.FileName ?? "{{baseName}}"); + {{/isContainer}} + } + + {{/required}} + {{/isMultipart}} {{/isFile}} {{/formParams}} + {{#formParams}} + {{#-first}} + {{#isMultipart}} + foreach (var formParamLocalVar in formParameterLocalVars) + multipartContentLocalVar.Add(new StringContent(formParamLocalVar.Value ?? string.Empty), formParamLocalVar.Key); + {{/isMultipart}} + {{^isMultipart}} + if (formParameterLocalVars.Count > 0) + httpRequestMessageLocalVar.Content = new FormUrlEncodedContent(formParameterLocalVars); + {{/isMultipart}} + + {{/-first}} + {{/formParams}} {{#bodyParam}} {{#required}} - httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) + httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is {{packageName}}.{{clientPackage}}.FileParameter fileParameterLocalVar + ? httpRequestMessageLocalVar.Content = new StreamContent(fileParameterLocalVar.Content) : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); {{/required}} {{^required}} if ({{paramName}}.IsSet) - httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is System.IO.Stream stream - ? httpRequestMessageLocalVar.Content = new StreamContent(stream) - : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); + { + httpRequestMessageLocalVar.Content = ({{paramName}}{{^required}}.Value{{/required}} as object) is {{packageName}}.{{clientPackage}}.FileParameter fileParameterLocalVar + ? httpRequestMessageLocalVar.Content = new StreamContent(fileParameterLocalVar.Content) + : httpRequestMessageLocalVar.Content = new StringContent(JsonSerializer.Serialize({{paramName}}{{^required}}.Value{{/required}}, _jsonSerializerOptions)); + } {{/required}} {{/bodyParam}} + + {{#constantParams}} + {{#isHeaderParam}} + // Set client side default value of Header Param "{{baseName}}". + if (ClientUtils.IsContentHeader("{{baseName}}")) + { + httpRequestMessageLocalVar.Content.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + } + else + { + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", ClientUtils.ParameterToString({{#_enum}}"{{{.}}}"{{/_enum}})); // Constant header parameter + } + + {{/isHeaderParam}} + {{/constantParams}} + {{#headerParams}} + {{#required}} + // Set client side default value of Header Param "{{baseName}}". + if (ClientUtils.IsContentHeader("{{baseName}}")) + { + httpRequestMessageLocalVar.Content?.Headers.Add("{{baseName}}", {{#headerIsJsonMimeType}}JsonSerializer.Serialize({{paramName}}, _jsonSerializerOptions){{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ClientUtils.ParameterToString({{paramName}}){{/headerIsJsonMimeType}}); + } + else + { + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", {{#headerIsJsonMimeType}}JsonSerializer.Serialize({{paramName}}, _jsonSerializerOptions){{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ClientUtils.ParameterToString({{paramName}}){{/headerIsJsonMimeType}}); + } + + {{/required}} + {{^required}} + if ({{paramName}}.IsSet) + { + // Set client side default value of Header Param "{{baseName}}". + if (ClientUtils.IsContentHeader("{{baseName}}")) + { + httpRequestMessageLocalVar.Content?.Headers.Add("{{baseName}}", {{#headerIsJsonMimeType}}JsonSerializer.Serialize({{paramName}}.Value, _jsonSerializerOptions){{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ClientUtils.ParameterToString({{paramName}}.Value){{/headerIsJsonMimeType}}); + } + else + { + httpRequestMessageLocalVar.Headers.Add("{{baseName}}", {{#headerIsJsonMimeType}}JsonSerializer.Serialize({{paramName}}.Value, _jsonSerializerOptions){{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ClientUtils.ParameterToString({{paramName}}.Value){{/headerIsJsonMimeType}}); + } + } + + {{/required}} + {{/headerParams}} + {{#authMethods}} {{#-first}} List tokenBaseLocalVars = new List(); @@ -581,10 +676,12 @@ namespace {{packageName}}.{{apiPackage}} {{#consumes}} {{#-first}} + {{^formParams}} string{{nrt?}} contentTypeLocalVar = ClientUtils.SelectHeaderContentType(contentTypes); if (contentTypeLocalVar != null && httpRequestMessageLocalVar.Content != null) httpRequestMessageLocalVar.Content.Headers.ContentType = new MediaTypeHeaderValue(contentTypeLocalVar); + {{/formParams}} {{/-first}} {{/consumes}} @@ -601,10 +698,10 @@ namespace {{packageName}}.{{apiPackage}} {{#produces}} {{#-first}} - string{{nrt?}} acceptLocalVar = ClientUtils.SelectHeaderAccept(acceptLocalVars); + IEnumerable acceptHeaderValuesLocalVar = ClientUtils.SelectHeaderAcceptArray(acceptLocalVars); - if (acceptLocalVar != null) - httpRequestMessageLocalVar.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptLocalVar)); + foreach (var acceptLocalVar in acceptHeaderValuesLocalVar) + httpRequestMessageLocalVar.Headers.Accept.Add(acceptLocalVar); {{/-first}} {{/produces}} {{#net60OrLater}} @@ -619,11 +716,34 @@ namespace {{packageName}}.{{apiPackage}} using (HttpResponseMessage httpResponseMessageLocalVar = await HttpClient.SendAsync(httpRequestMessageLocalVar, cancellationToken).ConfigureAwait(false)) { - string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); - - ILogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse> apiResponseLoggerLocalVar = LoggerFactory.CreateLogger<{{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse>(); + {{#vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse apiResponseLocalVar; + + switch ((int)httpResponseMessageLocalVar.StatusCode) { + {{#responses}} + {{#isBinary}} + case ({{code}}): + {{/isBinary}} + {{/responses}} + {{#responses}} + {{#isBinary}} + {{#-first}} + { + byte[] responseBytesArrayLocalVar = await httpResponseMessageLocalVar.Content.ReadAsByteArrayAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); + System.IO.Stream responseContentStreamLocalVar = new System.IO.MemoryStream(responseBytesArrayLocalVar); + apiResponseLocalVar = new{{^net60OrLater}} {{#vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse{{/net60OrLater}}(Logger, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentStreamLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); - {{#vendorExtensions.x-duplicates}}{{.}}.{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse apiResponseLocalVar = new{{^net60OrLater}} {{operationId}}ApiResponse{{/net60OrLater}}(apiResponseLoggerLocalVar, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); + break; + } + {{/-first}} + {{/isBinary}} + {{/responses}} + default: { + string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false); + apiResponseLocalVar = new{{^net60OrLater}} {{#vendorExtensions.x-duplicates}}{{classname}}{{/vendorExtensions.x-duplicates}}{{operationId}}ApiResponse{{/net60OrLater}}(Logger, httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{{path}}}", requestedAtLocalVar, _jsonSerializerOptions); + + break; + } + } After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}}); @@ -682,22 +802,34 @@ namespace {{packageName}}.{{apiPackage}} } {{/lambda.trimLineBreaks}} } - {{^vendorExtensions.x-duplicates}} + {{#lambda.copy}} + {{#lambda.trim}} + {{#vendorExtensions.x-duplicates}} + {{classname}} + {{/vendorExtensions.x-duplicates}} + {{/lambda.trim}} + {{/lambda.copy}} + {{#lambda.cache}} + classname + {{#lambda.trim}} + {{classname}} + {{/lambda.trim}} + {{/lambda.cache}} {{#responses}} {{#-first}} /// - /// The + /// The /// - {{>visibility}} partial class {{operationId}}ApiResponse : {{packageName}}.{{clientPackage}}.ApiResponse, {{interfacePrefix}}{{operationId}}ApiResponse + {{>visibility}} partial class {{#lambda.paste}}{{/lambda.paste}}{{operationId}}ApiResponse : {{packageName}}.{{clientPackage}}.ApiResponse, {{interfacePrefix}}{{#lambda.paste}}{{/lambda.paste}}{{operationId}}ApiResponse { /// /// The logger /// - public ILogger<{{operationId}}ApiResponse> Logger { get; } + public ILogger<{{#lambda.recall}}classname{{/lambda.recall}}> Logger { get; } /// - /// The + /// The /// /// /// @@ -706,7 +838,23 @@ namespace {{packageName}}.{{apiPackage}} /// /// /// - public {{operationId}}ApiResponse(ILogger<{{operationId}}ApiResponse> logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + public {{#lambda.paste}}{{/lambda.paste}}{{operationId}}ApiResponse(ILogger<{{classname}}> logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, rawContent, path, requestedAt, jsonSerializerOptions) + { + Logger = logger; + OnCreated(httpRequestMessage, httpResponseMessage); + } + + /// + /// The + /// + /// + /// + /// + /// + /// + /// + /// + public {{#lambda.paste}}{{/lambda.paste}}{{operationId}}ApiResponse(ILogger<{{classname}}> logger, System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, System.IO.Stream contentStream, string path, DateTime requestedAt, System.Text.Json.JsonSerializerOptions jsonSerializerOptions) : base(httpRequestMessage, httpResponseMessage, contentStream, path, requestedAt, jsonSerializerOptions) { Logger = logger; OnCreated(httpRequestMessage, httpResponseMessage); @@ -748,14 +896,26 @@ namespace {{packageName}}.{{apiPackage}} /// /// public {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{vendorExtensions.x-http-status}}() + { + bool suppressDefault = false; + {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} result = {{#net60OrLater}}null{{/net60OrLater}}{{^net60OrLater}}default{{/net60OrLater}}; + On{{vendorExtensions.x-http-status}}(ref suppressDefault, ref result); + if (!suppressDefault) + result = Default{{vendorExtensions.x-http-status}}(); + return result; + } + + private {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} Default{{vendorExtensions.x-http-status}}() { {{#lambda.trimTrailingWithNewLine}} {{#lambda.indent4}} - {{>AsModel}} + {{>AsModel}}{{! prevent indent}} {{/lambda.indent4}} {{/lambda.trimTrailingWithNewLine}} } + partial void On{{vendorExtensions.x-http-status}}(ref bool suppressDefault, ref {{#isModel}}{{^containerType}}{{packageName}}.{{modelPackage}}.{{/containerType}}{{/isModel}}{{{dataType}}}{{#nrt}}?{{/nrt}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} result); + /// /// Returns true if the response is {{code}} {{vendorExtensions.x-http-status}} and the deserialized response is not null /// @@ -784,7 +944,7 @@ namespace {{packageName}}.{{apiPackage}} OnDeserializationError(ref suppressDefaultLog, exception, httpStatusCode); {{#lambda.trimTrailingWithNewLine}} {{#lambda.indent4}} - {{>OnDeserializationError}} + {{>OnDeserializationError}}{{! prevent indent}} {{/lambda.indent4}} {{/lambda.trimTrailingWithNewLine}} } @@ -795,9 +955,8 @@ namespace {{packageName}}.{{apiPackage}} } {{/-first}} {{/responses}} - {{/vendorExtensions.x-duplicates}} {{/operation}} } {{/operations}} } -{{/lambda.trimLineBreaks}} +{{/lambda.trimLineBreaks}} \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/generichost/api_test.mustache b/sdks/dotnet/templates/libraries/generichost/api_test.mustache index 02ce22168..31434cb98 100644 --- a/sdks/dotnet/templates/libraries/generichost/api_test.mustache +++ b/sdks/dotnet/templates/libraries/generichost/api_test.mustache @@ -11,6 +11,7 @@ using {{packageName}}.{{modelPackage}};{{/hasImport}} {{>testInstructions}} + namespace {{packageName}}.Test.{{apiPackage}} { /// @@ -34,16 +35,20 @@ namespace {{packageName}}.Test.{{apiPackage}} public async Task {{operationId}}AsyncTest() { {{#allParams}} - {{^required}}Client.Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} = default{{nrt!}}; + {{^required}}Client.Option<{{/required}}{{>OperationDataType}}{{^required}}>{{/required}} {{paramName}} = default{{nrt!}}; {{/allParams}} - {{#returnType}} + {{#responses}} + {{#-first}} + {{#dataType}} var response = await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - var model = response.{{#lambda.first}}{{#responses}}{{vendorExtensions.x-http-status}} {{/responses}}{{/lambda.first}}(); - Assert.IsType<{{{.}}}>(model); - {{/returnType}} - {{^returnType}} + var model = response.{{vendorExtensions.x-http-status}}(); + Assert.IsType<{{#isModel}}{{packageName}}.{{modelPackage}}.{{/isModel}}{{{.}}}>(model); + {{/dataType}} + {{^dataType}} await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - {{/returnType}} + {{/dataType}} + {{/-first}} + {{/responses}} } {{/operation}} {{/operations}} diff --git a/sdks/dotnet/templates/libraries/generichost/model.mustache b/sdks/dotnet/templates/libraries/generichost/model.mustache index f9931574d..a9f6c2e4c 100644 --- a/sdks/dotnet/templates/libraries/generichost/model.mustache +++ b/sdks/dotnet/templates/libraries/generichost/model.mustache @@ -1,5 +1,6 @@ // {{>partial_header}} + {{#nrt}} #nullable enable @@ -37,13 +38,17 @@ namespace {{packageName}}.{{modelPackage}} { {{#isEnum}} {{>modelEnum}} + {{/isEnum}} {{^isEnum}} {{>modelGeneric}} + {{>JsonConverter}} + {{/isEnum}} {{>SourceGenerationContext}} + {{/model}} {{/lambda.trimTrailingWithNewLine}} {{/models}} diff --git a/sdks/dotnet/templates/libraries/generichost/modelGeneric.mustache b/sdks/dotnet/templates/libraries/generichost/modelGeneric.mustache index 04fb37138..2335c7bf3 100644 --- a/sdks/dotnet/templates/libraries/generichost/modelGeneric.mustache +++ b/sdks/dotnet/templates/libraries/generichost/modelGeneric.mustache @@ -17,7 +17,7 @@ /// {{description}}{{^description}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} {{/isDiscriminator}} {{/allVars}} - {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{{dataType}}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{#model.composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{baseType}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{parent}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}.{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} + {{#model.vendorExtensions.x-model-is-operation-input}}{{>visibility}}{{/model.vendorExtensions.x-model-is-operation-input}}{{^model.vendorExtensions.x-model-is-operation-input}}internal{{/model.vendorExtensions.x-model-is-operation-input}} {{classname}}({{#lambda.joinWithComma}}{{{dataType}}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{#model.composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{baseType}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{parent}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}.{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { {{#composedSchemas.anyOf}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; @@ -62,7 +62,7 @@ {{^composedSchemas.anyOf}} [JsonConstructor] {{/composedSchemas.anyOf}} - {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{baseType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { {{#composedSchemas.anyOf}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; @@ -97,12 +97,14 @@ {{#items}} {{^complexType}} {{>modelInnerEnum}} + {{/complexType}} {{/items}} {{/items.isEnum}} {{#isEnum}} {{^complexType}} {{>modelInnerEnum}} + {{/complexType}} {{/isEnum}} {{^isDiscriminator}} @@ -113,7 +115,7 @@ /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}{{#isReadOnly}}{{#vendorExtensions.x-setter-visibility}}private set; {{/vendorExtensions.x-setter-visibility}}{{/isReadOnly}}} {{/required}} /// @@ -129,7 +131,7 @@ {{#deprecated}} [Obsolete] {{/deprecated}} - public {{#isNew}}new {{/isNew}}{{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + {{#vendorExtensions.x-property-visibility}}{{.}}{{/vendorExtensions.x-property-visibility}}{{^vendorExtensions.x-property-visibility}}public{{/vendorExtensions.x-property-visibility}} {{#isNew}}new {{/isNew}}{{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}{{#vendorExtensions.x-setter-visibility}}{{.}} set; {{/vendorExtensions.x-setter-visibility}}}{{/required}}{{^required}}{ get { return this.{{name}}Option.Value; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}{{#vendorExtensions.x-setter-visibility}}{{.}} set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/vendorExtensions.x-setter-visibility}}}{{/required}} {{/isEnum}} {{/isDiscriminator}} @@ -142,7 +144,7 @@ /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + public {{#isNew}}new {{/isNew}}Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}{{#isReadOnly}}{{#vendorExtensions.x-setter-visibility}}private set; {{/vendorExtensions.x-setter-visibility}}{{/isReadOnly}}} {{/required}} /// @@ -155,7 +157,7 @@ {{#deprecated}} [Obsolete] {{/deprecated}} - public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option; } {{^isReadOnly}}set { this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + {{#vendorExtensions.x-property-visibility}}{{.}}{{/vendorExtensions.x-property-visibility}}{{^vendorExtensions.x-property-visibility}}public{{/vendorExtensions.x-property-visibility}} {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}{{#vendorExtensions.x-setter-visibility}}{{.}} set; {{/vendorExtensions.x-setter-visibility}}}{{/required}}{{^required}}{ get { return this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option.Value; } {{^isReadOnly}}set { this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}{{#vendorExtensions.x-setter-visibility}}{{.}} set { this.{{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/vendorExtensions.x-setter-visibility}}}{{/required}} {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.anyOf}} @@ -171,7 +173,7 @@ {{#deprecated}} [Obsolete] {{/deprecated}} - public {{{dataType}}}{{>NullConditionalProperty}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}} { get; {{^isReadOnly}}set; {{/isReadOnly}}} + {{#vendorExtensions.x-property-visibility}}{{.}}{{/vendorExtensions.x-property-visibility}}{{^vendorExtensions.x-property-visibility}}public{{/vendorExtensions.x-property-visibility}} {{{dataType}}}{{>NullConditionalProperty}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}} { get; {{^isReadOnly}}set; {{/isReadOnly}}{{#vendorExtensions.x-setter-visibility}}{{.}} set; {{/vendorExtensions.x-setter-visibility}}} {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.oneOf}} @@ -199,7 +201,7 @@ /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public new Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + public new Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}{{#isReadOnly}}{{#vendorExtensions.x-setter-visibility}}private set; {{/vendorExtensions.x-setter-visibility}}{{/isReadOnly}}} {{/required}} /// @@ -213,7 +215,7 @@ {{#deprecated}} [Obsolete] {{/deprecated}} - public new {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + {{#vendorExtensions.x-property-visibility}}{{.}}{{/vendorExtensions.x-property-visibility}}{{^vendorExtensions.x-property-visibility}}public{{/vendorExtensions.x-property-visibility}} new {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}{{#vendorExtensions.x-setter-visibility}}{{.}} set; {{/vendorExtensions.x-setter-visibility}}}{{/required}}{{^required}}{ get { return this.{{name}}Option.Value; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}{{#vendorExtensions.x-setter-visibility}}{{.}} set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/vendorExtensions.x-setter-visibility}}}{{/required}} {{/isNew}} {{/isInherited}} @@ -224,7 +226,7 @@ /// [JsonIgnore] [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] - public Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}} + public Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{name}}Option { get; {{^isReadOnly}}private set; {{/isReadOnly}}{{#isReadOnly}}{{#vendorExtensions.x-setter-visibility}}private set; {{/vendorExtensions.x-setter-visibility}}{{/isReadOnly}}} {{/required}} /// @@ -238,7 +240,7 @@ {{#deprecated}} [Obsolete] {{/deprecated}} - public {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}}{{/required}}{{^required}}{ get { return this.{{name}}Option; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}}{{/required}} + {{#vendorExtensions.x-property-visibility}}{{.}}{{/vendorExtensions.x-property-visibility}}{{^vendorExtensions.x-property-visibility}}public{{/vendorExtensions.x-property-visibility}} {{{datatypeWithEnum}}}{{#lambda.first}}{{#isNullable}}{{>NullConditionalProperty}} {{/isNullable}}{{^required}}{{nrt?}}{{^nrt}}{{#vendorExtensions.x-is-value-type}}?{{/vendorExtensions.x-is-value-type}}{{/nrt}} {{/required}}{{/lambda.first}} {{name}} {{#required}}{ get; {{^isReadOnly}}set; {{/isReadOnly}}{{#vendorExtensions.x-setter-visibility}}{{.}} set; {{/vendorExtensions.x-setter-visibility}}}{{/required}}{{^required}}{ get { return this.{{name}}Option.Value; } {{^isReadOnly}}set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/isReadOnly}}{{#vendorExtensions.x-setter-visibility}}{{.}} set { this.{{name}}Option = new{{^net70OrLater}} Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>{{/net70OrLater}}(value); } {{/vendorExtensions.x-setter-visibility}}}{{/required}} {{/isInherited}} {{/isEnum}} @@ -388,6 +390,7 @@ {{^parentModel}} {{>validatable}} + {{/parentModel}} {{/validatable}} } \ No newline at end of file diff --git a/sdks/dotnet/templates/libraries/httpclient/ApiClient.mustache b/sdks/dotnet/templates/libraries/httpclient/ApiClient.mustache index 603284acb..1cbab2bfb 100644 --- a/sdks/dotnet/templates/libraries/httpclient/ApiClient.mustache +++ b/sdks/dotnet/templates/libraries/httpclient/ApiClient.mustache @@ -79,7 +79,7 @@ namespace {{packageName}}.Client public async Task Deserialize(HttpResponseMessage response) { - var result = (T) await Deserialize(response, typeof(T)).ConfigureAwait(false); + var result = (T)await Deserialize(response, typeof(T)).ConfigureAwait(false); return result; } @@ -95,13 +95,13 @@ namespace {{packageName}}.Client // process response headers, e.g. Access-Control-Allow-Methods foreach (var responseHeader in response.Headers) { - headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); } // process response content headers, e.g. Content-Type foreach (var responseHeader in response.Content.Headers) { - headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); + headers.Add(responseHeader.Key + "=" + ClientUtils.ParameterToString(responseHeader.Value)); } // RFC 2183 & RFC 2616 @@ -112,7 +112,8 @@ namespace {{packageName}}.Client } else if (type == typeof(FileParameter)) { - if (headers != null) { + if (headers != null) + { foreach (var header in headers) { var match = fileNameRegex.Match(header.ToString()); @@ -191,6 +192,9 @@ namespace {{packageName}}.Client /// {{>visibility}} partial class ApiClient : IDisposable, ISynchronousClient{{#supportsAsync}}, IAsynchronousClient{{/supportsAsync}} { + {{#net60OrLater}} + private static readonly HttpRequestOptionsKey> _httpOptionsCookieContainerKey = new("CookieContainer"); + {{/net60OrLater}} private readonly string _baseUrl; private readonly HttpClientHandler _httpClientHandler; @@ -283,7 +287,8 @@ namespace {{packageName}}.Client /// public void Dispose() { - if(_disposeClient) { + if(_disposeClient) + { _httpClient.Dispose(); } } @@ -413,18 +418,23 @@ namespace {{packageName}}.Client // TODO provide an alternative that allows cookies per request instead of per API client if (options.Cookies != null && options.Cookies.Count > 0) { + {{#net60OrLater}} + request.Options.Set(_httpOptionsCookieContainerKey, options.Cookies); + {{/net60OrLater}} + {{^net60OrLater}} request.Properties["CookieContainer"] = options.Cookies; + {{/net60OrLater}} } return request; } - partial void InterceptRequest(HttpRequestMessage req); - partial void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response); + {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptRequest(HttpRequestMessage req){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} + {{#useVirtualForHooks}}public virtual{{/useVirtualForHooks}}{{^useVirtualForHooks}}partial{{/useVirtualForHooks}} void InterceptResponse(HttpRequestMessage req, HttpResponseMessage response){{#useVirtualForHooks}} { }{{/useVirtualForHooks}}{{^useVirtualForHooks}};{{/useVirtualForHooks}} private async Task> ToApiResponse(HttpResponseMessage response, object responseData, Uri uri) { - T result = (T) responseData; + T result = (T)responseData; string rawContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var transformed = new ApiResponse(response.StatusCode, new Multimap({{#caseInsensitiveResponseHeaders}}StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), result, rawContent) @@ -459,7 +469,7 @@ namespace {{packageName}}.Client transformed.Cookies.Add(cookie); } } - catch (PlatformNotSupportedException) {} + catch (PlatformNotSupportedException) { } } return transformed; @@ -472,7 +482,7 @@ namespace {{packageName}}.Client private async Task> ExecAsync(HttpRequestMessage req, IReadableConfiguration configuration, - System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + System.Threading.CancellationToken cancellationToken = default) { CancellationTokenSource timeoutTokenSource = null; CancellationTokenSource finalTokenSource = null; @@ -496,15 +506,22 @@ namespace {{packageName}}.Client if (configuration.ClientCertificates != null) { - if(_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + if (_httpClientHandler == null) throw new InvalidOperationException("Configuration `ClientCertificates` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); _httpClientHandler.ClientCertificates.AddRange(configuration.ClientCertificates); } + {{^net60OrLater}} var cookieContainer = req.Properties.ContainsKey("CookieContainer") ? req.Properties["CookieContainer"] as List : null; + {{/net60OrLater}} + {{#net60OrLater}} + if (req.Options.TryGetValue(_httpOptionsCookieContainerKey, out var cookieContainer)) + {{/net60OrLater}} + {{^net60OrLater}} if (cookieContainer != null) + {{/net60OrLater}} { - if(_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); + if (_httpClientHandler == null) throw new InvalidOperationException("Request property `CookieContainer` not supported when the client is explicitly created without an HttpClientHandler, use the proper constructor."); foreach (var cookie in cookieContainer) { _httpClientHandler.CookieContainer.Add(cookie); @@ -538,7 +555,7 @@ namespace {{packageName}}.Client if (!response.IsSuccessStatusCode) { - return await ToApiResponse(response, default(T), req.RequestUri).ConfigureAwait(false); + return await ToApiResponse(response, default, req.RequestUri).ConfigureAwait(false); } object responseData = await deserializer.Deserialize(response).ConfigureAwait(false); @@ -546,11 +563,12 @@ namespace {{packageName}}.Client // if the response type is oneOf/anyOf, call FromJSON to deserialize the data if (typeof({{{packageName}}}.{{modelPackage}}.AbstractOpenAPISchema).IsAssignableFrom(typeof(T))) { - responseData = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content }); + string jsonString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + responseData = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { jsonString }); } else if (typeof(T).Name == "Stream") // for binary response { - responseData = (T) (object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + responseData = (T)(object) await response.Content.ReadAsStreamAsync().ConfigureAwait(false); } InterceptResponse(req, response); @@ -591,7 +609,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Get, path, options, config), config, cancellationToken); @@ -606,7 +624,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Post, path, options, config), config, cancellationToken); @@ -621,7 +639,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Put, path, options, config), config, cancellationToken); @@ -636,7 +654,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Delete, path, options, config), config, cancellationToken); @@ -651,7 +669,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Head, path, options, config), config, cancellationToken); @@ -666,7 +684,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(HttpMethod.Options, path, options, config), config, cancellationToken); @@ -681,7 +699,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest(new HttpMethod("PATCH"), path, options, config), config, cancellationToken); diff --git a/sdks/dotnet/templates/libraries/httpclient/api.mustache b/sdks/dotnet/templates/libraries/httpclient/api.mustache index ebf563b5e..331b3396f 100644 --- a/sdks/dotnet/templates/libraries/httpclient/api.mustache +++ b/sdks/dotnet/templates/libraries/httpclient/api.mustache @@ -36,7 +36,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); /// /// {{summary}} @@ -50,7 +50,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} #endregion Synchronous Operations } @@ -78,7 +78,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default); /// /// {{summary}} @@ -95,7 +95,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default); {{/operation}} #endregion Asynchronous Operations } @@ -335,7 +335,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} @@ -350,7 +350,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#allParams}} {{#required}} @@ -430,12 +430,12 @@ namespace {{packageName}}.{{apiPackage}} {{/queryParams}} {{#headerParams}} {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#headerIsJsonMimeType}}ParameterToJsonString{{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ParameterToString{{/headerIsJsonMimeType}}({{paramName}})); // header parameter {{/required}} {{^required}} if ({{paramName}} != null) { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#headerIsJsonMimeType}}ParameterToJsonString{{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ParameterToString{{/headerIsJsonMimeType}}({{paramName}})); // header parameter } {{/required}} {{/headerParams}} @@ -552,7 +552,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} @@ -570,7 +570,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default) { {{#allParams}} {{#required}} @@ -647,12 +647,12 @@ namespace {{packageName}}.{{apiPackage}} {{/constantParams}} {{#headerParams}} {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#headerIsJsonMimeType}}ParameterToJsonString{{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ParameterToString{{/headerIsJsonMimeType}}({{paramName}})); // header parameter {{/required}} {{^required}} if ({{paramName}} != null) { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#headerIsJsonMimeType}}ParameterToJsonString{{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ParameterToString{{/headerIsJsonMimeType}}({{paramName}})); // header parameter } {{/required}} {{/headerParams}} diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/ApiClient.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/ApiClient.mustache index df7b9d054..71d621c88 100644 --- a/sdks/dotnet/templates/libraries/unityWebRequest/ApiClient.mustache +++ b/sdks/dotnet/templates/libraries/unityWebRequest/ApiClient.mustache @@ -274,6 +274,23 @@ namespace {{packageName}}.Client request = UnityWebRequest.Post(uri, form); request.method = method; } + else if (contentType == "application/octet-stream") + { + if(options.Data is Stream stream) + { + using (var binaryReader = new BinaryReader(stream)) + { + var bytes = binaryReader.ReadBytes((int)stream.Length); + request = UnityWebRequest.Put(uri, bytes); + request.method = method; + request.SetRequestHeader("Content-Type", "application/octet-stream"); + } + } + else + { + throw new InvalidDataException($"{nameof(options.Data)} is not of {nameof(Stream)} type"); + } + } else if (options.Data != null) { var serializer = new CustomJsonCodec(SerializerSettings, configuration); @@ -371,16 +388,24 @@ namespace {{packageName}}.Client string path, RequestOptions options, IReadableConfiguration configuration, - System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + System.Threading.CancellationToken cancellationToken = default) { var deserializer = new CustomJsonCodec(SerializerSettings, configuration); using (request) { + {{#useIntForTimeout}} if (configuration.Timeout > 0) { - request.timeout = (int)Math.Ceiling(configuration.Timeout / 1000.0f); + request.timeout = configuration.Timeout; + } + {{/useIntForTimeout}} + {{^useIntForTimeout}} + if (configuration.Timeout > TimeSpan.Zero) + { + request.timeout = (int)Math.Ceiling(configuration.Timeout.TotalSeconds); } + {{/useIntForTimeout}} if (configuration.Proxy != null) { @@ -400,21 +425,34 @@ namespace {{packageName}}.Client InterceptRequest(request, path, options, configuration); + #if UNITY_2020_2_OR_NEWER + // For Unity 2020.2 and newer, use UnityWebRequest.Result. var asyncOp = request.SendWebRequest(); - - TaskCompletionSource tsc = new TaskCompletionSource(); - asyncOp.completed += (_) => tsc.TrySetResult(request.result); - + TaskCompletionSource tcs = new TaskCompletionSource(); + asyncOp.completed += (_) => tcs.TrySetResult(request.result); using (var tokenRegistration = cancellationToken.Register(request.Abort, true)) { - await tsc.Task; + await tcs.Task; } - + if (request.result == UnityWebRequest.Result.ConnectionError || request.result == UnityWebRequest.Result.DataProcessingError) { throw new ConnectionException(request); } + #else + // For Unity 2019 and earlier, await the operation directly. + var asyncOp = request.SendWebRequest(); + using (var tokenRegistration = cancellationToken.Register(request.Abort, true)) + { + await asyncOp; + } + + if (request.isNetworkError || request.isHttpError) + { + throw new ConnectionException(request); + } + #endif object responseData = deserializer.Deserialize(request); @@ -445,7 +483,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> GetAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest("GET", path, options, config), path, options, config, cancellationToken); @@ -460,7 +498,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> PostAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest("POST", path, options, config), path, options, config, cancellationToken); @@ -475,7 +513,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> PutAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest("PUT", path, options, config), path, options, config, cancellationToken); @@ -490,7 +528,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> DeleteAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest("DELETE", path, options, config), path, options, config, cancellationToken); @@ -505,7 +543,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> HeadAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest("HEAD", path, options, config), path, options, config, cancellationToken); @@ -520,7 +558,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> OptionsAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest("OPTIONS", path, options, config), path, options, config, cancellationToken); @@ -535,7 +573,7 @@ namespace {{packageName}}.Client /// GlobalConfiguration has been done before calling this method. /// Token that enables callers to cancel the request. /// A Task containing ApiResponse - public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public Task> PatchAsync(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default) { var config = configuration ?? GlobalConfiguration.Instance; return ExecAsync(NewRequest("PATCH", path, options, config), path, options, config, cancellationToken); @@ -636,4 +674,4 @@ namespace {{packageName}}.Client } #endregion ISynchronousClient } -} \ No newline at end of file +} diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/ConnectionException.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/ConnectionException.mustache index 108ea3bf5..c4c9ae32e 100644 --- a/sdks/dotnet/templates/libraries/unityWebRequest/ConnectionException.mustache +++ b/sdks/dotnet/templates/libraries/unityWebRequest/ConnectionException.mustache @@ -5,6 +5,7 @@ using UnityEngine.Networking; namespace {{packageName}}.Client { +#if UNITY_2020_1_OR_NEWER public class ConnectionException : Exception { public UnityWebRequest.Result Result { get; private set; } @@ -18,4 +19,39 @@ namespace {{packageName}}.Client Error = request.error ?? ""; } } +#else + // For Unity 2019, define a custom enum that roughly simulates UnityWebRequest.Result. + public enum UnityWebRequestResultLegacy + { + Success, + ConnectionError, + ProtocolError, + DataProcessingError + } + + public class ConnectionException : Exception + { + public UnityWebRequestResultLegacy Result { get; private set; } + public string Error { get; private set; } + + public ConnectionException(UnityWebRequest request) + : base($"Error: {request.error}") + { + if (request.isNetworkError) + { + Result = UnityWebRequestResultLegacy.ConnectionError; + } + else if (request.isHttpError) + { + Result = UnityWebRequestResultLegacy.ProtocolError; + } + else + { + Result = UnityWebRequestResultLegacy.Success; + } + + Error = request.error ?? ""; + } + } +#endif } diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/README.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/README.mustache index b0a140dd6..e94bc78c6 100644 --- a/sdks/dotnet/templates/libraries/unityWebRequest/README.mustache +++ b/sdks/dotnet/templates/libraries/unityWebRequest/README.mustache @@ -20,7 +20,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap ## Version support This generator should support all current LTS versions of Unity -- Unity 2020.3 (LTS) and up +- Unity 2019.4 (LTS) and up - .NET Standard 2.1 / .NET Framework diff --git a/sdks/dotnet/templates/libraries/unityWebRequest/api.mustache b/sdks/dotnet/templates/libraries/unityWebRequest/api.mustache index 189ebfea9..eb058f580 100644 --- a/sdks/dotnet/templates/libraries/unityWebRequest/api.mustache +++ b/sdks/dotnet/templates/libraries/unityWebRequest/api.mustache @@ -35,7 +35,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); /// /// {{summary}} @@ -49,7 +49,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} #endregion Synchronous Operations } @@ -77,7 +77,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default); /// /// {{summary}} @@ -94,7 +94,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default); {{/operation}} #endregion Asynchronous Operations } @@ -261,7 +261,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} @@ -276,7 +276,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#allParams}} {{#required}} @@ -356,12 +356,12 @@ namespace {{packageName}}.{{apiPackage}} {{/queryParams}} {{#headerParams}} {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#headerIsJsonMimeType}}ParameterToJsonString{{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ParameterToString{{/headerIsJsonMimeType}}({{paramName}})); // header parameter {{/required}} {{^required}} if ({{paramName}} != null) { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#headerIsJsonMimeType}}ParameterToJsonString{{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ParameterToString{{/headerIsJsonMimeType}}({{paramName}})); // header parameter } {{/required}} {{/headerParams}} @@ -476,7 +476,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default) { var task = {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken); {{#returnType}} @@ -508,7 +508,7 @@ namespace {{packageName}}.{{apiPackage}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default) { {{#allParams}} {{#required}} @@ -567,12 +567,12 @@ namespace {{packageName}}.{{apiPackage}} {{/queryParams}} {{#headerParams}} {{#required}} - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#headerIsJsonMimeType}}ParameterToJsonString{{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ParameterToString{{/headerIsJsonMimeType}}({{paramName}})); // header parameter {{/required}} {{^required}} if ({{paramName}} != null) { - localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.ParameterToString({{paramName}})); // header parameter + localVarRequestOptions.HeaderParameters.Add("{{baseName}}", {{packageName}}.Client.ClientUtils.{{#headerIsJsonMimeType}}ParameterToJsonString{{/headerIsJsonMimeType}}{{^headerIsJsonMimeType}}ParameterToString{{/headerIsJsonMimeType}}({{paramName}})); // header parameter } {{/required}} {{/headerParams}} diff --git a/sdks/dotnet/templates/modelEnum.mustache b/sdks/dotnet/templates/modelEnum.mustache index 37fb53f5f..96b408d8d 100644 --- a/sdks/dotnet/templates/modelEnum.mustache +++ b/sdks/dotnet/templates/modelEnum.mustache @@ -21,7 +21,7 @@ {{/-first}} {{/enumVars}} {{/allowableValues}} - {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}} : byte{{/vendorExtensions.x-enum-byte}}{{#isLong}} : long{{/isLong}} { {{#allowableValues}} {{#enumVars}} @@ -46,18 +46,18 @@ /// /// Converts to and from the JSON value /// - public static class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter + {{>visibility}} static class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter { /// /// Parses a given value to /// /// /// - public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} FromString(string value) + {{>visibility}} static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} FromString(string value) { {{#allowableValues}} {{#enumVars}} - if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + if (value.Equals({{#isNumeric}}({{{value}}}{{#isFloat}}f{{/isFloat}}{{#isDouble}}d{{/isDouble}}{{#isDecimal}}m{{/isDecimal}}).ToString(System.Globalization.CultureInfo.InvariantCulture){{/isNumeric}}{{^isNumeric}}{{^isString}}({{{value}}}).ToString(System.Globalization.CultureInfo.InvariantCulture){{/isString}}{{#isString}}"{{{value}}}"{{/isString}}{{/isNumeric}})) return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; {{/enumVars}} @@ -70,11 +70,11 @@ /// /// /// - public static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? FromStringOrDefault(string value) + {{>visibility}} static {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? FromStringOrDefault(string value) { {{#allowableValues}} {{#enumVars}} - if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + if (value.Equals({{#isNumeric}}({{{value}}}{{#isFloat}}f{{/isFloat}}{{#isDouble}}d{{/isDouble}}{{#isDecimal}}m{{/isDecimal}}).ToString(System.Globalization.CultureInfo.InvariantCulture){{/isNumeric}}{{^isNumeric}}{{^isString}}({{{value}}}).ToString(System.Globalization.CultureInfo.InvariantCulture){{/isString}}{{#isString}}"{{{value}}}"{{/isString}}{{/isNumeric}})) return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; {{/enumVars}} @@ -88,11 +88,47 @@ /// /// /// - public static {{>EnumValueDataType}} ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} value) + {{>visibility}} static {{>EnumValueDataType}} ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} value) { - {{^isString}} + {{#vendorExtensions.x-enum-byte}} return ({{>EnumValueDataType}}) value; - {{/isString}} + {{/vendorExtensions.x-enum-byte}} + {{#isInteger}} + return ({{>EnumValueDataType}}) value; + {{/isInteger}} + {{#isLong}} + return ({{>EnumValueDataType}}) value; + {{/isLong}} + {{#isFloat}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{{value}}}f; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isFloat}} + {{#isDouble}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{{value}}}d; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isDouble}} + {{#isDecimal}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{{value}}}m; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isDecimal}} {{#isString}} {{#allowableValues}} {{#enumVars}} @@ -110,7 +146,7 @@ /// A Json converter for type /// /// - public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> + {{>visibility}} class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}JsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { /// /// Returns a {{datatypeWithEnum}} from the Json object @@ -121,6 +157,49 @@ /// public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + {{#vendorExtensions.x-enum-byte}} + string rawValue = reader.{{>EnumJsonReaderMethod}}().ToString(System.Globalization.CultureInfo.InvariantCulture); + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + if (result != null) + return result.Value; + throw new JsonException(); + {{/vendorExtensions.x-enum-byte}} + {{#isInteger}} + string rawValue = reader.{{>EnumJsonReaderMethod}}().ToString(System.Globalization.CultureInfo.InvariantCulture); + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + if (result != null) + return result.Value; + throw new JsonException(); + {{/isInteger}} + {{#isLong}} + string rawValue = reader.{{>EnumJsonReaderMethod}}().ToString(System.Globalization.CultureInfo.InvariantCulture); + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + if (result != null) + return result.Value; + throw new JsonException(); + {{/isLong}} + {{#isFloat}} + string rawValue = reader.GetSingle().ToString(System.Globalization.CultureInfo.InvariantCulture); + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + if (result != null) + return result.Value; + throw new JsonException(); + {{/isFloat}} + {{#isDouble}} + string rawValue = reader.GetDouble().ToString(System.Globalization.CultureInfo.InvariantCulture); + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + if (result != null) + return result.Value; + throw new JsonException(); + {{/isDouble}} + {{#isDecimal}} + string rawValue = reader.GetDecimal().ToString(System.Globalization.CultureInfo.InvariantCulture); + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + if (result != null) + return result.Value; + throw new JsonException(); + {{/isDecimal}} + {{#isString}} string{{nrt?}} rawValue = reader.GetString(); {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null @@ -131,6 +210,7 @@ return result.Value; throw new JsonException(); + {{/isString}} } /// @@ -141,14 +221,19 @@ /// public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) { - writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.ToString()); + {{^isString}} + writer.WriteNumberValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}})); + {{/isString}} + {{#isString}} + writer.WriteStringValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}).ToString()); + {{/isString}} } } /// /// A Json converter for type /// - public class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}?> + {{>visibility}} class {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}NullableJsonConverter : JsonConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}?> { /// /// Returns a {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} from the Json object @@ -159,6 +244,52 @@ /// public override {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { + if (reader.TokenType == JsonTokenType.Null) + return null; + + {{#vendorExtensions.x-enum-byte}} + string rawValue = reader.{{>EnumJsonReaderMethod}}().ToString(System.Globalization.CultureInfo.InvariantCulture); + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + if (result != null) + return result.Value; + throw new JsonException(); + {{/vendorExtensions.x-enum-byte}} + {{#isInteger}} + string rawValue = reader.{{>EnumJsonReaderMethod}}().ToString(System.Globalization.CultureInfo.InvariantCulture); + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + if (result != null) + return result.Value; + throw new JsonException(); + {{/isInteger}} + {{#isLong}} + string rawValue = reader.{{>EnumJsonReaderMethod}}().ToString(System.Globalization.CultureInfo.InvariantCulture); + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + if (result != null) + return result.Value; + throw new JsonException(); + {{/isLong}} + {{#isFloat}} + string rawValue = reader.GetSingle().ToString(System.Globalization.CultureInfo.InvariantCulture); + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + if (result != null) + return result.Value; + throw new JsonException(); + {{/isFloat}} + {{#isDouble}} + string rawValue = reader.GetDouble().ToString(System.Globalization.CultureInfo.InvariantCulture); + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + if (result != null) + return result.Value; + throw new JsonException(); + {{/isDouble}} + {{#isDecimal}} + string rawValue = reader.GetDecimal().ToString(System.Globalization.CultureInfo.InvariantCulture); + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.FromStringOrDefault(rawValue); + if (result != null) + return result.Value; + throw new JsonException(); + {{/isDecimal}} + {{#isString}} string{{nrt?}} rawValue = reader.GetString(); {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? result = rawValue == null @@ -169,17 +300,26 @@ return result.Value; throw new JsonException(); + {{/isString}} } /// - /// Writes the DateTime to the json writer + /// Writes the {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} to the json writer /// /// /// /// public override void Write(Utf8JsonWriter writer, {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}? {{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions options) { - writer.WriteStringValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}?.ToString() ?? "null"); + if ({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.HasValue) + {{^isString}} + writer.WriteNumberValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.Value)); + {{/isString}} + {{#isString}} + writer.WriteStringValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}ValueConverter.ToJsonValue({{#lambda.camelcase_sanitize_param}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/lambda.camelcase_sanitize_param}}.Value).ToString()); + {{/isString}} + else + writer.WriteNullValue(); } } {{/useGenericHost}} diff --git a/sdks/dotnet/templates/modelGeneric.mustache b/sdks/dotnet/templates/modelGeneric.mustache index 5075f0e64..272095d5f 100644 --- a/sdks/dotnet/templates/modelGeneric.mustache +++ b/sdks/dotnet/templates/modelGeneric.mustache @@ -31,12 +31,14 @@ {{#items}} {{^complexType}} {{>modelInnerEnum}} + {{/complexType}} {{/items}} {{/items.isEnum}} {{#isEnum}} {{^complexType}} {{>modelInnerEnum}} + {{/complexType}} {{/isEnum}} {{#isEnum}} @@ -167,7 +169,7 @@ [JsonConstructorAttribute] {{/hasOnlyReadOnly}} {{^useCustomTemplateCode}} - public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} + public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{#conditionalSerialization}}{{#vendorExtensions.x-csharp-value-type}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/vendorExtensions.x-csharp-value-type}}{{/conditionalSerialization}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default{{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default{{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} { {{/useCustomTemplateCode}} {{#useCustomTemplateCode}} @@ -255,11 +257,20 @@ {{/useCustomTemplateCode}} {{/conditionalSerialization}} {{#conditionalSerialization}} + {{#vendorExtensions.x-csharp-value-type}} + if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} != null) + { + this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}.Value; + this._flag{{name}} = true; + } + {{/vendorExtensions.x-csharp-value-type}} + {{^vendorExtensions.x-csharp-value-type}} this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}; if (this.{{name}} != null) { this._flag{{name}} = true; } + {{/vendorExtensions.x-csharp-value-type}} {{/conditionalSerialization}} {{/defaultValue}} {{/required}} @@ -526,6 +537,7 @@ {{#validatable}} {{>validatable}} + {{/validatable}} {{#useCustomTemplateCode}} public List GetOpenApiTypes() diff --git a/sdks/dotnet/templates/modelInnerEnum.mustache b/sdks/dotnet/templates/modelInnerEnum.mustache index 462ded84d..90e2d9b3a 100644 --- a/sdks/dotnet/templates/modelInnerEnum.mustache +++ b/sdks/dotnet/templates/modelInnerEnum.mustache @@ -10,7 +10,7 @@ [JsonConverter(typeof(StringEnumConverter))] {{/useGenericHost}} {{/isString}} - {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}} : byte{{/vendorExtensions.x-enum-byte}}{{#isLong}} : long{{/isLong}} { {{#allowableValues}} {{#enumVars}} @@ -41,7 +41,7 @@ { {{#allowableValues}} {{#enumVars}} - if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + if (value.Equals({{#isNumeric}}({{{value}}}{{#isFloat}}f{{/isFloat}}{{#isDouble}}d{{/isDouble}}{{#isDecimal}}m{{/isDecimal}}).ToString(System.Globalization.CultureInfo.InvariantCulture){{/isNumeric}}{{^isNumeric}}{{^isString}}({{{value}}}).ToString(System.Globalization.CultureInfo.InvariantCulture){{/isString}}{{#isString}}"{{{value}}}"{{/isString}}{{/isNumeric}})) return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; {{/enumVars}} @@ -58,7 +58,7 @@ { {{#allowableValues}} {{#enumVars}} - if (value.Equals({{^isString}}({{{value}}}).ToString(){{/isString}}{{#isString}}"{{{value}}}"{{/isString}})) + if (value.Equals({{#isNumeric}}({{{value}}}{{#isFloat}}f{{/isFloat}}{{#isDouble}}d{{/isDouble}}{{#isDecimal}}m{{/isDecimal}}).ToString(System.Globalization.CultureInfo.InvariantCulture){{/isNumeric}}{{^isNumeric}}{{^isString}}({{{value}}}).ToString(System.Globalization.CultureInfo.InvariantCulture){{/isString}}{{#isString}}"{{{value}}}"{{/isString}}{{/isNumeric}})) return {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}; {{/enumVars}} @@ -72,14 +72,53 @@ /// /// {{#isString}} + {{^isNumeric}} /// + {{/isNumeric}} {{/isString}} public static {{>EnumValueDataType}}{{#lambda.first}}{{#nrt}}{{#isString}}{{#isNullable}}{{nrt?}} {{^nrt}}{{#vendorExtensions.x-is-value-type}}? {{/vendorExtensions.x-is-value-type}}{{/nrt}}{{/isNullable}}{{/isString}}{{/nrt}}{{/lambda.first}} {{datatypeWithEnum}}ToJsonValue({{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#isString}}{{>NullConditionalProperty}}{{/isString}} value) { - {{^isString}} + {{#vendorExtensions.x-enum-byte}} return ({{>EnumValueDataType}}) value; - {{/isString}} + {{/vendorExtensions.x-enum-byte}} + {{#isInteger}} + return ({{>EnumValueDataType}}) value; + {{/isInteger}} + {{#isLong}} + return ({{>EnumValueDataType}}) value; + {{/isLong}} + {{#isFloat}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{{value}}}f; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isFloat}} + {{#isDouble}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{{value}}}d; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isDouble}} + {{#isDecimal}} + {{#allowableValues}} + {{#enumVars}} + if (value == {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.{{name}}) + return {{{value}}}m; + + {{/enumVars}} + {{/allowableValues}} + throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isDecimal}} {{#isString}} + {{^isNumeric}} {{#isNullable}} if (value == null) return null; @@ -93,6 +132,7 @@ {{/enumVars}} {{/allowableValues}} throw new NotImplementedException($"Value could not be handled: '{value}'"); + {{/isNumeric}} {{/isString}} } {{/useGenericHost}} diff --git a/sdks/dotnet/templates/netcore_project.mustache b/sdks/dotnet/templates/netcore_project.mustache index 06243449e..a78f10fc0 100644 --- a/sdks/dotnet/templates/netcore_project.mustache +++ b/sdks/dotnet/templates/netcore_project.mustache @@ -27,11 +27,17 @@ {{{.}}}{{/packageTags}}{{#nrt}} {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} false + {{#treatWarningsAsErrors}} + true + {{/treatWarningsAsErrors}} + {{#warningsNotAsErrors}} + {{warningsNotAsErrors}} + {{/warningsNotAsErrors}} {{#useCompareNetObjects}} - + {{/useCompareNetObjects}} {{^useGenericHost}} @@ -41,13 +47,74 @@ {{/useRestSharp}} {{#useGenericHost}} - - + {{#netStandard}} + + + {{/netStandard}} + {{#net47}} + + + {{/net47}} + {{#net48}} + + + {{/net48}} + {{#net6.0}} + + + {{/net6.0}} + {{#net7.0}} + + + {{/net7.0}} + {{#net8.0}} + + + {{/net8.0}} + {{#net9.0}} + + + {{/net9.0}} + {{#net10.0}} + + + {{/net10.0}} {{#supportsRetry}} - + {{#netStandard}} + + {{/netStandard}} + {{#net47}} + + {{/net47}} + {{#net48}} + + {{/net48}} + {{#net6.0}} + + {{/net6.0}} + {{#net7.0}} + + {{/net7.0}} + {{#net8.0}} + + {{/net8.0}} + {{#net9.0}} + + {{/net9.0}} + {{#net10.0}} + + {{/net10.0}} {{/supportsRetry}} {{#net80OrLater}} - + {{#net8.0}} + + {{/net8.0}} + {{#net9.0}} + + {{/net9.0}} + {{#net10.0}} + + {{/net10.0}} {{/net80OrLater}} {{^net60OrLater}} diff --git a/sdks/dotnet/templates/netcore_testproject.mustache b/sdks/dotnet/templates/netcore_testproject.mustache index 90434b77e..c51da5d13 100644 --- a/sdks/dotnet/templates/netcore_testproject.mustache +++ b/sdks/dotnet/templates/netcore_testproject.mustache @@ -6,12 +6,19 @@ {{testTargetFramework}} false{{#nrt}} {{#useGenericHost}}enable{{/useGenericHost}}{{^useGenericHost}}annotations{{/useGenericHost}}{{/nrt}} + false + {{#treatWarningsAsErrors}} + true + {{/treatWarningsAsErrors}} + {{#warningsNotAsErrors}} + {{warningsNotAsErrors}} + {{/warningsNotAsErrors}} - - - + + + diff --git a/sdks/dotnet/templates/validatable.mustache b/sdks/dotnet/templates/validatable.mustache index 140ff9217..6b2a78aa5 100644 --- a/sdks/dotnet/templates/validatable.mustache +++ b/sdks/dotnet/templates/validatable.mustache @@ -65,6 +65,9 @@ {{#vars}} {{#hasValidation}} {{^isEnum}} + {{^isDateTime}} + {{^isDate}} + {{^isTime}} {{#maxLength}} // {{{name}}} ({{{dataType}}}) maxLength if (this.{{{name}}} != null && this.{{{name}}}.Length > {{maxLength}}) @@ -81,6 +84,9 @@ } {{/minLength}} + {{/isTime}} + {{/isDate}} + {{/isDateTime}} {{#maximum}} // {{{name}}} ({{{dataType}}}) maximum if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} {{#exclusiveMaximum}}<={{/exclusiveMaximum}}{{^exclusiveMaximum}}>{{/exclusiveMaximum}} ({{{dataType}}}){{maximum}}) @@ -104,7 +110,7 @@ if (this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null){ {{#lambda.trimTrailingWithNewLine}} {{#lambda.indent4}} - {{>ValidateRegex}} + {{>ValidateRegex}}{{! prevent indent}} {{/lambda.indent4}} {{/lambda.trimTrailingWithNewLine}} @@ -114,7 +120,7 @@ {{^isNullable}} {{#lambda.trimTrailingWithNewLine}} {{#lambda.indent3}} - {{>ValidateRegex}} + {{>ValidateRegex}}{{! prevent indent}} {{/lambda.indent3}} {{/lambda.trimTrailingWithNewLine}} @@ -124,7 +130,7 @@ if (this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} != null) { {{#lambda.trimTrailingWithNewLine}} {{#lambda.indent4}} - {{>ValidateRegex}} + {{>ValidateRegex}}{{! prevent indent}} {{/lambda.indent4}} {{/lambda.trimTrailingWithNewLine}} From e3d7e7ce76f6cfad07148c42e1a851646324a3c7 Mon Sep 17 00:00:00 2001 From: Grzegorz Biernacki Date: Mon, 19 Oct 2026 10:00:36 +0200 Subject: [PATCH 2/4] Note .NET 10 SDK requirement for building from source --- sdks/dotnet/README.md | 2 ++ sdks/dotnet/templates/README.mustache | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index be40b552f..30501e00f 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -47,6 +47,8 @@ this command. ## Frameworks supported - .NET 8.0 or later (the package includes `net8.0` and `net10.0` builds) +Building the SDK from source requires the .NET 10 SDK. + ## Dependencies diff --git a/sdks/dotnet/templates/README.mustache b/sdks/dotnet/templates/README.mustache index c160b0b50..26112eeed 100644 --- a/sdks/dotnet/templates/README.mustache +++ b/sdks/dotnet/templates/README.mustache @@ -64,6 +64,8 @@ this command. {{/netStandard}} {{#useCustomTemplateCode}} - .NET 8.0 or later (the package includes `net8.0` and `net10.0` builds) + +Building the SDK from source requires the .NET 10 SDK. {{/useCustomTemplateCode}} From e1897848b18bc53023857e151adcd0ceccba2cf3 Mon Sep 17 00:00:00 2001 From: Grzegorz Biernacki Date: Mon, 19 Oct 2026 10:36:28 +0200 Subject: [PATCH 3/4] Allow building the .NET SDK from source with the .NET 8 SDK --- sdks/dotnet/README.md | 2 +- .../src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj | 3 ++- sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj | 8 +++++++- sdks/dotnet/templates/README.mustache | 2 +- sdks/dotnet/templates/netcore_project.mustache | 13 +++++++++++++ 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/sdks/dotnet/README.md b/sdks/dotnet/README.md index 30501e00f..c03909b3f 100644 --- a/sdks/dotnet/README.md +++ b/sdks/dotnet/README.md @@ -47,7 +47,7 @@ this command. ## Frameworks supported - .NET 8.0 or later (the package includes `net8.0` and `net10.0` builds) -Building the SDK from source requires the .NET 10 SDK. +Building the SDK from source works with the .NET 8 SDK (`net8.0` build) or the .NET 10 SDK (`net8.0` and `net10.0` builds). ## Dependencies diff --git a/sdks/dotnet/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj b/sdks/dotnet/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj index 87fcca11f..e55de27a9 100644 --- a/sdks/dotnet/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj +++ b/sdks/dotnet/src/Dropbox.Sign.Test/Dropbox.Sign.Test.csproj @@ -3,7 +3,8 @@ Dropbox.Sign.Test Dropbox.Sign.Test - net8.0;net10.0 + net8.0 + net8.0;net10.0 false Dropbox.Sign.Test diff --git a/sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj b/sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj index 67a48582c..2f41028ab 100644 --- a/sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj +++ b/sdks/dotnet/src/Dropbox.Sign/Dropbox.Sign.csproj @@ -2,7 +2,9 @@ false - net8.0;net10.0 + + net8.0 + net8.0;net10.0 Dropbox.Sign Dropbox.Sign Library @@ -32,4 +34,8 @@ + + + + diff --git a/sdks/dotnet/templates/README.mustache b/sdks/dotnet/templates/README.mustache index 26112eeed..78d8d891b 100644 --- a/sdks/dotnet/templates/README.mustache +++ b/sdks/dotnet/templates/README.mustache @@ -65,7 +65,7 @@ this command. {{#useCustomTemplateCode}} - .NET 8.0 or later (the package includes `net8.0` and `net10.0` builds) -Building the SDK from source requires the .NET 10 SDK. +Building the SDK from source works with the .NET 8 SDK (`net8.0` build) or the .NET 10 SDK (`net8.0` and `net10.0` builds). {{/useCustomTemplateCode}} diff --git a/sdks/dotnet/templates/netcore_project.mustache b/sdks/dotnet/templates/netcore_project.mustache index a78f10fc0..a25d5ffff 100644 --- a/sdks/dotnet/templates/netcore_project.mustache +++ b/sdks/dotnet/templates/netcore_project.mustache @@ -3,7 +3,14 @@ {{#useGenericHost}} true {{/useGenericHost}}{{^useGenericHost}} false{{/useGenericHost}} +{{^useCustomTemplateCode}} {{targetFramework}} +{{/useCustomTemplateCode}} +{{#useCustomTemplateCode}} + + net8.0 + {{targetFramework}} +{{/useCustomTemplateCode}} {{packageName}} {{packageName}} Library @@ -153,4 +160,10 @@ {{/net48}} {{/useGenericHost}} +{{#useCustomTemplateCode}} + + + + +{{/useCustomTemplateCode}} {{>netcore_project.additions}} From 24f2da429e4300d132e7201f3a86020fd5bf190f Mon Sep 17 00:00:00 2001 From: Grzegorz Biernacki Date: Mon, 19 Oct 2026 15:44:49 +0200 Subject: [PATCH 4/4] Fix missing quote in .NET project template --- sdks/dotnet/templates/netcore_project.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/dotnet/templates/netcore_project.mustache b/sdks/dotnet/templates/netcore_project.mustache index a25d5ffff..1cc548748 100644 --- a/sdks/dotnet/templates/netcore_project.mustache +++ b/sdks/dotnet/templates/netcore_project.mustache @@ -71,7 +71,7 @@ {{/net6.0}} {{#net7.0}} - + {{/net7.0}} {{#net8.0}}