From c8c1766ea662690a4be56ad124f39e1467d55f38 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:45:36 +0100 Subject: [PATCH] ci: regenerated with OpenAPI Doc 3.0.0, Speakeasy CLI 1.330.0 (#270) Co-authored-by: speakeasybot --- platform/.speakeasy/gen.lock | 26 +- platform/Codat/Platform/Codat.Platform.csproj | 6 +- platform/Codat/Platform/CodatPlatform.cs | 48 +-- platform/Codat/Platform/Companies.cs | 264 +++++++++++-- .../Codat/Platform/ConnectionManagement.cs | 74 +++- platform/Codat/Platform/Connections.cs | 314 ++++++++++++--- platform/Codat/Platform/CorsSettings.cs | 122 ++++-- platform/Codat/Platform/CustomDataType.cs | 214 ++++++++-- platform/Codat/Platform/Groups.cs | 214 ++++++++-- platform/Codat/Platform/Hooks/HookTypes.cs | 1 - platform/Codat/Platform/Hooks/SDKHooks.cs | 1 - platform/Codat/Platform/Integrations.cs | 164 ++++++-- .../Platform/Models/Errors/ErrorMessage.cs | 1 - .../Platform/Models/Errors/SDKException.cs | 1 - .../Operations/AddCompanyToGroupRequest.cs | 1 - .../Operations/AddCompanyToGroupResponse.cs | 1 - .../ConfigureCustomDataTypeRequest.cs | 1 - .../ConfigureCustomDataTypeResponse.cs | 1 - .../ConfigureSupplementalDataRequest.cs | 1 - .../ConfigureSupplementalDataResponse.cs | 1 - .../Models/Operations/CreateApiKeyResponse.cs | 1 - .../Operations/CreateCompanyResponse.cs | 1 - .../Operations/CreateConnectionRequest.cs | 1 - .../Operations/CreateConnectionRequestBody.cs | 1 - .../Operations/CreateConnectionResponse.cs | 1 - .../Models/Operations/CreateGroupResponse.cs | 1 - .../Models/Operations/CreateRuleResponse.cs | 1 - .../CreateWebhookConsumerResponse.cs | 1 - .../Platform/Models/Operations/DataType.cs | 1 - .../Models/Operations/DeleteApiKeyRequest.cs | 1 - .../Models/Operations/DeleteApiKeyResponse.cs | 1 - .../Models/Operations/DeleteCompanyRequest.cs | 1 - .../Operations/DeleteCompanyResponse.cs | 1 - .../Operations/DeleteConnectionRequest.cs | 1 - .../Operations/DeleteConnectionResponse.cs | 1 - .../DeleteWebhookConsumerRequest.cs | 1 - .../DeleteWebhookConsumerResponse.cs | 1 - .../Operations/GetCompanyDataStatusRequest.cs | 1 - .../GetCompanyDataStatusResponse.cs | 1 - .../GetCompanyPushHistoryRequest.cs | 1 - .../GetCompanyPushHistoryResponse.cs | 1 - .../Models/Operations/GetCompanyRequest.cs | 1 - .../Models/Operations/GetCompanyResponse.cs | 1 - ...tConnectionManagementAccessTokenRequest.cs | 1 - ...ConnectionManagementAccessTokenResponse.cs | 1 - ...onnectionManagementCorsSettingsResponse.cs | 1 - .../Models/Operations/GetConnectionRequest.cs | 1 - .../Operations/GetConnectionResponse.cs | 1 - ...eateUpdateModelOptionsByDataTypeRequest.cs | 1 - ...ateUpdateModelOptionsByDataTypeResponse.cs | 1 - .../GetCustomDataTypeConfigurationRequest.cs | 1 - .../GetCustomDataTypeConfigurationResponse.cs | 1 - .../Operations/GetIntegrationRequest.cs | 1 - .../Operations/GetIntegrationResponse.cs | 1 - .../GetIntegrationsBrandingRequest.cs | 1 - .../GetIntegrationsBrandingResponse.cs | 1 - .../Models/Operations/GetProfileResponse.cs | 1 - .../GetProfileSyncSettingsResponse.cs | 1 - .../Operations/GetPullOperationRequest.cs | 1 - .../Operations/GetPullOperationResponse.cs | 1 - .../Operations/GetPushOperationRequest.cs | 1 - .../Operations/GetPushOperationResponse.cs | 1 - ...GetSupplementalDataConfigurationRequest.cs | 1 - ...etSupplementalDataConfigurationResponse.cs | 1 - .../Models/Operations/GetWebhookRequest.cs | 1 - .../Models/Operations/GetWebhookResponse.cs | 1 - .../Models/Operations/ListApiKeysResponse.cs | 1 - .../Models/Operations/ListCompaniesRequest.cs | 1 - .../Operations/ListCompaniesResponse.cs | 1 - .../Operations/ListConnectionsRequest.cs | 1 - .../Operations/ListConnectionsResponse.cs | 1 - .../ListCustomDataTypeRecordsRequest.cs | 1 - .../ListCustomDataTypeRecordsResponse.cs | 1 - .../Models/Operations/ListGroupsResponse.cs | 1 - .../Operations/ListIntegrationsRequest.cs | 1 - .../Operations/ListIntegrationsResponse.cs | 1 - .../Operations/ListPullOperationsRequest.cs | 1 - .../Operations/ListPullOperationsResponse.cs | 1 - .../Models/Operations/ListRulesRequest.cs | 1 - .../Models/Operations/ListRulesResponse.cs | 1 - .../ListWebhookConsumersResponse.cs | 1 - .../Models/Operations/PathParamDataType.cs | 1 - .../Operations/RefreshCompanyDataRequest.cs | 1 - .../Operations/RefreshCompanyDataResponse.cs | 1 - .../RefreshCustomDataTypeRequest.cs | 1 - .../RefreshCustomDataTypeResponse.cs | 1 - .../Operations/RefreshDataTypeRequest.cs | 1 - .../Operations/RefreshDataTypeResponse.cs | 1 - .../RemoveCompanyFromGroupRequest.cs | 1 - .../RemoveCompanyFromGroupResponse.cs | 1 - ...onnectionManagementCorsSettingsResponse.cs | 1 - .../Operations/UnlinkConnectionRequest.cs | 1 - .../Operations/UnlinkConnectionResponse.cs | 1 - .../Models/Operations/UpdateCompanyRequest.cs | 1 - .../Operations/UpdateCompanyResponse.cs | 1 - .../UpdateConnectionAuthorizationRequest.cs | 1 - .../UpdateConnectionAuthorizationResponse.cs | 1 - .../Operations/UpdateProfileResponse.cs | 1 - .../UpdateProfileSyncSettingsRequestBody.cs | 1 - .../UpdateProfileSyncSettingsResponse.cs | 1 - .../Platform/Models/Shared/ApiKeyDetails.cs | 1 - .../Codat/Platform/Models/Shared/ApiKeys.cs | 1 - .../Codat/Platform/Models/Shared/Branding.cs | 1 - .../Platform/Models/Shared/BrandingButton.cs | 1 - .../Platform/Models/Shared/BrandingImage.cs | 1 - .../Platform/Models/Shared/BrandingLogo.cs | 1 - .../Shared/ClientRateLimitReachedWebhook.cs | 1 - .../ClientRateLimitReachedWebhookData.cs | 1 - .../Shared/ClientRateLimitResetWebhook.cs | 1 - .../Shared/ClientRateLimitResetWebhookData.cs | 1 - .../Codat/Platform/Models/Shared/Companies.cs | 1 - .../Codat/Platform/Models/Shared/Company.cs | 1 - .../Models/Shared/CompanyGroupAssignment.cs | 1 - .../Models/Shared/CompanyRequestBody.cs | 1 - .../Platform/Models/Shared/Connection.cs | 1 - .../Shared/ConnectionManagementAccessToken.cs | 1 - .../ConnectionManagementAllowedOrigins.cs | 1 - .../Shared/ConnectionStatusChangedWebhook.cs | 1 - .../ConnectionStatusChangedWebhookData.cs | 1 - .../Platform/Models/Shared/Connections.cs | 1 - .../Codat/Platform/Models/Shared/Content.cs | 1 - .../Platform/Models/Shared/CreateApiKey.cs | 1 - .../Platform/Models/Shared/CreateRule.cs | 1 - .../Shared/CustomDataTypeConfiguration.cs | 1 - .../Models/Shared/CustomDataTypeRecord.cs | 1 - .../Models/Shared/CustomDataTypeRecords.cs | 1 - .../Models/Shared/DataConnectionError.cs | 41 +- .../Models/Shared/DataConnectionStatus.cs | 1 - .../Platform/Models/Shared/DataStatus.cs | 1 - .../Platform/Models/Shared/DataStatuses.cs | 1 - .../Models/Shared/DataSyncCompletedWebhook.cs | 1 - .../Shared/DataSyncCompletedWebhookData.cs | 1 - .../Codat/Platform/Models/Shared/DataType.cs | 1 - .../Platform/Models/Shared/DataTypeFeature.cs | 1 - .../Codat/Platform/Models/Shared/DataTypes.cs | 1 - .../Shared/DatasetDataChangedWebhook.cs | 1 - .../Shared/DatasetDataChangedWebhookData.cs | 1 - .../Platform/Models/Shared/DatasetStatus.cs | 1 - .../DatasetStatusChangedErrorWebhook.cs | 1 - .../DatasetStatusChangedErrorWebhookData.cs | 1 - .../Platform/Models/Shared/ErrorStatus.cs | 60 +++ .../Platform/Models/Shared/ErrorValidation.cs | 1 - .../Models/Shared/ErrorValidationItem.cs | 1 - .../Platform/Models/Shared/FeatureState.cs | 1 - .../Platform/Models/Shared/FeatureType.cs | 1 - .../Codat/Platform/Models/Shared/Group.cs | 1 - .../Platform/Models/Shared/GroupPrototype.cs | 1 - .../Codat/Platform/Models/Shared/GroupRef.cs | 1 - .../Codat/Platform/Models/Shared/Groups.cs | 1 - .../Codat/Platform/Models/Shared/HalRef.cs | 1 - .../Platform/Models/Shared/ImageReference.cs | 1 - .../Platform/Models/Shared/Integration.cs | 1 - .../Platform/Models/Shared/Integrations.cs | 1 - .../Codat/Platform/Models/Shared/Links.cs | 1 - .../Platform/Models/Shared/ModifiedDate.cs | 1 - .../Shared/NewCompanySynchronizedWebhook.cs | 1 - .../NewCompanySynchronizedWebhookData.cs | 1 - .../Codat/Platform/Models/Shared/Profile.cs | 1 - .../Platform/Models/Shared/PullOperation.cs | 3 +- .../Platform/Models/Shared/PullOperations.cs | 1 - .../Platform/Models/Shared/PushChangeType.cs | 1 - .../Models/Shared/PushFieldValidation.cs | 1 - .../Platform/Models/Shared/PushOperation.cs | 1 - .../Models/Shared/PushOperationChange.cs | 1 - .../Models/Shared/PushOperationRef.cs | 1 - .../Models/Shared/PushOperationStatus.cs | 1 - .../PushOperationStatusChangedWebhook.cs | 1 - .../PushOperationStatusChangedWebhookData.cs | 1 - .../Shared/PushOperationTimedOutWebhook.cs | 1 - .../PushOperationTimedOutWebhookData.cs | 1 - .../Platform/Models/Shared/PushOperations.cs | 1 - .../Platform/Models/Shared/PushOption.cs | 1 - .../Models/Shared/PushOptionChoice.cs | 1 - .../Models/Shared/PushOptionProperty.cs | 1 - .../Platform/Models/Shared/PushOptionType.cs | 1 - .../Models/Shared/PushValidationInfo.cs | 1 - .../Platform/Models/Shared/SchemaDataType.cs | 1 - .../Codat/Platform/Models/Shared/Security.cs | 1 - .../Platform/Models/Shared/SourceType.cs | 1 - .../Codat/Platform/Models/Shared/Status.cs | 1 - .../Shared/SupplementalDataConfiguration.cs | 1 - .../SupplementalDataSourceConfiguration.cs | 1 - .../Models/Shared/SupportedFeature.cs | 1 - .../Platform/Models/Shared/SyncSetting.cs | 1 - .../Platform/Models/Shared/SyncSettings.cs | 1 - .../Models/Shared/UpdateConnectionStatus.cs | 1 - .../Platform/Models/Shared/Validation.cs | 1 - .../Platform/Models/Shared/ValidationItem.cs | 1 - .../Codat/Platform/Models/Shared/Webhook.cs | 1 - .../Platform/Models/Shared/WebhookConsumer.cs | 1 - .../Models/Shared/WebhookConsumerPrototype.cs | 1 - .../Models/Shared/WebhookConsumers.cs | 1 - .../Platform/Models/Shared/WebhookNotifier.cs | 1 - .../Codat/Platform/Models/Shared/Webhooks.cs | 1 - .../ClientRateLimitReachedResponse.cs | 1 - .../Webhooks/ClientRateLimitResetResponse.cs | 1 - ...panyDataConnectionStatusChangedResponse.cs | 1 - .../Webhooks/DataSyncCompletedResponse.cs | 1 - .../Webhooks/DatasetDataChangedResponse.cs | 1 - ...tStatusHasChangedToAnErrorStateResponse.cs | 1 - .../NewCompanySynchronizedResponse.cs | 1 - .../PushOperationHasTimedOutResponse.cs | 1 - .../PushOperationStatusHasChangedResponse.cs | 1 - platform/Codat/Platform/PushData.cs | 164 ++++++-- platform/Codat/Platform/RefreshData.cs | 264 +++++++++++-- platform/Codat/Platform/Settings.cs | 364 +++++++++++++++--- platform/Codat/Platform/SupplementalData.cs | 114 +++++- .../Codat/Platform/Utils/AnyDeserializer.cs | 1 - .../Platform/Utils/BigIntStrConverter.cs | 1 - .../Platform/Utils/DecimalStrConverter.cs | 1 - .../Codat/Platform/Utils/EnumConverter.cs | 3 +- .../Utils/FlexibleObjectDeserializer.cs | 1 - .../Codat/Platform/Utils/HeaderSerializer.cs | 1 - .../Platform/Utils/IsoDateTimeSerializer.cs | 1 - .../Platform/Utils/RequestBodySerializer.cs | 1 - .../Utils/ResponseBodyDeserializer.cs | 94 ++++- .../Platform/Utils/Retries/BackoffStrategy.cs | 47 +++ .../Codat/Platform/Utils/Retries/Retries.cs | 156 ++++++++ .../Platform/Utils/Retries/RetryConfig.cs | 46 +++ .../Codat/Platform/Utils/SecurityMetadata.cs | 1 - .../Platform/Utils/SpeakeasyHttpClient.cs | 64 ++- .../Codat/Platform/Utils/SpeakeasyMetadata.cs | 1 - platform/Codat/Platform/Utils/URLBuilder.cs | 18 +- platform/Codat/Platform/Utils/Utilities.cs | 1 - platform/Codat/Platform/Webhooks.cs | 323 +++++++++++++--- platform/NUGET.md | 185 +++++++++ platform/README.md | 71 +++- platform/RELEASES.md | 12 +- .../GetCompanyPushHistoryRequest.md | 2 +- .../Models/Operations/ListCompaniesRequest.md | 2 +- .../Operations/ListConnectionsRequest.md | 2 +- .../Operations/ListIntegrationsRequest.md | 2 +- .../Operations/ListPullOperationsRequest.md | 2 +- .../Models/Operations/ListRulesRequest.md | 2 +- .../docs/Models/Shared/DataConnectionError.md | 8 +- platform/docs/Models/Shared/ErrorStatus.md | 11 + platform/docs/Models/Shared/PullOperation.md | 2 +- platform/docs/sdks/companies/README.md | 1 + .../docs/sdks/connectionmanagement/README.md | 6 +- platform/docs/sdks/connections/README.md | 1 + platform/docs/sdks/corssettings/README.md | 8 +- platform/docs/sdks/integrations/README.md | 1 + platform/docs/sdks/pushdata/README.md | 1 + platform/docs/sdks/refreshdata/README.md | 1 + platform/docs/sdks/settings/README.md | 1 - platform/docs/sdks/webhooks/README.md | 6 +- platform/gen.yaml | 2 +- platform/global.json | 2 +- 248 files changed, 3016 insertions(+), 722 deletions(-) create mode 100644 platform/Codat/Platform/Models/Shared/ErrorStatus.cs create mode 100644 platform/Codat/Platform/Utils/Retries/BackoffStrategy.cs create mode 100644 platform/Codat/Platform/Utils/Retries/Retries.cs create mode 100644 platform/Codat/Platform/Utils/Retries/RetryConfig.cs create mode 100644 platform/NUGET.md create mode 100644 platform/docs/Models/Shared/ErrorStatus.md diff --git a/platform/.speakeasy/gen.lock b/platform/.speakeasy/gen.lock index 13ca20f22..d0e0e3fad 100755 --- a/platform/.speakeasy/gen.lock +++ b/platform/.speakeasy/gen.lock @@ -1,28 +1,34 @@ lockVersion: 2.0.0 id: 803b84ac-e26a-4a5c-9224-dbc3d0c7712a management: - docChecksum: 45c9274f0e3c7dac25b46ab3b4007b5f + docChecksum: ced98ff1180e32d5026f7d960a49babc docVersion: 3.0.0 - speakeasyVersion: 1.277.6 - generationVersion: 2.319.7 - releaseVersion: 3.6.1 - configChecksum: e1137e6a45616de97875384f08e19dd5 + speakeasyVersion: 1.330.0 + generationVersion: 2.361.10 + releaseVersion: 3.7.0 + configChecksum: e558689099753511014e0b28c07cb15e repoURL: https://github.com/codatio/client-sdk-csharp.git repoSubDirectory: platform published: true features: csharp: + additionalDependencies: 0.1.0 constsAndDefaults: 0.0.1 - core: 3.8.2 + core: 3.9.8 deprecations: 2.81.2 examples: 2.81.3 globalSecurity: 2.83.4 + globalSecurityCallbacks: 0.1.0 globalServerURLs: 2.82.3 groups: 2.81.2 ignores: 2.81.1 inputOutputModels: 2.83.0 + intellisenseMarkdownSupport: 0.1.0 nameOverrides: 2.81.2 - responseFormat: 0.0.2 + nullables: 0.1.0 + responseFormat: 0.0.4 + retries: 0.0.1 + sdkHooks: 0.1.0 webhooks: 1.0.0 generatedFiles: - Codat/Platform/Settings.cs @@ -49,6 +55,9 @@ generatedFiles: - Codat/Platform/Utils/IsoDateTimeSerializer.cs - Codat/Platform/Utils/RequestBodySerializer.cs - Codat/Platform/Utils/ResponseBodyDeserializer.cs + - Codat/Platform/Utils/Retries/BackoffStrategy.cs + - Codat/Platform/Utils/Retries/Retries.cs + - Codat/Platform/Utils/Retries/RetryConfig.cs - Codat/Platform/Utils/SecurityMetadata.cs - Codat/Platform/Utils/SpeakeasyHttpClient.cs - Codat/Platform/Utils/SpeakeasyMetadata.cs @@ -156,6 +165,7 @@ generatedFiles: - Codat/Platform/Models/Shared/Connection.cs - Codat/Platform/Models/Shared/DataConnectionStatus.cs - Codat/Platform/Models/Shared/SourceType.cs + - Codat/Platform/Models/Shared/ErrorStatus.cs - Codat/Platform/Models/Shared/DataConnectionError.cs - Codat/Platform/Models/Shared/CompanyRequestBody.cs - Codat/Platform/Models/Shared/Companies.cs @@ -345,6 +355,7 @@ generatedFiles: - docs/Models/Shared/Connection.md - docs/Models/Shared/DataConnectionStatus.md - docs/Models/Shared/SourceType.md + - docs/Models/Shared/ErrorStatus.md - docs/Models/Shared/DataConnectionError.md - docs/Models/Shared/CompanyRequestBody.md - docs/Models/Shared/Companies.md @@ -447,6 +458,7 @@ generatedFiles: - docs/sdks/integrations/README.md - docs/sdks/supplementaldata/README.md - docs/sdks/webhooks/README.md + - NUGET.md - USAGE.md - .gitattributes - Codat/Platform/Hooks/SDKHooks.cs diff --git a/platform/Codat/Platform/Codat.Platform.csproj b/platform/Codat/Platform/Codat.Platform.csproj index 076455482..376a06d90 100644 --- a/platform/Codat/Platform/Codat.Platform.csproj +++ b/platform/Codat/Platform/Codat.Platform.csproj @@ -2,7 +2,7 @@ true Codat.Platform - 3.6.1 + 3.7.0 Codat net6.0 enable @@ -13,8 +13,8 @@ - - + + diff --git a/platform/Codat/Platform/CodatPlatform.cs b/platform/Codat/Platform/CodatPlatform.cs index 59b5a6815..4f45e2ce8 100644 --- a/platform/Codat/Platform/CodatPlatform.cs +++ b/platform/Codat/Platform/CodatPlatform.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -13,6 +12,7 @@ namespace Codat.Platform using Codat.Platform.Hooks; using Codat.Platform.Models.Errors; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -64,7 +64,7 @@ public interface ICodatPlatform public ICompanies Companies { get; } /// - /// Configure connection management UI and retrieve access tokens for authentication. + /// Configure UI and retrieve access tokens for authentication used by **Connections SDK**. /// public IConnectionManagement ConnectionManagement { get; } @@ -120,7 +120,8 @@ public class SDKConfig public string ServerUrl = ""; public int ServerIndex = 0; - public SDKHooks hooks = new SDKHooks(); + public SDKHooks Hooks = new SDKHooks(); + public RetryConfig? RetryConfig = null; public string GetTemplatedServerUrl() { @@ -134,7 +135,7 @@ public string GetTemplatedServerUrl() public ISpeakeasyHttpClient InitHooks(ISpeakeasyHttpClient client) { string preHooksUrl = GetTemplatedServerUrl(); - var (postHooksUrl, postHooksClient) = this.hooks.SDKInit(preHooksUrl, client); + var (postHooksUrl, postHooksClient) = this.Hooks.SDKInit(preHooksUrl, client); if (preHooksUrl != postHooksUrl) { this.ServerUrl = postHooksUrl; @@ -178,13 +179,13 @@ public class CodatPlatform: ICodatPlatform public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; private int _serverIndex = 0; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; public ISettings Settings { get; private set; } public ICompanies Companies { get; private set; } @@ -198,7 +199,7 @@ public class CodatPlatform: ICodatPlatform public ISupplementalData SupplementalData { get; private set; } public IWebhooks Webhooks { get; private set; } - public CodatPlatform(Security? security = null, Func? securitySource = null, int? serverIndex = null, string? serverUrl = null, Dictionary? urlParams = null, ISpeakeasyHttpClient? client = null) + public CodatPlatform(Security? security = null, Func? securitySource = null, int? serverIndex = null, string? serverUrl = null, Dictionary? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null) { if (serverIndex != null) { @@ -218,7 +219,7 @@ public CodatPlatform(Security? security = null, Func? securitySource = _serverUrl = serverUrl; } - _defaultClient = new SpeakeasyHttpClient(client); + _client = client ?? new SpeakeasyHttpClient(); if(securitySource != null) { @@ -236,43 +237,44 @@ public CodatPlatform(Security? security = null, Func? securitySource = SDKConfiguration = new SDKConfig() { ServerIndex = _serverIndex, - ServerUrl = _serverUrl + ServerUrl = _serverUrl, + RetryConfig = retryConfig }; - _defaultClient = SDKConfiguration.InitHooks(_defaultClient); + _client = SDKConfiguration.InitHooks(_client); - Settings = new Settings(_defaultClient, _securitySource, _serverUrl, SDKConfiguration); + Settings = new Settings(_client, _securitySource, _serverUrl, SDKConfiguration); - Companies = new Companies(_defaultClient, _securitySource, _serverUrl, SDKConfiguration); + Companies = new Companies(_client, _securitySource, _serverUrl, SDKConfiguration); - ConnectionManagement = new ConnectionManagement(_defaultClient, _securitySource, _serverUrl, SDKConfiguration); + ConnectionManagement = new ConnectionManagement(_client, _securitySource, _serverUrl, SDKConfiguration); - Connections = new Connections(_defaultClient, _securitySource, _serverUrl, SDKConfiguration); + Connections = new Connections(_client, _securitySource, _serverUrl, SDKConfiguration); - CustomDataType = new CustomDataType(_defaultClient, _securitySource, _serverUrl, SDKConfiguration); + CustomDataType = new CustomDataType(_client, _securitySource, _serverUrl, SDKConfiguration); - PushData = new PushData(_defaultClient, _securitySource, _serverUrl, SDKConfiguration); + PushData = new PushData(_client, _securitySource, _serverUrl, SDKConfiguration); - RefreshData = new RefreshData(_defaultClient, _securitySource, _serverUrl, SDKConfiguration); + RefreshData = new RefreshData(_client, _securitySource, _serverUrl, SDKConfiguration); - Groups = new Groups(_defaultClient, _securitySource, _serverUrl, SDKConfiguration); + Groups = new Groups(_client, _securitySource, _serverUrl, SDKConfiguration); - Integrations = new Integrations(_defaultClient, _securitySource, _serverUrl, SDKConfiguration); + Integrations = new Integrations(_client, _securitySource, _serverUrl, SDKConfiguration); - SupplementalData = new SupplementalData(_defaultClient, _securitySource, _serverUrl, SDKConfiguration); + SupplementalData = new SupplementalData(_client, _securitySource, _serverUrl, SDKConfiguration); - Webhooks = new Webhooks(_defaultClient, _securitySource, _serverUrl, SDKConfiguration); + Webhooks = new Webhooks(_client, _securitySource, _serverUrl, SDKConfiguration); } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Companies.cs b/platform/Codat/Platform/Companies.cs index 4876a60e5..68c4c3323 100644 --- a/platform/Codat/Platform/Companies.cs +++ b/platform/Codat/Platform/Companies.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -14,6 +13,7 @@ namespace Codat.Platform using Codat.Platform.Models.Errors; using Codat.Platform.Models.Operations; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -40,7 +40,7 @@ public interface ICompanies /// If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. /// /// - Task CreateAsync(CompanyRequestBody? request = null); + Task CreateAsync(CompanyRequestBody? request = null, RetryConfig? retryConfig = null); /// /// Delete a company @@ -53,7 +53,7 @@ public interface ICompanies /// /// /// - Task DeleteAsync(DeleteCompanyRequest request); + Task DeleteAsync(DeleteCompanyRequest request, RetryConfig? retryConfig = null); /// /// Get company @@ -66,7 +66,7 @@ public interface ICompanies /// /// /// - Task GetAsync(GetCompanyRequest request); + Task GetAsync(GetCompanyRequest request, RetryConfig? retryConfig = null); /// /// List companies @@ -78,7 +78,7 @@ public interface ICompanies /// Each company can have multiple connections to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. /// /// - Task ListAsync(ListCompaniesRequest request); + Task ListAsync(ListCompaniesRequest request, RetryConfig? retryConfig = null); /// /// Update company @@ -91,7 +91,7 @@ public interface ICompanies /// Each company can have multiple connections to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. /// /// - Task UpdateAsync(UpdateCompanyRequest request); + Task UpdateAsync(UpdateCompanyRequest request, RetryConfig? retryConfig = null); } /// @@ -101,23 +101,23 @@ public class Companies: ICompanies { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; - public Companies(ISpeakeasyHttpClient defaultClient, Func? securitySource, string serverUrl, SDKConfig config) + public Companies(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) { - _defaultClient = defaultClient; + _client = client; _securitySource = securitySource; _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task CreateAsync(CompanyRequestBody? request = null) + public async Task CreateAsync(CompanyRequestBody? request = null, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -139,16 +139,52 @@ public async Task CreateAsync(CompanyRequestBody? request var hookCtx = new HookContext("create-company", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -157,7 +193,7 @@ public async Task CreateAsync(CompanyRequestBody? request } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -168,7 +204,7 @@ public async Task CreateAsync(CompanyRequestBody? request } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -213,7 +249,7 @@ public async Task CreateAsync(CompanyRequestBody? request } } - public async Task DeleteAsync(DeleteCompanyRequest request) + public async Task DeleteAsync(DeleteCompanyRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request); @@ -228,16 +264,52 @@ public async Task DeleteAsync(DeleteCompanyRequest reques var hookCtx = new HookContext("delete-company", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -246,7 +318,7 @@ public async Task DeleteAsync(DeleteCompanyRequest reques } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -257,7 +329,7 @@ public async Task DeleteAsync(DeleteCompanyRequest reques } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -292,7 +364,7 @@ public async Task DeleteAsync(DeleteCompanyRequest reques } } - public async Task GetAsync(GetCompanyRequest request) + public async Task GetAsync(GetCompanyRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request); @@ -307,16 +379,52 @@ public async Task GetAsync(GetCompanyRequest request) var hookCtx = new HookContext("get-company", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -325,7 +433,7 @@ public async Task GetAsync(GetCompanyRequest request) } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -336,7 +444,7 @@ public async Task GetAsync(GetCompanyRequest request) } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -381,7 +489,7 @@ public async Task GetAsync(GetCompanyRequest request) } } - public async Task ListAsync(ListCompaniesRequest request) + public async Task ListAsync(ListCompaniesRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies", request); @@ -396,16 +504,52 @@ public async Task ListAsync(ListCompaniesRequest request) var hookCtx = new HookContext("list-companies", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -414,7 +558,7 @@ public async Task ListAsync(ListCompaniesRequest request) } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -425,7 +569,7 @@ public async Task ListAsync(ListCompaniesRequest request) } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -470,7 +614,7 @@ public async Task ListAsync(ListCompaniesRequest request) } } - public async Task UpdateAsync(UpdateCompanyRequest request) + public async Task UpdateAsync(UpdateCompanyRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request); @@ -491,16 +635,52 @@ public async Task UpdateAsync(UpdateCompanyRequest reques var hookCtx = new HookContext("update-company", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -509,7 +689,7 @@ public async Task UpdateAsync(UpdateCompanyRequest reques } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -520,7 +700,7 @@ public async Task UpdateAsync(UpdateCompanyRequest reques } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; diff --git a/platform/Codat/Platform/ConnectionManagement.cs b/platform/Codat/Platform/ConnectionManagement.cs index 1fd2a1527..a4ecb6721 100644 --- a/platform/Codat/Platform/ConnectionManagement.cs +++ b/platform/Codat/Platform/ConnectionManagement.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -14,6 +13,7 @@ namespace Codat.Platform using Codat.Platform.Models.Errors; using Codat.Platform.Models.Operations; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -23,7 +23,7 @@ namespace Codat.Platform using System; /// - /// Configure connection management UI and retrieve access tokens for authentication. + /// Configure UI and retrieve access tokens for authentication used by **Connections SDK**. /// public interface IConnectionManagement { @@ -33,40 +33,40 @@ public interface IConnectionManagement /// Get access token /// /// - /// Use the *Get access token* endpoint to retrieve a new access token for use by the connection management UI. The token is only valid for one hour and applies to a single company.
+ /// Use the *Get access token* endpoint to retrieve a new access token for use with the Connections SDK. The token is only valid for one hour and applies to a single company.
///
- /// The embedded connection management UI lets your customers control access to their data by allowing them to manage their existing connections. + /// The embeddable Connections SDK lets your customers control access to their data by allowing them to manage their existing connections. ///
///
- Task GetAccessTokenAsync(GetConnectionManagementAccessTokenRequest request); + Task GetAccessTokenAsync(GetConnectionManagementAccessTokenRequest request, RetryConfig? retryConfig = null); } /// - /// Configure connection management UI and retrieve access tokens for authentication. + /// Configure UI and retrieve access tokens for authentication used by **Connections SDK**. /// public class ConnectionManagement: IConnectionManagement { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; public ICorsSettings CorsSettings { get; private set; } - public ConnectionManagement(ISpeakeasyHttpClient defaultClient, Func? securitySource, string serverUrl, SDKConfig config) + public ConnectionManagement(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) { - _defaultClient = defaultClient; + _client = client; _securitySource = securitySource; _serverUrl = serverUrl; SDKConfiguration = config; - CorsSettings = new CorsSettings(_defaultClient, _securitySource, _serverUrl, SDKConfiguration); + CorsSettings = new CorsSettings(_client, _securitySource, _serverUrl, SDKConfiguration); } - public async Task GetAccessTokenAsync(GetConnectionManagementAccessTokenRequest request) + public async Task GetAccessTokenAsync(GetConnectionManagementAccessTokenRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connectionManagement/accessToken", request); @@ -81,16 +81,52 @@ public async Task GetAccessTokenAsyn var hookCtx = new HookContext("get-connection-management-access-token", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -99,7 +135,7 @@ public async Task GetAccessTokenAsyn } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -110,7 +146,7 @@ public async Task GetAccessTokenAsyn } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; diff --git a/platform/Codat/Platform/Connections.cs b/platform/Codat/Platform/Connections.cs index 37c0e461c..06b3455ed 100644 --- a/platform/Codat/Platform/Connections.cs +++ b/platform/Codat/Platform/Connections.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -14,6 +13,7 @@ namespace Codat.Platform using Codat.Platform.Models.Errors; using Codat.Platform.Models.Operations; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -37,7 +37,7 @@ public interface IConnections /// Use the List Integrations endpoint to access valid platform keys. /// /// - Task CreateAsync(CreateConnectionRequest request); + Task CreateAsync(CreateConnectionRequest request, RetryConfig? retryConfig = null); /// /// Delete connection @@ -47,7 +47,7 @@ public interface IConnections /// This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. /// /// - Task DeleteAsync(DeleteConnectionRequest request); + Task DeleteAsync(DeleteConnectionRequest request, RetryConfig? retryConfig = null); /// /// Get connection @@ -56,7 +56,7 @@ public interface IConnections /// Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. /// /// - Task GetAsync(GetConnectionRequest request); + Task GetAsync(GetConnectionRequest request, RetryConfig? retryConfig = null); /// /// List connections @@ -65,7 +65,7 @@ public interface IConnections /// List the connections for a company. /// /// - Task ListAsync(ListConnectionsRequest request); + Task ListAsync(ListConnectionsRequest request, RetryConfig? retryConfig = null); /// /// Unlink connection @@ -74,7 +74,7 @@ public interface IConnections /// This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. /// /// - Task UnlinkAsync(UnlinkConnectionRequest request); + Task UnlinkAsync(UnlinkConnectionRequest request, RetryConfig? retryConfig = null); /// /// Update authorization @@ -83,7 +83,7 @@ public interface IConnections /// Update data connection's authorization. /// /// - Task UpdateAuthorizationAsync(UpdateConnectionAuthorizationRequest request); + Task UpdateAuthorizationAsync(UpdateConnectionAuthorizationRequest request, RetryConfig? retryConfig = null); } /// @@ -93,23 +93,23 @@ public class Connections: IConnections { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; - public Connections(ISpeakeasyHttpClient defaultClient, Func? securitySource, string serverUrl, SDKConfig config) + public Connections(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) { - _defaultClient = defaultClient; + _client = client; _securitySource = securitySource; _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task CreateAsync(CreateConnectionRequest request) + public async Task CreateAsync(CreateConnectionRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections", request); @@ -130,16 +130,52 @@ public async Task CreateAsync(CreateConnectionRequest var hookCtx = new HookContext("create-connection", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -148,7 +184,7 @@ public async Task CreateAsync(CreateConnectionRequest } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -159,7 +195,7 @@ public async Task CreateAsync(CreateConnectionRequest } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -204,7 +240,7 @@ public async Task CreateAsync(CreateConnectionRequest } } - public async Task DeleteAsync(DeleteConnectionRequest request) + public async Task DeleteAsync(DeleteConnectionRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}", request); @@ -219,16 +255,52 @@ public async Task DeleteAsync(DeleteConnectionRequest var hookCtx = new HookContext("delete-connection", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -237,7 +309,7 @@ public async Task DeleteAsync(DeleteConnectionRequest } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -248,7 +320,7 @@ public async Task DeleteAsync(DeleteConnectionRequest } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -283,7 +355,7 @@ public async Task DeleteAsync(DeleteConnectionRequest } } - public async Task GetAsync(GetConnectionRequest request) + public async Task GetAsync(GetConnectionRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}", request); @@ -298,16 +370,52 @@ public async Task GetAsync(GetConnectionRequest request) var hookCtx = new HookContext("get-connection", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -316,7 +424,7 @@ public async Task GetAsync(GetConnectionRequest request) } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -327,7 +435,7 @@ public async Task GetAsync(GetConnectionRequest request) } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -372,7 +480,7 @@ public async Task GetAsync(GetConnectionRequest request) } } - public async Task ListAsync(ListConnectionsRequest request) + public async Task ListAsync(ListConnectionsRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections", request); @@ -387,16 +495,52 @@ public async Task ListAsync(ListConnectionsRequest requ var hookCtx = new HookContext("list-connections", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -405,7 +549,7 @@ public async Task ListAsync(ListConnectionsRequest requ } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -416,7 +560,7 @@ public async Task ListAsync(ListConnectionsRequest requ } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -461,7 +605,7 @@ public async Task ListAsync(ListConnectionsRequest requ } } - public async Task UnlinkAsync(UnlinkConnectionRequest request) + public async Task UnlinkAsync(UnlinkConnectionRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}", request); @@ -482,16 +626,52 @@ public async Task UnlinkAsync(UnlinkConnectionRequest var hookCtx = new HookContext("unlink-connection", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -500,7 +680,7 @@ public async Task UnlinkAsync(UnlinkConnectionRequest } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -511,7 +691,7 @@ public async Task UnlinkAsync(UnlinkConnectionRequest } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -556,7 +736,7 @@ public async Task UnlinkAsync(UnlinkConnectionRequest } } - public async Task UpdateAuthorizationAsync(UpdateConnectionAuthorizationRequest request) + public async Task UpdateAuthorizationAsync(UpdateConnectionAuthorizationRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/authorization", request); @@ -577,16 +757,52 @@ public async Task UpdateAuthorizationAsyn var hookCtx = new HookContext("update-connection-authorization", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -595,7 +811,7 @@ public async Task UpdateAuthorizationAsyn } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -606,7 +822,7 @@ public async Task UpdateAuthorizationAsyn } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; diff --git a/platform/Codat/Platform/CorsSettings.cs b/platform/Codat/Platform/CorsSettings.cs index 6a1e70471..372d254b4 100644 --- a/platform/Codat/Platform/CorsSettings.cs +++ b/platform/Codat/Platform/CorsSettings.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -14,6 +13,7 @@ namespace Codat.Platform using Codat.Platform.Models.Errors; using Codat.Platform.Models.Operations; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -31,12 +31,12 @@ public interface ICorsSettings /// /// The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing (CORS) with Codat.
///
- /// Enabling CORS with Codat is required by our embedded connection management UI to access Codat's API endpoints.
+ /// Enabling CORS with Codat is required by our embeddable Connections SDK to access Codat's API endpoints.
///
- /// The embedded connection management UI lets your customers control access to their data by allowing them to manage their existing connections. + /// The embeddable Connections SDK lets your customers control access to their data by allowing them to manage their existing connections. ///
///
- Task GetAsync(); + Task GetAsync(RetryConfig? retryConfig = null); /// /// Set CORS settings @@ -44,35 +44,35 @@ public interface ICorsSettings /// /// The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing (CORS).
///
- /// Enabling CORS with Codat is required by our embedded connection management UI to access Codat's API endpoints.
+ /// Enabling CORS with Codat is required by our embeddable Connections SDK to access Codat's API endpoints.
///
- /// The embedded connection management UI lets your customers control access to their data by allowing them to manage their existing connections. + /// The embeddable Connections SDK lets your customers control access to their data by allowing them to manage their existing connections. ///
///
- Task SetAsync(ConnectionManagementAllowedOrigins? request = null); + Task SetAsync(ConnectionManagementAllowedOrigins? request = null, RetryConfig? retryConfig = null); } public class CorsSettings: ICorsSettings { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; - public CorsSettings(ISpeakeasyHttpClient defaultClient, Func? securitySource, string serverUrl, SDKConfig config) + public CorsSettings(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) { - _defaultClient = defaultClient; + _client = client; _securitySource = securitySource; _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task GetAsync() + public async Task GetAsync(RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -88,16 +88,52 @@ public async Task GetAsync() var hookCtx = new HookContext("get-connection-management-cors-settings", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -106,7 +142,7 @@ public async Task GetAsync() } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -117,7 +153,7 @@ public async Task GetAsync() } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -162,7 +198,7 @@ public async Task GetAsync() } } - public async Task SetAsync(ConnectionManagementAllowedOrigins? request = null) + public async Task SetAsync(ConnectionManagementAllowedOrigins? request = null, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -184,16 +220,52 @@ public async Task SetAsync(Connecti var hookCtx = new HookContext("set-connection-management-cors-settings", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -202,7 +274,7 @@ public async Task SetAsync(Connecti } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -213,7 +285,7 @@ public async Task SetAsync(Connecti } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; diff --git a/platform/Codat/Platform/CustomDataType.cs b/platform/Codat/Platform/CustomDataType.cs index 1ec87a334..a9e6f0d81 100644 --- a/platform/Codat/Platform/CustomDataType.cs +++ b/platform/Codat/Platform/CustomDataType.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -14,6 +13,7 @@ namespace Codat.Platform using Codat.Platform.Models.Errors; using Codat.Platform.Models.Operations; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -45,7 +45,7 @@ public interface ICustomDataType /// - Make your custom configuration as similar as possible to our standard data types so you can interact with them in exactly the same way. /// /// - Task ConfigureAsync(ConfigureCustomDataTypeRequest request); + Task ConfigureAsync(ConfigureCustomDataTypeRequest request, RetryConfig? retryConfig = null); /// /// Get custom data configuration @@ -56,7 +56,7 @@ public interface ICustomDataType /// A custom data type is an additional data type you can create that is not included in Codat's standardized data model. /// /// - Task GetConfigurationAsync(GetCustomDataTypeConfigurationRequest request); + Task GetConfigurationAsync(GetCustomDataTypeConfigurationRequest request, RetryConfig? retryConfig = null); /// /// List custom data type records @@ -67,7 +67,7 @@ public interface ICustomDataType /// A custom data type is an additional data type you can create that is not included in Codat's standardized data model.s endpoint returns a paginated list of records whose schema is defined Configure custom data type /// /// - Task ListAsync(ListCustomDataTypeRecordsRequest request); + Task ListAsync(ListCustomDataTypeRecordsRequest request, RetryConfig? retryConfig = null); /// /// Refresh custom data type @@ -76,7 +76,7 @@ public interface ICustomDataType /// The *Refresh custom data type* endpoint refreshes the specified custom data type for a given company. This is an asynchronous operation that will sync updated data from the linked integration into Codat for you to view. /// /// - Task RefreshAsync(RefreshCustomDataTypeRequest request); + Task RefreshAsync(RefreshCustomDataTypeRequest request, RetryConfig? retryConfig = null); } /// @@ -86,23 +86,23 @@ public class CustomDataType: ICustomDataType { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; - public CustomDataType(ISpeakeasyHttpClient defaultClient, Func? securitySource, string serverUrl, SDKConfig config) + public CustomDataType(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) { - _defaultClient = defaultClient; + _client = client; _securitySource = securitySource; _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task ConfigureAsync(ConfigureCustomDataTypeRequest request) + public async Task ConfigureAsync(ConfigureCustomDataTypeRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}", request); @@ -123,16 +123,52 @@ public async Task ConfigureAsync(ConfigureCusto var hookCtx = new HookContext("configure-custom-data-type", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -141,7 +177,7 @@ public async Task ConfigureAsync(ConfigureCusto } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -152,7 +188,7 @@ public async Task ConfigureAsync(ConfigureCusto } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -197,7 +233,7 @@ public async Task ConfigureAsync(ConfigureCusto } } - public async Task GetConfigurationAsync(GetCustomDataTypeConfigurationRequest request) + public async Task GetConfigurationAsync(GetCustomDataTypeConfigurationRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}", request); @@ -212,16 +248,52 @@ public async Task GetConfigurationAsync( var hookCtx = new HookContext("get-custom-data-type-configuration", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -230,7 +302,7 @@ public async Task GetConfigurationAsync( } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -241,7 +313,7 @@ public async Task GetConfigurationAsync( } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -286,7 +358,7 @@ public async Task GetConfigurationAsync( } } - public async Task ListAsync(ListCustomDataTypeRecordsRequest request) + public async Task ListAsync(ListCustomDataTypeRecordsRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/custom/{customDataIdentifier}", request); @@ -301,16 +373,52 @@ public async Task ListAsync(ListCustomDataTyp var hookCtx = new HookContext("list-custom-data-type-records", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode == 451 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -319,7 +427,7 @@ public async Task ListAsync(ListCustomDataTyp } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -330,7 +438,7 @@ public async Task ListAsync(ListCustomDataTyp } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -375,7 +483,7 @@ public async Task ListAsync(ListCustomDataTyp } } - public async Task RefreshAsync(RefreshCustomDataTypeRequest request) + public async Task RefreshAsync(RefreshCustomDataTypeRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/queue/custom/{customDataIdentifier}", request); @@ -390,16 +498,52 @@ public async Task RefreshAsync(RefreshCustomDataT var hookCtx = new HookContext("refresh-custom-data-type", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode == 451 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -408,7 +552,7 @@ public async Task RefreshAsync(RefreshCustomDataT } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -419,7 +563,7 @@ public async Task RefreshAsync(RefreshCustomDataT } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; diff --git a/platform/Codat/Platform/Groups.cs b/platform/Codat/Platform/Groups.cs index 1672c5b90..67e278eea 100644 --- a/platform/Codat/Platform/Groups.cs +++ b/platform/Codat/Platform/Groups.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -14,6 +13,7 @@ namespace Codat.Platform using Codat.Platform.Models.Errors; using Codat.Platform.Models.Operations; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -37,7 +37,7 @@ public interface IGroups /// Groups define a set of companies that are organized based on a chosen characteristic and can be managed in the same way. /// /// - Task AddCompanyAsync(AddCompanyToGroupRequest request); + Task AddCompanyAsync(AddCompanyToGroupRequest request, RetryConfig? retryConfig = null); /// /// Create group @@ -53,7 +53,7 @@ public interface IGroups /// * It's possible to create up to 20 groups per client. /// /// - Task CreateAsync(GroupPrototype? request = null); + Task CreateAsync(GroupPrototype? request = null, RetryConfig? retryConfig = null); /// /// List groups @@ -64,7 +64,7 @@ public interface IGroups /// Groups define a set of companies that are organized based on a chosen characteristic and can be managed in the same way. /// /// - Task ListAsync(); + Task ListAsync(RetryConfig? retryConfig = null); /// /// Remove company @@ -75,7 +75,7 @@ public interface IGroups /// Groups define a set of companies that are organized based on a chosen characteristic and can be managed in the same way. /// /// - Task RemoveCompanyAsync(RemoveCompanyFromGroupRequest request); + Task RemoveCompanyAsync(RemoveCompanyFromGroupRequest request, RetryConfig? retryConfig = null); } /// @@ -85,23 +85,23 @@ public class Groups: IGroups { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; - public Groups(ISpeakeasyHttpClient defaultClient, Func? securitySource, string serverUrl, SDKConfig config) + public Groups(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) { - _defaultClient = defaultClient; + _client = client; _securitySource = securitySource; _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task AddCompanyAsync(AddCompanyToGroupRequest request) + public async Task AddCompanyAsync(AddCompanyToGroupRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/groups", request); @@ -122,16 +122,52 @@ public async Task AddCompanyAsync(AddCompanyToGroupRe var hookCtx = new HookContext("add-company-to-group", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -140,7 +176,7 @@ public async Task AddCompanyAsync(AddCompanyToGroupRe } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -151,7 +187,7 @@ public async Task AddCompanyAsync(AddCompanyToGroupRe } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -196,7 +232,7 @@ public async Task AddCompanyAsync(AddCompanyToGroupRe } } - public async Task CreateAsync(GroupPrototype? request = null) + public async Task CreateAsync(GroupPrototype? request = null, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -218,16 +254,52 @@ public async Task CreateAsync(GroupPrototype? request = nul var hookCtx = new HookContext("create-group", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 409 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -236,7 +308,7 @@ public async Task CreateAsync(GroupPrototype? request = nul } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -247,7 +319,7 @@ public async Task CreateAsync(GroupPrototype? request = nul } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -292,7 +364,7 @@ public async Task CreateAsync(GroupPrototype? request = nul } } - public async Task ListAsync() + public async Task ListAsync(RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -308,16 +380,52 @@ public async Task ListAsync() var hookCtx = new HookContext("list-groups", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -326,7 +434,7 @@ public async Task ListAsync() } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -337,7 +445,7 @@ public async Task ListAsync() } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -382,7 +490,7 @@ public async Task ListAsync() } } - public async Task RemoveCompanyAsync(RemoveCompanyFromGroupRequest request) + public async Task RemoveCompanyAsync(RemoveCompanyFromGroupRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/groups/{groupId}", request); @@ -397,16 +505,52 @@ public async Task RemoveCompanyAsync(RemoveCompa var hookCtx = new HookContext("remove-company-from-group", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -415,7 +559,7 @@ public async Task RemoveCompanyAsync(RemoveCompa } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -426,7 +570,7 @@ public async Task RemoveCompanyAsync(RemoveCompa } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; diff --git a/platform/Codat/Platform/Hooks/HookTypes.cs b/platform/Codat/Platform/Hooks/HookTypes.cs index 3e0d02c8d..1ea862b01 100644 --- a/platform/Codat/Platform/Hooks/HookTypes.cs +++ b/platform/Codat/Platform/Hooks/HookTypes.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Hooks/SDKHooks.cs b/platform/Codat/Platform/Hooks/SDKHooks.cs index 300efe494..6b0642f97 100644 --- a/platform/Codat/Platform/Hooks/SDKHooks.cs +++ b/platform/Codat/Platform/Hooks/SDKHooks.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Integrations.cs b/platform/Codat/Platform/Integrations.cs index e6626f867..b7f6ad735 100644 --- a/platform/Codat/Platform/Integrations.cs +++ b/platform/Codat/Platform/Integrations.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -14,6 +13,7 @@ namespace Codat.Platform using Codat.Platform.Models.Errors; using Codat.Platform.Models.Operations; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -35,7 +35,7 @@ public interface IIntegrations /// Get single integration, by platformKey /// /// - Task GetAsync(GetIntegrationRequest request); + Task GetAsync(GetIntegrationRequest request, RetryConfig? retryConfig = null); /// /// Get branding @@ -44,7 +44,7 @@ public interface IIntegrations /// Get branding for platform. /// /// - Task GetBrandingAsync(GetIntegrationsBrandingRequest request); + Task GetBrandingAsync(GetIntegrationsBrandingRequest request, RetryConfig? retryConfig = null); /// /// List integrations @@ -53,7 +53,7 @@ public interface IIntegrations /// List your available integrations /// /// - Task ListAsync(ListIntegrationsRequest request); + Task ListAsync(ListIntegrationsRequest request, RetryConfig? retryConfig = null); } /// @@ -63,23 +63,23 @@ public class Integrations: IIntegrations { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; - public Integrations(ISpeakeasyHttpClient defaultClient, Func? securitySource, string serverUrl, SDKConfig config) + public Integrations(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) { - _defaultClient = defaultClient; + _client = client; _securitySource = securitySource; _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task GetAsync(GetIntegrationRequest request) + public async Task GetAsync(GetIntegrationRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/integrations/{platformKey}", request); @@ -94,16 +94,52 @@ public async Task GetAsync(GetIntegrationRequest request var hookCtx = new HookContext("get-integration", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -112,7 +148,7 @@ public async Task GetAsync(GetIntegrationRequest request } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -123,7 +159,7 @@ public async Task GetAsync(GetIntegrationRequest request } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -168,7 +204,7 @@ public async Task GetAsync(GetIntegrationRequest request } } - public async Task GetBrandingAsync(GetIntegrationsBrandingRequest request) + public async Task GetBrandingAsync(GetIntegrationsBrandingRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/integrations/{platformKey}/branding", request); @@ -183,16 +219,52 @@ public async Task GetBrandingAsync(GetIntegrati var hookCtx = new HookContext("get-integrations-branding", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -201,7 +273,7 @@ public async Task GetBrandingAsync(GetIntegrati } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -212,7 +284,7 @@ public async Task GetBrandingAsync(GetIntegrati } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -257,7 +329,7 @@ public async Task GetBrandingAsync(GetIntegrati } } - public async Task ListAsync(ListIntegrationsRequest request) + public async Task ListAsync(ListIntegrationsRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/integrations", request); @@ -272,16 +344,52 @@ public async Task ListAsync(ListIntegrationsRequest re var hookCtx = new HookContext("list-integrations", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -290,7 +398,7 @@ public async Task ListAsync(ListIntegrationsRequest re } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -301,7 +409,7 @@ public async Task ListAsync(ListIntegrationsRequest re } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; diff --git a/platform/Codat/Platform/Models/Errors/ErrorMessage.cs b/platform/Codat/Platform/Models/Errors/ErrorMessage.cs index 4ff7ad45e..eafa05286 100644 --- a/platform/Codat/Platform/Models/Errors/ErrorMessage.cs +++ b/platform/Codat/Platform/Models/Errors/ErrorMessage.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Errors/SDKException.cs b/platform/Codat/Platform/Models/Errors/SDKException.cs index 2b07da1fa..dcbef01f3 100644 --- a/platform/Codat/Platform/Models/Errors/SDKException.cs +++ b/platform/Codat/Platform/Models/Errors/SDKException.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/AddCompanyToGroupRequest.cs b/platform/Codat/Platform/Models/Operations/AddCompanyToGroupRequest.cs index ea5a17f08..83088b80b 100644 --- a/platform/Codat/Platform/Models/Operations/AddCompanyToGroupRequest.cs +++ b/platform/Codat/Platform/Models/Operations/AddCompanyToGroupRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/AddCompanyToGroupResponse.cs b/platform/Codat/Platform/Models/Operations/AddCompanyToGroupResponse.cs index f5fc6d6d0..5056de65a 100644 --- a/platform/Codat/Platform/Models/Operations/AddCompanyToGroupResponse.cs +++ b/platform/Codat/Platform/Models/Operations/AddCompanyToGroupResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ConfigureCustomDataTypeRequest.cs b/platform/Codat/Platform/Models/Operations/ConfigureCustomDataTypeRequest.cs index 879e0dd22..2f1bf9df8 100644 --- a/platform/Codat/Platform/Models/Operations/ConfigureCustomDataTypeRequest.cs +++ b/platform/Codat/Platform/Models/Operations/ConfigureCustomDataTypeRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ConfigureCustomDataTypeResponse.cs b/platform/Codat/Platform/Models/Operations/ConfigureCustomDataTypeResponse.cs index 1482fcb43..157c5a554 100644 --- a/platform/Codat/Platform/Models/Operations/ConfigureCustomDataTypeResponse.cs +++ b/platform/Codat/Platform/Models/Operations/ConfigureCustomDataTypeResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ConfigureSupplementalDataRequest.cs b/platform/Codat/Platform/Models/Operations/ConfigureSupplementalDataRequest.cs index 707d731c8..6c109f255 100644 --- a/platform/Codat/Platform/Models/Operations/ConfigureSupplementalDataRequest.cs +++ b/platform/Codat/Platform/Models/Operations/ConfigureSupplementalDataRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ConfigureSupplementalDataResponse.cs b/platform/Codat/Platform/Models/Operations/ConfigureSupplementalDataResponse.cs index 1816f77cd..36311405d 100644 --- a/platform/Codat/Platform/Models/Operations/ConfigureSupplementalDataResponse.cs +++ b/platform/Codat/Platform/Models/Operations/ConfigureSupplementalDataResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/CreateApiKeyResponse.cs b/platform/Codat/Platform/Models/Operations/CreateApiKeyResponse.cs index eb29e68b7..3ed343ca2 100644 --- a/platform/Codat/Platform/Models/Operations/CreateApiKeyResponse.cs +++ b/platform/Codat/Platform/Models/Operations/CreateApiKeyResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/CreateCompanyResponse.cs b/platform/Codat/Platform/Models/Operations/CreateCompanyResponse.cs index ca4721f1e..801391f66 100644 --- a/platform/Codat/Platform/Models/Operations/CreateCompanyResponse.cs +++ b/platform/Codat/Platform/Models/Operations/CreateCompanyResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/CreateConnectionRequest.cs b/platform/Codat/Platform/Models/Operations/CreateConnectionRequest.cs index 348883c1f..c4456adfe 100644 --- a/platform/Codat/Platform/Models/Operations/CreateConnectionRequest.cs +++ b/platform/Codat/Platform/Models/Operations/CreateConnectionRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/CreateConnectionRequestBody.cs b/platform/Codat/Platform/Models/Operations/CreateConnectionRequestBody.cs index cc787972a..6804c0b7a 100644 --- a/platform/Codat/Platform/Models/Operations/CreateConnectionRequestBody.cs +++ b/platform/Codat/Platform/Models/Operations/CreateConnectionRequestBody.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/CreateConnectionResponse.cs b/platform/Codat/Platform/Models/Operations/CreateConnectionResponse.cs index 5a92d45a7..d5e04ee35 100644 --- a/platform/Codat/Platform/Models/Operations/CreateConnectionResponse.cs +++ b/platform/Codat/Platform/Models/Operations/CreateConnectionResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/CreateGroupResponse.cs b/platform/Codat/Platform/Models/Operations/CreateGroupResponse.cs index 007eb8b31..951ee8ec4 100644 --- a/platform/Codat/Platform/Models/Operations/CreateGroupResponse.cs +++ b/platform/Codat/Platform/Models/Operations/CreateGroupResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/CreateRuleResponse.cs b/platform/Codat/Platform/Models/Operations/CreateRuleResponse.cs index 2c3e00f61..397a64b4a 100644 --- a/platform/Codat/Platform/Models/Operations/CreateRuleResponse.cs +++ b/platform/Codat/Platform/Models/Operations/CreateRuleResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/CreateWebhookConsumerResponse.cs b/platform/Codat/Platform/Models/Operations/CreateWebhookConsumerResponse.cs index 45ad246d8..05c1a7088 100644 --- a/platform/Codat/Platform/Models/Operations/CreateWebhookConsumerResponse.cs +++ b/platform/Codat/Platform/Models/Operations/CreateWebhookConsumerResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/DataType.cs b/platform/Codat/Platform/Models/Operations/DataType.cs index 105709263..d977a8060 100644 --- a/platform/Codat/Platform/Models/Operations/DataType.cs +++ b/platform/Codat/Platform/Models/Operations/DataType.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/DeleteApiKeyRequest.cs b/platform/Codat/Platform/Models/Operations/DeleteApiKeyRequest.cs index a6a280da9..c0170036f 100644 --- a/platform/Codat/Platform/Models/Operations/DeleteApiKeyRequest.cs +++ b/platform/Codat/Platform/Models/Operations/DeleteApiKeyRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/DeleteApiKeyResponse.cs b/platform/Codat/Platform/Models/Operations/DeleteApiKeyResponse.cs index c1d7f7167..5499ce697 100644 --- a/platform/Codat/Platform/Models/Operations/DeleteApiKeyResponse.cs +++ b/platform/Codat/Platform/Models/Operations/DeleteApiKeyResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/DeleteCompanyRequest.cs b/platform/Codat/Platform/Models/Operations/DeleteCompanyRequest.cs index 3e27cd8b0..73a3f1fbc 100644 --- a/platform/Codat/Platform/Models/Operations/DeleteCompanyRequest.cs +++ b/platform/Codat/Platform/Models/Operations/DeleteCompanyRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/DeleteCompanyResponse.cs b/platform/Codat/Platform/Models/Operations/DeleteCompanyResponse.cs index b65bf44cb..9c6d516fa 100644 --- a/platform/Codat/Platform/Models/Operations/DeleteCompanyResponse.cs +++ b/platform/Codat/Platform/Models/Operations/DeleteCompanyResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/DeleteConnectionRequest.cs b/platform/Codat/Platform/Models/Operations/DeleteConnectionRequest.cs index 92bcc549e..85d9db003 100644 --- a/platform/Codat/Platform/Models/Operations/DeleteConnectionRequest.cs +++ b/platform/Codat/Platform/Models/Operations/DeleteConnectionRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/DeleteConnectionResponse.cs b/platform/Codat/Platform/Models/Operations/DeleteConnectionResponse.cs index 3b4430e4c..78cbcbfeb 100644 --- a/platform/Codat/Platform/Models/Operations/DeleteConnectionResponse.cs +++ b/platform/Codat/Platform/Models/Operations/DeleteConnectionResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/DeleteWebhookConsumerRequest.cs b/platform/Codat/Platform/Models/Operations/DeleteWebhookConsumerRequest.cs index 6ed685821..6e5a35c69 100644 --- a/platform/Codat/Platform/Models/Operations/DeleteWebhookConsumerRequest.cs +++ b/platform/Codat/Platform/Models/Operations/DeleteWebhookConsumerRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/DeleteWebhookConsumerResponse.cs b/platform/Codat/Platform/Models/Operations/DeleteWebhookConsumerResponse.cs index f8a272926..ed98d6cd7 100644 --- a/platform/Codat/Platform/Models/Operations/DeleteWebhookConsumerResponse.cs +++ b/platform/Codat/Platform/Models/Operations/DeleteWebhookConsumerResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetCompanyDataStatusRequest.cs b/platform/Codat/Platform/Models/Operations/GetCompanyDataStatusRequest.cs index b196ea192..6df892f62 100644 --- a/platform/Codat/Platform/Models/Operations/GetCompanyDataStatusRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetCompanyDataStatusRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetCompanyDataStatusResponse.cs b/platform/Codat/Platform/Models/Operations/GetCompanyDataStatusResponse.cs index 3241145ef..4037f4638 100644 --- a/platform/Codat/Platform/Models/Operations/GetCompanyDataStatusResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetCompanyDataStatusResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetCompanyPushHistoryRequest.cs b/platform/Codat/Platform/Models/Operations/GetCompanyPushHistoryRequest.cs index b39025fba..b1eb2eee5 100644 --- a/platform/Codat/Platform/Models/Operations/GetCompanyPushHistoryRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetCompanyPushHistoryRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetCompanyPushHistoryResponse.cs b/platform/Codat/Platform/Models/Operations/GetCompanyPushHistoryResponse.cs index 8183cc9d0..96eba542c 100644 --- a/platform/Codat/Platform/Models/Operations/GetCompanyPushHistoryResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetCompanyPushHistoryResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetCompanyRequest.cs b/platform/Codat/Platform/Models/Operations/GetCompanyRequest.cs index 4169b19cc..f1030ce78 100644 --- a/platform/Codat/Platform/Models/Operations/GetCompanyRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetCompanyRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetCompanyResponse.cs b/platform/Codat/Platform/Models/Operations/GetCompanyResponse.cs index e916e835b..fefeb6038 100644 --- a/platform/Codat/Platform/Models/Operations/GetCompanyResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetCompanyResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetConnectionManagementAccessTokenRequest.cs b/platform/Codat/Platform/Models/Operations/GetConnectionManagementAccessTokenRequest.cs index ae783af84..660a028d7 100644 --- a/platform/Codat/Platform/Models/Operations/GetConnectionManagementAccessTokenRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetConnectionManagementAccessTokenRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetConnectionManagementAccessTokenResponse.cs b/platform/Codat/Platform/Models/Operations/GetConnectionManagementAccessTokenResponse.cs index 56587d53b..c8ffb5883 100644 --- a/platform/Codat/Platform/Models/Operations/GetConnectionManagementAccessTokenResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetConnectionManagementAccessTokenResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetConnectionManagementCorsSettingsResponse.cs b/platform/Codat/Platform/Models/Operations/GetConnectionManagementCorsSettingsResponse.cs index dd8e656ab..accec701c 100644 --- a/platform/Codat/Platform/Models/Operations/GetConnectionManagementCorsSettingsResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetConnectionManagementCorsSettingsResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetConnectionRequest.cs b/platform/Codat/Platform/Models/Operations/GetConnectionRequest.cs index 76296bb9f..fb877a536 100644 --- a/platform/Codat/Platform/Models/Operations/GetConnectionRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetConnectionRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetConnectionResponse.cs b/platform/Codat/Platform/Models/Operations/GetConnectionResponse.cs index 367f014af..9fae1ca7d 100644 --- a/platform/Codat/Platform/Models/Operations/GetConnectionResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetConnectionResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetCreateUpdateModelOptionsByDataTypeRequest.cs b/platform/Codat/Platform/Models/Operations/GetCreateUpdateModelOptionsByDataTypeRequest.cs index 8a29c41fa..6ff4bc140 100644 --- a/platform/Codat/Platform/Models/Operations/GetCreateUpdateModelOptionsByDataTypeRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetCreateUpdateModelOptionsByDataTypeRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetCreateUpdateModelOptionsByDataTypeResponse.cs b/platform/Codat/Platform/Models/Operations/GetCreateUpdateModelOptionsByDataTypeResponse.cs index f4c9a4257..1e14486cf 100644 --- a/platform/Codat/Platform/Models/Operations/GetCreateUpdateModelOptionsByDataTypeResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetCreateUpdateModelOptionsByDataTypeResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetCustomDataTypeConfigurationRequest.cs b/platform/Codat/Platform/Models/Operations/GetCustomDataTypeConfigurationRequest.cs index 8aa11659e..b6b182065 100644 --- a/platform/Codat/Platform/Models/Operations/GetCustomDataTypeConfigurationRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetCustomDataTypeConfigurationRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetCustomDataTypeConfigurationResponse.cs b/platform/Codat/Platform/Models/Operations/GetCustomDataTypeConfigurationResponse.cs index a32b51bf8..4e91549c4 100644 --- a/platform/Codat/Platform/Models/Operations/GetCustomDataTypeConfigurationResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetCustomDataTypeConfigurationResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetIntegrationRequest.cs b/platform/Codat/Platform/Models/Operations/GetIntegrationRequest.cs index 18687225e..5eaea04af 100644 --- a/platform/Codat/Platform/Models/Operations/GetIntegrationRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetIntegrationRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetIntegrationResponse.cs b/platform/Codat/Platform/Models/Operations/GetIntegrationResponse.cs index 7c89fade3..a6c1e4269 100644 --- a/platform/Codat/Platform/Models/Operations/GetIntegrationResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetIntegrationResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetIntegrationsBrandingRequest.cs b/platform/Codat/Platform/Models/Operations/GetIntegrationsBrandingRequest.cs index cc1353cba..92d3c6411 100644 --- a/platform/Codat/Platform/Models/Operations/GetIntegrationsBrandingRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetIntegrationsBrandingRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetIntegrationsBrandingResponse.cs b/platform/Codat/Platform/Models/Operations/GetIntegrationsBrandingResponse.cs index 06bbed489..06da122d0 100644 --- a/platform/Codat/Platform/Models/Operations/GetIntegrationsBrandingResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetIntegrationsBrandingResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetProfileResponse.cs b/platform/Codat/Platform/Models/Operations/GetProfileResponse.cs index b236754ab..283546edb 100644 --- a/platform/Codat/Platform/Models/Operations/GetProfileResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetProfileResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetProfileSyncSettingsResponse.cs b/platform/Codat/Platform/Models/Operations/GetProfileSyncSettingsResponse.cs index 6f4f97570..60a69ff0a 100644 --- a/platform/Codat/Platform/Models/Operations/GetProfileSyncSettingsResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetProfileSyncSettingsResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetPullOperationRequest.cs b/platform/Codat/Platform/Models/Operations/GetPullOperationRequest.cs index eedbbf06a..8b43d42ad 100644 --- a/platform/Codat/Platform/Models/Operations/GetPullOperationRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetPullOperationRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetPullOperationResponse.cs b/platform/Codat/Platform/Models/Operations/GetPullOperationResponse.cs index 7614bf181..76f590e14 100644 --- a/platform/Codat/Platform/Models/Operations/GetPullOperationResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetPullOperationResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetPushOperationRequest.cs b/platform/Codat/Platform/Models/Operations/GetPushOperationRequest.cs index e65fdebc3..5f6707037 100644 --- a/platform/Codat/Platform/Models/Operations/GetPushOperationRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetPushOperationRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetPushOperationResponse.cs b/platform/Codat/Platform/Models/Operations/GetPushOperationResponse.cs index 29d3624ae..318c90a40 100644 --- a/platform/Codat/Platform/Models/Operations/GetPushOperationResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetPushOperationResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetSupplementalDataConfigurationRequest.cs b/platform/Codat/Platform/Models/Operations/GetSupplementalDataConfigurationRequest.cs index b5c7ec48c..20b3545d0 100644 --- a/platform/Codat/Platform/Models/Operations/GetSupplementalDataConfigurationRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetSupplementalDataConfigurationRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetSupplementalDataConfigurationResponse.cs b/platform/Codat/Platform/Models/Operations/GetSupplementalDataConfigurationResponse.cs index 322cde268..2f43eb548 100644 --- a/platform/Codat/Platform/Models/Operations/GetSupplementalDataConfigurationResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetSupplementalDataConfigurationResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetWebhookRequest.cs b/platform/Codat/Platform/Models/Operations/GetWebhookRequest.cs index 87b2a1b5c..58af1c232 100644 --- a/platform/Codat/Platform/Models/Operations/GetWebhookRequest.cs +++ b/platform/Codat/Platform/Models/Operations/GetWebhookRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/GetWebhookResponse.cs b/platform/Codat/Platform/Models/Operations/GetWebhookResponse.cs index fbecaa698..e97589236 100644 --- a/platform/Codat/Platform/Models/Operations/GetWebhookResponse.cs +++ b/platform/Codat/Platform/Models/Operations/GetWebhookResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListApiKeysResponse.cs b/platform/Codat/Platform/Models/Operations/ListApiKeysResponse.cs index eadb206c1..b51db9fa8 100644 --- a/platform/Codat/Platform/Models/Operations/ListApiKeysResponse.cs +++ b/platform/Codat/Platform/Models/Operations/ListApiKeysResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListCompaniesRequest.cs b/platform/Codat/Platform/Models/Operations/ListCompaniesRequest.cs index c4bb80807..4cf37ae67 100644 --- a/platform/Codat/Platform/Models/Operations/ListCompaniesRequest.cs +++ b/platform/Codat/Platform/Models/Operations/ListCompaniesRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListCompaniesResponse.cs b/platform/Codat/Platform/Models/Operations/ListCompaniesResponse.cs index eb46169de..e21b60903 100644 --- a/platform/Codat/Platform/Models/Operations/ListCompaniesResponse.cs +++ b/platform/Codat/Platform/Models/Operations/ListCompaniesResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListConnectionsRequest.cs b/platform/Codat/Platform/Models/Operations/ListConnectionsRequest.cs index 01a10bebb..fc9d00fb2 100644 --- a/platform/Codat/Platform/Models/Operations/ListConnectionsRequest.cs +++ b/platform/Codat/Platform/Models/Operations/ListConnectionsRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListConnectionsResponse.cs b/platform/Codat/Platform/Models/Operations/ListConnectionsResponse.cs index c6d899d39..fe96df443 100644 --- a/platform/Codat/Platform/Models/Operations/ListConnectionsResponse.cs +++ b/platform/Codat/Platform/Models/Operations/ListConnectionsResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListCustomDataTypeRecordsRequest.cs b/platform/Codat/Platform/Models/Operations/ListCustomDataTypeRecordsRequest.cs index aefd706d4..0602dd65e 100644 --- a/platform/Codat/Platform/Models/Operations/ListCustomDataTypeRecordsRequest.cs +++ b/platform/Codat/Platform/Models/Operations/ListCustomDataTypeRecordsRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListCustomDataTypeRecordsResponse.cs b/platform/Codat/Platform/Models/Operations/ListCustomDataTypeRecordsResponse.cs index 624a81754..6adaa84be 100644 --- a/platform/Codat/Platform/Models/Operations/ListCustomDataTypeRecordsResponse.cs +++ b/platform/Codat/Platform/Models/Operations/ListCustomDataTypeRecordsResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListGroupsResponse.cs b/platform/Codat/Platform/Models/Operations/ListGroupsResponse.cs index 1144b0a3a..6c063b25d 100644 --- a/platform/Codat/Platform/Models/Operations/ListGroupsResponse.cs +++ b/platform/Codat/Platform/Models/Operations/ListGroupsResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListIntegrationsRequest.cs b/platform/Codat/Platform/Models/Operations/ListIntegrationsRequest.cs index 87c291f85..f8c03979b 100644 --- a/platform/Codat/Platform/Models/Operations/ListIntegrationsRequest.cs +++ b/platform/Codat/Platform/Models/Operations/ListIntegrationsRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListIntegrationsResponse.cs b/platform/Codat/Platform/Models/Operations/ListIntegrationsResponse.cs index 4492b0afa..4dad06ef5 100644 --- a/platform/Codat/Platform/Models/Operations/ListIntegrationsResponse.cs +++ b/platform/Codat/Platform/Models/Operations/ListIntegrationsResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListPullOperationsRequest.cs b/platform/Codat/Platform/Models/Operations/ListPullOperationsRequest.cs index 2d6d8c14e..ff1759e00 100644 --- a/platform/Codat/Platform/Models/Operations/ListPullOperationsRequest.cs +++ b/platform/Codat/Platform/Models/Operations/ListPullOperationsRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListPullOperationsResponse.cs b/platform/Codat/Platform/Models/Operations/ListPullOperationsResponse.cs index 14919ec32..42aa172ae 100644 --- a/platform/Codat/Platform/Models/Operations/ListPullOperationsResponse.cs +++ b/platform/Codat/Platform/Models/Operations/ListPullOperationsResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListRulesRequest.cs b/platform/Codat/Platform/Models/Operations/ListRulesRequest.cs index e49f04203..f2b538e47 100644 --- a/platform/Codat/Platform/Models/Operations/ListRulesRequest.cs +++ b/platform/Codat/Platform/Models/Operations/ListRulesRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListRulesResponse.cs b/platform/Codat/Platform/Models/Operations/ListRulesResponse.cs index c76fd1ccf..5b933fbd1 100644 --- a/platform/Codat/Platform/Models/Operations/ListRulesResponse.cs +++ b/platform/Codat/Platform/Models/Operations/ListRulesResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/ListWebhookConsumersResponse.cs b/platform/Codat/Platform/Models/Operations/ListWebhookConsumersResponse.cs index 1287e79a1..df6615dcd 100644 --- a/platform/Codat/Platform/Models/Operations/ListWebhookConsumersResponse.cs +++ b/platform/Codat/Platform/Models/Operations/ListWebhookConsumersResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/PathParamDataType.cs b/platform/Codat/Platform/Models/Operations/PathParamDataType.cs index 568976380..ee5576a01 100644 --- a/platform/Codat/Platform/Models/Operations/PathParamDataType.cs +++ b/platform/Codat/Platform/Models/Operations/PathParamDataType.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/RefreshCompanyDataRequest.cs b/platform/Codat/Platform/Models/Operations/RefreshCompanyDataRequest.cs index 934c68547..a6213c1dd 100644 --- a/platform/Codat/Platform/Models/Operations/RefreshCompanyDataRequest.cs +++ b/platform/Codat/Platform/Models/Operations/RefreshCompanyDataRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/RefreshCompanyDataResponse.cs b/platform/Codat/Platform/Models/Operations/RefreshCompanyDataResponse.cs index d472439e0..3fdf6bcb6 100644 --- a/platform/Codat/Platform/Models/Operations/RefreshCompanyDataResponse.cs +++ b/platform/Codat/Platform/Models/Operations/RefreshCompanyDataResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/RefreshCustomDataTypeRequest.cs b/platform/Codat/Platform/Models/Operations/RefreshCustomDataTypeRequest.cs index 497d95206..cae287800 100644 --- a/platform/Codat/Platform/Models/Operations/RefreshCustomDataTypeRequest.cs +++ b/platform/Codat/Platform/Models/Operations/RefreshCustomDataTypeRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/RefreshCustomDataTypeResponse.cs b/platform/Codat/Platform/Models/Operations/RefreshCustomDataTypeResponse.cs index 82aa55113..6318a89ce 100644 --- a/platform/Codat/Platform/Models/Operations/RefreshCustomDataTypeResponse.cs +++ b/platform/Codat/Platform/Models/Operations/RefreshCustomDataTypeResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/RefreshDataTypeRequest.cs b/platform/Codat/Platform/Models/Operations/RefreshDataTypeRequest.cs index 75167eba6..008073d2f 100644 --- a/platform/Codat/Platform/Models/Operations/RefreshDataTypeRequest.cs +++ b/platform/Codat/Platform/Models/Operations/RefreshDataTypeRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/RefreshDataTypeResponse.cs b/platform/Codat/Platform/Models/Operations/RefreshDataTypeResponse.cs index 9760e47ff..279e4eab3 100644 --- a/platform/Codat/Platform/Models/Operations/RefreshDataTypeResponse.cs +++ b/platform/Codat/Platform/Models/Operations/RefreshDataTypeResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/RemoveCompanyFromGroupRequest.cs b/platform/Codat/Platform/Models/Operations/RemoveCompanyFromGroupRequest.cs index 856d6ac18..5b34309e4 100644 --- a/platform/Codat/Platform/Models/Operations/RemoveCompanyFromGroupRequest.cs +++ b/platform/Codat/Platform/Models/Operations/RemoveCompanyFromGroupRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/RemoveCompanyFromGroupResponse.cs b/platform/Codat/Platform/Models/Operations/RemoveCompanyFromGroupResponse.cs index c3926603c..6c63fbbd9 100644 --- a/platform/Codat/Platform/Models/Operations/RemoveCompanyFromGroupResponse.cs +++ b/platform/Codat/Platform/Models/Operations/RemoveCompanyFromGroupResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/SetConnectionManagementCorsSettingsResponse.cs b/platform/Codat/Platform/Models/Operations/SetConnectionManagementCorsSettingsResponse.cs index 579146c6d..290fa3d0d 100644 --- a/platform/Codat/Platform/Models/Operations/SetConnectionManagementCorsSettingsResponse.cs +++ b/platform/Codat/Platform/Models/Operations/SetConnectionManagementCorsSettingsResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/UnlinkConnectionRequest.cs b/platform/Codat/Platform/Models/Operations/UnlinkConnectionRequest.cs index 620f82b63..7301fb1a4 100644 --- a/platform/Codat/Platform/Models/Operations/UnlinkConnectionRequest.cs +++ b/platform/Codat/Platform/Models/Operations/UnlinkConnectionRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/UnlinkConnectionResponse.cs b/platform/Codat/Platform/Models/Operations/UnlinkConnectionResponse.cs index 56323758a..a9a58469a 100644 --- a/platform/Codat/Platform/Models/Operations/UnlinkConnectionResponse.cs +++ b/platform/Codat/Platform/Models/Operations/UnlinkConnectionResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/UpdateCompanyRequest.cs b/platform/Codat/Platform/Models/Operations/UpdateCompanyRequest.cs index 007b67798..641632bc0 100644 --- a/platform/Codat/Platform/Models/Operations/UpdateCompanyRequest.cs +++ b/platform/Codat/Platform/Models/Operations/UpdateCompanyRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/UpdateCompanyResponse.cs b/platform/Codat/Platform/Models/Operations/UpdateCompanyResponse.cs index 363506e15..69b698d9d 100644 --- a/platform/Codat/Platform/Models/Operations/UpdateCompanyResponse.cs +++ b/platform/Codat/Platform/Models/Operations/UpdateCompanyResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/UpdateConnectionAuthorizationRequest.cs b/platform/Codat/Platform/Models/Operations/UpdateConnectionAuthorizationRequest.cs index 54769edbd..0f6e061f9 100644 --- a/platform/Codat/Platform/Models/Operations/UpdateConnectionAuthorizationRequest.cs +++ b/platform/Codat/Platform/Models/Operations/UpdateConnectionAuthorizationRequest.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/UpdateConnectionAuthorizationResponse.cs b/platform/Codat/Platform/Models/Operations/UpdateConnectionAuthorizationResponse.cs index e6b98f6f7..a67d94534 100644 --- a/platform/Codat/Platform/Models/Operations/UpdateConnectionAuthorizationResponse.cs +++ b/platform/Codat/Platform/Models/Operations/UpdateConnectionAuthorizationResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/UpdateProfileResponse.cs b/platform/Codat/Platform/Models/Operations/UpdateProfileResponse.cs index 3bdc6cf88..160ded1a2 100644 --- a/platform/Codat/Platform/Models/Operations/UpdateProfileResponse.cs +++ b/platform/Codat/Platform/Models/Operations/UpdateProfileResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/UpdateProfileSyncSettingsRequestBody.cs b/platform/Codat/Platform/Models/Operations/UpdateProfileSyncSettingsRequestBody.cs index a53f06cad..01d668a2d 100644 --- a/platform/Codat/Platform/Models/Operations/UpdateProfileSyncSettingsRequestBody.cs +++ b/platform/Codat/Platform/Models/Operations/UpdateProfileSyncSettingsRequestBody.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Operations/UpdateProfileSyncSettingsResponse.cs b/platform/Codat/Platform/Models/Operations/UpdateProfileSyncSettingsResponse.cs index 02dce2ed0..02c029081 100644 --- a/platform/Codat/Platform/Models/Operations/UpdateProfileSyncSettingsResponse.cs +++ b/platform/Codat/Platform/Models/Operations/UpdateProfileSyncSettingsResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ApiKeyDetails.cs b/platform/Codat/Platform/Models/Shared/ApiKeyDetails.cs index 622c7687d..90dc58d1d 100644 --- a/platform/Codat/Platform/Models/Shared/ApiKeyDetails.cs +++ b/platform/Codat/Platform/Models/Shared/ApiKeyDetails.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ApiKeys.cs b/platform/Codat/Platform/Models/Shared/ApiKeys.cs index d2ca69ed3..7a9580122 100644 --- a/platform/Codat/Platform/Models/Shared/ApiKeys.cs +++ b/platform/Codat/Platform/Models/Shared/ApiKeys.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Branding.cs b/platform/Codat/Platform/Models/Shared/Branding.cs index f807f0220..d05236840 100644 --- a/platform/Codat/Platform/Models/Shared/Branding.cs +++ b/platform/Codat/Platform/Models/Shared/Branding.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/BrandingButton.cs b/platform/Codat/Platform/Models/Shared/BrandingButton.cs index 8c7f9f237..7797e1c78 100644 --- a/platform/Codat/Platform/Models/Shared/BrandingButton.cs +++ b/platform/Codat/Platform/Models/Shared/BrandingButton.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/BrandingImage.cs b/platform/Codat/Platform/Models/Shared/BrandingImage.cs index 3d6a6ba19..16667dc2e 100644 --- a/platform/Codat/Platform/Models/Shared/BrandingImage.cs +++ b/platform/Codat/Platform/Models/Shared/BrandingImage.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/BrandingLogo.cs b/platform/Codat/Platform/Models/Shared/BrandingLogo.cs index b7b62d7cd..e5eba19f1 100644 --- a/platform/Codat/Platform/Models/Shared/BrandingLogo.cs +++ b/platform/Codat/Platform/Models/Shared/BrandingLogo.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ClientRateLimitReachedWebhook.cs b/platform/Codat/Platform/Models/Shared/ClientRateLimitReachedWebhook.cs index 9fa10d137..68ea12427 100644 --- a/platform/Codat/Platform/Models/Shared/ClientRateLimitReachedWebhook.cs +++ b/platform/Codat/Platform/Models/Shared/ClientRateLimitReachedWebhook.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ClientRateLimitReachedWebhookData.cs b/platform/Codat/Platform/Models/Shared/ClientRateLimitReachedWebhookData.cs index ed447bc86..7d6f1aa49 100644 --- a/platform/Codat/Platform/Models/Shared/ClientRateLimitReachedWebhookData.cs +++ b/platform/Codat/Platform/Models/Shared/ClientRateLimitReachedWebhookData.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ClientRateLimitResetWebhook.cs b/platform/Codat/Platform/Models/Shared/ClientRateLimitResetWebhook.cs index e08850582..3f6a01f6d 100644 --- a/platform/Codat/Platform/Models/Shared/ClientRateLimitResetWebhook.cs +++ b/platform/Codat/Platform/Models/Shared/ClientRateLimitResetWebhook.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ClientRateLimitResetWebhookData.cs b/platform/Codat/Platform/Models/Shared/ClientRateLimitResetWebhookData.cs index d5d309351..b07c2a227 100644 --- a/platform/Codat/Platform/Models/Shared/ClientRateLimitResetWebhookData.cs +++ b/platform/Codat/Platform/Models/Shared/ClientRateLimitResetWebhookData.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Companies.cs b/platform/Codat/Platform/Models/Shared/Companies.cs index 9ded9b529..ff708a5fa 100644 --- a/platform/Codat/Platform/Models/Shared/Companies.cs +++ b/platform/Codat/Platform/Models/Shared/Companies.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Company.cs b/platform/Codat/Platform/Models/Shared/Company.cs index 7aa14ff0e..df48cdefa 100644 --- a/platform/Codat/Platform/Models/Shared/Company.cs +++ b/platform/Codat/Platform/Models/Shared/Company.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/CompanyGroupAssignment.cs b/platform/Codat/Platform/Models/Shared/CompanyGroupAssignment.cs index 8e71b03b0..b0717e944 100644 --- a/platform/Codat/Platform/Models/Shared/CompanyGroupAssignment.cs +++ b/platform/Codat/Platform/Models/Shared/CompanyGroupAssignment.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/CompanyRequestBody.cs b/platform/Codat/Platform/Models/Shared/CompanyRequestBody.cs index e820ef350..37ef0abeb 100644 --- a/platform/Codat/Platform/Models/Shared/CompanyRequestBody.cs +++ b/platform/Codat/Platform/Models/Shared/CompanyRequestBody.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Connection.cs b/platform/Codat/Platform/Models/Shared/Connection.cs index 00458af1f..e62f26e5b 100644 --- a/platform/Codat/Platform/Models/Shared/Connection.cs +++ b/platform/Codat/Platform/Models/Shared/Connection.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ConnectionManagementAccessToken.cs b/platform/Codat/Platform/Models/Shared/ConnectionManagementAccessToken.cs index 82505fb2b..99392631e 100644 --- a/platform/Codat/Platform/Models/Shared/ConnectionManagementAccessToken.cs +++ b/platform/Codat/Platform/Models/Shared/ConnectionManagementAccessToken.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ConnectionManagementAllowedOrigins.cs b/platform/Codat/Platform/Models/Shared/ConnectionManagementAllowedOrigins.cs index c16da1543..c3f3a36a3 100644 --- a/platform/Codat/Platform/Models/Shared/ConnectionManagementAllowedOrigins.cs +++ b/platform/Codat/Platform/Models/Shared/ConnectionManagementAllowedOrigins.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ConnectionStatusChangedWebhook.cs b/platform/Codat/Platform/Models/Shared/ConnectionStatusChangedWebhook.cs index f8a0f7e2b..9a4b1584b 100644 --- a/platform/Codat/Platform/Models/Shared/ConnectionStatusChangedWebhook.cs +++ b/platform/Codat/Platform/Models/Shared/ConnectionStatusChangedWebhook.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ConnectionStatusChangedWebhookData.cs b/platform/Codat/Platform/Models/Shared/ConnectionStatusChangedWebhookData.cs index 02d11b12f..6182ac688 100644 --- a/platform/Codat/Platform/Models/Shared/ConnectionStatusChangedWebhookData.cs +++ b/platform/Codat/Platform/Models/Shared/ConnectionStatusChangedWebhookData.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Connections.cs b/platform/Codat/Platform/Models/Shared/Connections.cs index 0d5c37ebd..e31aeca55 100644 --- a/platform/Codat/Platform/Models/Shared/Connections.cs +++ b/platform/Codat/Platform/Models/Shared/Connections.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Content.cs b/platform/Codat/Platform/Models/Shared/Content.cs index 49eb41b3e..49ae8951f 100644 --- a/platform/Codat/Platform/Models/Shared/Content.cs +++ b/platform/Codat/Platform/Models/Shared/Content.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/CreateApiKey.cs b/platform/Codat/Platform/Models/Shared/CreateApiKey.cs index 930daba8c..2337a30a4 100644 --- a/platform/Codat/Platform/Models/Shared/CreateApiKey.cs +++ b/platform/Codat/Platform/Models/Shared/CreateApiKey.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/CreateRule.cs b/platform/Codat/Platform/Models/Shared/CreateRule.cs index e030e62fe..56c8e34a2 100644 --- a/platform/Codat/Platform/Models/Shared/CreateRule.cs +++ b/platform/Codat/Platform/Models/Shared/CreateRule.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/CustomDataTypeConfiguration.cs b/platform/Codat/Platform/Models/Shared/CustomDataTypeConfiguration.cs index a93e7211b..1bf854680 100644 --- a/platform/Codat/Platform/Models/Shared/CustomDataTypeConfiguration.cs +++ b/platform/Codat/Platform/Models/Shared/CustomDataTypeConfiguration.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/CustomDataTypeRecord.cs b/platform/Codat/Platform/Models/Shared/CustomDataTypeRecord.cs index 02a8629c2..baa0e5a20 100644 --- a/platform/Codat/Platform/Models/Shared/CustomDataTypeRecord.cs +++ b/platform/Codat/Platform/Models/Shared/CustomDataTypeRecord.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/CustomDataTypeRecords.cs b/platform/Codat/Platform/Models/Shared/CustomDataTypeRecords.cs index 54330f3ea..e7b8c0eeb 100644 --- a/platform/Codat/Platform/Models/Shared/CustomDataTypeRecords.cs +++ b/platform/Codat/Platform/Models/Shared/CustomDataTypeRecords.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DataConnectionError.cs b/platform/Codat/Platform/Models/Shared/DataConnectionError.cs index 055dada6a..8b4d9a1f6 100644 --- a/platform/Codat/Platform/Models/Shared/DataConnectionError.cs +++ b/platform/Codat/Platform/Models/Shared/DataConnectionError.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -10,6 +9,7 @@ #nullable enable namespace Codat.Platform.Models.Shared { + using Codat.Platform.Models.Shared; using Codat.Platform.Utils; using Newtonsoft.Json; @@ -17,7 +17,7 @@ public class DataConnectionError { /// - /// A brief message about the error. + /// A message about a error returned by Codat. /// [JsonProperty("errorMessage")] public string? ErrorMessage { get; set; } @@ -50,13 +50,46 @@ public class DataConnectionError public string? ErroredOnUtc { get; set; } /// - /// The HTTP status code returned by the error. + /// In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:
+ /// + /// + ///
+ /// ```
+ /// 2020-10-08T22:40:50Z
+ /// 2021-01-01T00:00:00
+ /// ```
+ ///
+ ///
+ ///
+ /// When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:
+ ///
+ /// - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
+ /// - Unqualified local time: `2021-11-15T01:00:00`
+ /// - UTC time offsets: `2021-11-15T01:00:00-05:00`
+ ///
+ /// > Time zones
+ /// >
+ /// > Not all dates from Codat will contain information about time zones.
+ /// > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. + ///
+ ///
+ [JsonProperty("resolvedOnUtc")] + public string? ResolvedOnUtc { get; set; } + + /// + /// The current status of a transient error. Null statuses indicate that the error is not transient. + /// + [JsonProperty("status")] + public ErrorStatus? Status { get; set; } = null; + + /// + /// The HTTP status code returned by the source platform when the error occurred. /// [JsonProperty("statusCode")] public string? StatusCode { get; set; } /// - /// A non-numeric status code/text. + /// A non-numeric status code/text returned by the source platform when the error occurred. /// [JsonProperty("statusText")] public string? StatusText { get; set; } diff --git a/platform/Codat/Platform/Models/Shared/DataConnectionStatus.cs b/platform/Codat/Platform/Models/Shared/DataConnectionStatus.cs index 70cb5ca66..4c4fce97e 100644 --- a/platform/Codat/Platform/Models/Shared/DataConnectionStatus.cs +++ b/platform/Codat/Platform/Models/Shared/DataConnectionStatus.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DataStatus.cs b/platform/Codat/Platform/Models/Shared/DataStatus.cs index 7a95c83e2..753314246 100644 --- a/platform/Codat/Platform/Models/Shared/DataStatus.cs +++ b/platform/Codat/Platform/Models/Shared/DataStatus.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DataStatuses.cs b/platform/Codat/Platform/Models/Shared/DataStatuses.cs index b4a7e5c4c..0f80c3637 100644 --- a/platform/Codat/Platform/Models/Shared/DataStatuses.cs +++ b/platform/Codat/Platform/Models/Shared/DataStatuses.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DataSyncCompletedWebhook.cs b/platform/Codat/Platform/Models/Shared/DataSyncCompletedWebhook.cs index 835841e60..371cd4fe5 100644 --- a/platform/Codat/Platform/Models/Shared/DataSyncCompletedWebhook.cs +++ b/platform/Codat/Platform/Models/Shared/DataSyncCompletedWebhook.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DataSyncCompletedWebhookData.cs b/platform/Codat/Platform/Models/Shared/DataSyncCompletedWebhookData.cs index 5a5584473..33989d83a 100644 --- a/platform/Codat/Platform/Models/Shared/DataSyncCompletedWebhookData.cs +++ b/platform/Codat/Platform/Models/Shared/DataSyncCompletedWebhookData.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DataType.cs b/platform/Codat/Platform/Models/Shared/DataType.cs index 48543502f..7e46e5ae7 100644 --- a/platform/Codat/Platform/Models/Shared/DataType.cs +++ b/platform/Codat/Platform/Models/Shared/DataType.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DataTypeFeature.cs b/platform/Codat/Platform/Models/Shared/DataTypeFeature.cs index bb6dce19d..72421bedc 100644 --- a/platform/Codat/Platform/Models/Shared/DataTypeFeature.cs +++ b/platform/Codat/Platform/Models/Shared/DataTypeFeature.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DataTypes.cs b/platform/Codat/Platform/Models/Shared/DataTypes.cs index 7ecb9dd33..d4430ec39 100644 --- a/platform/Codat/Platform/Models/Shared/DataTypes.cs +++ b/platform/Codat/Platform/Models/Shared/DataTypes.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DatasetDataChangedWebhook.cs b/platform/Codat/Platform/Models/Shared/DatasetDataChangedWebhook.cs index bcc903d44..dec70567f 100644 --- a/platform/Codat/Platform/Models/Shared/DatasetDataChangedWebhook.cs +++ b/platform/Codat/Platform/Models/Shared/DatasetDataChangedWebhook.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DatasetDataChangedWebhookData.cs b/platform/Codat/Platform/Models/Shared/DatasetDataChangedWebhookData.cs index fe96d5e36..14b6db1f6 100644 --- a/platform/Codat/Platform/Models/Shared/DatasetDataChangedWebhookData.cs +++ b/platform/Codat/Platform/Models/Shared/DatasetDataChangedWebhookData.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DatasetStatus.cs b/platform/Codat/Platform/Models/Shared/DatasetStatus.cs index 27019278f..769f6922b 100644 --- a/platform/Codat/Platform/Models/Shared/DatasetStatus.cs +++ b/platform/Codat/Platform/Models/Shared/DatasetStatus.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DatasetStatusChangedErrorWebhook.cs b/platform/Codat/Platform/Models/Shared/DatasetStatusChangedErrorWebhook.cs index 7da6c6ff7..247051eb0 100644 --- a/platform/Codat/Platform/Models/Shared/DatasetStatusChangedErrorWebhook.cs +++ b/platform/Codat/Platform/Models/Shared/DatasetStatusChangedErrorWebhook.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/DatasetStatusChangedErrorWebhookData.cs b/platform/Codat/Platform/Models/Shared/DatasetStatusChangedErrorWebhookData.cs index 6c4defe7b..c93964a62 100644 --- a/platform/Codat/Platform/Models/Shared/DatasetStatusChangedErrorWebhookData.cs +++ b/platform/Codat/Platform/Models/Shared/DatasetStatusChangedErrorWebhookData.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ErrorStatus.cs b/platform/Codat/Platform/Models/Shared/ErrorStatus.cs new file mode 100644 index 000000000..cb68e95a8 --- /dev/null +++ b/platform/Codat/Platform/Models/Shared/ErrorStatus.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Codat.Platform.Models.Shared +{ + using Codat.Platform.Utils; + using Newtonsoft.Json; + using System; + + /// + /// The current status of a transient error. Null statuses indicate that the error is not transient. + /// + public enum ErrorStatus + { + [JsonProperty("Active")] + Active, + [JsonProperty("Resolved")] + Resolved, + } + + public static class ErrorStatusExtension + { + public static string Value(this ErrorStatus value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } + + public static ErrorStatus ToEnum(this string value) + { + foreach(var field in typeof(ErrorStatus).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } + + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); + + if (enumVal is ErrorStatus) + { + return (ErrorStatus)enumVal; + } + } + } + + throw new Exception($"Unknown value {value} for enum ErrorStatus"); + } + } + +} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Shared/ErrorValidation.cs b/platform/Codat/Platform/Models/Shared/ErrorValidation.cs index e85a7bb00..5d300ca7d 100644 --- a/platform/Codat/Platform/Models/Shared/ErrorValidation.cs +++ b/platform/Codat/Platform/Models/Shared/ErrorValidation.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ErrorValidationItem.cs b/platform/Codat/Platform/Models/Shared/ErrorValidationItem.cs index db7cfb480..cb5f6b955 100644 --- a/platform/Codat/Platform/Models/Shared/ErrorValidationItem.cs +++ b/platform/Codat/Platform/Models/Shared/ErrorValidationItem.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/FeatureState.cs b/platform/Codat/Platform/Models/Shared/FeatureState.cs index 9d1cd44e4..57a3459be 100644 --- a/platform/Codat/Platform/Models/Shared/FeatureState.cs +++ b/platform/Codat/Platform/Models/Shared/FeatureState.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/FeatureType.cs b/platform/Codat/Platform/Models/Shared/FeatureType.cs index ed83db49a..d2ed60d65 100644 --- a/platform/Codat/Platform/Models/Shared/FeatureType.cs +++ b/platform/Codat/Platform/Models/Shared/FeatureType.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Group.cs b/platform/Codat/Platform/Models/Shared/Group.cs index 050873760..a4d21483a 100644 --- a/platform/Codat/Platform/Models/Shared/Group.cs +++ b/platform/Codat/Platform/Models/Shared/Group.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/GroupPrototype.cs b/platform/Codat/Platform/Models/Shared/GroupPrototype.cs index 0ace7f044..8f841e0d4 100644 --- a/platform/Codat/Platform/Models/Shared/GroupPrototype.cs +++ b/platform/Codat/Platform/Models/Shared/GroupPrototype.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/GroupRef.cs b/platform/Codat/Platform/Models/Shared/GroupRef.cs index ab662378d..840874d51 100644 --- a/platform/Codat/Platform/Models/Shared/GroupRef.cs +++ b/platform/Codat/Platform/Models/Shared/GroupRef.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Groups.cs b/platform/Codat/Platform/Models/Shared/Groups.cs index 0579bd600..544931c46 100644 --- a/platform/Codat/Platform/Models/Shared/Groups.cs +++ b/platform/Codat/Platform/Models/Shared/Groups.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/HalRef.cs b/platform/Codat/Platform/Models/Shared/HalRef.cs index 78ead0774..218d6ba0e 100644 --- a/platform/Codat/Platform/Models/Shared/HalRef.cs +++ b/platform/Codat/Platform/Models/Shared/HalRef.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ImageReference.cs b/platform/Codat/Platform/Models/Shared/ImageReference.cs index 4ec3930cf..353db1342 100644 --- a/platform/Codat/Platform/Models/Shared/ImageReference.cs +++ b/platform/Codat/Platform/Models/Shared/ImageReference.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Integration.cs b/platform/Codat/Platform/Models/Shared/Integration.cs index 1426ebf73..2cada3430 100644 --- a/platform/Codat/Platform/Models/Shared/Integration.cs +++ b/platform/Codat/Platform/Models/Shared/Integration.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Integrations.cs b/platform/Codat/Platform/Models/Shared/Integrations.cs index ec7d5854a..a25ce6bd1 100644 --- a/platform/Codat/Platform/Models/Shared/Integrations.cs +++ b/platform/Codat/Platform/Models/Shared/Integrations.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Links.cs b/platform/Codat/Platform/Models/Shared/Links.cs index c2df44535..e800bf80d 100644 --- a/platform/Codat/Platform/Models/Shared/Links.cs +++ b/platform/Codat/Platform/Models/Shared/Links.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ModifiedDate.cs b/platform/Codat/Platform/Models/Shared/ModifiedDate.cs index 19871b57b..30efe8b95 100644 --- a/platform/Codat/Platform/Models/Shared/ModifiedDate.cs +++ b/platform/Codat/Platform/Models/Shared/ModifiedDate.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/NewCompanySynchronizedWebhook.cs b/platform/Codat/Platform/Models/Shared/NewCompanySynchronizedWebhook.cs index abbac6416..c471f5741 100644 --- a/platform/Codat/Platform/Models/Shared/NewCompanySynchronizedWebhook.cs +++ b/platform/Codat/Platform/Models/Shared/NewCompanySynchronizedWebhook.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/NewCompanySynchronizedWebhookData.cs b/platform/Codat/Platform/Models/Shared/NewCompanySynchronizedWebhookData.cs index 378c6c331..cded294e7 100644 --- a/platform/Codat/Platform/Models/Shared/NewCompanySynchronizedWebhookData.cs +++ b/platform/Codat/Platform/Models/Shared/NewCompanySynchronizedWebhookData.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Profile.cs b/platform/Codat/Platform/Models/Shared/Profile.cs index 159c9a1e8..f87b8bbed 100644 --- a/platform/Codat/Platform/Models/Shared/Profile.cs +++ b/platform/Codat/Platform/Models/Shared/Profile.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PullOperation.cs b/platform/Codat/Platform/Models/Shared/PullOperation.cs index 98c0a6d06..4a2d425fe 100644 --- a/platform/Codat/Platform/Models/Shared/PullOperation.cs +++ b/platform/Codat/Platform/Models/Shared/PullOperation.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -70,7 +69,7 @@ public class PullOperation public string DataType { get; set; } = default!; /// - /// A message about a transient or persistent error. + /// A message about a transient or persistent error returned by Codat or the source platform. /// [JsonProperty("errorMessage")] public string? ErrorMessage { get; set; } = null; diff --git a/platform/Codat/Platform/Models/Shared/PullOperations.cs b/platform/Codat/Platform/Models/Shared/PullOperations.cs index 37334c5ee..bf82eea21 100644 --- a/platform/Codat/Platform/Models/Shared/PullOperations.cs +++ b/platform/Codat/Platform/Models/Shared/PullOperations.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushChangeType.cs b/platform/Codat/Platform/Models/Shared/PushChangeType.cs index c9d754cb8..ee4cf9e72 100644 --- a/platform/Codat/Platform/Models/Shared/PushChangeType.cs +++ b/platform/Codat/Platform/Models/Shared/PushChangeType.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushFieldValidation.cs b/platform/Codat/Platform/Models/Shared/PushFieldValidation.cs index c42dfac23..5a8246be1 100644 --- a/platform/Codat/Platform/Models/Shared/PushFieldValidation.cs +++ b/platform/Codat/Platform/Models/Shared/PushFieldValidation.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOperation.cs b/platform/Codat/Platform/Models/Shared/PushOperation.cs index 493744ff1..6eeca3427 100644 --- a/platform/Codat/Platform/Models/Shared/PushOperation.cs +++ b/platform/Codat/Platform/Models/Shared/PushOperation.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOperationChange.cs b/platform/Codat/Platform/Models/Shared/PushOperationChange.cs index 67292abe9..3b84ce922 100644 --- a/platform/Codat/Platform/Models/Shared/PushOperationChange.cs +++ b/platform/Codat/Platform/Models/Shared/PushOperationChange.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOperationRef.cs b/platform/Codat/Platform/Models/Shared/PushOperationRef.cs index b1c19bedd..5564c1703 100644 --- a/platform/Codat/Platform/Models/Shared/PushOperationRef.cs +++ b/platform/Codat/Platform/Models/Shared/PushOperationRef.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOperationStatus.cs b/platform/Codat/Platform/Models/Shared/PushOperationStatus.cs index 6a28f1e94..5ef776f94 100644 --- a/platform/Codat/Platform/Models/Shared/PushOperationStatus.cs +++ b/platform/Codat/Platform/Models/Shared/PushOperationStatus.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOperationStatusChangedWebhook.cs b/platform/Codat/Platform/Models/Shared/PushOperationStatusChangedWebhook.cs index 9c6deaa55..92057dc38 100644 --- a/platform/Codat/Platform/Models/Shared/PushOperationStatusChangedWebhook.cs +++ b/platform/Codat/Platform/Models/Shared/PushOperationStatusChangedWebhook.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOperationStatusChangedWebhookData.cs b/platform/Codat/Platform/Models/Shared/PushOperationStatusChangedWebhookData.cs index 99658231c..2e42e911a 100644 --- a/platform/Codat/Platform/Models/Shared/PushOperationStatusChangedWebhookData.cs +++ b/platform/Codat/Platform/Models/Shared/PushOperationStatusChangedWebhookData.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOperationTimedOutWebhook.cs b/platform/Codat/Platform/Models/Shared/PushOperationTimedOutWebhook.cs index 405f65812..c2f90a421 100644 --- a/platform/Codat/Platform/Models/Shared/PushOperationTimedOutWebhook.cs +++ b/platform/Codat/Platform/Models/Shared/PushOperationTimedOutWebhook.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOperationTimedOutWebhookData.cs b/platform/Codat/Platform/Models/Shared/PushOperationTimedOutWebhookData.cs index 689592a19..d964f7cbb 100644 --- a/platform/Codat/Platform/Models/Shared/PushOperationTimedOutWebhookData.cs +++ b/platform/Codat/Platform/Models/Shared/PushOperationTimedOutWebhookData.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOperations.cs b/platform/Codat/Platform/Models/Shared/PushOperations.cs index f8d5f1fef..26fb1d650 100644 --- a/platform/Codat/Platform/Models/Shared/PushOperations.cs +++ b/platform/Codat/Platform/Models/Shared/PushOperations.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOption.cs b/platform/Codat/Platform/Models/Shared/PushOption.cs index c0dc2b187..2fabbdd8c 100644 --- a/platform/Codat/Platform/Models/Shared/PushOption.cs +++ b/platform/Codat/Platform/Models/Shared/PushOption.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOptionChoice.cs b/platform/Codat/Platform/Models/Shared/PushOptionChoice.cs index cdb4b6c1b..2449d5298 100644 --- a/platform/Codat/Platform/Models/Shared/PushOptionChoice.cs +++ b/platform/Codat/Platform/Models/Shared/PushOptionChoice.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOptionProperty.cs b/platform/Codat/Platform/Models/Shared/PushOptionProperty.cs index b49d1fedf..7340bda54 100644 --- a/platform/Codat/Platform/Models/Shared/PushOptionProperty.cs +++ b/platform/Codat/Platform/Models/Shared/PushOptionProperty.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushOptionType.cs b/platform/Codat/Platform/Models/Shared/PushOptionType.cs index 8cb4ec52d..3f8ecc896 100644 --- a/platform/Codat/Platform/Models/Shared/PushOptionType.cs +++ b/platform/Codat/Platform/Models/Shared/PushOptionType.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/PushValidationInfo.cs b/platform/Codat/Platform/Models/Shared/PushValidationInfo.cs index 94ceab947..a84a88f03 100644 --- a/platform/Codat/Platform/Models/Shared/PushValidationInfo.cs +++ b/platform/Codat/Platform/Models/Shared/PushValidationInfo.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/SchemaDataType.cs b/platform/Codat/Platform/Models/Shared/SchemaDataType.cs index ae1a6bbd4..cd44f809b 100644 --- a/platform/Codat/Platform/Models/Shared/SchemaDataType.cs +++ b/platform/Codat/Platform/Models/Shared/SchemaDataType.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Security.cs b/platform/Codat/Platform/Models/Shared/Security.cs index ee29e3e35..599aa15f0 100644 --- a/platform/Codat/Platform/Models/Shared/Security.cs +++ b/platform/Codat/Platform/Models/Shared/Security.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/SourceType.cs b/platform/Codat/Platform/Models/Shared/SourceType.cs index bc0ffbfbf..ae30d58e0 100644 --- a/platform/Codat/Platform/Models/Shared/SourceType.cs +++ b/platform/Codat/Platform/Models/Shared/SourceType.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Status.cs b/platform/Codat/Platform/Models/Shared/Status.cs index de118e9fc..094b8c7a3 100644 --- a/platform/Codat/Platform/Models/Shared/Status.cs +++ b/platform/Codat/Platform/Models/Shared/Status.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/SupplementalDataConfiguration.cs b/platform/Codat/Platform/Models/Shared/SupplementalDataConfiguration.cs index d114dbbfb..087a3f899 100644 --- a/platform/Codat/Platform/Models/Shared/SupplementalDataConfiguration.cs +++ b/platform/Codat/Platform/Models/Shared/SupplementalDataConfiguration.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/SupplementalDataSourceConfiguration.cs b/platform/Codat/Platform/Models/Shared/SupplementalDataSourceConfiguration.cs index a0bc15c14..a568715ef 100644 --- a/platform/Codat/Platform/Models/Shared/SupplementalDataSourceConfiguration.cs +++ b/platform/Codat/Platform/Models/Shared/SupplementalDataSourceConfiguration.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/SupportedFeature.cs b/platform/Codat/Platform/Models/Shared/SupportedFeature.cs index 2bffc4084..b98425df7 100644 --- a/platform/Codat/Platform/Models/Shared/SupportedFeature.cs +++ b/platform/Codat/Platform/Models/Shared/SupportedFeature.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/SyncSetting.cs b/platform/Codat/Platform/Models/Shared/SyncSetting.cs index 8cf3471c9..77cc2b411 100644 --- a/platform/Codat/Platform/Models/Shared/SyncSetting.cs +++ b/platform/Codat/Platform/Models/Shared/SyncSetting.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/SyncSettings.cs b/platform/Codat/Platform/Models/Shared/SyncSettings.cs index 983874b9c..c34ba2540 100644 --- a/platform/Codat/Platform/Models/Shared/SyncSettings.cs +++ b/platform/Codat/Platform/Models/Shared/SyncSettings.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/UpdateConnectionStatus.cs b/platform/Codat/Platform/Models/Shared/UpdateConnectionStatus.cs index 2e3995afb..9ef2b50dc 100644 --- a/platform/Codat/Platform/Models/Shared/UpdateConnectionStatus.cs +++ b/platform/Codat/Platform/Models/Shared/UpdateConnectionStatus.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Validation.cs b/platform/Codat/Platform/Models/Shared/Validation.cs index 020c4e446..9b07ea162 100644 --- a/platform/Codat/Platform/Models/Shared/Validation.cs +++ b/platform/Codat/Platform/Models/Shared/Validation.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/ValidationItem.cs b/platform/Codat/Platform/Models/Shared/ValidationItem.cs index 5ed547f3a..9455c0397 100644 --- a/platform/Codat/Platform/Models/Shared/ValidationItem.cs +++ b/platform/Codat/Platform/Models/Shared/ValidationItem.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Webhook.cs b/platform/Codat/Platform/Models/Shared/Webhook.cs index fd4624ace..ce42b75c3 100644 --- a/platform/Codat/Platform/Models/Shared/Webhook.cs +++ b/platform/Codat/Platform/Models/Shared/Webhook.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/WebhookConsumer.cs b/platform/Codat/Platform/Models/Shared/WebhookConsumer.cs index df0508701..67cc35656 100644 --- a/platform/Codat/Platform/Models/Shared/WebhookConsumer.cs +++ b/platform/Codat/Platform/Models/Shared/WebhookConsumer.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/WebhookConsumerPrototype.cs b/platform/Codat/Platform/Models/Shared/WebhookConsumerPrototype.cs index ecdf3e61d..f95cff516 100644 --- a/platform/Codat/Platform/Models/Shared/WebhookConsumerPrototype.cs +++ b/platform/Codat/Platform/Models/Shared/WebhookConsumerPrototype.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/WebhookConsumers.cs b/platform/Codat/Platform/Models/Shared/WebhookConsumers.cs index f3e3168f6..ab418aeef 100644 --- a/platform/Codat/Platform/Models/Shared/WebhookConsumers.cs +++ b/platform/Codat/Platform/Models/Shared/WebhookConsumers.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/WebhookNotifier.cs b/platform/Codat/Platform/Models/Shared/WebhookNotifier.cs index 59b5287b4..b4de21d6e 100644 --- a/platform/Codat/Platform/Models/Shared/WebhookNotifier.cs +++ b/platform/Codat/Platform/Models/Shared/WebhookNotifier.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Shared/Webhooks.cs b/platform/Codat/Platform/Models/Shared/Webhooks.cs index 79b9258de..4f7a6e935 100644 --- a/platform/Codat/Platform/Models/Shared/Webhooks.cs +++ b/platform/Codat/Platform/Models/Shared/Webhooks.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse.cs b/platform/Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse.cs index aacb94993..d5f825a68 100644 --- a/platform/Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse.cs b/platform/Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse.cs index 13bc518d6..e306fda10 100644 --- a/platform/Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.cs b/platform/Codat/Platform/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.cs index 4be0b5a4d..bcd512500 100644 --- a/platform/Codat/Platform/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Webhooks/DataSyncCompletedResponse.cs b/platform/Codat/Platform/Models/Webhooks/DataSyncCompletedResponse.cs index e01813092..a4893a7af 100644 --- a/platform/Codat/Platform/Models/Webhooks/DataSyncCompletedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/DataSyncCompletedResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Webhooks/DatasetDataChangedResponse.cs b/platform/Codat/Platform/Models/Webhooks/DatasetDataChangedResponse.cs index 1cef281e2..74a5a8dc9 100644 --- a/platform/Codat/Platform/Models/Webhooks/DatasetDataChangedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/DatasetDataChangedResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.cs b/platform/Codat/Platform/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.cs index 4bde0db27..b5ca390ab 100644 --- a/platform/Codat/Platform/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Webhooks/NewCompanySynchronizedResponse.cs b/platform/Codat/Platform/Models/Webhooks/NewCompanySynchronizedResponse.cs index d49a1b060..9e44db771 100644 --- a/platform/Codat/Platform/Models/Webhooks/NewCompanySynchronizedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/NewCompanySynchronizedResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Webhooks/PushOperationHasTimedOutResponse.cs b/platform/Codat/Platform/Models/Webhooks/PushOperationHasTimedOutResponse.cs index ba7211e20..d022be314 100644 --- a/platform/Codat/Platform/Models/Webhooks/PushOperationHasTimedOutResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/PushOperationHasTimedOutResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Models/Webhooks/PushOperationStatusHasChangedResponse.cs b/platform/Codat/Platform/Models/Webhooks/PushOperationStatusHasChangedResponse.cs index 65f63d1dd..fd632a050 100644 --- a/platform/Codat/Platform/Models/Webhooks/PushOperationStatusHasChangedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/PushOperationStatusHasChangedResponse.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/PushData.cs b/platform/Codat/Platform/PushData.cs index f9a9101ed..1eeece5f8 100644 --- a/platform/Codat/Platform/PushData.cs +++ b/platform/Codat/Platform/PushData.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -14,6 +13,7 @@ namespace Codat.Platform using Codat.Platform.Models.Errors; using Codat.Platform.Models.Operations; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -44,7 +44,7 @@ public interface IPushData /// > Check out our coverage explorer for integrations that support push (POST/PUT methods). /// ///
- Task GetModelOptionsAsync(GetCreateUpdateModelOptionsByDataTypeRequest request); + Task GetModelOptionsAsync(GetCreateUpdateModelOptionsByDataTypeRequest request, RetryConfig? retryConfig = null); /// /// Get push operation @@ -53,7 +53,7 @@ public interface IPushData /// Retrieve push operation. /// /// - Task GetOperationAsync(GetPushOperationRequest request); + Task GetOperationAsync(GetPushOperationRequest request, RetryConfig? retryConfig = null); /// /// List push operations @@ -62,7 +62,7 @@ public interface IPushData /// List push operation records. /// /// - Task ListOperationsAsync(GetCompanyPushHistoryRequest request); + Task ListOperationsAsync(GetCompanyPushHistoryRequest request, RetryConfig? retryConfig = null); } /// @@ -72,23 +72,23 @@ public class PushData: IPushData { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; - public PushData(ISpeakeasyHttpClient defaultClient, Func? securitySource, string serverUrl, SDKConfig config) + public PushData(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) { - _defaultClient = defaultClient; + _client = client; _securitySource = securitySource; _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task GetModelOptionsAsync(GetCreateUpdateModelOptionsByDataTypeRequest request) + public async Task GetModelOptionsAsync(GetCreateUpdateModelOptionsByDataTypeRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/options/{dataType}", request); @@ -103,16 +103,52 @@ public async Task GetModelOptions var hookCtx = new HookContext("get-create-update-model-options-by-data-type", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -121,7 +157,7 @@ public async Task GetModelOptions } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -132,7 +168,7 @@ public async Task GetModelOptions } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -177,7 +213,7 @@ public async Task GetModelOptions } } - public async Task GetOperationAsync(GetPushOperationRequest request) + public async Task GetOperationAsync(GetPushOperationRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/push/{pushOperationKey}", request); @@ -192,16 +228,52 @@ public async Task GetOperationAsync(GetPushOperationRe var hookCtx = new HookContext("get-push-operation", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -210,7 +282,7 @@ public async Task GetOperationAsync(GetPushOperationRe } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -221,7 +293,7 @@ public async Task GetOperationAsync(GetPushOperationRe } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -266,7 +338,7 @@ public async Task GetOperationAsync(GetPushOperationRe } } - public async Task ListOperationsAsync(GetCompanyPushHistoryRequest request) + public async Task ListOperationsAsync(GetCompanyPushHistoryRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/push", request); @@ -281,16 +353,52 @@ public async Task ListOperationsAsync(GetCompanyP var hookCtx = new HookContext("get-company-push-history", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -299,7 +407,7 @@ public async Task ListOperationsAsync(GetCompanyP } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -310,7 +418,7 @@ public async Task ListOperationsAsync(GetCompanyP } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; diff --git a/platform/Codat/Platform/RefreshData.cs b/platform/Codat/Platform/RefreshData.cs index fe4513bb9..2a27deb9b 100644 --- a/platform/Codat/Platform/RefreshData.cs +++ b/platform/Codat/Platform/RefreshData.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -14,6 +13,7 @@ namespace Codat.Platform using Codat.Platform.Models.Errors; using Codat.Platform.Models.Operations; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -39,7 +39,7 @@ public interface IRefreshData /// Read more about data type settings and `fetch on first link`. /// /// - Task AllAsync(RefreshCompanyDataRequest request); + Task AllAsync(RefreshCompanyDataRequest request, RetryConfig? retryConfig = null); /// /// Refresh data type @@ -50,7 +50,7 @@ public interface IRefreshData /// This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. /// /// - Task ByDataTypeAsync(RefreshDataTypeRequest request); + Task ByDataTypeAsync(RefreshDataTypeRequest request, RetryConfig? retryConfig = null); /// /// Get data status @@ -59,7 +59,7 @@ public interface IRefreshData /// Get the state of each data type for a company /// /// - Task GetAsync(GetCompanyDataStatusRequest request); + Task GetAsync(GetCompanyDataStatusRequest request, RetryConfig? retryConfig = null); /// /// Get pull operation @@ -68,7 +68,7 @@ public interface IRefreshData /// Retrieve information about a single dataset or pull operation. /// /// - Task GetPullOperationAsync(GetPullOperationRequest request); + Task GetPullOperationAsync(GetPullOperationRequest request, RetryConfig? retryConfig = null); /// /// List pull operations @@ -77,7 +77,7 @@ public interface IRefreshData /// Gets the pull operation history (datasets) for a given company. /// /// - Task ListPullOperationsAsync(ListPullOperationsRequest request); + Task ListPullOperationsAsync(ListPullOperationsRequest request, RetryConfig? retryConfig = null); } /// @@ -87,23 +87,23 @@ public class RefreshData: IRefreshData { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; - public RefreshData(ISpeakeasyHttpClient defaultClient, Func? securitySource, string serverUrl, SDKConfig config) + public RefreshData(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) { - _defaultClient = defaultClient; + _client = client; _securitySource = securitySource; _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task AllAsync(RefreshCompanyDataRequest request) + public async Task AllAsync(RefreshCompanyDataRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/data/all", request); @@ -118,16 +118,52 @@ public async Task AllAsync(RefreshCompanyDataRequest var hookCtx = new HookContext("refresh-company-data", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -136,7 +172,7 @@ public async Task AllAsync(RefreshCompanyDataRequest } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -147,7 +183,7 @@ public async Task AllAsync(RefreshCompanyDataRequest } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -182,7 +218,7 @@ public async Task AllAsync(RefreshCompanyDataRequest } } - public async Task ByDataTypeAsync(RefreshDataTypeRequest request) + public async Task ByDataTypeAsync(RefreshDataTypeRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/data/queue/{dataType}", request); @@ -197,16 +233,52 @@ public async Task ByDataTypeAsync(RefreshDataTypeReques var hookCtx = new HookContext("refresh-data-type", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -215,7 +287,7 @@ public async Task ByDataTypeAsync(RefreshDataTypeReques } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -226,7 +298,7 @@ public async Task ByDataTypeAsync(RefreshDataTypeReques } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -271,7 +343,7 @@ public async Task ByDataTypeAsync(RefreshDataTypeReques } } - public async Task GetAsync(GetCompanyDataStatusRequest request) + public async Task GetAsync(GetCompanyDataStatusRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/dataStatus", request); @@ -286,16 +358,52 @@ public async Task GetAsync(GetCompanyDataStatusReq var hookCtx = new HookContext("get-company-data-status", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -304,7 +412,7 @@ public async Task GetAsync(GetCompanyDataStatusReq } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -315,7 +423,7 @@ public async Task GetAsync(GetCompanyDataStatusReq } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -360,7 +468,7 @@ public async Task GetAsync(GetCompanyDataStatusReq } } - public async Task GetPullOperationAsync(GetPullOperationRequest request) + public async Task GetPullOperationAsync(GetPullOperationRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/data/history/{datasetId}", request); @@ -375,16 +483,52 @@ public async Task GetPullOperationAsync(GetPullOperati var hookCtx = new HookContext("get-pull-operation", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -393,7 +537,7 @@ public async Task GetPullOperationAsync(GetPullOperati } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -404,7 +548,7 @@ public async Task GetPullOperationAsync(GetPullOperati } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -449,7 +593,7 @@ public async Task GetPullOperationAsync(GetPullOperati } } - public async Task ListPullOperationsAsync(ListPullOperationsRequest request) + public async Task ListPullOperationsAsync(ListPullOperationsRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/data/history", request); @@ -464,16 +608,52 @@ public async Task ListPullOperationsAsync(ListPullOp var hookCtx = new HookContext("list-pull-operations", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -482,7 +662,7 @@ public async Task ListPullOperationsAsync(ListPullOp } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -493,7 +673,7 @@ public async Task ListPullOperationsAsync(ListPullOp } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; diff --git a/platform/Codat/Platform/Settings.cs b/platform/Codat/Platform/Settings.cs index 5e8b3fd24..444dbb9c3 100644 --- a/platform/Codat/Platform/Settings.cs +++ b/platform/Codat/Platform/Settings.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -14,6 +13,7 @@ namespace Codat.Platform using Codat.Platform.Models.Errors; using Codat.Platform.Models.Operations; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -45,7 +45,7 @@ public interface ISettings /// * The number of API keys is limited to 10. If you have reached the maximum amount of keys, use the *Delete API key* endpoint to delete an unused key first. /// /// - Task CreateApiKeyAsync(CreateApiKey? request = null); + Task CreateApiKeyAsync(CreateApiKey? request = null, RetryConfig? retryConfig = null); /// /// Delete API key @@ -63,7 +63,7 @@ public interface ISettings /// * It is possible to delete the API key used to authenticate the *Delete API key* request. /// /// - Task DeleteApiKeyAsync(DeleteApiKeyRequest request); + Task DeleteApiKeyAsync(DeleteApiKeyRequest request, RetryConfig? retryConfig = null); /// /// Get profile @@ -72,7 +72,7 @@ public interface ISettings /// Fetch your Codat profile. /// /// - Task GetProfileAsync(); + Task GetProfileAsync(RetryConfig? retryConfig = null); /// /// Get sync settings @@ -81,7 +81,7 @@ public interface ISettings /// Retrieve the sync settings for your client. This includes how often data types should be queued to be updated, and how much history should be fetched. /// /// - Task GetSyncSettingsAsync(); + Task GetSyncSettingsAsync(RetryConfig? retryConfig = null); /// /// List API keys @@ -94,7 +94,7 @@ public interface ISettings /// You can read more about authentication at Codat and managing API keys via the Portal UI or API. /// /// - Task ListApiKeysAsync(); + Task ListApiKeysAsync(RetryConfig? retryConfig = null); /// /// Update profile @@ -103,7 +103,7 @@ public interface ISettings /// Update your Codat profile /// /// - Task UpdateProfileAsync(Profile? request = null); + Task UpdateProfileAsync(Profile? request = null, RetryConfig? retryConfig = null); /// /// Update all sync settings @@ -112,7 +112,7 @@ public interface ISettings /// Update sync settings for all data types. /// /// - Task UpdateSyncSettingsAsync(UpdateProfileSyncSettingsRequestBody? request = null); + Task UpdateSyncSettingsAsync(UpdateProfileSyncSettingsRequestBody? request = null, RetryConfig? retryConfig = null); } /// @@ -122,23 +122,23 @@ public class Settings: ISettings { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; - public Settings(ISpeakeasyHttpClient defaultClient, Func? securitySource, string serverUrl, SDKConfig config) + public Settings(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) { - _defaultClient = defaultClient; + _client = client; _securitySource = securitySource; _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task CreateApiKeyAsync(CreateApiKey? request = null) + public async Task CreateApiKeyAsync(CreateApiKey? request = null, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -160,16 +160,52 @@ public async Task CreateApiKeyAsync(CreateApiKey? request var hookCtx = new HookContext("create-api-key", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 409 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -178,7 +214,7 @@ public async Task CreateApiKeyAsync(CreateApiKey? request } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -189,7 +225,7 @@ public async Task CreateApiKeyAsync(CreateApiKey? request } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -234,7 +270,7 @@ public async Task CreateApiKeyAsync(CreateApiKey? request } } - public async Task DeleteApiKeyAsync(DeleteApiKeyRequest request) + public async Task DeleteApiKeyAsync(DeleteApiKeyRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/apiKeys/{apiKeyId}", request); @@ -249,16 +285,52 @@ public async Task DeleteApiKeyAsync(DeleteApiKeyRequest re var hookCtx = new HookContext("delete-api-key", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -267,7 +339,7 @@ public async Task DeleteApiKeyAsync(DeleteApiKeyRequest re } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -278,7 +350,7 @@ public async Task DeleteApiKeyAsync(DeleteApiKeyRequest re } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -323,7 +395,7 @@ public async Task DeleteApiKeyAsync(DeleteApiKeyRequest re } } - public async Task GetProfileAsync() + public async Task GetProfileAsync(RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -339,16 +411,52 @@ public async Task GetProfileAsync() var hookCtx = new HookContext("get-profile", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -357,7 +465,7 @@ public async Task GetProfileAsync() } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -368,7 +476,7 @@ public async Task GetProfileAsync() } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -413,7 +521,7 @@ public async Task GetProfileAsync() } } - public async Task GetSyncSettingsAsync() + public async Task GetSyncSettingsAsync(RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -429,16 +537,52 @@ public async Task GetSyncSettingsAsync() var hookCtx = new HookContext("get-profile-syncSettings", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -447,7 +591,7 @@ public async Task GetSyncSettingsAsync() } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -458,7 +602,7 @@ public async Task GetSyncSettingsAsync() } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -503,7 +647,7 @@ public async Task GetSyncSettingsAsync() } } - public async Task ListApiKeysAsync() + public async Task ListApiKeysAsync(RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -519,16 +663,52 @@ public async Task ListApiKeysAsync() var hookCtx = new HookContext("list-api-keys", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -537,7 +717,7 @@ public async Task ListApiKeysAsync() } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -548,7 +728,7 @@ public async Task ListApiKeysAsync() } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -593,7 +773,7 @@ public async Task ListApiKeysAsync() } } - public async Task UpdateProfileAsync(Profile? request = null) + public async Task UpdateProfileAsync(Profile? request = null, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -615,16 +795,52 @@ public async Task UpdateProfileAsync(Profile? request = n var hookCtx = new HookContext("update-profile", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -633,7 +849,7 @@ public async Task UpdateProfileAsync(Profile? request = n } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -644,7 +860,7 @@ public async Task UpdateProfileAsync(Profile? request = n } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -689,7 +905,7 @@ public async Task UpdateProfileAsync(Profile? request = n } } - public async Task UpdateSyncSettingsAsync(UpdateProfileSyncSettingsRequestBody? request = null) + public async Task UpdateSyncSettingsAsync(UpdateProfileSyncSettingsRequestBody? request = null, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -711,16 +927,52 @@ public async Task UpdateSyncSettingsAsync(Upd var hookCtx = new HookContext("update-profile-syncSettings", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -729,7 +981,7 @@ public async Task UpdateSyncSettingsAsync(Upd } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -740,7 +992,7 @@ public async Task UpdateSyncSettingsAsync(Upd } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; diff --git a/platform/Codat/Platform/SupplementalData.cs b/platform/Codat/Platform/SupplementalData.cs index 8101741c7..0ad357fc7 100644 --- a/platform/Codat/Platform/SupplementalData.cs +++ b/platform/Codat/Platform/SupplementalData.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -14,6 +13,7 @@ namespace Codat.Platform using Codat.Platform.Models.Errors; using Codat.Platform.Models.Operations; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -40,7 +40,7 @@ public interface ISupplementalData /// See the *examples* for integration-specific frequently requested properties. /// /// - Task ConfigureAsync(ConfigureSupplementalDataRequest request); + Task ConfigureAsync(ConfigureSupplementalDataRequest request, RetryConfig? retryConfig = null); /// /// Get configuration @@ -51,7 +51,7 @@ public interface ISupplementalData /// Supplemental data is additional data you can include in Codat's standard data types. /// /// - Task GetConfigurationAsync(GetSupplementalDataConfigurationRequest request); + Task GetConfigurationAsync(GetSupplementalDataConfigurationRequest request, RetryConfig? retryConfig = null); } /// @@ -61,23 +61,23 @@ public class SupplementalData: ISupplementalData { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; - public SupplementalData(ISpeakeasyHttpClient defaultClient, Func? securitySource, string serverUrl, SDKConfig config) + public SupplementalData(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) { - _defaultClient = defaultClient; + _client = client; _securitySource = securitySource; _serverUrl = serverUrl; SDKConfiguration = config; } - public async Task ConfigureAsync(ConfigureSupplementalDataRequest request) + public async Task ConfigureAsync(ConfigureSupplementalDataRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig", request); @@ -98,16 +98,52 @@ public async Task ConfigureAsync(ConfigureSup var hookCtx = new HookContext("configure-supplemental-data", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -116,7 +152,7 @@ public async Task ConfigureAsync(ConfigureSup } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -127,7 +163,7 @@ public async Task ConfigureAsync(ConfigureSup } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -162,7 +198,7 @@ public async Task ConfigureAsync(ConfigureSup } } - public async Task GetConfigurationAsync(GetSupplementalDataConfigurationRequest request) + public async Task GetConfigurationAsync(GetSupplementalDataConfigurationRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig", request); @@ -177,16 +213,52 @@ public async Task GetConfigurationAsyn var hookCtx = new HookContext("get-supplemental-data-configuration", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -195,7 +267,7 @@ public async Task GetConfigurationAsyn } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -206,7 +278,7 @@ public async Task GetConfigurationAsyn } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; diff --git a/platform/Codat/Platform/Utils/AnyDeserializer.cs b/platform/Codat/Platform/Utils/AnyDeserializer.cs index 119a240f1..0f8a49b13 100644 --- a/platform/Codat/Platform/Utils/AnyDeserializer.cs +++ b/platform/Codat/Platform/Utils/AnyDeserializer.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Utils/BigIntStrConverter.cs b/platform/Codat/Platform/Utils/BigIntStrConverter.cs index 5fbb978b5..68a18f981 100644 --- a/platform/Codat/Platform/Utils/BigIntStrConverter.cs +++ b/platform/Codat/Platform/Utils/BigIntStrConverter.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Utils/DecimalStrConverter.cs b/platform/Codat/Platform/Utils/DecimalStrConverter.cs index bf4bc10a8..c25d97b1b 100644 --- a/platform/Codat/Platform/Utils/DecimalStrConverter.cs +++ b/platform/Codat/Platform/Utils/DecimalStrConverter.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Utils/EnumConverter.cs b/platform/Codat/Platform/Utils/EnumConverter.cs index 99ebe5b1b..969375bb2 100644 --- a/platform/Codat/Platform/Utils/EnumConverter.cs +++ b/platform/Codat/Platform/Utils/EnumConverter.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -35,7 +34,7 @@ JsonSerializer serializer { if (reader.Value == null) { - throw new ArgumentNullException(nameof(reader.Value)); + return null; } var extensionType = System.Type.GetType(objectType.FullName + "Extension"); diff --git a/platform/Codat/Platform/Utils/FlexibleObjectDeserializer.cs b/platform/Codat/Platform/Utils/FlexibleObjectDeserializer.cs index 7a3701671..962efd357 100644 --- a/platform/Codat/Platform/Utils/FlexibleObjectDeserializer.cs +++ b/platform/Codat/Platform/Utils/FlexibleObjectDeserializer.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Utils/HeaderSerializer.cs b/platform/Codat/Platform/Utils/HeaderSerializer.cs index c4bc0db23..b08dafe46 100644 --- a/platform/Codat/Platform/Utils/HeaderSerializer.cs +++ b/platform/Codat/Platform/Utils/HeaderSerializer.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Utils/IsoDateTimeSerializer.cs b/platform/Codat/Platform/Utils/IsoDateTimeSerializer.cs index 9dd12f315..9c0557ead 100644 --- a/platform/Codat/Platform/Utils/IsoDateTimeSerializer.cs +++ b/platform/Codat/Platform/Utils/IsoDateTimeSerializer.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Utils/RequestBodySerializer.cs b/platform/Codat/Platform/Utils/RequestBodySerializer.cs index 725339723..c2bce54fb 100644 --- a/platform/Codat/Platform/Utils/RequestBodySerializer.cs +++ b/platform/Codat/Platform/Utils/RequestBodySerializer.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Utils/ResponseBodyDeserializer.cs b/platform/Codat/Platform/Utils/ResponseBodyDeserializer.cs index bc3a4db9c..05a260250 100644 --- a/platform/Codat/Platform/Utils/ResponseBodyDeserializer.cs +++ b/platform/Codat/Platform/Utils/ResponseBodyDeserializer.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -13,10 +12,12 @@ namespace Codat.Platform.Utils using System; using System.Collections; using System.Collections.Generic; + using System.Linq; using System.Net.Http; using System.Reflection; using System.Text; using Newtonsoft.Json; + using Newtonsoft.Json.Linq; internal class ResponseBodyDeserializer @@ -26,5 +27,96 @@ internal class ResponseBodyDeserializer { return JsonConvert.DeserializeObject(json, new JsonSerializerSettings(){ NullValueHandling = nullValueHandling, MissingMemberHandling = missingMemberHandling, Converters = Utilities.GetJsonDeserializers(typeof(T))}); } + + public sealed class MissingMemberException : Exception + { + public MissingMemberException() : base("Missing member.") { } + } + + public sealed class DeserializationException : Exception + { + public DeserializationException(Type type) : base($"Could not deserialize into {type} type.") { } + } + + public static T? DeserializeUndiscriminatedUnionMember(string json) + { + try + { + return Deserialize(json, missingMemberHandling: MissingMemberHandling.Error); + } + catch (Exception ex) + { + if (ex is Newtonsoft.Json.JsonSerializationException && + ex.Source == "Newtonsoft.Json" && + ex.Message.Contains("Could not find member")) + { + throw new MissingMemberException(); + } + else if (ex is Newtonsoft.Json.JsonReaderException || + ex is Newtonsoft.Json.JsonSerializationException + ) + { + throw new DeserializationException(typeof(T)); + } + + throw; + } + } + + public static object DeserializeUndiscriminatedUnionFallback(System.Type type, object obj, string propertyName, string json) + { + MethodInfo? method = typeof(ResponseBodyDeserializer).GetMethod("Deserialize"); + if (method != null) + { + MethodInfo generic = method!.MakeGenericMethod(type); + var args = new object[] { json, NullValueHandling.Ignore, MissingMemberHandling.Ignore }; + var value = generic.Invoke(null, args); + PropertyInfo? propertyInfo = obj.GetType().GetProperty(propertyName!); + if (propertyInfo != null && value != null) + { + propertyInfo!.SetValue(obj, value!); + return obj; + } + } + + throw new DeserializationException(type); + } + + public static int MissingJsonProperties(System.Type type, string json) + { + int missing = 0; + + JObject jo = JObject.Parse(json); + + var jsonPropertyAttributes = type.GetProperties() + .Where(prop => Attribute.IsDefined(prop, typeof(JsonPropertyAttribute))) + .Select(prop => prop.GetCustomAttribute(typeof(JsonPropertyAttribute)) as JsonPropertyAttribute) + .Where(attr => attr != null && attr!.PropertyName != null) + .ToList(); + + foreach (var attr in jsonPropertyAttributes) + { + string propertyName = attr!.PropertyName!; + if (!jo.TryGetValue(propertyName, out var _value)){ + missing++; + } + } + + return missing; + } + + public static int CompareFallbackCandidates(System.Type typeA, System.Type typeB, string json) + { + var missingA = MissingJsonProperties(typeA, json); + var missingB = MissingJsonProperties(typeB, json); + + if (missingA == missingB) + { + return typeB.GetProperties().Count().CompareTo(typeA.GetProperties().Count()); + } + + return missingA.CompareTo(missingB); + } + } } \ No newline at end of file diff --git a/platform/Codat/Platform/Utils/Retries/BackoffStrategy.cs b/platform/Codat/Platform/Utils/Retries/BackoffStrategy.cs new file mode 100644 index 000000000..7e9608ba8 --- /dev/null +++ b/platform/Codat/Platform/Utils/Retries/BackoffStrategy.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Codat.Platform.Utils.Retries +{ + public class BackoffStrategy + { + public readonly long InitialIntervalMs; + public readonly long MaxIntervalMs; + public readonly long MaxElapsedTimeMs; + public readonly double BaseFactor; + public readonly double JitterFactor; + + /// + /// Configures the exponential backoff strategy. + /// + /// + /// The duration between consecutive attempts is calculated as follows: + /// intervalMs = min(maxIntervalMs, initialIntervalMs*(baseFactor^attempts) +/- r) + /// where baseFactor (also referred to as "exponent") is the multiplicative factor + /// and r a random value between 0 and jitterFactor*intervalMs. + /// + /// The initial interval in milliseconds. + /// The maximum interval in milliseconds. + /// The maximum elapsed time in milliseconds. + /// The base factor used to compute the exponential interval + /// The jitter factor used to randomize the backoff interval + public BackoffStrategy(long initialIntervalMs, + long maxIntervalMs, + long maxElapsedTimeMs, + double exponent, + double jitterFactor = 0.5) + { + InitialIntervalMs = initialIntervalMs; + MaxIntervalMs = maxIntervalMs; + MaxElapsedTimeMs = maxElapsedTimeMs; + BaseFactor = exponent; + JitterFactor = jitterFactor; + } + } +} \ No newline at end of file diff --git a/platform/Codat/Platform/Utils/Retries/Retries.cs b/platform/Codat/Platform/Utils/Retries/Retries.cs new file mode 100644 index 000000000..890edf1e2 --- /dev/null +++ b/platform/Codat/Platform/Utils/Retries/Retries.cs @@ -0,0 +1,156 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Codat.Platform.Utils.Retries +{ + using System; + using System.Net.Http; + using System.Collections.Generic; + using System.Threading.Tasks; + using Models.Errors; + + public class Retries + { + private Func> action; + private RetryConfig retryConfig; + private List statusCodes; + + public Retries(Func> action, RetryConfig retryConfig, List statusCodes) + { + this.action = action; + this.retryConfig = retryConfig; + this.statusCodes = statusCodes; + + if (statusCodes.Count == 0) + { + throw new ArgumentException("statusCodes list cannot be empty"); + } + } + + public sealed class PermanentException : Exception + { + public PermanentException(Exception innerException) : base("NonRetryable error.", innerException) { } + } + + public sealed class RetryableException : Exception + { + public HttpResponseMessage? Response = null; + + public RetryableException(HttpResponseMessage response) { + Response = response; + } + + public RetryableException(Exception innerException) : base("An error occurred.", innerException) { } + } + + public async Task Run() + { + switch(retryConfig.Strategy) { + case RetryConfig.RetryStrategy.BACKOFF: + return await retryWithBackoff(retryConfig.RetryConnectionErrors); + + case RetryConfig.RetryStrategy.NONE: + return await action(); + + default: + throw new ArgumentException("Invalid retry strategy"); + } + } + + private async Task GetResponseAsync(bool retryConnectionErrors) + { + try + { + var response = await action(); + + foreach (var statusCode in statusCodes) + { + if (statusCode.ToUpper().Contains("X")) + { + var codeRange = int.Parse(statusCode.Substring(0, 1)); + var statusMajor = (int)response.StatusCode / 100; + if (codeRange == statusMajor) + { + throw new RetryableException(response); + } + } + else + { + var code = int.Parse(statusCode); + if (code == (int)response.StatusCode) + { + throw new RetryableException(response); + } + } + } + + return response; + } + catch (RetryableException) + { + throw; + } + catch (Exception ex) + { + if ((ex is HttpRequestException || ex is TaskCanceledException) && retryConfig.RetryConnectionErrors) + { + throw new RetryableException(ex); + } + throw new PermanentException(ex); + } + } + + private async Task retryWithBackoff(bool retryConnectionErrors) + { + var backoff = retryConfig.Backoff; + if(backoff == null){ + throw new ArgumentException("Backoff strategy is not defined"); + } + + var startMs = DateTimeOffset.Now.ToUnixTimeMilliseconds(); + var numAttempts = 0; + + while (true) + { + try + { + return await GetResponseAsync(retryConnectionErrors); + } + catch (PermanentException ex) + { + throw ex.InnerException!; + } + catch (RetryableException ex) + { + var nowMs = DateTimeOffset.Now.ToUnixTimeMilliseconds(); + if (nowMs - startMs > backoff.MaxElapsedTimeMs) + { + if(ex.Response != null) + { + return ex.Response; + } + throw; + } + + var intervalMs = backoff.InitialIntervalMs * Math.Pow(backoff.BaseFactor, numAttempts); + var jitterMs = backoff.JitterFactor * intervalMs; + intervalMs = intervalMs - jitterMs + new Random().NextDouble() * (2 * jitterMs + 1); + intervalMs = Math.Min(intervalMs, backoff.MaxIntervalMs); + + await Task.Delay((int)intervalMs); + numAttempts += 1; + } + catch (Exception) + { + throw new Exception("Unexpected error occurred."); + } + } + } + } +} \ No newline at end of file diff --git a/platform/Codat/Platform/Utils/Retries/RetryConfig.cs b/platform/Codat/Platform/Utils/Retries/RetryConfig.cs new file mode 100644 index 000000000..f8330147d --- /dev/null +++ b/platform/Codat/Platform/Utils/Retries/RetryConfig.cs @@ -0,0 +1,46 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +namespace Codat.Platform.Utils.Retries +{ + public class RetryConfig + { + public enum RetryStrategy + { + BACKOFF, + NONE + } + public readonly RetryStrategy Strategy; + public readonly BackoffStrategy? Backoff; + public readonly bool RetryConnectionErrors; + + /// + /// Selects the retry strategy. + /// + /// The retry strategy. + /// The backoff strategy configuration (if applicable) + /// Whether to retry on connection errors. + /// + /// The backoff strategy is only required if the retry strategy is set to BACKOFF. + /// To disable retries, set the strategy to NONE. + /// + public RetryConfig(RetryStrategy strategy, BackoffStrategy? backoff = null, bool retryConnectionErrors = false) + { + + if (strategy == RetryStrategy.BACKOFF && backoff == null) + { + throw new System.ArgumentNullException("Backoff strategy configuration was not provided"); + } + + Strategy = strategy; + Backoff = backoff; + RetryConnectionErrors = retryConnectionErrors; + } + } +} \ No newline at end of file diff --git a/platform/Codat/Platform/Utils/SecurityMetadata.cs b/platform/Codat/Platform/Utils/SecurityMetadata.cs index cf279bc3d..4853ee249 100644 --- a/platform/Codat/Platform/Utils/SecurityMetadata.cs +++ b/platform/Codat/Platform/Utils/SecurityMetadata.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Utils/SpeakeasyHttpClient.cs b/platform/Codat/Platform/Utils/SpeakeasyHttpClient.cs index c380af86a..674925143 100644 --- a/platform/Codat/Platform/Utils/SpeakeasyHttpClient.cs +++ b/platform/Codat/Platform/Utils/SpeakeasyHttpClient.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -17,41 +16,66 @@ namespace Codat.Platform.Utils public interface ISpeakeasyHttpClient { + /// + /// Sends an HTTP request asynchronously. + /// + /// The HTTP request message to send. + /// The value of the TResult parameter contains the HTTP response message. Task SendAsync(HttpRequestMessage request); + + /// + /// Clones an HTTP request asynchronously. + /// + /// + /// This method is used in the context of Retries. It creates a new HttpRequestMessage instance + /// as a deep copy of the original request, including its method, URI, content, headers and options. + /// + /// The HTTP request message to clone. + /// The value of the TResult parameter contains the cloned HTTP request message. + Task CloneAsync(HttpRequestMessage request); } public class SpeakeasyHttpClient : ISpeakeasyHttpClient { - private class HttpClient : ISpeakeasyHttpClient + protected readonly HttpClient httpClient; + + public SpeakeasyHttpClient() + { + httpClient = new System.Net.Http.HttpClient(); + } + + public virtual async Task SendAsync(HttpRequestMessage request) { - private System.Net.Http.HttpClient client; + return await httpClient.SendAsync(request); + } - public HttpClient() + public virtual async Task CloneAsync(HttpRequestMessage request) + { + HttpRequestMessage clone = new HttpRequestMessage(request.Method, request.RequestUri); + + if (request.Content != null) { - client = new System.Net.Http.HttpClient(); + clone.Content = new ByteArrayContent(await request.Content.ReadAsByteArrayAsync()); + if (request.Content.Headers != null) + { + foreach (var h in request.Content.Headers) + { + clone.Content.Headers.Add(h.Key, h.Value); + } + } } - public async Task SendAsync(HttpRequestMessage request) + foreach (KeyValuePair> header in request.Headers) { - return await client.SendAsync(request); + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); } - } - private ISpeakeasyHttpClient? client; - - internal SpeakeasyHttpClient(ISpeakeasyHttpClient? client = null) - { - if (client == null) + foreach (KeyValuePair prop in request.Options) { - client = new HttpClient(); + clone.Options.TryAdd(prop.Key, prop.Value); } - this.client = client; - } - - public async Task SendAsync(HttpRequestMessage request) - { - return await client?.SendAsync(request); + return clone; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Utils/SpeakeasyMetadata.cs b/platform/Codat/Platform/Utils/SpeakeasyMetadata.cs index d912ffd3d..9897cc9c5 100644 --- a/platform/Codat/Platform/Utils/SpeakeasyMetadata.cs +++ b/platform/Codat/Platform/Utils/SpeakeasyMetadata.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Utils/URLBuilder.cs b/platform/Codat/Platform/Utils/URLBuilder.cs index 4f8b291b1..e07701f8c 100644 --- a/platform/Codat/Platform/Utils/URLBuilder.cs +++ b/platform/Codat/Platform/Utils/URLBuilder.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -18,7 +17,7 @@ namespace Codat.Platform.Utils internal static class URLBuilder { - public static string Build(string baseUrl, string path, object? request) + public static string Build(string baseUrl, string relativeUrl, object? request) { var url = baseUrl; @@ -27,19 +26,28 @@ public static string Build(string baseUrl, string path, object? request) url = url.Substring(0, url.Length - 1); } - url += path; + var pathAndFragment = relativeUrl.Split('#'); + if (pathAndFragment.Length > 2) + { + throw new ArgumentException($"Malformed URL: {relativeUrl}"); + } - var parameters = GetPathParameters(request); + url += pathAndFragment[0]; + var parameters = GetPathParameters(request); url = ReplaceParameters(url, parameters); var queryParams = SerializeQueryParams(TrySerializeQueryParams(request)); - if (queryParams != "") { url += $"?{queryParams}"; } + if (pathAndFragment.Length == 2) + { + url += $"#{pathAndFragment[1]}"; + } + return url; } diff --git a/platform/Codat/Platform/Utils/Utilities.cs b/platform/Codat/Platform/Utils/Utilities.cs index 3addba92f..e624e3e1a 100644 --- a/platform/Codat/Platform/Utils/Utilities.cs +++ b/platform/Codat/Platform/Utils/Utilities.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. diff --git a/platform/Codat/Platform/Webhooks.cs b/platform/Codat/Platform/Webhooks.cs index 06ec57519..e30486ffd 100644 --- a/platform/Codat/Platform/Webhooks.cs +++ b/platform/Codat/Platform/Webhooks.cs @@ -1,4 +1,3 @@ - //------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. @@ -14,6 +13,7 @@ namespace Codat.Platform using Codat.Platform.Models.Errors; using Codat.Platform.Models.Operations; using Codat.Platform.Models.Shared; + using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; @@ -35,7 +35,7 @@ public interface IWebhooks /// Create a new webhook configuration /// /// - Task CreateAsync(CreateRule? request = null); + Task CreateAsync(CreateRule? request = null, RetryConfig? retryConfig = null); /// /// Create webhook consumer @@ -43,10 +43,13 @@ public interface IWebhooks /// /// Use the *Create webhook consumer* endpoint to create a new webhook consumer that will listen to messages we send you.
///
- /// Webhook consumer is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on Codat's webhook service. + /// Webhook consumer is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on Codat's webhook service.
+ ///
+ /// ### Tips and traps
+ /// - The number of webhook consumers you can create is limited to 50. If you have reached the maximum number of consumers, use the *Delete webhook consumer* endpoint to delete an unused consumer first. ///
///
- Task CreateConsumerAsync(WebhookConsumerPrototype? request = null); + Task CreateConsumerAsync(WebhookConsumerPrototype? request = null, RetryConfig? retryConfig = null); /// /// Delete webhook consumer @@ -57,7 +60,7 @@ public interface IWebhooks /// Webhook consumer is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on Codat's webhook service. /// /// - Task DeleteConsumerAsync(DeleteWebhookConsumerRequest request); + Task DeleteConsumerAsync(DeleteWebhookConsumerRequest request, RetryConfig? retryConfig = null); /// /// Get webhook @@ -66,7 +69,7 @@ public interface IWebhooks /// Get a single webhook /// /// - Task GetAsync(GetWebhookRequest request); + Task GetAsync(GetWebhookRequest request, RetryConfig? retryConfig = null); /// /// List webhooks @@ -75,7 +78,7 @@ public interface IWebhooks /// List webhooks that you are subscribed to. /// /// - Task ListAsync(ListRulesRequest request); + Task ListAsync(ListRulesRequest request, RetryConfig? retryConfig = null); /// /// List webhook consumers @@ -86,7 +89,7 @@ public interface IWebhooks /// Webhook consumer is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on Codat's webhook service. /// /// - Task ListConsumersAsync(); + Task ListConsumersAsync(RetryConfig? retryConfig = null); } /// @@ -96,24 +99,24 @@ public class Webhooks: IWebhooks { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "3.6.1"; - private const string _sdkGenVersion = "2.319.7"; + private const string _sdkVersion = "3.7.0"; + private const string _sdkGenVersion = "2.361.10"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform"; + private const string _userAgent = "speakeasy-sdk/csharp 3.7.0 2.361.10 3.0.0 Codat.Platform"; private string _serverUrl = ""; - private ISpeakeasyHttpClient _defaultClient; + private ISpeakeasyHttpClient _client; private Func? _securitySource; - public Webhooks(ISpeakeasyHttpClient defaultClient, Func? securitySource, string serverUrl, SDKConfig config) + public Webhooks(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) { - _defaultClient = defaultClient; + _client = client; _securitySource = securitySource; _serverUrl = serverUrl; SDKConfiguration = config; } [Obsolete("This method will be removed in a future release, please migrate away from it as soon as possible")] - public async Task CreateAsync(CreateRule? request = null) + public async Task CreateAsync(CreateRule? request = null, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -135,16 +138,52 @@ public async Task CreateAsync(CreateRule? request = null) var hookCtx = new HookContext("create-rule", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -153,7 +192,7 @@ public async Task CreateAsync(CreateRule? request = null) } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -164,7 +203,7 @@ public async Task CreateAsync(CreateRule? request = null) } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -209,7 +248,7 @@ public async Task CreateAsync(CreateRule? request = null) } } - public async Task CreateConsumerAsync(WebhookConsumerPrototype? request = null) + public async Task CreateConsumerAsync(WebhookConsumerPrototype? request = null, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -231,16 +270,52 @@ public async Task CreateConsumerAsync(WebhookCons var hookCtx = new HookContext("create-webhook-consumer", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; - if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) + if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -249,7 +324,7 @@ public async Task CreateConsumerAsync(WebhookCons } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -260,7 +335,7 @@ public async Task CreateConsumerAsync(WebhookCons } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -283,7 +358,7 @@ public async Task CreateConsumerAsync(WebhookCons throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); } } - else if(new List{401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { @@ -305,7 +380,7 @@ public async Task CreateConsumerAsync(WebhookCons } } - public async Task DeleteConsumerAsync(DeleteWebhookConsumerRequest request) + public async Task DeleteConsumerAsync(DeleteWebhookConsumerRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/webhooks/{webhookId}", request); @@ -320,16 +395,52 @@ public async Task DeleteConsumerAsync(DeleteWebho var hookCtx = new HookContext("delete-webhook-consumer", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -338,7 +449,7 @@ public async Task DeleteConsumerAsync(DeleteWebho } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -349,7 +460,7 @@ public async Task DeleteConsumerAsync(DeleteWebho } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -385,7 +496,7 @@ public async Task DeleteConsumerAsync(DeleteWebho } [Obsolete("This method will be removed in a future release, please migrate away from it as soon as possible")] - public async Task GetAsync(GetWebhookRequest request) + public async Task GetAsync(GetWebhookRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/rules/{ruleId}", request); @@ -400,16 +511,52 @@ public async Task GetAsync(GetWebhookRequest request) var hookCtx = new HookContext("get-webhook", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -418,7 +565,7 @@ public async Task GetAsync(GetWebhookRequest request) } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -429,7 +576,7 @@ public async Task GetAsync(GetWebhookRequest request) } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -475,7 +622,7 @@ public async Task GetAsync(GetWebhookRequest request) } [Obsolete("This method will be removed in a future release, please migrate away from it as soon as possible")] - public async Task ListAsync(ListRulesRequest request) + public async Task ListAsync(ListRulesRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/rules", request); @@ -490,16 +637,52 @@ public async Task ListAsync(ListRulesRequest request) var hookCtx = new HookContext("list-rules", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -508,7 +691,7 @@ public async Task ListAsync(ListRulesRequest request) } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -519,7 +702,7 @@ public async Task ListAsync(ListRulesRequest request) } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; @@ -564,7 +747,7 @@ public async Task ListAsync(ListRulesRequest request) } } - public async Task ListConsumersAsync() + public async Task ListConsumersAsync(RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -580,16 +763,52 @@ public async Task ListConsumersAsync() var hookCtx = new HookContext("list-webhook-consumers", null, _securitySource); - httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); + if (retryConfig == null) + { + if (this.SDKConfiguration.RetryConfig != null) + { + retryConfig = this.SDKConfiguration.RetryConfig; + } + else + { + var backoff = new BackoffStrategy( + initialIntervalMs: 500L, + maxIntervalMs: 60000L, + maxElapsedTimeMs: 3600000L, + exponent: 1.5 + ); + retryConfig = new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: backoff, + retryConnectionErrors: true + ); + } + } + + List statusCodes = new List + { + "408", + "429", + "5XX", + }; + + Func> retrySend = async () => + { + var _httpRequest = await _client.CloneAsync(httpRequest); + return await _client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + HttpResponseMessage httpResponse; try { - httpResponse = await _defaultClient.SendAsync(httpRequest); + httpResponse = await retries.Run(); int _statusCode = (int)httpResponse.StatusCode; if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -598,7 +817,7 @@ public async Task ListConsumersAsync() } catch (Exception error) { - var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); if (_httpResponse != null) { httpResponse = _httpResponse; @@ -609,7 +828,7 @@ public async Task ListConsumersAsync() } } - httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; diff --git a/platform/NUGET.md b/platform/NUGET.md new file mode 100644 index 000000000..b3b13464b --- /dev/null +++ b/platform/NUGET.md @@ -0,0 +1,185 @@ +# Codat.Platform + + + +## SDK Example Usage + +### Example + +```csharp +using Codat.Platform; +using Codat.Platform.Models.Shared; + +var sdk = new CodatPlatform(security: new Security() { + AuthHeader = "Basic BASE_64_ENCODED(API_KEY)", + }); + +CreateApiKey req = new CreateApiKey() { + Name = "azure-invoice-finance-processor", +}; + +var res = await sdk.Settings.CreateApiKeyAsync(req); + +// handle response +``` + + + +## Retries + +Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. + +To change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call: +```csharp +using Codat.Platform; +using Codat.Platform.Models.Shared; + +var sdk = new CodatPlatform(security: new Security() { + AuthHeader = "Basic BASE_64_ENCODED(API_KEY)", + }); + +CreateApiKey req = new CreateApiKey() { + Name = "azure-invoice-finance-processor", +}; + +var res = await sdk.Settings.CreateApiKeyAsync(req, + retryConfig: new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: new BackoffStrategy( + initialIntervalMs: 1L, + maxIntervalMs: 50L, + maxElapsedTimeMs: 100L, + exponent: 1.1 + ), + retryConnectionErrors: false +)); + +// handle response +``` + +If you'd like to override the default retry strategy for all operations that support retries, you can use the `RetryConfig` optional parameter when intitializing the SDK: +```csharp +using Codat.Platform; +using Codat.Platform.Models.Shared; + +var sdk = new CodatPlatform( + retryConfig: new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: new BackoffStrategy( + initialIntervalMs: 1L, + maxIntervalMs: 50L, + maxElapsedTimeMs: 100L, + exponent: 1.1 + ), + retryConnectionErrors: false +), + security: new Security() { + AuthHeader = "Basic BASE_64_ENCODED(API_KEY)", + }); + +CreateApiKey req = new CreateApiKey() { + Name = "azure-invoice-finance-processor", +}; + +var res = await sdk.Settings.CreateApiKeyAsync(req); + +// handle response +``` + + + +## Error Handling + +Handling errors in this SDK should largely match your expectations. All operations return a response object or thow an exception. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate type. + +| Error Object | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| Codat.Platform.Models.Errors.ErrorMessage | 400,401,402,403,409,429,500,503 | application/json | +| Codat.Platform.Models.Errors.SDKException | 4xx-5xx | */* | + +### Example + +```csharp +using Codat.Platform; +using Codat.Platform.Models.Shared; +using System; +using Codat.Platform.Models.Errors; + +var sdk = new CodatPlatform(security: new Security() { + AuthHeader = "Basic BASE_64_ENCODED(API_KEY)", + }); + +CreateApiKey req = new CreateApiKey() { + Name = "azure-invoice-finance-processor", +}; + +try +{ + var res = await sdk.Settings.CreateApiKeyAsync(req); + // handle response +} +catch (Exception ex) +{ + if (ex is ErrorMessage) + { + // handle exception + } + else if (ex is Codat.Platform.Models.Errors.SDKException) + { + // handle exception + } +} + +``` + + + +## Server Selection + +### Select Server by Index + +You can override the default server globally by passing a server index to the `serverIndex: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: + +| # | Server | Variables | +| - | ------ | --------- | +| 0 | `https://api.codat.io` | None | + + + + +### Override Server URL Per-Client + +The default server can also be overridden globally by passing a URL to the `serverUrl: str` optional parameter when initializing the SDK client instance. For example: + + + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security scheme globally: + +| Name | Type | Scheme | +| ------------ | ------------ | ------------ | +| `AuthHeader` | apiKey | API key | + +You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example: +```csharp +using Codat.Platform; +using Codat.Platform.Models.Shared; + +var sdk = new CodatPlatform(security: new Security() { + AuthHeader = "Basic BASE_64_ENCODED(API_KEY)", + }); + +CreateApiKey req = new CreateApiKey() { + Name = "azure-invoice-finance-processor", +}; + +var res = await sdk.Settings.CreateApiKeyAsync(req); + +// handle response +``` + + + \ No newline at end of file diff --git a/platform/README.md b/platform/README.md index 8389d5a73..ac4a33a55 100644 --- a/platform/README.md +++ b/platform/README.md @@ -7,11 +7,17 @@ Manage the building blocks of Codat, including companies, connections, and more. ## SDK Installation -### Nuget +### NuGet ```bash dotnet add package Codat.Platform ``` + +### Locally + +```bash +dotnet add reference path/to/Codat/Platform.csproj +``` ## Example Usage @@ -221,6 +227,69 @@ catch (Exception ex) ``` + +## Retries + +Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. + +To change the default retry strategy for a single API call, simply pass a `RetryConfig` to the call: +```csharp +using Codat.Platform; +using Codat.Platform.Models.Shared; + +var sdk = new CodatPlatform(security: new Security() { + AuthHeader = "Basic BASE_64_ENCODED(API_KEY)", + }); + +CreateApiKey req = new CreateApiKey() { + Name = "azure-invoice-finance-processor", +}; + +var res = await sdk.Settings.CreateApiKeyAsync(req, + retryConfig: new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: new BackoffStrategy( + initialIntervalMs: 1L, + maxIntervalMs: 50L, + maxElapsedTimeMs: 100L, + exponent: 1.1 + ), + retryConnectionErrors: false +)); + +// handle response +``` + +If you'd like to override the default retry strategy for all operations that support retries, you can use the `RetryConfig` optional parameter when intitializing the SDK: +```csharp +using Codat.Platform; +using Codat.Platform.Models.Shared; + +var sdk = new CodatPlatform( + retryConfig: new RetryConfig( + strategy: RetryConfig.RetryStrategy.BACKOFF, + backoff: new BackoffStrategy( + initialIntervalMs: 1L, + maxIntervalMs: 50L, + maxElapsedTimeMs: 100L, + exponent: 1.1 + ), + retryConnectionErrors: false +), + security: new Security() { + AuthHeader = "Basic BASE_64_ENCODED(API_KEY)", + }); + +CreateApiKey req = new CreateApiKey() { + Name = "azure-invoice-finance-processor", +}; + +var res = await sdk.Settings.CreateApiKeyAsync(req); + +// handle response +``` + + diff --git a/platform/RELEASES.md b/platform/RELEASES.md index 59cec8f83..4b8de1bb5 100644 --- a/platform/RELEASES.md +++ b/platform/RELEASES.md @@ -156,4 +156,14 @@ Based on: ### Generated - [csharp v3.6.1] platform ### Releases -- [NuGet v3.6.1] https://www.nuget.org/packages/Codat.Platform/3.6.1 - platform \ No newline at end of file +- [NuGet v3.6.1] https://www.nuget.org/packages/Codat.Platform/3.6.1 - platform + +## 2024-07-09 16:24:41 +### Changes +Based on: +- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Platform.yaml +- Speakeasy CLI 1.330.0 (2.361.10) https://github.com/speakeasy-api/speakeasy +### Generated +- [csharp v3.7.0] platform +### Releases +- [NuGet v3.7.0] https://www.nuget.org/packages/Codat.Platform/3.7.0 - platform \ No newline at end of file diff --git a/platform/docs/Models/Operations/GetCompanyPushHistoryRequest.md b/platform/docs/Models/Operations/GetCompanyPushHistoryRequest.md index 16c5b762a..f1f4a4e94 100644 --- a/platform/docs/Models/Operations/GetCompanyPushHistoryRequest.md +++ b/platform/docs/Models/Operations/GetCompanyPushHistoryRequest.md @@ -9,4 +9,4 @@ | `OrderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | *int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | *int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/platform/docs/Models/Operations/ListCompaniesRequest.md b/platform/docs/Models/Operations/ListCompaniesRequest.md index 62f4c9388..6bc85ebaa 100644 --- a/platform/docs/Models/Operations/ListCompaniesRequest.md +++ b/platform/docs/Models/Operations/ListCompaniesRequest.md @@ -8,4 +8,4 @@ | `OrderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | *int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | *int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/platform/docs/Models/Operations/ListConnectionsRequest.md b/platform/docs/Models/Operations/ListConnectionsRequest.md index 834c74065..d393fef2a 100644 --- a/platform/docs/Models/Operations/ListConnectionsRequest.md +++ b/platform/docs/Models/Operations/ListConnectionsRequest.md @@ -9,4 +9,4 @@ | `OrderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | *int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | *int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/platform/docs/Models/Operations/ListIntegrationsRequest.md b/platform/docs/Models/Operations/ListIntegrationsRequest.md index 72619b388..7795514d2 100644 --- a/platform/docs/Models/Operations/ListIntegrationsRequest.md +++ b/platform/docs/Models/Operations/ListIntegrationsRequest.md @@ -8,4 +8,4 @@ | `OrderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | *int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | *int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/platform/docs/Models/Operations/ListPullOperationsRequest.md b/platform/docs/Models/Operations/ListPullOperationsRequest.md index 37723f226..55eed6d70 100644 --- a/platform/docs/Models/Operations/ListPullOperationsRequest.md +++ b/platform/docs/Models/Operations/ListPullOperationsRequest.md @@ -9,4 +9,4 @@ | `OrderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | *int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | *int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/platform/docs/Models/Operations/ListRulesRequest.md b/platform/docs/Models/Operations/ListRulesRequest.md index 5eea99a9f..f7c05f146 100644 --- a/platform/docs/Models/Operations/ListRulesRequest.md +++ b/platform/docs/Models/Operations/ListRulesRequest.md @@ -8,4 +8,4 @@ | `OrderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `Page` | *int* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `PageSize` | *int* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `Query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `Query` | *string* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/platform/docs/Models/Shared/DataConnectionError.md b/platform/docs/Models/Shared/DataConnectionError.md index 70740832d..83491b008 100644 --- a/platform/docs/Models/Shared/DataConnectionError.md +++ b/platform/docs/Models/Shared/DataConnectionError.md @@ -5,7 +5,9 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ErrorMessage` | *string* | :heavy_minus_sign: | A brief message about the error. | | +| `ErrorMessage` | *string* | :heavy_minus_sign: | A message about a error returned by Codat. | | | `ErroredOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | -| `StatusCode` | *string* | :heavy_minus_sign: | The HTTP status code returned by the error. | | -| `StatusText` | *string* | :heavy_minus_sign: | A non-numeric status code/text. | | \ No newline at end of file +| `ResolvedOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `Status` | [ErrorStatus](../../Models/Shared/ErrorStatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | | +| `StatusCode` | *string* | :heavy_minus_sign: | The HTTP status code returned by the source platform when the error occurred. | | +| `StatusText` | *string* | :heavy_minus_sign: | A non-numeric status code/text returned by the source platform when the error occurred. | | \ No newline at end of file diff --git a/platform/docs/Models/Shared/ErrorStatus.md b/platform/docs/Models/Shared/ErrorStatus.md new file mode 100644 index 000000000..9dc662553 --- /dev/null +++ b/platform/docs/Models/Shared/ErrorStatus.md @@ -0,0 +1,11 @@ +# ErrorStatus + +The current status of a transient error. Null statuses indicate that the error is not transient. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `Active` | Active | +| `Resolved` | Resolved | \ No newline at end of file diff --git a/platform/docs/Models/Shared/PullOperation.md b/platform/docs/Models/Shared/PullOperation.md index f48846ef9..969e86709 100644 --- a/platform/docs/Models/Shared/PullOperation.md +++ b/platform/docs/Models/Shared/PullOperation.md @@ -12,7 +12,7 @@ Information about a queued, in progress or completed pull operation. | `Completed` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `ConnectionId` | *string* | :heavy_check_mark: | Unique identifier of the connection associated to this pull operation. | 50830828-7d39-4367-b0eb-5ddb2de5faa5 | | `DataType` | *string* | :heavy_check_mark: | The data type you are requesting in a pull operation. | | -| `ErrorMessage` | *string* | :heavy_minus_sign: | A message about a transient or persistent error. | | +| `ErrorMessage` | *string* | :heavy_minus_sign: | A message about a transient or persistent error returned by Codat or the source platform. | | | `Id` | *string* | :heavy_check_mark: | Unique identifier of the pull operation. | 943accd0-4247-42d8-865b-363c8629e1da | | `IsCompleted` | *bool* | :heavy_check_mark: | `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. | | | `IsErrored` | *bool* | :heavy_check_mark: | `True` if the pull operation entered an error state. | | diff --git a/platform/docs/sdks/companies/README.md b/platform/docs/sdks/companies/README.md index 332563351..c9531d895 100644 --- a/platform/docs/sdks/companies/README.md +++ b/platform/docs/sdks/companies/README.md @@ -177,6 +177,7 @@ ListCompaniesRequest req = new ListCompaniesRequest() { OrderBy = "-modifiedDate", Page = 1, PageSize = 100, + Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", }; var res = await sdk.Companies.ListAsync(req); diff --git a/platform/docs/sdks/connectionmanagement/README.md b/platform/docs/sdks/connectionmanagement/README.md index bf3498c3c..636c283a7 100644 --- a/platform/docs/sdks/connectionmanagement/README.md +++ b/platform/docs/sdks/connectionmanagement/README.md @@ -3,7 +3,7 @@ ## Overview -Configure connection management UI and retrieve access tokens for authentication. +Configure UI and retrieve access tokens for authentication used by **Connections SDK**. ### Available Operations @@ -11,9 +11,9 @@ Configure connection management UI and retrieve access tokens for authentication ## GetAccessToken -Use the *Get access token* endpoint to retrieve a new access token for use by the [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management). The token is only valid for one hour and applies to a single company. +Use the *Get access token* endpoint to retrieve a new access token for use with the [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management). The token is only valid for one hour and applies to a single company. -The embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. +The embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. ### Example Usage diff --git a/platform/docs/sdks/connections/README.md b/platform/docs/sdks/connections/README.md index c83d5b4e9..52093b02d 100644 --- a/platform/docs/sdks/connections/README.md +++ b/platform/docs/sdks/connections/README.md @@ -165,6 +165,7 @@ ListConnectionsRequest req = new ListConnectionsRequest() { OrderBy = "-modifiedDate", Page = 1, PageSize = 100, + Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", }; var res = await sdk.Connections.ListAsync(req); diff --git a/platform/docs/sdks/corssettings/README.md b/platform/docs/sdks/corssettings/README.md index 39c318231..742d11146 100644 --- a/platform/docs/sdks/corssettings/README.md +++ b/platform/docs/sdks/corssettings/README.md @@ -10,9 +10,9 @@ The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. -Enabling CORS with Codat is required by our embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. +Enabling CORS with Codat is required by our embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. -The embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. +The embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. ### Example Usage @@ -44,9 +44,9 @@ var res = await sdk.ConnectionManagement.CorsSettings.GetAsync(); The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). -Enabling CORS with Codat is required by our embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. +Enabling CORS with Codat is required by our embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. -The embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. +The embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. ### Example Usage diff --git a/platform/docs/sdks/integrations/README.md b/platform/docs/sdks/integrations/README.md index 5d6d29ed1..818be611e 100644 --- a/platform/docs/sdks/integrations/README.md +++ b/platform/docs/sdks/integrations/README.md @@ -112,6 +112,7 @@ ListIntegrationsRequest req = new ListIntegrationsRequest() { OrderBy = "-modifiedDate", Page = 1, PageSize = 100, + Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", }; var res = await sdk.Integrations.ListAsync(req); diff --git a/platform/docs/sdks/pushdata/README.md b/platform/docs/sdks/pushdata/README.md index 242b91571..bece77ad9 100644 --- a/platform/docs/sdks/pushdata/README.md +++ b/platform/docs/sdks/pushdata/README.md @@ -125,6 +125,7 @@ GetCompanyPushHistoryRequest req = new GetCompanyPushHistoryRequest() { OrderBy = "-modifiedDate", Page = 1, PageSize = 100, + Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", }; var res = await sdk.PushData.ListOperationsAsync(req); diff --git a/platform/docs/sdks/refreshdata/README.md b/platform/docs/sdks/refreshdata/README.md index d501abb81..7d65d926b 100644 --- a/platform/docs/sdks/refreshdata/README.md +++ b/platform/docs/sdks/refreshdata/README.md @@ -205,6 +205,7 @@ ListPullOperationsRequest req = new ListPullOperationsRequest() { OrderBy = "-modifiedDate", Page = 1, PageSize = 100, + Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", }; var res = await sdk.RefreshData.ListPullOperationsAsync(req); diff --git a/platform/docs/sdks/settings/README.md b/platform/docs/sdks/settings/README.md index d8613f9f6..81da624ea 100644 --- a/platform/docs/sdks/settings/README.md +++ b/platform/docs/sdks/settings/README.md @@ -226,7 +226,6 @@ var sdk = new CodatPlatform(security: new Security() { Profile req = new Profile() { AlertAuthHeader = "Bearer tXEiHiRK7XCtI8TNHbpGs1LI1pumdb4Cl1QIo7B2", - ApiKey = "sartANTjHAkLdbyDfaynoTQb7pkmj6hXHmnQKMrB", ConfirmCompanyName = true, IconUrl = "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", LogoUrl = "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", diff --git a/platform/docs/sdks/webhooks/README.md b/platform/docs/sdks/webhooks/README.md index 3c8b7a678..ac20ab156 100644 --- a/platform/docs/sdks/webhooks/README.md +++ b/platform/docs/sdks/webhooks/README.md @@ -70,6 +70,9 @@ var res = await sdk.Webhooks.CreateAsync(req); [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). +### Tips and traps +- The number of webhook consumers you can create is limited to 50. If you have reached the maximum number of consumers, use the [*Delete webhook consumer*](https://docs.codat.io/platform-api#/operations/delete-webhook-consumer) endpoint to delete an unused consumer first. + ### Example Usage ```csharp @@ -104,7 +107,7 @@ var res = await sdk.Webhooks.CreateConsumerAsync(req); | Error Object | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401,402,403,429,500,503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 400,401,402,403,429,500,503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4xx-5xx | */* | ## DeleteConsumer @@ -214,6 +217,7 @@ ListRulesRequest req = new ListRulesRequest() { OrderBy = "-modifiedDate", Page = 1, PageSize = 100, + Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", }; var res = await sdk.Webhooks.ListAsync(req); diff --git a/platform/gen.yaml b/platform/gen.yaml index 63728fc5c..39fc86888 100644 --- a/platform/gen.yaml +++ b/platform/gen.yaml @@ -11,7 +11,7 @@ generation: oAuth2ClientCredentialsEnabled: false telemetryEnabled: true csharp: - version: 3.6.1 + version: 3.7.0 additionalDependencies: [] author: Codat clientServerStatusCodesAsErrors: true diff --git a/platform/global.json b/platform/global.json index 39c6b2556..b7d28eaab 100644 --- a/platform/global.json +++ b/platform/global.json @@ -3,4 +3,4 @@ "version": "6.0.0", "rollForward": "latestMinor" } -} +} \ No newline at end of file