From c777661d426bbf7334788f0abebd717718446f30 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 15 Oct 2025 09:34:46 +0000 Subject: [PATCH] ## Csharp SDK Changes Detected: * `Codat.platform.Connection.Created()`: * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Settings.Update-Profile()`: * `request.AlertAuthHeader` **Removed** **Breaking** :warning: * `response.alertAuthHeader` **Removed** **Breaking** :warning: * `Codat.platform.Settings.Get-Profile()`: `response.alertAuthHeader` **Removed** **Breaking** :warning: * `Codat.platform.Webhooks.Create-Consumer()`: * `request` **Changed** **Breaking** :warning: * `response` **Changed** **Breaking** :warning: * `Codat.platform.Webhooks.List-Consumers()`: `response.results.[]` **Changed** **Breaking** :warning: * `Codat.platform.Connections.Update-Authorization()`: `response.connectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Connections.Unlink()`: `response.connectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Connections.Get()`: `response.connectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Connections.Create()`: `response.connectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Connections.List()`: `response.results.[].ConnectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Companies.Update()`: * `request` **Changed** **Breaking** :warning: * `response.dataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Companies.Get()`: `response.dataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Companies.Create()`: `response.dataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Companies.List()`: * `request.Tags` **Added** * `response.results.[].DataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Connection.Deleted()`: * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Connection.Reconnected()`: * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Connection.Disconnected()`: * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Connection.Failed()`: * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.Connection.Connected()`: * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** :warning: * `Codat.platform.DatasetStatusHasChangedToAnErrorState()`: **Deleted** **Breaking** :warning: * `Codat.platform.NewCompanySynchronized()`: **Deleted** **Breaking** :warning: * `Codat.platform.Webhooks.Create()`: **Deleted** **Breaking** :warning: * `Codat.platform.Webhooks.Get()`: **Deleted** **Breaking** :warning: * `Codat.platform.ConnectionManagement.Cors-Settings.Set()`: **Deleted** **Breaking** :warning: * `Codat.platform.ConnectionManagement.Cors-Settings.Get()`: **Deleted** **Breaking** :warning: * `Codat.platform.ConnectionManagement.Get-Access-Token()`: **Deleted** **Breaking** :warning: * `Codat.platform.ClientRateLimitReset()`: **Deleted** **Breaking** :warning: * `Codat.platform.ClientRateLimitReached()`: **Deleted** **Breaking** :warning: * `Codat.platform.PushOperationHasTimedOut()`: **Deleted** **Breaking** :warning: * `Codat.platform.Read.Completed()`: * `request.Payload.DataTypes.[].Issues` **Added** * `Codat.platform.Read.Completed.Initial()`: * `request.Payload.DataTypes.[].Issues` **Added** * `Codat.platform.PushOperationStatusHasChanged()`: **Deleted** **Breaking** :warning: * `Codat.platform.Webhooks.List()`: **Deleted** **Breaking** :warning: * `Codat.platform.Companies.Replace()`: **Added** * `Codat.platform.DatasetDataChanged()`: **Deleted** **Breaking** :warning: * `Codat.platform.DataSyncCompleted()`: **Deleted** **Breaking** :warning: * `Codat.platform.CompanyDataConnectionStatusChanged()`: **Deleted** **Breaking** :warning: * `Codat.platform.ReadData.Get-Validation-Results()`: **Added** * `Codat.platform.Settings.Set()`: **Added** * `Codat.platform.Settings.Get()`: **Added** * `Codat.platform.RefreshData.All()`: `error.status[400]` **Added** * `Codat.platform.RefreshData.By-Data-Type()`: `error.status[400]` **Added** * `Codat.platform.RefreshData.Get()`: `response.accountTransactions.LastSuccessfulSync` **Changed** * `Codat.platform.Cors.Set()`: **Added** * `Codat.platform.Cors.Get()`: **Added** * `Codat.platform.ConnectionManagement.Get()`: **Added** * `Codat.platform.Companies.Refresh-Product-Data()`: **Added** --- .speakeasy/workflow.lock | 16 +- platform/.gitignore | 5 + platform/.speakeasy/gen.lock | 1481 ++++++++--------- platform/.speakeasy/gen.yaml | 15 +- platform/Codat/Platform/Codat.Platform.csproj | 4 +- platform/Codat/Platform/CodatPlatform.cs | 194 ++- platform/Codat/Platform/Companies.cs | 943 +++++++++-- .../Codat/Platform/ConnectionManagement.cs | 107 +- platform/Codat/Platform/Connections.cs | 451 +++-- .../Platform/{CorsSettings.cs => Cors.cs} | 185 +- platform/Codat/Platform/CustomDataType.cs | 315 +++- platform/Codat/Platform/Hooks/HookTypes.cs | 21 +- platform/Codat/Platform/Hooks/SDKHooks.cs | 14 +- platform/Codat/Platform/Integrations.cs | 241 ++- .../Platform/Models/Components/ApiKeys.cs | 2 +- .../ClientRateLimitReachedWebhook.cs | 63 - .../ClientRateLimitReachedWebhookData.cs | 51 - .../Components/ClientRateLimitResetWebhook.cs | 63 - .../ClientRateLimitResetWebhookData.cs | 63 - .../{Webhooks.cs => CompanyUpdateRequest.cs} | 27 +- .../Platform/Models/Components/Connection.cs | 2 +- .../ConnectionStatusChangedWebhook.cs | 75 - .../ConnectionStatusChangedWebhookData.cs | 43 - .../Platform/Models/Components/DataStatus.cs | 4 +- .../Models/Components/DataStatusDataTypes.cs | 142 -- .../Components/DataSyncCompletedWebhook.cs | 75 - .../Models/Components/DataTypeFeature.cs | 2 +- .../Models/Components/DataTypeReadSummary.cs | 50 + .../Platform/Models/Components/DataTypes.cs | 143 +- .../Components/DatasetDataChangedWebhook.cs | 75 - .../DatasetStatusChangedErrorWebhook.cs | 75 - .../Components/{CreateRule.cs => Issue.cs} | 18 +- ...tusChangedWebhookData.cs => IssueLinks.cs} | 21 +- .../NewCompanySynchronizedWebhook.cs | 71 - .../Platform/Models/Components/Profile.cs | 8 +- .../Models/Components/PropertieDataType.cs | 142 -- .../Models/Components/PushOperation.cs | 4 +- .../Models/Components/PushOperationRef.cs | 2 +- .../PushOperationStatusChangedWebhook.cs | 75 - .../PushOperationTimedOutWebhook.cs | 75 - .../PushOperationTimedOutWebhookData.cs | 37 - .../Components/ReadCompletedWebhookPayload.cs | 2 +- .../Platform/Models/Components/SyncSetting.cs | 2 +- .../Platform/Models/Components/Validation.cs | 4 +- .../Models/Components/ValidationItem.cs | 18 +- ...ErrorWebhookData.cs => ValidationItem1.cs} | 21 +- ...WebhookNotifier.cs => ValidationResult.cs} | 14 +- .../Platform/Models/Components/Webhook.cs | 43 - .../Models/Components/WebhookConsumer.cs | 10 +- .../Components/WebhookConsumerPrototype.cs | 10 +- .../Models/Errors/CodatPlatformException.cs | 80 + .../Platform/Models/Errors/ErrorMessage.cs | 57 +- .../Errors/ResponseValidationException.cs | 29 + .../Platform/Models/Errors/SDKException.cs | 34 +- .../Models/Requests/AddProductResponse.cs | 2 +- .../ConfigureCustomDataTypeResponse.cs | 2 +- .../ConfigureSupplementalDataResponse.cs | 2 +- .../Models/Requests/CreateApiKeyResponse.cs | 2 +- .../Models/Requests/CreateCompanyResponse.cs | 2 +- .../Requests/CreateConnectionResponse.cs | 2 +- .../Requests/CreateWebhookConsumerResponse.cs | 2 +- .../Models/Requests/DeleteApiKeyResponse.cs | 2 +- .../Models/Requests/DeleteCompanyResponse.cs | 2 +- .../Requests/DeleteConnectionResponse.cs | 2 +- .../Requests/DeleteWebhookConsumerResponse.cs | 2 +- .../Requests/GetCompanyAccessTokenResponse.cs | 2 +- .../Requests/GetCompanyDataStatusResponse.cs | 2 +- .../Requests/GetCompanyPushHistoryResponse.cs | 2 +- .../Models/Requests/GetCompanyResponse.cs | 2 +- ...ConnectionManagementAccessTokenResponse.cs | 2 +- ...onnectionManagementCorsSettingsResponse.cs | 2 +- .../Models/Requests/GetConnectionResponse.cs | 2 +- ...Response.cs => GetCorsSettingsResponse.cs} | 8 +- ...ateUpdateModelOptionsByDataTypeResponse.cs | 2 +- .../GetCustomDataTypeConfigurationResponse.cs | 2 +- .../Models/Requests/GetIntegrationResponse.cs | 2 +- .../GetIntegrationsBrandingResponse.cs | 2 +- .../Models/Requests/GetProfileResponse.cs | 2 +- .../GetProfileSyncSettingsResponse.cs | 2 +- .../Requests/GetPullOperationResponse.cs | 2 +- .../Requests/GetPushOperationResponse.cs | 2 +- .../GetReadValidationResultsRequest.cs} | 16 +- ...cs => GetReadValidationResultsResponse.cs} | 6 +- ...etSupplementalDataConfigurationResponse.cs | 2 +- .../Models/Requests/ListApiKeysResponse.cs | 2 +- .../Models/Requests/ListCompaniesRequest.cs | 6 + .../Models/Requests/ListCompaniesResponse.cs | 2 +- .../Requests/ListConnectionsResponse.cs | 2 +- .../ListCustomDataTypeRecordsResponse.cs | 2 +- .../Requests/ListIntegrationsResponse.cs | 2 +- .../Requests/ListPullOperationsResponse.cs | 2 +- .../Models/Requests/ListRulesRequest.cs | 41 - .../Requests/ListWebhookConsumersResponse.cs | 2 +- .../Requests/RefreshCompanyDataResponse.cs | 2 +- .../Requests/RefreshCustomDataTypeResponse.cs | 2 +- .../Requests/RefreshDataTypeResponse.cs | 2 +- .../RefreshProductDataRequest.cs} | 18 +- .../RefreshProductDataResponse.cs} | 6 +- .../Models/Requests/RemoveProductResponse.cs | 2 +- ...ookRequest.cs => ReplaceCompanyRequest.cs} | 12 +- ...kResponse.cs => ReplaceCompanyResponse.cs} | 6 +- ...onnectionManagementCorsSettingsResponse.cs | 2 +- .../SetCorsSettingsResponse.cs} | 12 +- .../Requests/UnlinkConnectionResponse.cs | 2 +- .../Models/Requests/UpdateCompanyRequest.cs | 2 +- .../Models/Requests/UpdateCompanyResponse.cs | 2 +- .../UpdateConnectionAuthorizationResponse.cs | 2 +- .../Models/Requests/UpdateProfileResponse.cs | 2 +- .../UpdateProfileSyncSettingsResponse.cs | 2 +- .../ClientRateLimitReachedResponse.cs | 2 +- .../Webhooks/ClientRateLimitResetResponse.cs | 2 +- .../Webhooks/ClientRateLimitResetResponse1.cs | 34 - .../Models/Webhooks/CompanyCreatedResponse.cs | 2 +- ...panyDataConnectionStatusChangedResponse.cs | 34 - .../Models/Webhooks/CompanyDeletedResponse.cs | 2 +- .../Webhooks/ConnectionConnectedResponse.cs | 2 +- .../Webhooks/ConnectionCreatedResponse.cs | 2 +- .../Webhooks/ConnectionDeletedResponse.cs | 2 +- .../ConnectionDisconnectedResponse.cs | 2 +- .../Webhooks/ConnectionFailedResponse.cs | 2 +- .../Webhooks/ConnectionReconnectedResponse.cs | 2 +- .../Webhooks/DataSyncCompletedResponse.cs | 34 - .../DataTypeWriteSuccessfulResponse.cs | 2 +- .../DataTypeWriteUnsuccessfulResponse.cs | 2 +- ...tStatusHasChangedToAnErrorStateResponse.cs | 34 - .../NewCompanySynchronizedResponse.cs | 34 - .../PushOperationHasTimedOutResponse.cs | 34 - .../PushOperationStatusHasChangedResponse.cs | 34 - .../Webhooks/ReadCompletedInitialResponse.cs | 2 +- .../Models/Webhooks/ReadCompletedResponse.cs | 2 +- platform/Codat/Platform/PushData.cs | 248 ++- platform/Codat/Platform/ReadData.cs | 225 +++ platform/Codat/Platform/RefreshData.cs | 381 ++++- platform/Codat/Platform/SDKConfig.cs | 60 + platform/Codat/Platform/Settings.cs | 881 ++++++++-- platform/Codat/Platform/SupplementalData.cs | 155 +- .../Codat/Platform/Utils/OpenEnumConverter.cs | 62 + .../Platform/Utils/RequestBodySerializer.cs | 103 +- .../Utils/ResponseBodyDeserializer.cs | 10 + .../Codat/Platform/Utils/SecurityMetadata.cs | 2 + .../Platform/Utils/SpeakeasyHttpClient.cs | 5 +- platform/Codat/Platform/Utils/URLBuilder.cs | 6 +- platform/Codat/Platform/Webhooks.cs | 605 ++----- platform/NUGET.md | 102 +- platform/README.md | 146 +- platform/RELEASES.md | 12 +- platform/USAGE.md | 5 +- .../ClientRateLimitReachedWebhook.md | 16 - .../ClientRateLimitReachedWebhookData.md | 9 - .../Components/ClientRateLimitResetWebhook.md | 16 - .../Models/Components/CompanyUpdateRequest.md | 10 + platform/docs/Models/Components/Connection.md | 2 +- .../ConnectionStatusChangedWebhook.md | 18 - .../ConnectionStatusChangedWebhookData.md | 11 - platform/docs/Models/Components/CreateRule.md | 12 - platform/docs/Models/Components/DataStatus.md | 4 +- .../Models/Components/DataStatusDataTypes.md | 52 - .../Components/DataSyncCompletedWebhook.md | 18 - .../DataSyncCompletedWebhookData.md | 9 - .../docs/Models/Components/DataTypeFeature.md | 2 +- .../Models/Components/DataTypeReadSummary.md | 12 + platform/docs/Models/Components/DataTypes.md | 55 +- .../Components/DatasetDataChangedWebhook.md | 18 - .../DatasetDataChangedWebhookData.md | 9 - .../DatasetStatusChangedErrorWebhook.md | 18 - .../DatasetStatusChangedErrorWebhookData.md | 10 - platform/docs/Models/Components/Issue.md | 12 + .../IssueLinks.md} | 9 +- .../docs/Models/Components/ModifiedDate.md | 2 +- .../NewCompanySynchronizedWebhook.md | 17 - platform/docs/Models/Components/Profile.md | 1 - .../Models/Components/PropertieDataType.md | 52 - .../docs/Models/Components/PushOperation.md | 2 +- .../Models/Components/PushOperationRef.md | 2 +- .../PushOperationStatusChangedWebhook.md | 18 - .../PushOperationStatusChangedWebhookData.md | 10 - .../PushOperationTimedOutWebhook.md | 18 - .../PushOperationTimedOutWebhookData.md | 10 - .../Components/ReadCompletedWebhookPayload.md | 2 +- .../docs/Models/Components/SyncSetting.md | 2 +- platform/docs/Models/Components/Validation.md | 8 +- .../docs/Models/Components/ValidationItem.md | 11 +- .../docs/Models/Components/ValidationItem1.md | 10 + .../Models/Components/ValidationResult.md | 9 + platform/docs/Models/Components/Webhook.md | 13 - .../docs/Models/Components/WebhookConsumer.md | 15 +- .../Components/WebhookConsumerPrototype.md | 13 +- .../docs/Models/Components/WebhookNotifier.md | 9 - platform/docs/Models/Components/Webhooks.md | 12 - .../Models/Requests/CreateCompanyResponse.md | 12 +- .../Models/Requests/CreateRuleResponse.md | 11 - .../Models/Requests/GetCompanyResponse.md | 12 +- .../GetCorsSettingsResponse.md} | 13 +- .../GetReadValidationResultsRequest.md | 9 + .../GetReadValidationResultsResponse.md} | 5 +- .../docs/Models/Requests/GetWebhookRequest.md | 8 - .../Models/Requests/GetWebhookResponse.md | 11 - .../Models/Requests/ListCompaniesRequest.md | 13 +- .../docs/Models/Requests/ListRulesResponse.md | 11 - .../Requests/RefreshProductDataRequest.md | 9 + .../RefreshProductDataResponse.md} | 2 +- .../Models/Requests/ReplaceCompanyRequest.md | 9 + .../ReplaceCompanyResponse.md} | 14 +- .../SetCorsSettingsResponse.md} | 13 +- .../Models/Requests/UpdateCompanyRequest.md | 8 +- .../Models/Requests/UpdateCompanyResponse.md | 12 +- .../Webhooks/DataSyncCompletedResponse.md | 10 - ...tStatusHasChangedToAnErrorStateResponse.md | 10 - .../NewCompanySynchronizedResponse.md | 10 - .../PushOperationHasTimedOutResponse.md | 10 - .../PushOperationStatusHasChangedResponse.md | 10 - platform/docs/sdks/codatplatform/README.md | 29 - platform/docs/sdks/companies/README.md | 180 +- .../docs/sdks/connectionmanagement/README.md | 19 +- platform/docs/sdks/connections/README.md | 42 +- .../sdks/{corssettings => cors}/README.md | 36 +- platform/docs/sdks/customdatatype/README.md | 45 +- platform/docs/sdks/integrations/README.md | 20 +- platform/docs/sdks/pushdata/README.md | 27 +- platform/docs/sdks/readdata/README.md | 57 + platform/docs/sdks/refreshdata/README.md | 34 +- platform/docs/sdks/settings/README.md | 115 +- platform/docs/sdks/supplementaldata/README.md | 29 +- platform/docs/sdks/webhooks/README.md | 164 +- 224 files changed, 6019 insertions(+), 4777 deletions(-) rename platform/Codat/Platform/{CorsSettings.cs => Cors.cs} (56%) delete mode 100644 platform/Codat/Platform/Models/Components/ClientRateLimitReachedWebhook.cs delete mode 100644 platform/Codat/Platform/Models/Components/ClientRateLimitReachedWebhookData.cs delete mode 100644 platform/Codat/Platform/Models/Components/ClientRateLimitResetWebhook.cs delete mode 100644 platform/Codat/Platform/Models/Components/ClientRateLimitResetWebhookData.cs rename platform/Codat/Platform/Models/Components/{Webhooks.cs => CompanyUpdateRequest.cs} (51%) delete mode 100644 platform/Codat/Platform/Models/Components/ConnectionStatusChangedWebhook.cs delete mode 100644 platform/Codat/Platform/Models/Components/ConnectionStatusChangedWebhookData.cs delete mode 100644 platform/Codat/Platform/Models/Components/DataStatusDataTypes.cs delete mode 100644 platform/Codat/Platform/Models/Components/DataSyncCompletedWebhook.cs create mode 100644 platform/Codat/Platform/Models/Components/DataTypeReadSummary.cs delete mode 100644 platform/Codat/Platform/Models/Components/DatasetDataChangedWebhook.cs delete mode 100644 platform/Codat/Platform/Models/Components/DatasetStatusChangedErrorWebhook.cs rename platform/Codat/Platform/Models/Components/{CreateRule.cs => Issue.cs} (62%) rename platform/Codat/Platform/Models/Components/{PushOperationStatusChangedWebhookData.cs => IssueLinks.cs} (50%) delete mode 100644 platform/Codat/Platform/Models/Components/NewCompanySynchronizedWebhook.cs delete mode 100644 platform/Codat/Platform/Models/Components/PropertieDataType.cs delete mode 100644 platform/Codat/Platform/Models/Components/PushOperationStatusChangedWebhook.cs delete mode 100644 platform/Codat/Platform/Models/Components/PushOperationTimedOutWebhook.cs delete mode 100644 platform/Codat/Platform/Models/Components/PushOperationTimedOutWebhookData.cs rename platform/Codat/Platform/Models/Components/{DatasetStatusChangedErrorWebhookData.cs => ValidationItem1.cs} (55%) rename platform/Codat/Platform/Models/Components/{WebhookNotifier.cs => ValidationResult.cs} (64%) delete mode 100644 platform/Codat/Platform/Models/Components/Webhook.cs create mode 100644 platform/Codat/Platform/Models/Errors/CodatPlatformException.cs create mode 100644 platform/Codat/Platform/Models/Errors/ResponseValidationException.cs rename platform/Codat/Platform/Models/Requests/{ListRulesResponse.cs => GetCorsSettingsResponse.cs} (87%) rename platform/Codat/Platform/Models/{Components/DataSyncCompletedWebhookData.cs => Requests/GetReadValidationResultsRequest.cs} (59%) rename platform/Codat/Platform/Models/Requests/{CreateRuleResponse.cs => GetReadValidationResultsResponse.cs} (91%) delete mode 100644 platform/Codat/Platform/Models/Requests/ListRulesRequest.cs rename platform/Codat/Platform/Models/{Components/DatasetDataChangedWebhookData.cs => Requests/RefreshProductDataRequest.cs} (52%) rename platform/Codat/Platform/Models/{Webhooks/DatasetDataChangedResponse.cs => Requests/RefreshProductDataResponse.cs} (92%) rename platform/Codat/Platform/Models/Requests/{GetWebhookRequest.cs => ReplaceCompanyRequest.cs} (64%) rename platform/Codat/Platform/Models/Requests/{GetWebhookResponse.cs => ReplaceCompanyResponse.cs} (93%) rename platform/Codat/Platform/Models/{Webhooks/ClientRateLimitReachedResponse1.cs => Requests/SetCorsSettingsResponse.cs} (77%) delete mode 100644 platform/Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse1.cs delete mode 100644 platform/Codat/Platform/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.cs delete mode 100644 platform/Codat/Platform/Models/Webhooks/DataSyncCompletedResponse.cs delete mode 100644 platform/Codat/Platform/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.cs delete mode 100644 platform/Codat/Platform/Models/Webhooks/NewCompanySynchronizedResponse.cs delete mode 100644 platform/Codat/Platform/Models/Webhooks/PushOperationHasTimedOutResponse.cs delete mode 100644 platform/Codat/Platform/Models/Webhooks/PushOperationStatusHasChangedResponse.cs create mode 100644 platform/Codat/Platform/ReadData.cs create mode 100644 platform/Codat/Platform/SDKConfig.cs create mode 100644 platform/Codat/Platform/Utils/OpenEnumConverter.cs delete mode 100644 platform/docs/Models/Components/ClientRateLimitReachedWebhook.md delete mode 100644 platform/docs/Models/Components/ClientRateLimitReachedWebhookData.md delete mode 100644 platform/docs/Models/Components/ClientRateLimitResetWebhook.md create mode 100644 platform/docs/Models/Components/CompanyUpdateRequest.md delete mode 100644 platform/docs/Models/Components/ConnectionStatusChangedWebhook.md delete mode 100644 platform/docs/Models/Components/ConnectionStatusChangedWebhookData.md delete mode 100644 platform/docs/Models/Components/CreateRule.md delete mode 100644 platform/docs/Models/Components/DataStatusDataTypes.md delete mode 100644 platform/docs/Models/Components/DataSyncCompletedWebhook.md delete mode 100644 platform/docs/Models/Components/DataSyncCompletedWebhookData.md create mode 100644 platform/docs/Models/Components/DataTypeReadSummary.md delete mode 100644 platform/docs/Models/Components/DatasetDataChangedWebhook.md delete mode 100644 platform/docs/Models/Components/DatasetDataChangedWebhookData.md delete mode 100644 platform/docs/Models/Components/DatasetStatusChangedErrorWebhook.md delete mode 100644 platform/docs/Models/Components/DatasetStatusChangedErrorWebhookData.md create mode 100644 platform/docs/Models/Components/Issue.md rename platform/docs/Models/{Requests/ListRulesRequest.md => Components/IssueLinks.md} (50%) delete mode 100644 platform/docs/Models/Components/NewCompanySynchronizedWebhook.md delete mode 100644 platform/docs/Models/Components/PropertieDataType.md delete mode 100644 platform/docs/Models/Components/PushOperationStatusChangedWebhook.md delete mode 100644 platform/docs/Models/Components/PushOperationStatusChangedWebhookData.md delete mode 100644 platform/docs/Models/Components/PushOperationTimedOutWebhook.md delete mode 100644 platform/docs/Models/Components/PushOperationTimedOutWebhookData.md create mode 100644 platform/docs/Models/Components/ValidationItem1.md create mode 100644 platform/docs/Models/Components/ValidationResult.md delete mode 100644 platform/docs/Models/Components/Webhook.md delete mode 100644 platform/docs/Models/Components/WebhookNotifier.md delete mode 100644 platform/docs/Models/Components/Webhooks.md delete mode 100644 platform/docs/Models/Requests/CreateRuleResponse.md rename platform/docs/Models/{Webhooks/ClientRateLimitReachedResponse1.md => Requests/GetCorsSettingsResponse.md} (62%) create mode 100644 platform/docs/Models/Requests/GetReadValidationResultsRequest.md rename platform/docs/Models/{Webhooks/CompanyDataConnectionStatusChangedResponse.md => Requests/GetReadValidationResultsResponse.md} (82%) delete mode 100644 platform/docs/Models/Requests/GetWebhookRequest.md delete mode 100644 platform/docs/Models/Requests/GetWebhookResponse.md delete mode 100644 platform/docs/Models/Requests/ListRulesResponse.md create mode 100644 platform/docs/Models/Requests/RefreshProductDataRequest.md rename platform/docs/Models/{Webhooks/DatasetDataChangedResponse.md => Requests/RefreshProductDataResponse.md} (98%) create mode 100644 platform/docs/Models/Requests/ReplaceCompanyRequest.md rename platform/docs/Models/{Components/ClientRateLimitResetWebhookData.md => Requests/ReplaceCompanyResponse.md} (79%) rename platform/docs/Models/{Webhooks/ClientRateLimitResetResponse1.md => Requests/SetCorsSettingsResponse.md} (62%) delete mode 100644 platform/docs/Models/Webhooks/DataSyncCompletedResponse.md delete mode 100644 platform/docs/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.md delete mode 100644 platform/docs/Models/Webhooks/NewCompanySynchronizedResponse.md delete mode 100644 platform/docs/Models/Webhooks/PushOperationHasTimedOutResponse.md delete mode 100644 platform/docs/Models/Webhooks/PushOperationStatusHasChangedResponse.md delete mode 100644 platform/docs/sdks/codatplatform/README.md rename platform/docs/sdks/{corssettings => cors}/README.md (61%) create mode 100644 platform/docs/sdks/readdata/README.md diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 2b15d80a3..5827e16e0 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.544.0 +speakeasyVersion: 1.636.3 sources: bank-feeds-source: sourceNamespace: bank-feeds-source @@ -18,11 +18,11 @@ sources: - 3.0.0 platform-source: sourceNamespace: platform-source - sourceRevisionDigest: sha256:22a642c12144b2db0229ae5cd0f7f387de2337e5483b7d9d67894510ab466434 - sourceBlobDigest: sha256:d80a27e44fffb9c61f16a99e7d25c294f39be1a5a761d51a87c76477f8589f54 + sourceRevisionDigest: sha256:0f78aa549819043f4ba97e688320aad9a246b4f96dd9427dddcc76973ac48cd2 + sourceBlobDigest: sha256:b1168d9a178d8cca7ff8fea320ab38bbc14b279b8ef463011adf760747529c64 tags: - latest - - speakeasy-sdk-regen-1732624920 + - speakeasy-sdk-regen-1760520838 - 3.0.0 sync-for-commerce-source: sourceNamespace: sync-for-commerce-source @@ -80,10 +80,10 @@ targets: platform-library: source: platform-source sourceNamespace: platform-source - sourceRevisionDigest: sha256:22a642c12144b2db0229ae5cd0f7f387de2337e5483b7d9d67894510ab466434 - sourceBlobDigest: sha256:d80a27e44fffb9c61f16a99e7d25c294f39be1a5a761d51a87c76477f8589f54 - codeSamplesNamespace: platform-source-code-samples - codeSamplesRevisionDigest: sha256:2ab0377bf53e999f63ed07738a6d8ab38a44b9aa133d0016d3326255c06acf68 + sourceRevisionDigest: sha256:0f78aa549819043f4ba97e688320aad9a246b4f96dd9427dddcc76973ac48cd2 + sourceBlobDigest: sha256:b1168d9a178d8cca7ff8fea320ab38bbc14b279b8ef463011adf760747529c64 + codeSamplesNamespace: platform-source-csharp-code-samples + codeSamplesRevisionDigest: sha256:e9ac2ef0069007a2dd268e98934f1a19b0539db33822de0873a5625440a98cfd sync-for-commerce-library: source: sync-for-commerce-source sourceNamespace: sync-for-commerce-source diff --git a/platform/.gitignore b/platform/.gitignore index b004ecedd..a3f0a5df4 100755 --- a/platform/.gitignore +++ b/platform/.gitignore @@ -1,3 +1,8 @@ +.DS_Store +**/.speakeasy/temp/ +**/.speakeasy/logs/ +.env +.env.local obj/ bin/ debug/ diff --git a/platform/.speakeasy/gen.lock b/platform/.speakeasy/gen.lock index 40206699a..7b6e388a4 100755 --- a/platform/.speakeasy/gen.lock +++ b/platform/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 803b84ac-e26a-4a5c-9224-dbc3d0c7712a management: - docChecksum: 8dd29c2f971fac587d6257d3c3eca25b + docChecksum: 6ae21fe73a797851bee7e46d520f2fcf docVersion: 3.0.0 - speakeasyVersion: 1.446.1 - generationVersion: 2.462.1 - releaseVersion: 6.0.0 - configChecksum: dc3ae2e5168679a3a4384a7cca34809c + speakeasyVersion: 1.636.3 + generationVersion: 2.723.11 + releaseVersion: 6.1.0 + configChecksum: a48f247ba567951ae004eba417ee7e2f repoURL: https://github.com/codatio/client-sdk-csharp.git repoSubDirectory: platform published: true @@ -14,33 +14,33 @@ features: csharp: additionalDependencies: 0.1.0 constsAndDefaults: 0.0.1 - core: 3.10.6 + core: 3.13.0 deprecations: 2.81.2 - examples: 2.81.3 - globalSecurity: 2.83.6 + examples: 2.81.6 + globalSecurity: 2.83.8 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 - globalServerURLs: 2.82.3 - groups: 2.81.2 + globalServerURLs: 2.82.4 + groups: 2.81.3 ignores: 2.81.1 intellisenseMarkdownSupport: 0.1.0 - methodArguments: 0.1.0 + methodArguments: 0.2.1 nameOverrides: 2.81.2 - nullables: 0.1.0 + nullables: 0.1.1 responseFormat: 0.0.4 retries: 0.0.1 - sdkHooks: 0.1.0 + sdkHooks: 0.2.0 + serverEventsSentinels: 0.2.0 webhooks: 1.0.0 generatedFiles: - .gitattributes - - CONTRIBUTING.md - Codat.Platform.sln - Codat/Platform/Codat.Platform.csproj - Codat/Platform/CodatPlatform.cs - Codat/Platform/Companies.cs - Codat/Platform/ConnectionManagement.cs - Codat/Platform/Connections.cs - - Codat/Platform/CorsSettings.cs + - Codat/Platform/Cors.cs - Codat/Platform/CustomDataType.cs - Codat/Platform/Hooks/HookTypes.cs - Codat/Platform/Hooks/SDKHooks.cs @@ -51,10 +51,6 @@ generatedFiles: - Codat/Platform/Models/Components/BrandingButton.cs - Codat/Platform/Models/Components/BrandingImage.cs - Codat/Platform/Models/Components/BrandingLogo.cs - - Codat/Platform/Models/Components/ClientRateLimitReachedWebhook.cs - - Codat/Platform/Models/Components/ClientRateLimitReachedWebhookData.cs - - Codat/Platform/Models/Components/ClientRateLimitResetWebhook.cs - - Codat/Platform/Models/Components/ClientRateLimitResetWebhookData.cs - Codat/Platform/Models/Components/ClientRateLimitWebhook.cs - Codat/Platform/Models/Components/ClientRateLimitWebhookPayload.cs - Codat/Platform/Models/Components/Companies.cs @@ -64,39 +60,31 @@ generatedFiles: - Codat/Platform/Models/Components/CompanyReference.cs - Codat/Platform/Models/Components/CompanyReferenceLinks.cs - Codat/Platform/Models/Components/CompanyRequestBody.cs + - Codat/Platform/Models/Components/CompanyUpdateRequest.cs - Codat/Platform/Models/Components/CompanyWebhook.cs - Codat/Platform/Models/Components/Connection.cs - Codat/Platform/Models/Components/ConnectionManagementAccessToken.cs - Codat/Platform/Models/Components/ConnectionManagementAllowedOrigins.cs - - Codat/Platform/Models/Components/ConnectionStatusChangedWebhook.cs - - Codat/Platform/Models/Components/ConnectionStatusChangedWebhookData.cs - Codat/Platform/Models/Components/ConnectionWebhook.cs - Codat/Platform/Models/Components/ConnectionWebhookPayload.cs - Codat/Platform/Models/Components/Connections.cs - Codat/Platform/Models/Components/Content.cs - Codat/Platform/Models/Components/CreateApiKey.cs - - Codat/Platform/Models/Components/CreateRule.cs - Codat/Platform/Models/Components/CustomDataTypeConfiguration.cs - Codat/Platform/Models/Components/CustomDataTypeRecord.cs - Codat/Platform/Models/Components/CustomDataTypeRecords.cs - Codat/Platform/Models/Components/DataConnectionError.cs - Codat/Platform/Models/Components/DataConnectionStatus.cs - Codat/Platform/Models/Components/DataStatus.cs - - Codat/Platform/Models/Components/DataStatusDataTypes.cs - Codat/Platform/Models/Components/DataStatuses.cs - - Codat/Platform/Models/Components/DataSyncCompletedWebhook.cs - - Codat/Platform/Models/Components/DataSyncCompletedWebhookData.cs - Codat/Platform/Models/Components/DataType.cs - Codat/Platform/Models/Components/DataTypeFeature.cs + - Codat/Platform/Models/Components/DataTypeReadSummary.cs - Codat/Platform/Models/Components/DataTypeWriteWebhook.cs - Codat/Platform/Models/Components/DataTypeWriteWebhookPayload.cs - Codat/Platform/Models/Components/DataTypeWriteWebhookRecord.cs - Codat/Platform/Models/Components/DataTypes.cs - - Codat/Platform/Models/Components/DatasetDataChangedWebhook.cs - - Codat/Platform/Models/Components/DatasetDataChangedWebhookData.cs - Codat/Platform/Models/Components/DatasetStatus.cs - - Codat/Platform/Models/Components/DatasetStatusChangedErrorWebhook.cs - - Codat/Platform/Models/Components/DatasetStatusChangedErrorWebhookData.cs - Codat/Platform/Models/Components/ErrorMessage.cs - Codat/Platform/Models/Components/ErrorStatus.cs - Codat/Platform/Models/Components/ErrorValidation.cs @@ -107,11 +95,11 @@ generatedFiles: - Codat/Platform/Models/Components/ImageReference.cs - Codat/Platform/Models/Components/Integration.cs - Codat/Platform/Models/Components/Integrations.cs + - Codat/Platform/Models/Components/Issue.cs + - Codat/Platform/Models/Components/IssueLinks.cs - Codat/Platform/Models/Components/Links.cs - Codat/Platform/Models/Components/ModifiedDate.cs - - Codat/Platform/Models/Components/NewCompanySynchronizedWebhook.cs - Codat/Platform/Models/Components/Profile.cs - - Codat/Platform/Models/Components/PropertieDataType.cs - Codat/Platform/Models/Components/PullOperation.cs - Codat/Platform/Models/Components/PullOperations.cs - Codat/Platform/Models/Components/PushChangeType.cs @@ -120,10 +108,6 @@ generatedFiles: - Codat/Platform/Models/Components/PushOperationChange.cs - Codat/Platform/Models/Components/PushOperationRef.cs - Codat/Platform/Models/Components/PushOperationStatus.cs - - Codat/Platform/Models/Components/PushOperationStatusChangedWebhook.cs - - Codat/Platform/Models/Components/PushOperationStatusChangedWebhookData.cs - - Codat/Platform/Models/Components/PushOperationTimedOutWebhook.cs - - Codat/Platform/Models/Components/PushOperationTimedOutWebhookData.cs - Codat/Platform/Models/Components/PushOperations.cs - Codat/Platform/Models/Components/PushOption.cs - Codat/Platform/Models/Components/PushOptionChoice.cs @@ -143,15 +127,16 @@ generatedFiles: - Codat/Platform/Models/Components/UpdateConnectionStatus.cs - Codat/Platform/Models/Components/Validation.cs - Codat/Platform/Models/Components/ValidationItem.cs - - Codat/Platform/Models/Components/Webhook.cs + - Codat/Platform/Models/Components/ValidationItem1.cs + - Codat/Platform/Models/Components/ValidationResult.cs - Codat/Platform/Models/Components/WebhookConsumer.cs - Codat/Platform/Models/Components/WebhookConsumerPrototype.cs - Codat/Platform/Models/Components/WebhookConsumers.cs - - Codat/Platform/Models/Components/WebhookNotifier.cs - - Codat/Platform/Models/Components/Webhooks.cs - Codat/Platform/Models/Components/WriteStatus.cs - Codat/Platform/Models/Components/WriteType.cs + - Codat/Platform/Models/Errors/CodatPlatformException.cs - Codat/Platform/Models/Errors/ErrorMessage.cs + - Codat/Platform/Models/Errors/ResponseValidationException.cs - Codat/Platform/Models/Errors/SDKException.cs - Codat/Platform/Models/Requests/AddProductRequest.cs - Codat/Platform/Models/Requests/AddProductResponse.cs @@ -164,7 +149,6 @@ generatedFiles: - Codat/Platform/Models/Requests/CreateConnectionRequest.cs - Codat/Platform/Models/Requests/CreateConnectionRequestBody.cs - Codat/Platform/Models/Requests/CreateConnectionResponse.cs - - Codat/Platform/Models/Requests/CreateRuleResponse.cs - Codat/Platform/Models/Requests/CreateWebhookConsumerResponse.cs - Codat/Platform/Models/Requests/DataType.cs - Codat/Platform/Models/Requests/DeleteApiKeyRequest.cs @@ -188,6 +172,7 @@ generatedFiles: - Codat/Platform/Models/Requests/GetConnectionManagementCorsSettingsResponse.cs - Codat/Platform/Models/Requests/GetConnectionRequest.cs - Codat/Platform/Models/Requests/GetConnectionResponse.cs + - Codat/Platform/Models/Requests/GetCorsSettingsResponse.cs - Codat/Platform/Models/Requests/GetCreateUpdateModelOptionsByDataTypeRequest.cs - Codat/Platform/Models/Requests/GetCreateUpdateModelOptionsByDataTypeResponse.cs - Codat/Platform/Models/Requests/GetCustomDataTypeConfigurationRequest.cs @@ -202,10 +187,10 @@ generatedFiles: - Codat/Platform/Models/Requests/GetPullOperationResponse.cs - Codat/Platform/Models/Requests/GetPushOperationRequest.cs - Codat/Platform/Models/Requests/GetPushOperationResponse.cs + - Codat/Platform/Models/Requests/GetReadValidationResultsRequest.cs + - Codat/Platform/Models/Requests/GetReadValidationResultsResponse.cs - Codat/Platform/Models/Requests/GetSupplementalDataConfigurationRequest.cs - Codat/Platform/Models/Requests/GetSupplementalDataConfigurationResponse.cs - - Codat/Platform/Models/Requests/GetWebhookRequest.cs - - Codat/Platform/Models/Requests/GetWebhookResponse.cs - Codat/Platform/Models/Requests/ListApiKeysResponse.cs - Codat/Platform/Models/Requests/ListCompaniesRequest.cs - Codat/Platform/Models/Requests/ListCompaniesResponse.cs @@ -217,8 +202,6 @@ generatedFiles: - Codat/Platform/Models/Requests/ListIntegrationsResponse.cs - Codat/Platform/Models/Requests/ListPullOperationsRequest.cs - Codat/Platform/Models/Requests/ListPullOperationsResponse.cs - - Codat/Platform/Models/Requests/ListRulesRequest.cs - - Codat/Platform/Models/Requests/ListRulesResponse.cs - Codat/Platform/Models/Requests/ListWebhookConsumersResponse.cs - Codat/Platform/Models/Requests/PathParamDataType.cs - Codat/Platform/Models/Requests/RefreshCompanyDataRequest.cs @@ -227,9 +210,14 @@ generatedFiles: - Codat/Platform/Models/Requests/RefreshCustomDataTypeResponse.cs - Codat/Platform/Models/Requests/RefreshDataTypeRequest.cs - Codat/Platform/Models/Requests/RefreshDataTypeResponse.cs + - Codat/Platform/Models/Requests/RefreshProductDataRequest.cs + - Codat/Platform/Models/Requests/RefreshProductDataResponse.cs - Codat/Platform/Models/Requests/RemoveProductRequest.cs - Codat/Platform/Models/Requests/RemoveProductResponse.cs + - Codat/Platform/Models/Requests/ReplaceCompanyRequest.cs + - Codat/Platform/Models/Requests/ReplaceCompanyResponse.cs - Codat/Platform/Models/Requests/SetConnectionManagementCorsSettingsResponse.cs + - Codat/Platform/Models/Requests/SetCorsSettingsResponse.cs - Codat/Platform/Models/Requests/UnlinkConnectionRequest.cs - Codat/Platform/Models/Requests/UnlinkConnectionResponse.cs - Codat/Platform/Models/Requests/UpdateCompanyRequest.cs @@ -240,11 +228,8 @@ generatedFiles: - Codat/Platform/Models/Requests/UpdateProfileSyncSettingsRequestBody.cs - Codat/Platform/Models/Requests/UpdateProfileSyncSettingsResponse.cs - Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse.cs - - Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse1.cs - Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse.cs - - Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse1.cs - Codat/Platform/Models/Webhooks/CompanyCreatedResponse.cs - - Codat/Platform/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.cs - Codat/Platform/Models/Webhooks/CompanyDeletedResponse.cs - Codat/Platform/Models/Webhooks/ConnectionConnectedResponse.cs - Codat/Platform/Models/Webhooks/ConnectionCreatedResponse.cs @@ -252,18 +237,14 @@ generatedFiles: - Codat/Platform/Models/Webhooks/ConnectionDisconnectedResponse.cs - Codat/Platform/Models/Webhooks/ConnectionFailedResponse.cs - Codat/Platform/Models/Webhooks/ConnectionReconnectedResponse.cs - - Codat/Platform/Models/Webhooks/DataSyncCompletedResponse.cs - Codat/Platform/Models/Webhooks/DataTypeWriteSuccessfulResponse.cs - Codat/Platform/Models/Webhooks/DataTypeWriteUnsuccessfulResponse.cs - - Codat/Platform/Models/Webhooks/DatasetDataChangedResponse.cs - - Codat/Platform/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.cs - - Codat/Platform/Models/Webhooks/NewCompanySynchronizedResponse.cs - - Codat/Platform/Models/Webhooks/PushOperationHasTimedOutResponse.cs - - Codat/Platform/Models/Webhooks/PushOperationStatusHasChangedResponse.cs - Codat/Platform/Models/Webhooks/ReadCompletedInitialResponse.cs - Codat/Platform/Models/Webhooks/ReadCompletedResponse.cs - Codat/Platform/PushData.cs + - Codat/Platform/ReadData.cs - Codat/Platform/RefreshData.cs + - Codat/Platform/SDKConfig.cs - Codat/Platform/Settings.cs - Codat/Platform/SupplementalData.cs - Codat/Platform/Utils/AnyDeserializer.cs @@ -273,6 +254,7 @@ generatedFiles: - Codat/Platform/Utils/FlexibleObjectDeserializer.cs - Codat/Platform/Utils/HeaderSerializer.cs - Codat/Platform/Utils/IsoDateTimeSerializer.cs + - Codat/Platform/Utils/OpenEnumConverter.cs - Codat/Platform/Utils/RequestBodySerializer.cs - Codat/Platform/Utils/ResponseBodyDeserializer.cs - Codat/Platform/Utils/Retries/BackoffStrategy.cs @@ -292,10 +274,6 @@ generatedFiles: - docs/Models/Components/BrandingButton.md - docs/Models/Components/BrandingImage.md - docs/Models/Components/BrandingLogo.md - - docs/Models/Components/ClientRateLimitReachedWebhook.md - - docs/Models/Components/ClientRateLimitReachedWebhookData.md - - docs/Models/Components/ClientRateLimitResetWebhook.md - - docs/Models/Components/ClientRateLimitResetWebhookData.md - docs/Models/Components/ClientRateLimitWebhook.md - docs/Models/Components/ClientRateLimitWebhookPayload.md - docs/Models/Components/Companies.md @@ -305,39 +283,31 @@ generatedFiles: - docs/Models/Components/CompanyReference.md - docs/Models/Components/CompanyReferenceLinks.md - docs/Models/Components/CompanyRequestBody.md + - docs/Models/Components/CompanyUpdateRequest.md - docs/Models/Components/CompanyWebhook.md - docs/Models/Components/Connection.md - docs/Models/Components/ConnectionManagementAccessToken.md - docs/Models/Components/ConnectionManagementAllowedOrigins.md - - docs/Models/Components/ConnectionStatusChangedWebhook.md - - docs/Models/Components/ConnectionStatusChangedWebhookData.md - docs/Models/Components/ConnectionWebhook.md - docs/Models/Components/ConnectionWebhookPayload.md - docs/Models/Components/Connections.md - docs/Models/Components/Content.md - docs/Models/Components/CreateApiKey.md - - docs/Models/Components/CreateRule.md - docs/Models/Components/CustomDataTypeConfiguration.md - docs/Models/Components/CustomDataTypeRecord.md - docs/Models/Components/CustomDataTypeRecords.md - docs/Models/Components/DataConnectionError.md - docs/Models/Components/DataConnectionStatus.md - docs/Models/Components/DataStatus.md - - docs/Models/Components/DataStatusDataTypes.md - docs/Models/Components/DataStatuses.md - - docs/Models/Components/DataSyncCompletedWebhook.md - - docs/Models/Components/DataSyncCompletedWebhookData.md - docs/Models/Components/DataType.md - docs/Models/Components/DataTypeFeature.md + - docs/Models/Components/DataTypeReadSummary.md - docs/Models/Components/DataTypeWriteWebhook.md - docs/Models/Components/DataTypeWriteWebhookPayload.md - docs/Models/Components/DataTypeWriteWebhookRecord.md - docs/Models/Components/DataTypes.md - - docs/Models/Components/DatasetDataChangedWebhook.md - - docs/Models/Components/DatasetDataChangedWebhookData.md - docs/Models/Components/DatasetStatus.md - - docs/Models/Components/DatasetStatusChangedErrorWebhook.md - - docs/Models/Components/DatasetStatusChangedErrorWebhookData.md - docs/Models/Components/ErrorMessage.md - docs/Models/Components/ErrorStatus.md - docs/Models/Components/ErrorValidation.md @@ -348,11 +318,11 @@ generatedFiles: - docs/Models/Components/ImageReference.md - docs/Models/Components/Integration.md - docs/Models/Components/Integrations.md + - docs/Models/Components/Issue.md + - docs/Models/Components/IssueLinks.md - docs/Models/Components/Links.md - docs/Models/Components/ModifiedDate.md - - docs/Models/Components/NewCompanySynchronizedWebhook.md - docs/Models/Components/Profile.md - - docs/Models/Components/PropertieDataType.md - docs/Models/Components/PullOperation.md - docs/Models/Components/PullOperations.md - docs/Models/Components/PushChangeType.md @@ -361,10 +331,6 @@ generatedFiles: - docs/Models/Components/PushOperationChange.md - docs/Models/Components/PushOperationRef.md - docs/Models/Components/PushOperationStatus.md - - docs/Models/Components/PushOperationStatusChangedWebhook.md - - docs/Models/Components/PushOperationStatusChangedWebhookData.md - - docs/Models/Components/PushOperationTimedOutWebhook.md - - docs/Models/Components/PushOperationTimedOutWebhookData.md - docs/Models/Components/PushOperations.md - docs/Models/Components/PushOption.md - docs/Models/Components/PushOptionChoice.md @@ -384,12 +350,11 @@ generatedFiles: - docs/Models/Components/UpdateConnectionStatus.md - docs/Models/Components/Validation.md - docs/Models/Components/ValidationItem.md - - docs/Models/Components/Webhook.md + - docs/Models/Components/ValidationItem1.md + - docs/Models/Components/ValidationResult.md - docs/Models/Components/WebhookConsumer.md - docs/Models/Components/WebhookConsumerPrototype.md - docs/Models/Components/WebhookConsumers.md - - docs/Models/Components/WebhookNotifier.md - - docs/Models/Components/Webhooks.md - docs/Models/Components/WriteStatus.md - docs/Models/Components/WriteType.md - docs/Models/Errors/ErrorMessage.md @@ -404,7 +369,6 @@ generatedFiles: - docs/Models/Requests/CreateConnectionRequest.md - docs/Models/Requests/CreateConnectionRequestBody.md - docs/Models/Requests/CreateConnectionResponse.md - - docs/Models/Requests/CreateRuleResponse.md - docs/Models/Requests/CreateWebhookConsumerResponse.md - docs/Models/Requests/DataType.md - docs/Models/Requests/DeleteApiKeyRequest.md @@ -428,6 +392,7 @@ generatedFiles: - docs/Models/Requests/GetConnectionManagementCorsSettingsResponse.md - docs/Models/Requests/GetConnectionRequest.md - docs/Models/Requests/GetConnectionResponse.md + - docs/Models/Requests/GetCorsSettingsResponse.md - docs/Models/Requests/GetCreateUpdateModelOptionsByDataTypeRequest.md - docs/Models/Requests/GetCreateUpdateModelOptionsByDataTypeResponse.md - docs/Models/Requests/GetCustomDataTypeConfigurationRequest.md @@ -442,10 +407,10 @@ generatedFiles: - docs/Models/Requests/GetPullOperationResponse.md - docs/Models/Requests/GetPushOperationRequest.md - docs/Models/Requests/GetPushOperationResponse.md + - docs/Models/Requests/GetReadValidationResultsRequest.md + - docs/Models/Requests/GetReadValidationResultsResponse.md - docs/Models/Requests/GetSupplementalDataConfigurationRequest.md - docs/Models/Requests/GetSupplementalDataConfigurationResponse.md - - docs/Models/Requests/GetWebhookRequest.md - - docs/Models/Requests/GetWebhookResponse.md - docs/Models/Requests/ListApiKeysResponse.md - docs/Models/Requests/ListCompaniesRequest.md - docs/Models/Requests/ListCompaniesResponse.md @@ -457,8 +422,6 @@ generatedFiles: - docs/Models/Requests/ListIntegrationsResponse.md - docs/Models/Requests/ListPullOperationsRequest.md - docs/Models/Requests/ListPullOperationsResponse.md - - docs/Models/Requests/ListRulesRequest.md - - docs/Models/Requests/ListRulesResponse.md - docs/Models/Requests/ListWebhookConsumersResponse.md - docs/Models/Requests/PathParamDataType.md - docs/Models/Requests/RefreshCompanyDataRequest.md @@ -467,9 +430,14 @@ generatedFiles: - docs/Models/Requests/RefreshCustomDataTypeResponse.md - docs/Models/Requests/RefreshDataTypeRequest.md - docs/Models/Requests/RefreshDataTypeResponse.md + - docs/Models/Requests/RefreshProductDataRequest.md + - docs/Models/Requests/RefreshProductDataResponse.md - docs/Models/Requests/RemoveProductRequest.md - docs/Models/Requests/RemoveProductResponse.md + - docs/Models/Requests/ReplaceCompanyRequest.md + - docs/Models/Requests/ReplaceCompanyResponse.md - docs/Models/Requests/SetConnectionManagementCorsSettingsResponse.md + - docs/Models/Requests/SetCorsSettingsResponse.md - docs/Models/Requests/UnlinkConnectionRequest.md - docs/Models/Requests/UnlinkConnectionResponse.md - docs/Models/Requests/UpdateCompanyRequest.md @@ -480,11 +448,8 @@ generatedFiles: - docs/Models/Requests/UpdateProfileSyncSettingsRequestBody.md - docs/Models/Requests/UpdateProfileSyncSettingsResponse.md - docs/Models/Webhooks/ClientRateLimitReachedResponse.md - - docs/Models/Webhooks/ClientRateLimitReachedResponse1.md - docs/Models/Webhooks/ClientRateLimitResetResponse.md - - docs/Models/Webhooks/ClientRateLimitResetResponse1.md - docs/Models/Webhooks/CompanyCreatedResponse.md - - docs/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.md - docs/Models/Webhooks/CompanyDeletedResponse.md - docs/Models/Webhooks/ConnectionConnectedResponse.md - docs/Models/Webhooks/ConnectionCreatedResponse.md @@ -492,213 +457,114 @@ generatedFiles: - docs/Models/Webhooks/ConnectionDisconnectedResponse.md - docs/Models/Webhooks/ConnectionFailedResponse.md - docs/Models/Webhooks/ConnectionReconnectedResponse.md - - docs/Models/Webhooks/DataSyncCompletedResponse.md - docs/Models/Webhooks/DataTypeWriteSuccessfulResponse.md - docs/Models/Webhooks/DataTypeWriteUnsuccessfulResponse.md - - docs/Models/Webhooks/DatasetDataChangedResponse.md - - docs/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.md - - docs/Models/Webhooks/NewCompanySynchronizedResponse.md - - docs/Models/Webhooks/PushOperationHasTimedOutResponse.md - - docs/Models/Webhooks/PushOperationStatusHasChangedResponse.md - docs/Models/Webhooks/ReadCompletedInitialResponse.md - docs/Models/Webhooks/ReadCompletedResponse.md - - docs/sdks/codatplatform/README.md - docs/sdks/companies/README.md - docs/sdks/connectionmanagement/README.md - docs/sdks/connections/README.md - - docs/sdks/corssettings/README.md + - docs/sdks/cors/README.md - docs/sdks/customdatatype/README.md - docs/sdks/integrations/README.md - docs/sdks/pushdata/README.md + - docs/sdks/readdata/README.md - docs/sdks/refreshdata/README.md - docs/sdks/settings/README.md - docs/sdks/supplementaldata/README.md - docs/sdks/webhooks/README.md - global.json examples: - create-api-key: - Create API key with name: + company.created: + Company created: requestBody: - application/json: {"name": "azure-invoice-finance-processor"} - responses: - "201": - application/json: {"id": "e288a972-b402-4b21-93f9-b5335ae5679c", "name": "azure-invoice-finance-processor", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-10-23T00:00:00Z"} - "400": {} - API key details: + application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "company.created", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "Requested a loan for refurb.", "redirect": "https://link.codat.io/company/0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}} + company.deleted: + Company deleted: requestBody: - application/json: {"name": "azure-invoice-finance-processor"} - responses: - "201": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "azure-invoice-finance-processor", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-11T13:49:37Z"} - "400": {} - API key details with name: + application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "company.deleted", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "Requested a loan for refurb.", "redirect": "https://link.codat.io/company/0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "tags": {"customerRegion": "uk", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}}} + connection.created: + Connection created: requestBody: - application/json: {"name": "azure-invoice-finance-processor"} - responses: - "201": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "azure-invoice-finance-processor", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-11T13:49:37Z"} - "400": {} - Max length for name reached: + application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.created", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "connection": {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "PendingAuth", "lastSync": "2022-10-27T10:22:43.646Z", "created": "2022-10-27T09:53:29Z"}}} + connection.connected: + Connection connected: requestBody: - application/json: {"name": "azure-invoice-finance-processor"} - responses: - "201": - application/json: {"apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-10-23T00:00:00Z", "id": "e288a972-b402-4b21-93f9-b5335ae5679c", "name": "azure-invoice-finance-processor"} - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Max string length (50) for `name` reached.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-api-key: - Conflict: - parameters: - path: - apiKeyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "204": - application/json: {"statusCode": 429, "service": "PublicApi", "error": "You have made too many requests in a given amount of time; please retry later.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "401": - application/json: {"statusCode": 429, "service": "PublicApi", "error": "You have made too many requests in a given amount of time; please retry later.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-profile: - Unauthorized: - responses: - "200": - application/json: {"alertAuthHeader": "Bearer tXEiHiRK7XCtI8TNHbpGs1LI1pumdb4Cl1QIo7B2", "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", "name": "Bob's Burgers", "redirectUrl": "https://bobs-burgers.{countrySuffix}/{companyId}", "whiteListUrls": ["https://bobs-burgers.com", "https://bobs-burgers.co.uk"]} - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-profile-syncSettings: - Example: - responses: - "200": - application/json: {"clientId": "367f7975-267b-439b-90c6-a6040ee680f3", "settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "syncSchedule": 24, "syncOrder": 0, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "monthsToSync": 24, "isLocked": true}], "overridesDefaults": true} - "401": {} - Unauthorized: - responses: - "200": - application/json: {"settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "isLocked": true, "monthsToSync": 24, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "syncOrder": 0, "syncSchedule": 24}]} - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-api-keys: - Example: - responses: - "200": - application/json: {"results": [{"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-11T13:49:37Z"}, {"id": "c438836a-61fe-443f-8a19-24cc18be21e4", "name": "azure-invoice-finance-processor", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-23T09:43:48Z"}]} - "401": {} - Unauthorized: - responses: - "200": - application/json: {"results": []} - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - update-profile: - Unauthorized: + application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.connected", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "connection": {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.646Z", "created": "2022-10-27T09:53:29Z"}}} + connection.failed: + Connection failed: requestBody: - application/json: {"name": "Bob's Burgers", "logoUrl": "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", "iconUrl": "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", "redirectUrl": "https://bobs-burgers.{countrySuffix}/{companyId}", "whiteListUrls": ["https://bobs-burgers.com", "https://bobs-burgers.co.uk"], "alertAuthHeader": "Bearer tXEiHiRK7XCtI8TNHbpGs1LI1pumdb4Cl1QIo7B2", "confirmCompanyName": true} - responses: - "200": - application/json: {"alertAuthHeader": "Bearer tXEiHiRK7XCtI8TNHbpGs1LI1pumdb4Cl1QIo7B2", "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", "name": "Bob's Burgers", "redirectUrl": "https://bobs-burgers.{countrySuffix}/{companyId}", "whiteListUrls": ["https://bobs-burgers.com", "https://bobs-burgers.co.uk"]} - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - update-profile-syncSettings: - Unauthorized: + application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.failed", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "connection": {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "PendingAuth", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"statusCode": "403", "statusText": "User cancelled linking", "errorMessage": "User cancelled", "erroredOnUtc": "2022-10-27T09:53:29Z", "status": "Active"}]}}} + connection.disconnected: + Unlinked: requestBody: - application/json: {"clientId": "ce429104-79f0-4085-a720-e2d40fcc800f", "settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "syncSchedule": 24, "syncOrder": 0, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "monthsToSync": 24, "isLocked": true}]} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-company: - With no description: + application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.disconnected", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "connection": {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Unlinked", "lastSync": "2022-10-27T10:22:43.646Z", "created": "2022-10-27T09:53:29Z"}}} + De-authorized: requestBody: - application/json: {"name": "Technicalium", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [], "dataConnections": []} - "400": {} - With a description: + application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.disconnected", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "connection": {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Deauthorized", "lastSync": "2022-10-27T10:22:43.646Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"statusCode": "401", "statusText": "The integration de-authorized access to the connection.", "errorMessage": "The integration de-authorized access to the connection.", "erroredOnUtc": "2022-12-27T09:53:29Z", "status": "Active"}]}}} + connection.reconnected: + Reconnected: requestBody: - application/json: {"name": "Technicalium", "description": "Technology services, including web and app design and development"} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [], "dataConnections": []} - "400": {} - With a group: + application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.reconnected", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "connection": {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.646Z", "created": "2022-10-27T09:53:29Z"}}} + connection.deleted: + Deleted: requestBody: - application/json: {"name": "Technicalium", "description": "Requested early access to the new financing scheme.", "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}]} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": []} - "400": {} - Malformed query: + application/json: {"id": "ba29118f-5406-4e59-b05c-ba307ca38d01", "eventType": "connection.deleted", "generatedDate": "2024-08-08T17:10:34.015Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Bank of Dave", "description": "internal_id_mxO7rLfo", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}, "tags": {"customerRegion": "us", "uid": "335a086e-8563-4b03-94e3-39544225ecb6"}}, "connection": {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.646Z", "created": "2022-10-27T09:53:29Z"}}} + read.completed: + Read completed with validation warnings: requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}], "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "platform": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739"} - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - With a tag: + application/json: {"id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", "eventType": "read.completed", "generatedDate": "2022-10-23T00:00:00Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Toft stores", "description": "Requested early access to the new financing scheme.", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}}, "modifiedFromDate": "2022-10-23T00:00:00Z", "dataTypes": [{"connectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "recordsModified": false, "status": "Complete", "issues": [{"type": "warning.validation", "message": "Something doesn't look right about these invoices. You can see more information in the logs.", "links": {"logs": "https://api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/sync/743ec94a-8aa4-44bb-8bd4-e1855ee0e74b/validation", "portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/pull-history", "readMore": "https://docs.codat.io/using-the-api/get-data-troubleshooting#warning.validation"}}]}]}} + Read completed without issues: requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "tags": {"region": "us"}, "referenceSubsidiaryCompanies": [], "dataConnections": []} - delete-company: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-company: - Simple company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores holdings", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [], "dataConnections": []} - "401": {} - With groups: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "My First Company", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": []} - "401": {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}], "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "platform": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739"} - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Parent multi-entity company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []} - Subsidiary multi-entity company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "description": "", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]} + application/json: {"id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", "eventType": "read.completed", "generatedDate": "2022-10-23T00:00:00Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Toft stores", "description": "Requested early access to the new financing scheme.", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}}, "modifiedFromDate": "2022-10-23T00:00:00Z", "dataTypes": [{"connectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "recordsModified": false, "status": "Complete", "issues": []}]}} + read.completed.initial: + Initial with validation warnings: + requestBody: + application/json: {"id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", "eventType": "read.completed.initial", "generatedDate": "2022-10-23T00:00:00Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Toft stores", "description": "Requested early access to the new financing scheme.", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}}, "modifiedFromDate": "2022-10-23T00:00:00Z", "dataTypes": [{"connectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "recordsModified": false, "status": "Complete", "issues": [{"type": "warning.validation", "message": "Something doesn't look right about these invoices. You can see more information in the logs.", "links": {"logs": "https://api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/sync/743ec94a-8aa4-44bb-8bd4-e1855ee0e74b/validation", "portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/pull-history", "readMore": "https://docs.codat.io/using-the-api/get-data-troubleshooting#warning.validation"}}]}]}} + Initial without issues: + requestBody: + application/json: {"id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", "eventType": "read.completed.initial", "generatedDate": "2022-10-23T00:00:00Z", "payload": {"referenceCompany": {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "Toft stores", "description": "Requested early access to the new financing scheme.", "links": {"portal": "https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/summary"}}, "modifiedFromDate": "2022-10-23T00:00:00Z", "dataTypes": [{"connectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "recordsModified": false, "status": "Complete", "issues": []}]}} + '{dataType}.write.successful': + Record: + requestBody: + application/json: {"id": "bae71d36-ff47-420a-b4a6-f8c9ddf41140", "eventType": "{dataType}.write.successful", "generatedDate": "2023-05-03T10:00:23Z", "payload": {"id": "a9367074-b5c3-42c4-9be4-be129f43577e", "type": "Create", "referenceCompany": {"id": "70af3071-65d9-4ec3-b3cb-5283e8d55dac", "name": "Toft stores", "description": "cust_1MtJUT2eZvKYlo2CNaw2HvEv"}, "connectionId": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "requestedOnDate": "2023-05-03T10:00:00Z", "completedOnDate": "2023-05-03T10:00:23Z", "status": "Success", "record": {"id": "bil_1Nispe2eZvKYlo2Cd31jOCgZ"}}} + Attachment: + requestBody: + application/json: {"id": "bae71d36-ff47-420a-b4a6-f8c9ddf41140", "eventType": "{dataType}.write.successful", "generatedDate": "2023-05-03T10:00:23Z", "payload": {"id": "a9367074-b5c3-42c4-9be4-be129f43577e", "type": "UploadAttachment", "referenceCompany": {"id": "70af3071-65d9-4ec3-b3cb-5283e8d55dac", "name": "Toft stores", "description": "cust_1MtJUT2eZvKYlo2CNaw2HvEv"}, "connectionId": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "requestedOnDate": "2023-05-03T10:00:00Z", "completedOnDate": "2023-05-03T10:00:23Z", "status": "Success", "record": {"id": "bil_1Nispe2eZvKYlo2Cd31jOCgZ"}, "attachmentId": "att_1AZtxr2eZvKYlo2CJDX8whov"}} + '{dataType}.write.unsuccessful': + Record: + requestBody: + application/json: {"id": "bae71d36-ff47-420a-b4a6-f8c9ddf41140", "eventType": "{dataType}.write.unsuccessful", "generatedDate": "2023-05-03T10:00:23Z", "payload": {"id": "a9367074-b5c3-42c4-9be4-be129f43577e", "type": "Update", "referenceCompany": {"id": "70af3071-65d9-4ec3-b3cb-5283e8d55dac", "name": "Toft stores", "description": "cust_1MtJUT2eZvKYlo2CNaw2HvEv"}, "connectionId": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "requestedOnDate": "2023-05-03T10:00:00Z", "completedOnDate": "2023-05-03T10:00:23Z", "status": "Failed"}} + Record timed out: + requestBody: + application/json: {"id": "bae71d36-ff47-420a-b4a6-f8c9ddf41140", "eventType": "{dataType}.write.unsuccessful", "generatedDate": "2023-05-03T10:00:23Z", "payload": {"id": "a9367074-b5c3-42c4-9be4-be129f43577e", "type": "Delete", "referenceCompany": {"id": "70af3071-65d9-4ec3-b3cb-5283e8d55dac", "name": "Toft stores", "description": "cust_1MtJUT2eZvKYlo2CNaw2HvEv"}, "connectionId": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "requestedOnDate": "2023-05-03T10:00:00Z", "completedOnDate": "2023-05-03T10:00:23Z", "status": "TimedOut"}} + Attachment: + requestBody: + application/json: {"id": "bae71d36-ff47-420a-b4a6-f8c9ddf41140", "eventType": "{dataType}.write.unsuccessful", "generatedDate": "2023-05-03T10:00:23Z", "payload": {"id": "a9367074-b5c3-42c4-9be4-be129f43577e", "type": "UploadAttachment", "referenceCompany": {"id": "70af3071-65d9-4ec3-b3cb-5283e8d55dac", "name": "Toft stores", "description": "cust_1MtJUT2eZvKYlo2CNaw2HvEv"}, "connectionId": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "requestedOnDate": "2023-05-03T10:00:00Z", "completedOnDate": "2023-05-03T10:00:23Z", "status": "TimedOut", "record": {"id": "bil_1Nispe2eZvKYlo2Cd31jOCgZ"}}} + client.rateLimit.reached: + Reached: + requestBody: + application/json: {"id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", "eventType": "client.rateLimit.reached", "generatedDate": "2024-09-01T00:00:00Z", "payload": {"dailyQuota": 12000, "quotaRemaining": 0, "expiryDate": "2024-09-01T12:14:14Z"}} + client.rateLimit.reset: + Reset: + requestBody: + application/json: {"id": "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", "eventType": "client.rateLimit.reset", "generatedDate": "2024-09-01T00:00:00Z", "payload": {"dailyQuota": 12000, "quotaRemaining": 11993, "expiryDate": "2024-09-01T23:59:99Z"}} list-companies: - "": + speakeasy-default-list-companies: parameters: query: page: 1 pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "200": - application/json: {"results": [{"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []}]}], "pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": {} + application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} + "400": + application/json: {} + "500": + application/json: {} One company: parameters: query: @@ -706,10 +572,10 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "200": - application/json: {"results": [{"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "My Test Company", "description": "My Test Company make testing software", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 1, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} - "400": {} + application/json: {"results": [{"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "My Test Company", "description": "My Test Company make testing software", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 1, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} List of Companies: parameters: query: @@ -717,10 +583,10 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: "200": - application/json: {"results": [{"id": "d1568dde-adf6-11ed-afa1-0242ac120002", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []}, {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 3, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} - "400": {} + application/json: {"results": [{"id": "d1568dde-adf6-11ed-afa1-0242ac120002", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "products": ["spend-insights", "lending", "payables-v2"], "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []}, {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["lending", "spend-insights", "payables"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 3, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} Malformed query: parameters: query: @@ -728,11 +594,12 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: - "200": - application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}], "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "platform": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739"}], "totalResults": 1} "400": application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} Unresolved property: parameters: query: @@ -740,154 +607,233 @@ examples: pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" + tags: "region=uk && team=invoice-finance" responses: - "200": - application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}], "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "platform": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739"}], "totalResults": 1} "400": application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - update-company: - Update name: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + create-company: + With no description: requestBody: - application/json: {"name": "New Name", "description": "Requested early access to the new financing scheme."} + application/json: {"name": "Technicalium"} responses: "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": {} - Update description: + application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} + With a description: + requestBody: + application/json: {"name": "Technicalium", "description": "Technology services, including web and app design and development"} + responses: + "200": + application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} + With a tag: + requestBody: + application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} + responses: + "200": + application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "tags": {"region": "us"}, "referenceSubsidiaryCompanies": [], "dataConnections": []} + Malformed query: + requestBody: + application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} + responses: + "400": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-company: + Simple company: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Same name", "description": "Additional documents required"} responses: "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} - "401": {} - Unauthorized: + application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores holdings", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [], "dataConnections": []} + Parent multi-entity company: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} responses: "200": - application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}], "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "platform": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739"} - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-connection-management-access-token: - Access token: + application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []} + Subsidiary multi-entity company: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: "200": - application/json: {"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"} - "401": {} + application/json: {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "description": "", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]} Unauthorized: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: - "200": - application/json: {"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-connection-management-cors-settings: - Allowed origins: - responses: - "200": - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} - "401": {} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + delete-company: Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: - "200": - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - set-connection-management-cors-settings: - Allowed origins: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + replace-company: + Update name: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" requestBody: - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} + application/json: {"name": "New Name"} responses: "200": - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} - "401": {} - Unauthorized: + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} + Update description: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" requestBody: - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} + application/json: {"name": "Same name", "description": "Additional documents required"} responses: "200": - application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} + responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-connection: - Connection: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + update-company: + Update tags: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" requestBody: - application/json: {"platformKey": "gbol"} + application/json: {"tags": {"refrence": "new reference"}} responses: "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []} - "401": {} - Unauthorized: + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} + Update name: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" requestBody: - application/json: {"platformKey": "gbol"} + application/json: {"name": "New Name"} responses: "200": - application/json: {"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-connection: + application/json: {} + "500": + application/json: {} Unauthorized: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + requestBody: + application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-connection: - Connection: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + add-product: + Unauthorized: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productIdentifier: "bank-feeds" responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []} - "401": {} + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + remove-product: Unauthorized: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + productIdentifier: "bank-feeds" responses: - "200": - application/json: {"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-connections: - "": + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + refresh-product-data: + Standard product not supported: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" + productIdentifier: "bank-feeds" + responses: + "400": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Bank Feeds doesn't support data refreshing. For more information, refer to your solution’s documentation [here](https://docs.codat.io).", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Bank Feeds doesn't support data refreshing. For more information, refer to your solution’s documentation [here](https://docs.codat.io).", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + Read in progress: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + productIdentifier: "bank-feeds" + responses: + "400": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Data cannot be refreshed while a read operation is in progress. Allow the read to complete before attempting to refresh.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Data cannot be refreshed while a read operation is in progress. Allow the read to complete before attempting to refresh.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-company-access-token: + Simple company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"expiresIn": 86400, "accessToken": "string", "tokenType": "Bearer"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + list-connections: + speakeasy-default-list-connections: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" responses: "200": - application/json: {"results": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []}], "pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": {} + application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} + "400": + application/json: {} + "500": + application/json: {} Connections: parameters: path: @@ -900,7 +846,6 @@ examples: responses: "200": application/json: {"results": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}], "pageNumber": 0, "pageSize": 0, "totalResults": 0, "_links": {"self": {"href": "string"}, "current": {"href": "string"}, "next": {"href": "string"}, "previous": {"href": "string"}}} - "400": {} Malformed query: parameters: path: @@ -911,10 +856,10 @@ examples: query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" responses: - "200": - application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "totalResults": 1} "400": application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} Unresolved property: parameters: path: @@ -925,10 +870,61 @@ examples: query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" responses: - "200": - application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "totalResults": 1} "400": application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + create-connection: + Connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"platformKey": "gbol"} + responses: + "200": + application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"platformKey": "gbol"} + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-connection: + Connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + delete-connection: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} unlink-connection: Example: parameters: @@ -939,18 +935,21 @@ examples: application/json: {"status": "Unlinked"} responses: "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []} - "401": {} + application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} + "401": + application/json: {} + "500": + application/json: {} Unauthorized: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" responses: - "200": - application/json: {"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} update-connection-authorization: Unauthorized: parameters: @@ -958,128 +957,244 @@ examples: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" responses: - "200": - application/json: {"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - configure-custom-data-type: - Dynamics 365 Business Central: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-connection-management-access-token: + Access token: parameters: path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" - requestBody: - application/json: {"dataSource": "api/purchaseOrders", "requiredData": {"currency": "$[*].currencyCode", "number": "$[*].number", "date": "$[*].orderDate", "totalexvat": "$[*].totalAmountExcludingTax", "totaltax": "$[*].totalTaxAmount", "vendor": "$[*].number"}, "keyBy": ["$[*].id"], "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: "200": - application/json: {"dataSource": "api/purchaseOrders", "requiredData": {"currency": "$[*].currencyCode", "number": "$[*].number", "date": "$[*].orderDate", "totalexvat": "$[*].totalAmountExcludingTax", "totaltax": "$[*].totalTaxAmount", "vendor": "$[*].number"}, "keyBy": ["$[*].id"], "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} - "401": {} - Xero Simple Record: + application/json: {"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"} + Unauthorized: parameters: path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-connection-management-cors-settings: + Allowed origins: + responses: + "200": + application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} + Unauthorized: + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + set-connection-management-cors-settings: + Allowed origins: requestBody: - application/json: {"dataSource": "/api.xro/2.0/Accounts", "requiredData": {"code": "$.Code", "accountId": "$.AccountID", "type": "$.Type", "SysAcc": "$.SystemAccount"}, "keyBy": ["$.AccountID"]} + application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} responses: "200": - application/json: {"dataSource": "/api.xro/2.0/Accounts", "requiredData": {"code": "$.Code", "accountId": "$.AccountID", "type": "$.Type", "SysAcc": "$.SystemAccount"}, "keyBy": ["$.AccountID"]} - "401": {} - Xero Mapping Arrays: - parameters: - path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" + application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} + Unauthorized: requestBody: - application/json: {"dataSource": "/api.xro/2.0/Invoices", "requiredData": {"invNumber": "$.InvoiceNumber", "type": "$.Type", "InvoiceID": "$.InvoiceID", "lines": "$.LineItems[*]"}, "keyBy": ["$.InvoiceID"], "sourceModifiedDate": ["$.UpdatedDateUTC"]} + application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-cors-settings: + Allowed origins: responses: "200": - application/json: {"dataSource": "/api.xro/2.0/Invoices", "requiredData": {"invNumber": "$.InvoiceNumber", "type": "$.Type", "InvoiceID": "$.InvoiceID", "lines": "$.LineItems[*]"}, "keyBy": ["$.InvoiceID"], "sourceModifiedDate": ["$.UpdatedDateUTC"]} - "401": {} - QuickBooks Online: - parameters: - path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" + application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} + Unauthorized: + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + set-cors-settings: + Allowed origins: requestBody: - application/json: {"dataSource": "/query?query=select * from Account", "requiredData": {"id": "$.Id", "Currentbal": "$.CurrentBalance", "SubAcc": "$.SubAccount"}, "keyBy": ["$.Id"], "sourceModifiedDate": ["$.time"]} + application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} responses: "200": - application/json: {"dataSource": "/query?query=select * from Account", "requiredData": {"id": "$.Id", "Currentbal": "$.CurrentBalance", "SubAcc": "$.SubAccount"}, "keyBy": ["$.Id"], "sourceModifiedDate": ["$.time"]} - "401": {} + application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} Unauthorized: - parameters: - path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" requestBody: - application/json: {"dataSource": "api/purchaseOrders?$filter=currencyCode eq 'NOK'", "requiredData": {"currencyCode": "$[*].currencyCode", "id": "$[*].id", "number": "$[*].number", "orderDate": "$[*].orderDate", "totalAmountExcludingTax": "$[*].totalAmountExcludingTax", "totalTaxAmount": "$[*].totalTaxAmount", "vendorName": "$[*].number"}, "keyBy": ["$[*].id"], "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} + application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-profile: + Unauthorized: + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + update-profile: + Unauthorized: + requestBody: + application/json: {"name": "Bob's Burgers", "logoUrl": "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", "iconUrl": "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", "redirectUrl": "https://bobs-burgers.{countrySuffix}/{companyId}", "whiteListUrls": ["https://bobs-burgers.com", "https://bobs-burgers.co.uk"], "confirmCompanyName": true} + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-profile-syncSettings: + Example: responses: "200": - application/json: {"dataSource": "api/purchaseOrders?$filter=currencyCode eq 'NOK'", "keyBy": ["$[*].id"], "requiredData": {"currencyCode": "$[*].currencyCode", "id": "$[*].id", "number": "$[*].number", "orderDate": "$[*].orderDate", "totalAmountExcludingTax": "$[*].totalAmountExcludingTax", "totalTaxAmount": "$[*].totalTaxAmount", "vendorName": "$[*].number"}, "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} + application/json: {"clientId": "367f7975-267b-439b-90c6-a6040ee680f3", "settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "syncSchedule": 24, "syncOrder": 0, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "monthsToSync": 24, "isLocked": true}], "overridesDefaults": true} + Unauthorized: + responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-custom-data-type-configuration: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + update-profile-syncSettings: Unauthorized: - parameters: - path: - platformKey: "gbol" - customDataIdentifier: "DynamicsPurchaseOrders" + requestBody: + application/json: {"clientId": "9807ce3e-cfa5-4370-b4f2-09c282b1598b", "settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "syncSchedule": 24, "syncOrder": 0, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "monthsToSync": 24, "isLocked": true}], "overridesDefaults": true} + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + list-api-keys: + Example: responses: "200": - application/json: {"results": []} + application/json: {"results": [{"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-11T13:49:37Z"}, {"id": "c438836a-61fe-443f-8a19-24cc18be21e4", "name": "azure-invoice-finance-processor", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-23T09:43:48Z"}]} + Unauthorized: + responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-custom-data-type-records: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + create-api-key: + Create API key with name: + requestBody: + application/json: {"name": "azure-invoice-finance-processor"} + responses: + "201": + application/json: {"id": "e288a972-b402-4b21-93f9-b5335ae5679c", "name": "azure-invoice-finance-processor", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-10-23T00:00:00Z"} + "400": + application/json: {} + "500": + application/json: {} + API key details: + requestBody: + application/json: {"name": "azure-invoice-finance-processor"} + responses: + "201": + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-11T13:49:37Z"} + API key details with name: + requestBody: + application/json: {"name": "azure-invoice-finance-processor"} + responses: + "201": + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "azure-invoice-finance-processor", "apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-11T13:49:37Z"} + Max length for name reached: + requestBody: + application/json: {"name": "azure-invoice-finance-processor"} + responses: + "400": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Max string length (50) for `name` reached.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Max string length (50) for `name` reached.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + delete-api-key: + Conflict: + parameters: + path: + apiKeyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "204": + application/json: {"statusCode": 429, "service": "PublicApi", "error": "You have made too many requests in a given amount of time; please retry later.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "401": + application/json: {"statusCode": 429, "service": "PublicApi", "error": "You have made too many requests in a given amount of time; please retry later.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 429, "service": "PublicApi", "error": "You have made too many requests in a given amount of time; please retry later.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + refresh-company-data: Malformed query: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - customDataIdentifier: "DynamicsPurchaseOrders" - query: - page: 1 - pageSize: 100 responses: - "200": - application/json: {"results": []} "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - refresh-custom-data-type: - Unauthorized: + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "400": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + refresh-data-type: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "invoices" + responses: + "400": + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "invoices" + responses: + "400": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-company-data-status: + Example: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - customDataIdentifier: "DynamicsPurchaseOrders" responses: "200": - application/json: {"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "completed": "2022-10-23T00:00:00Z", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "isCompleted": false, "isErrored": false, "progress": 10, "requested": "2022-11-14T11:18:37.2798351Z", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z"} - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-create-update-model-options-by-data-type: + application/json: {"accountTransactions": {"dataType": "accountTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "balanceSheet": {"dataType": "balanceSheet", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "bankAccounts": {"dataType": "bankAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "bankTransactions": {"dataType": "bankTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "billCreditNotes": {"dataType": "billCreditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "billPayments": {"dataType": "billPayments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "bills": {"dataType": "bills", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "cashFlowStatement": {"dataType": "cashFlowStatement", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "chartOfAccounts": {"dataType": "chartOfAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "company": {"dataType": "company", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "creditNotes": {"dataType": "creditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "customers": {"dataType": "customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "directCosts": {"dataType": "directCosts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "directIncomes": {"dataType": "directIncomes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "invoices": {"dataType": "invoices", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "itemReceipts": {"dataType": "itemReceipts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "items": {"dataType": "items", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "journalEntries": {"dataType": "journalEntries", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "journals": {"dataType": "journals", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "paymentMethods": {"dataType": "paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "payments": {"dataType": "payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "profitAndLoss": {"dataType": "profitAndLoss", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "purchaseOrders": {"dataType": "purchaseOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "salesOrders": {"dataType": "salesOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "suppliers": {"dataType": "suppliers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "taxRates": {"dataType": "taxRates", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "trackingCategories": {"dataType": "trackingCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "transfers": {"dataType": "transfers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-accountBalances": {"dataType": "banking-accountBalances", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-accounts": {"dataType": "banking-accounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-transactionCategories": {"dataType": "banking-transactionCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-transactions": {"dataType": "banking-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-companyInfo": {"dataType": "commerce-companyInfo", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-customers": {"dataType": "commerce-customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-disputes": {"dataType": "commerce-disputes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-locations": {"dataType": "commerce-locations", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-orders": {"dataType": "commerce-orders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-paymentMethods": {"dataType": "commerce-paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-payments": {"dataType": "commerce-payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-productCategories": {"dataType": "commerce-productCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-products": {"dataType": "commerce-products", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-taxComponents": {"dataType": "commerce-taxComponents", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-transactions": {"dataType": "commerce-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}} Unauthorized: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - dataType: "invoices" responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-push-operation: - Unauthorized: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + list-pull-operations: + speakeasy-default-list-pull-operations: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - pushOperationKey: "59acd79e-29d3-4138-91d3-91d4641bf7ed" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" responses: "200": - application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "7d1027ad-1e15-4c1d-8064-17806d4a8ca2", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 954096} - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-company-push-history: - "": + application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} + "400": + application/json: {} + "500": + application/json: {} + Example: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" @@ -1090,8 +1205,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"results": [], "pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": {} + application/json: {"results": [{"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "status": "Initial", "requested": "2022-11-14T11:18:37.2798351Z", "progress": 10, "isCompleted": false, "isErrored": false}], "pageNumber": 0, "pageSize": 0, "totalResults": 0, "_links": {"self": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history"}, "current": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=1&pageSize=2"}, "next": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=2&pageSize=2"}}} Malformed query: parameters: path: @@ -1102,10 +1216,10 @@ examples: query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" responses: - "200": - application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} "400": application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} Unresolved property: parameters: path: @@ -1116,77 +1230,64 @@ examples: query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" responses: - "200": - application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [], "totalResults": 1} "400": application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - refresh-company-data: + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-pull-operation: Unauthorized: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + datasetId: "fa5f3e86-bd80-49b8-853c-5fbba4b201f5" responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - refresh-data-type: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - dataType: "invoices" - query: {} - responses: - "200": - application/json: {"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "completed": "2022-10-23T00:00:00Z", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "isCompleted": false, "isErrored": false, "progress": 10, "requested": "2022-11-14T11:18:37.2798351Z", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z"} - "401": + "500": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-company-data-status: - Example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + list-webhook-consumers: + Webhook consumers: responses: "200": - application/json: {"accountTransactions": {"dataType": "accountTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "balanceSheet": {"dataType": "balanceSheet", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "bankAccounts": {"dataType": "bankAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "bankTransactions": {"dataType": "bankTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "billCreditNotes": {"dataType": "billCreditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "billPayments": {"dataType": "billPayments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "bills": {"dataType": "bills", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "cashFlowStatement": {"dataType": "cashFlowStatement", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "chartOfAccounts": {"dataType": "chartOfAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "company": {"dataType": "company", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "creditNotes": {"dataType": "creditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "customers": {"dataType": "customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "directCosts": {"dataType": "directCosts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "directIncomes": {"dataType": "directIncomes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "invoices": {"dataType": "invoices", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "itemReceipts": {"dataType": "itemReceipts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "items": {"dataType": "items", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "journalEntries": {"dataType": "journalEntries", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "journals": {"dataType": "journals", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "paymentMethods": {"dataType": "paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "payments": {"dataType": "payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "profitAndLoss": {"dataType": "profitAndLoss", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "purchaseOrders": {"dataType": "purchaseOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "salesOrders": {"dataType": "salesOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "suppliers": {"dataType": "suppliers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "taxRates": {"dataType": "taxRates", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "trackingCategories": {"dataType": "trackingCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "transfers": {"dataType": "transfers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-accountBalances": {"dataType": "banking-accountBalances", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-accounts": {"dataType": "banking-accounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-transactionCategories": {"dataType": "banking-transactionCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-transactions": {"dataType": "banking-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-companyInfo": {"dataType": "commerce-companyInfo", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-customers": {"dataType": "commerce-customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-disputes": {"dataType": "commerce-disputes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-locations": {"dataType": "commerce-locations", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-orders": {"dataType": "commerce-orders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-paymentMethods": {"dataType": "commerce-paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-payments": {"dataType": "commerce-payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-productCategories": {"dataType": "commerce-productCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-products": {"dataType": "commerce-products", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-taxComponents": {"dataType": "commerce-taxComponents", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-transactions": {"dataType": "commerce-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}} - "401": {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + application/json: {"results": [{"id": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "url": "https://example.com/webhoook-consumers/sync-complete", "disabled": false, "eventTypes": ["DataSyncCompleted"]}, {"id": "ca3cac86-7925-4759-abc2-96405780fdfa", "url": "https://example.com/webhoook-consumers/dataset-changed", "disabled": true, "eventTypes": ["DatasetDataChanged"]}]} + Malformed query: responses: - "200": - application/json: {"accountTransactions": {"currentStatus": "ValidationError", "dataType": "bankTransactions", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "balanceSheet": {"currentStatus": "ProcessingError", "dataType": "commerce-orders", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "bankAccounts": {"currentStatus": "ProcessingError", "dataType": "commerce-locations", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "bankTransactions": {"currentStatus": "Processing", "dataType": "bankTransactions", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "banking-accountBalances": {"currentStatus": "PrerequisiteNotMet", "dataType": "commerce-paymentMethods", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "banking-accounts": {"currentStatus": "ProcessingQueued", "dataType": "banking-transactions", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "banking-transactionCategories": {"currentStatus": "ProcessingQueued", "dataType": "journalEntries", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "banking-transactions": {"currentStatus": "Complete", "dataType": "commerce-payments", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "billCreditNotes": {"currentStatus": "Mapping", "dataType": "bankAccounts", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "billPayments": {"currentStatus": "PermissionsError", "dataType": "directCosts", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "bills": {"currentStatus": "ProcessingQueued", "dataType": "itemReceipts", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "cashFlowStatement": {"currentStatus": "Cancelled", "dataType": "banking-transactions", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "chartOfAccounts": {"currentStatus": "Queued", "dataType": "commerce-transactions", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "commerce-companyInfo": {"currentStatus": "Mapping", "dataType": "journals", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "commerce-customers": {"currentStatus": "FetchError", "dataType": "suppliers", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "commerce-disputes": {"currentStatus": "Queued", "dataType": "invoices", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "commerce-locations": {"currentStatus": "ProcessingError", "dataType": "commerce-customers", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "commerce-orders": {"currentStatus": "Cancelled", "dataType": "commerce-customers", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "commerce-paymentMethods": {"currentStatus": "MapError", "dataType": "invoices", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "commerce-payments": {"currentStatus": "AuthError", "dataType": "commerce-companyInfo", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "commerce-productCategories": {"currentStatus": "ValidationQueued", "dataType": "cashFlowStatement", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "commerce-products": {"currentStatus": "ProcessingError", "dataType": "bankTransactions", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "commerce-taxComponents": {"currentStatus": "FetchError", "dataType": "directCosts", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "commerce-transactions": {"currentStatus": "FetchError", "dataType": "invoices", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "company": {"currentStatus": "MapQueued", "dataType": "commerce-payments", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "creditNotes": {"currentStatus": "Complete", "dataType": "accountTransactions", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "customers": {"currentStatus": "Cancelled", "dataType": "balanceSheet", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "directCosts": {"currentStatus": "Complete", "dataType": "purchaseOrders", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "directIncomes": {"currentStatus": "AuthError", "dataType": "suppliers", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "invoices": {"currentStatus": "Cancelled", "dataType": "billPayments", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "itemReceipts": {"currentStatus": "ValidationError", "dataType": "invoices", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "items": {"currentStatus": "PermissionsError", "dataType": "commerce-orders", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "journalEntries": {"currentStatus": "FetchError", "dataType": "commerce-taxComponents", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "journals": {"currentStatus": "Initial", "dataType": "commerce-disputes", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "paymentMethods": {"currentStatus": "PrerequisiteNotMet", "dataType": "accountTransactions", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "payments": {"currentStatus": "ProcessingQueued", "dataType": "commerce-disputes", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "profitAndLoss": {"currentStatus": "InternalError", "dataType": "items", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "purchaseOrders": {"currentStatus": "Fetching", "dataType": "bills", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "salesOrders": {"currentStatus": "MapQueued", "dataType": "accountTransactions", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "suppliers": {"currentStatus": "ProcessingError", "dataType": "bills", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "taxRates": {"currentStatus": "Fetching", "dataType": "balanceSheet", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "trackingCategories": {"currentStatus": "RateLimitError", "dataType": "itemReceipts", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}, "transfers": {"currentStatus": "Validating", "dataType": "billPayments", "lastSuccessfulSync": "2022-01-01T13:00:00.000Z", "latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101", "latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3"}} - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-pull-operation: + "400": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + create-webhook-consumer: + Subscribe consumer to one or more event types: + requestBody: + application/json: {"url": "https://example.com/webhoook-consumer", "disabled": false, "eventTypes": ["DataSyncCompleted", "Dataset data changed"]} + responses: + "201": + application/json: {"id": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "url": "https://example.com/webhoook-consumer", "disabled": false, "eventTypes": ["DataSyncCompleted", "DatasetDataChanged"]} + Subscribe consumer with disabled endpoint: + requestBody: + application/json: {"url": "https://example.com/webhoook-consumer", "disabled": true, "eventTypes": ["DataSyncCompleted"]} + responses: + "201": + application/json: {"id": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "url": "https://example.com/webhoook-consumer", "disabled": true, "eventTypes": ["DataSyncCompleted"]} + Malformed query: + responses: + "400": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + delete-webhook-consumer: Unauthorized: parameters: path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - datasetId: "7911a54a-c808-4f4b-b87e-b195f52b4da5" + webhookId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: - "200": - application/json: {"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "completed": "2022-10-23T00:00:00Z", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "isCompleted": false, "isErrored": false, "progress": 10, "requested": "2022-11-14T11:18:37.2798351Z", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z"} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-pull-operations: - "": - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z", "requested": "2022-11-14T11:18:37.2798351Z", "completed": "2022-10-23T00:00:00Z", "progress": 10, "isCompleted": false, "isErrored": false}], "pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": {} - Example: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + list-integrations: + speakeasy-default-list-integrations: parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" query: page: 1 pageSize: 100 @@ -1194,118 +1295,91 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"results": [{"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "status": "Initial", "requested": "2022-11-14T11:18:37.2798351Z", "progress": 10, "isCompleted": false, "isErrored": false}], "pageNumber": 0, "pageSize": 0, "totalResults": 0, "_links": {"self": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history"}, "current": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=1&pageSize=2"}, "next": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=2&pageSize=2"}}} - "400": {} + application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} + "400": + application/json: {} + "500": + application/json: {} Malformed query: parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" query: page: 1 pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" responses: - "200": - application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "completed": "2022-10-23T00:00:00Z", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "isCompleted": false, "isErrored": false, "progress": 10, "requested": "2022-11-14T11:18:37.2798351Z", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z"}], "totalResults": 1} "400": application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} Unresolved property: parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" query: page: 1 pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" responses: - "200": - application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "completed": "2022-10-23T00:00:00Z", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "isCompleted": false, "isErrored": false, "progress": 10, "requested": "2022-11-14T11:18:37.2798351Z", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z"}], "totalResults": 1} "400": application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - add-company-to-group: - Example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"groupId": "d7a6c4b4-dc87-45f6-b803-62f466398680"} - responses: - "200": - application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "description": "Requested early access to the new financing scheme.", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z", "dataConnectionErrors": []}]} - "401": {} + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-integration: Unauthorized: parameters: path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"groupId": "60d2fa12-8a04-11ee-b9d1-0242ac120002"} + platformKey: "gbol" responses: - "200": - application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "groups": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"}], "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "platform": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739"} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-group: - Example: - requestBody: - application/json: {"name": "Corporate cards department"} - responses: - "200": - application/json: {"id": "d7a6c4b4-dc87-45f6-b803-62f466398680", "name": "Corporate cards department"} - "401": {} - Unauthorized: - requestBody: - application/json: {"name": "Invoice finance team"} - responses: - "200": - application/json: {"id": "60d2fa12-8a04-11ee-b9d1-0242ac120002", "name": "Invoice finance team"} - "401": + "500": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-groups: - Example: - responses: - "200": - application/json: {"results": [{"id": "d7a6c4b4-dc87-45f6-b803-62f466398680", "name": "Corporate cards department"}, {"id": "e4498145-3b04-42bb-927c-d35726560a5b", "name": "Invoice finance team"}]} - "401": {} + get-integrations-branding: Unauthorized: + parameters: + path: + platformKey: "gbol" responses: - "200": - application/json: {"results": []} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - remove-company-from-group: - Unauthorized: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-read-validation-results: + Validation result: parameters: path: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - groupId: "60d2fa12-8a04-11ee-b9d1-0242ac120002" + datasetId: "0812af6e-436a-491f-9056-db91cb961ad3" responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-integration: + "200": + application/json: {"errors": [{"ruleId": "accounting-bill-030", "itemId": "fc2f2d1a-ff4d-40c6-a7fb-4bd7d04f4008", "message": "A bill's lines summed (69.99) should be the same as TotalAmount (70.00).", "validatorName": "BillValidator"}], "warnings": [{"ruleId": "accounting-bill-032", "itemId": "1d3979e5-7c28-432e-b562-04e9013c1ea0", "message": "A bill's lines sub total amount summed (3201.20) should be the same as SubTotal (3201.25)", "validatorName": "BillValidator"}]} Unauthorized: parameters: path: - platformKey: "gbol" + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + datasetId: "8c3ae743-3699-413e-8c9b-56e1b4de25b7" responses: - "200": - application/json: {"dataProvidedBy": "string", "datatypeFeatures": [{"dataType": "invoices", "supportedFeatures": [{"featureState": "NotSupported", "featureType": "Get"}]}], "enabled": true, "integrationId": "497a18ca-284e-40c0-985d-f72be35d468e", "isBeta": true, "isOfflineConnector": true, "key": "gbol", "logoUrl": "http://example.com", "name": "Xero", "sourceId": "accounting", "sourceType": "Commerce"} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-integrations-branding: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-create-update-model-options-by-data-type: Unauthorized: parameters: path: - platformKey: "gbol" + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + dataType: "invoices" responses: - "200": - application/json: {"button": {"default": {"image": {"alt": "xero default button icon", "src": "https://static.codat.io/public/officialButtons/Full/8A156A5A-39CB-4F9D-856E-76EF9Q7A9607.png"}}, "hover": {"image": {"alt": "xero hover button icon", "src": "https://static.codat.io/public/officialLogos/Full/8A156A5A-39CB-4F9D-856E-76EF9B9A9607.png"}}}, "logo": {"full": {"image": {"alt": "xero full icon", "src": "https://static.codat.io/public/officialLogos/Full/8A156A5A-39CB-4F9D-856E-76EF9B9A9607.png"}}, "square": {"image": {"alt": "xero square icon", "src": "https://static.codat.io/public/officialLogos/Square/8A156A5A-39CB-4F9D-856E-76EF9B2W3607.png"}}}, "sourceId": "35b92968-9851-4095-ad60-395c95cbcba4"} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-integrations: - "": + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-company-push-history: + speakeasy-default-get-company-push-history: parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" query: page: 1 pageSize: 100 @@ -1313,32 +1387,50 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"results": [{"key": "gbol", "logoUrl": "http://example.com", "name": "Xero", "enabled": true, "sourceId": "accounting", "sourceType": "Commerce", "integrationId": "497a18ca-284e-40c0-985d-f72be35d468e", "isOfflineConnector": true, "isBeta": true, "dataProvidedBy": "string", "datatypeFeatures": [{"dataType": "invoices", "supportedFeatures": [{"featureType": "Get", "featureState": "NotSupported"}]}]}], "pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": {} + application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} + "400": + application/json: {} + "500": + application/json: {} Malformed query: parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" query: page: 1 pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" responses: - "200": - application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"dataProvidedBy": "string", "datatypeFeatures": [{"dataType": "invoices", "supportedFeatures": [{"featureState": "Alpha", "featureType": "DownloadAttachment"}]}], "enabled": true, "integrationId": "497a18ca-284e-40c0-985d-f72be35d468e", "isBeta": true, "isOfflineConnector": true, "key": "gbol", "logoUrl": "http://example.com", "name": "Xero", "sourceId": "accounting", "sourceType": "BankFeed"}], "totalResults": 1} "400": application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} Unresolved property: parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" query: page: 1 pageSize: 100 query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" orderBy: "-modifiedDate" responses: - "200": - application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"dataProvidedBy": "string", "datatypeFeatures": [{"dataType": "invoices", "supportedFeatures": [{"featureState": "Alpha", "featureType": "DownloadAttachment"}]}], "enabled": true, "integrationId": "497a18ca-284e-40c0-985d-f72be35d468e", "isBeta": true, "isOfflineConnector": true, "key": "gbol", "logoUrl": "http://example.com", "name": "Xero", "sourceId": "accounting", "sourceType": "Banking"}], "totalResults": 1} "400": application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-push-operation: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + pushOperationKey: "660e8684-c0fb-4468-9e2a-b2e3b115d747" + responses: + "401": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} configure-supplemental-data: Xero - Accounts: parameters: @@ -1346,85 +1438,84 @@ examples: platformKey: "gbol" dataType: "invoices" requestBody: - application/json: - yourKeyNameForAccounts: - dataSource: /Accounts - pullData: - yourNameForTaxType: TaxType - yourNameForSystemAccount: SystemAccount + application/json: {} + responses: + "401": + application/json: {} + "500": + application/json: {} Xero - Invoices: parameters: path: platformKey: "gbol" dataType: "invoices" requestBody: - application/json: - yourKeyNameForInvoices: - dataSource: /Invoices - pullData: - yourNameForExpectedPaymentDate: ExpectedPaymentDate - yourNameForHasAttachments: HasAttachments + application/json: {} + responses: + "401": + application/json: {} + "500": + application/json: {} Xero - Items: parameters: path: platformKey: "gbol" dataType: "invoices" requestBody: - application/json: - yourKeyNameForItems: - dataSource: /Items - pullData: - yourNameForQuantityOnHand: QuantityOnHand - yourNameForTotalCostPool: TotalCostPool + application/json: {} + responses: + "401": + application/json: {} + "500": + application/json: {} Xero - Contacts: parameters: path: platformKey: "gbol" dataType: "invoices" requestBody: - application/json: - yourKeyNameForContacts: - dataSource: /Contacts - pullData: - yourNameForBankAccounts: BankAccountDetails + application/json: {} + responses: + "401": + application/json: {} + "500": + application/json: {} Xero - Tax rates: parameters: path: platformKey: "gbol" dataType: "invoices" requestBody: - application/json: - yourKeyNameForTaxRates: - dataSource: /TaxRates - pullData: - yourNameForCanApplyToLiabilities: CanApplyToLiabilities - yourNameForCanApplyToAssets: CanApplyToAssets - yourNameForCanApplyToEquity: CanApplyToEquity - yourNameForCanApplyToExpenses: CanApplyToExpenses - yourNameForCanApplyToRevenue: CanApplyToRevenue + application/json: {} + responses: + "401": + application/json: {} + "500": + application/json: {} QBO - Customers: parameters: path: platformKey: "gbol" dataType: "invoices" requestBody: - application/json: - yourKeyNameForCustomers: - dataSource: /Customer - pullData: - yourNameForSalesTermRef: SalesTermRef.value - yourNameForParentRef: ParentRef.value + application/json: {} + responses: + "401": + application/json: {} + "500": + application/json: {} QBO - Invoices: parameters: path: platformKey: "gbol" dataType: "invoices" requestBody: - application/json: - yourKeyNameForInvoices: - dataSource: /Invoice - pullData: - yourNameForSalesTermRef: SalesTermRef.value + application/json: {} + responses: + "401": + application/json: {} + "500": + application/json: {} Unauthorized: parameters: path: @@ -1435,6 +1526,8 @@ examples: responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} get-supplemental-data-configuration: Unauthorized: parameters: @@ -1442,213 +1535,101 @@ examples: platformKey: "gbol" dataType: "invoices" responses: - "200": - application/json: {"supplementalDataConfig": {"orders-supplemental-data": {"dataSource": "/orders", "pullData": {"orderNumber": "order_num"}, "pushData": {"orderNumber": "order_num"}}}} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-rule: - Company data connection status changed: - requestBody: - application/json: {"type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - responses: - "200": - application/json: {"id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - "401": {} - New company synchronized: - requestBody: - application/json: {"type": "New company synchronised", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - responses: - "200": - application/json: {"id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - "401": {} - Data sync completed: - requestBody: - application/json: {"type": "Data sync completed", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - responses: - "200": - application/json: {"id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - "401": {} - Dataset data changed: - requestBody: - application/json: {"type": "Dataset data changed", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - responses: - "200": - application/json: {"id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - "401": {} - Dataset status has changed to an error state: - requestBody: - application/json: {"type": "Data Sync Status Changed To Error", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - responses: - "200": - application/json: {"id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - "401": {} - Push operation status has changed: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + configure-custom-data-type: + Dynamics 365 Business Central: + parameters: + path: + platformKey: "gbol" + customDataIdentifier: "DynamicsPurchaseOrders" requestBody: - application/json: {"type": "Push Operation Status Changed", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} + application/json: {"dataSource": "api/purchaseOrders", "requiredData": {"currency": "$[*].currencyCode", "number": "$[*].number", "date": "$[*].orderDate", "totalexvat": "$[*].totalAmountExcludingTax", "totaltax": "$[*].totalTaxAmount", "vendor": "$[*].number"}, "keyBy": ["$[*].id"], "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} responses: "200": - application/json: {"id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - "401": {} - Push operation has timed out: + application/json: {"dataSource": "api/purchaseOrders", "requiredData": {"currency": "$[*].currencyCode", "number": "$[*].number", "date": "$[*].orderDate", "totalexvat": "$[*].totalAmountExcludingTax", "totaltax": "$[*].totalTaxAmount", "vendor": "$[*].number"}, "keyBy": ["$[*].id"], "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} + Xero Simple Record: + parameters: + path: + platformKey: "gbol" + customDataIdentifier: "DynamicsPurchaseOrders" requestBody: - application/json: {"type": "Push Operation Timed Out", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} + application/json: {"dataSource": "/api.xro/2.0/Accounts", "requiredData": {"code": "$.Code", "accountId": "$.AccountID", "type": "$.Type", "SysAcc": "$.SystemAccount"}, "keyBy": ["$.AccountID"]} responses: "200": - application/json: {"id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - "401": {} - Account categories updated: + application/json: {"dataSource": "/api.xro/2.0/Accounts", "requiredData": {"code": "$.Code", "accountId": "$.AccountID", "type": "$.Type", "SysAcc": "$.SystemAccount"}, "keyBy": ["$.AccountID"]} + Xero Mapping Arrays: + parameters: + path: + platformKey: "gbol" + customDataIdentifier: "DynamicsPurchaseOrders" requestBody: - application/json: {"type": "Account Categories Updated", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} + application/json: {"dataSource": "/api.xro/2.0/Invoices", "requiredData": {"invNumber": "$.InvoiceNumber", "type": "$.Type", "InvoiceID": "$.InvoiceID", "lines": "$.LineItems[*]"}, "keyBy": ["$.InvoiceID"], "sourceModifiedDate": ["$.UpdatedDateUTC"]} responses: "200": - application/json: {"id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - "401": {} - Sync Connection Deleted: + application/json: {"dataSource": "/api.xro/2.0/Invoices", "requiredData": {"invNumber": "$.InvoiceNumber", "type": "$.Type", "InvoiceID": "$.InvoiceID", "lines": "$.LineItems[*]"}, "keyBy": ["$.InvoiceID"], "sourceModifiedDate": ["$.UpdatedDateUTC"]} + QuickBooks Online: + parameters: + path: + platformKey: "gbol" + customDataIdentifier: "DynamicsPurchaseOrders" requestBody: - application/json: {"type": "Sync Connection Deleted", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} + application/json: {"dataSource": "/query?query=select * from Account", "requiredData": {"id": "$.Id", "Currentbal": "$.CurrentBalance", "SubAcc": "$.SubAccount"}, "keyBy": ["$.Id"], "sourceModifiedDate": ["$.time"]} responses: "200": - application/json: {"id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} - "401": {} + application/json: {"dataSource": "/query?query=select * from Account", "requiredData": {"id": "$.Id", "Currentbal": "$.CurrentBalance", "SubAcc": "$.SubAccount"}, "keyBy": ["$.Id"], "sourceModifiedDate": ["$.time"]} Unauthorized: + parameters: + path: + platformKey: "gbol" + customDataIdentifier: "DynamicsPurchaseOrders" requestBody: - application/json: {"type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}} + application/json: {"dataSource": "api/purchaseOrders?$filter=currencyCode eq 'NOK'", "requiredData": {"currencyCode": "$[*].currencyCode", "id": "$[*].id", "number": "$[*].number", "orderDate": "$[*].orderDate", "totalAmountExcludingTax": "$[*].totalAmountExcludingTax", "totalTaxAmount": "$[*].totalTaxAmount", "vendorName": "$[*].number"}, "keyBy": ["$[*].id"], "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} responses: - "200": - application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-webhook-consumer: - Subscribe consumer to one or more event types: - requestBody: - application/json: {"url": "https://example.com/webhoook-consumer", "eventTypes": ["DataSyncCompleted", "Dataset data changed"], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002"} - responses: - "201": - application/json: {"id": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "url": "https://example.com/webhoook-consumer", "disabled": false, "eventTypes": ["DataSyncCompleted", "DatasetDataChanged"], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002"} - "400": {} - Subscribe consumer with disabled endpoint: - requestBody: - application/json: {"url": "https://example.com/webhoook-consumer", "disabled": true, "eventTypes": ["DataSyncCompleted"], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002"} - responses: - "201": - application/json: {"id": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "url": "https://example.com/webhoook-consumer", "disabled": true, "eventTypes": ["DataSyncCompleted"], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002"} - "400": {} - Malformed query: - requestBody: - application/json: {"companyId": "8a210b68-6988-11ed-a1eb-0242ac120002"} - responses: - "201": - application/json: {"companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "id": "8a210b68-6988-11ed-a1eb-0242ac120002"} - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-webhook-consumer: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + get-custom-data-type-configuration: Unauthorized: parameters: path: - webhookId: "8a210b68-6988-11ed-a1eb-0242ac120002" + platformKey: "gbol" + customDataIdentifier: "DynamicsPurchaseOrders" responses: "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-webhook: + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + refresh-custom-data-type: Unauthorized: parameters: path: - ruleId: "7318949f-c008-4936-a8ff-10d7ab563fa6" + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customDataIdentifier: "DynamicsPurchaseOrders" responses: - "200": - application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} "401": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-rules: - "": - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}}, {"id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "type": "DataConnectionStatusChanged", "companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}}], "pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": {} - Example: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"results": [{"id": "fcfbfe0b-fe73-47ed-a7fe-0018567f5da2", "type": "DataConnectionStatusChanged", "notifiers": {"emails": [], "webhook": "https://webhook.site/6d385ea9-bcf9-48e4-9103-1958ccb54997"}}], "pageNumber": 1, "pageSize": 100, "totalResults": 1, "_links": {"self": {"href": "/rules"}, "current": {"href": "/rules?page=1&pageSize=100"}}} - "400": {} + "500": + application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + list-custom-data-type-records: Malformed query: parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customDataIdentifier: "DynamicsPurchaseOrders" query: page: 1 pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"}, {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"}], "totalResults": 1} - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"}, {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"}], "totalResults": 1} - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-webhook-consumers: - Webhook consumers: - responses: - "200": - application/json: {"results": [{"id": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "url": "https://example.com/webhoook-consumers/sync-complete", "disabled": false, "eventTypes": ["DataSyncCompleted"]}, {"id": "ca3cac86-7925-4759-abc2-96405780fdfa", "url": "https://example.com/webhoook-consumers/dataset-changed", "disabled": true, "eventTypes": ["DatasetDataChanged"]}]} - "400": {} - Malformed query: responses: - "200": - application/json: {"results": []} "400": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - add-product: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - productIdentifier: "lending" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - remove-product: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - productIdentifier: "expenses" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-company-access-token: - Simple company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"expiresIn": 86400, "accessToken": "string", "tokenType": "Bearer"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} +examplesVersion: 1.0.2 generatedTests: {} +releaseNotes: "## Csharp SDK Changes Detected:\n* `Codat.platform.Connection.Created()`: \n * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Settings.Update-Profile()`: \n * `request.AlertAuthHeader` **Removed** **Breaking** :warning:\n * `response.alertAuthHeader` **Removed** **Breaking** :warning:\n* `Codat.platform.Settings.Get-Profile()`: `response.alertAuthHeader` **Removed** **Breaking** :warning:\n* `Codat.platform.Webhooks.Create-Consumer()`: \n * `request` **Changed** **Breaking** :warning:\n * `response` **Changed** **Breaking** :warning:\n* `Codat.platform.Webhooks.List-Consumers()`: `response.results.[]` **Changed** **Breaking** :warning:\n* `Codat.platform.Connections.Update-Authorization()`: `response.connectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Connections.Unlink()`: `response.connectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Connections.Get()`: `response.connectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Connections.Create()`: `response.connectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Connections.List()`: `response.results.[].ConnectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Companies.Update()`: \n * `request` **Changed** **Breaking** :warning:\n * `response.dataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Companies.Get()`: `response.dataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Companies.Create()`: `response.dataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Companies.List()`: \n * `request.Tags` **Added**\n * `response.results.[].DataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Connection.Deleted()`: \n * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Connection.Reconnected()`: \n * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Connection.Disconnected()`: \n * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Connection.Failed()`: \n * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.Connection.Connected()`: \n * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** :warning:\n* `Codat.platform.DatasetStatusHasChangedToAnErrorState()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.NewCompanySynchronized()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.Webhooks.Create()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.Webhooks.Get()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.ConnectionManagement.Cors-Settings.Set()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.ConnectionManagement.Cors-Settings.Get()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.ConnectionManagement.Get-Access-Token()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.ClientRateLimitReset()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.ClientRateLimitReached()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.PushOperationHasTimedOut()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.Read.Completed()`: \n * `request.Payload.DataTypes.[].Issues` **Added**\n* `Codat.platform.Read.Completed.Initial()`: \n * `request.Payload.DataTypes.[].Issues` **Added**\n* `Codat.platform.PushOperationStatusHasChanged()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.Webhooks.List()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.Companies.Replace()`: **Added**\n* `Codat.platform.DatasetDataChanged()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.DataSyncCompleted()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.CompanyDataConnectionStatusChanged()`: **Deleted** **Breaking** :warning:\n* `Codat.platform.ReadData.Get-Validation-Results()`: **Added**\n* `Codat.platform.Settings.Set()`: **Added**\n* `Codat.platform.Settings.Get()`: **Added**\n* `Codat.platform.RefreshData.All()`: `error.status[400]` **Added**\n* `Codat.platform.RefreshData.By-Data-Type()`: `error.status[400]` **Added**\n* `Codat.platform.RefreshData.Get()`: `response.accountTransactions.LastSuccessfulSync` **Changed**\n* `Codat.platform.Cors.Set()`: **Added**\n* `Codat.platform.Cors.Get()`: **Added**\n* `Codat.platform.ConnectionManagement.Get()`: **Added**\n* `Codat.platform.Companies.Refresh-Product-Data()`: **Added**\n" diff --git a/platform/.speakeasy/gen.yaml b/platform/.speakeasy/gen.yaml index 51c511998..f29d84046 100644 --- a/platform/.speakeasy/gen.yaml +++ b/platform/.speakeasy/gen.yaml @@ -4,26 +4,38 @@ generation: maintainOpenAPIOrder: true usageSnippets: optionalPropertyRendering: withExample + sdkInitStyle: constructor useClassNamesForArrayFields: true fixes: nameResolutionDec2023: true + nameResolutionFeb2025: false parameterOrderingFeb2024: true requestResponseComponentNamesFeb2024: true + securityFeb2025: false + sharedErrorComponentsApr2025: false auth: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false + hoistGlobalSecurity: true + tests: + generateTests: true + generateNewTests: false + skipResponseBodyAssertions: false csharp: - version: 6.0.0 + version: 6.1.0 additionalDependencies: [] author: Codat + baseErrorName: CodatPlatformException clientServerStatusCodesAsErrors: true defaultErrorName: SDKException description: Manage the building blocks of Codat, including companies, connections, and more. disableNamespacePascalCasingApr2024: true dotnetVersion: net8.0 + enableCancellationToken: false enableSourceLink: false flattenGlobalSecurity: true flatteningOrder: "" + httpClientPrefix: Speakeasy imports: option: openapi paths: @@ -41,3 +53,4 @@ csharp: packageTags: "" responseFormat: envelope sourceDirectory: "" + useNodatime: true diff --git a/platform/Codat/Platform/Codat.Platform.csproj b/platform/Codat/Platform/Codat.Platform.csproj index 82fdd05ac..5857cb847 100644 --- a/platform/Codat/Platform/Codat.Platform.csproj +++ b/platform/Codat/Platform/Codat.Platform.csproj @@ -3,10 +3,10 @@ true Codat.Platform - 6.0.0 + 6.1.0 net8.0 Codat - Copyright (c) Codat 2024 + Copyright (c) Codat 2025 https://github.com/codatio/client-sdk-csharp.git git An API for the common components of all of Codat's products.
diff --git a/platform/Codat/Platform/CodatPlatform.cs b/platform/Codat/Platform/CodatPlatform.cs index 33cad76eb..b2eee6ec1 100644 --- a/platform/Codat/Platform/CodatPlatform.cs +++ b/platform/Codat/Platform/CodatPlatform.cs @@ -12,13 +12,13 @@ namespace Codat.Platform using Codat.Platform.Hooks; using Codat.Platform.Models.Components; using Codat.Platform.Models.Errors; - using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; - using System; /// /// Platform API: Platform API @@ -66,6 +66,12 @@ public interface ICodatPlatform /// Configure UI and retrieve access tokens for authentication used by **Connections SDK**. /// public IConnectionManagement ConnectionManagement { get; } + public ICors Cors { get; } + + /// + /// Manage company profile configuration, sync settings, and API keys. + /// + public ISettings Settings { get; } /// /// Initiate data refreshes, view pull status and history. @@ -83,9 +89,9 @@ public interface ICodatPlatform public IIntegrations Integrations { get; } /// - /// Manage company profile configuration, sync settings, and API keys. + /// View validation outcomes for completed read data operations. /// - public ISettings Settings { get; } + public IReadData ReadData { get; } /// /// Initiate and monitor Create, Update, and Delete operations. @@ -103,40 +109,6 @@ public interface ICodatPlatform public ICustomDataType CustomDataType { get; } } - public class SDKConfig - { - /// - /// List of server URLs available to the SDK. - /// - public static readonly string[] ServerList = { - "https://api.codat.io", - }; - - public string ServerUrl = ""; - public int ServerIndex = 0; - public SDKHooks Hooks = new SDKHooks(); - public RetryConfig? RetryConfig = null; - - public string GetTemplatedServerUrl() - { - if (!String.IsNullOrEmpty(this.ServerUrl)) - { - return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary()); - } - return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], new Dictionary()); - } - - public ISpeakeasyHttpClient InitHooks(ISpeakeasyHttpClient client) - { - string preHooksUrl = GetTemplatedServerUrl(); - var (postHooksUrl, postHooksClient) = this.Hooks.SDKInit(preHooksUrl, client); - if (preHooksUrl != postHooksUrl) - { - this.ServerUrl = postHooksUrl; - } - return postHooksClient; - } - } /// /// Platform API: Platform API @@ -172,25 +144,52 @@ public class CodatPlatform: ICodatPlatform public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "6.0.0"; - private const string _sdkGenVersion = "2.462.1"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform"; - private string _serverUrl = ""; - private int _serverIndex = 0; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; public ICompanies Companies { get; private set; } public IConnections Connections { get; private set; } public IConnectionManagement ConnectionManagement { get; private set; } + public ICors Cors { get; private set; } + public ISettings Settings { get; private set; } public IRefreshData RefreshData { get; private set; } public IWebhooks Webhooks { get; private set; } public IIntegrations Integrations { get; private set; } - public ISettings Settings { get; private set; } + public IReadData ReadData { get; private set; } public IPushData PushData { get; private set; } public ISupplementalData SupplementalData { get; private set; } public ICustomDataType CustomDataType { get; private set; } + public CodatPlatform(SDKConfig config) + { + SDKConfiguration = config; + InitHooks(); + + Companies = new Companies(SDKConfiguration); + + Connections = new Connections(SDKConfiguration); + + ConnectionManagement = new ConnectionManagement(SDKConfiguration); + + Cors = new Cors(SDKConfiguration); + + Settings = new Settings(SDKConfiguration); + + RefreshData = new RefreshData(SDKConfiguration); + + Webhooks = new Webhooks(SDKConfiguration); + + Integrations = new Integrations(SDKConfiguration); + + ReadData = new ReadData(SDKConfiguration); + + PushData = new PushData(SDKConfiguration); + + SupplementalData = new SupplementalData(SDKConfiguration); + + CustomDataType = new CustomDataType(SDKConfiguration); + } + public CodatPlatform(string? authHeader = null, Func? authHeaderSource = null, int? serverIndex = null, string? serverUrl = null, Dictionary? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null) { if (serverIndex != null) @@ -199,7 +198,6 @@ public CodatPlatform(string? authHeader = null, Func? authHeaderSource = { throw new Exception($"Invalid server index {serverIndex.Value}"); } - _serverIndex = serverIndex.Value; } if (serverUrl != null) @@ -208,10 +206,8 @@ public CodatPlatform(string? authHeader = null, Func? authHeaderSource = { serverUrl = Utilities.TemplateUrl(serverUrl, urlParams); } - _serverUrl = serverUrl; } - - _client = client ?? new SpeakeasyHttpClient(); + Func? _securitySource = null; if(authHeaderSource != null) { @@ -226,44 +222,114 @@ public CodatPlatform(string? authHeader = null, Func? authHeaderSource = throw new Exception("authHeader and authHeaderSource cannot both be null"); } - SDKConfiguration = new SDKConfig() + SDKConfiguration = new SDKConfig(client) { - ServerIndex = _serverIndex, - ServerUrl = _serverUrl, + ServerIndex = serverIndex == null ? 0 : serverIndex.Value, + ServerUrl = serverUrl == null ? "" : serverUrl, + SecuritySource = _securitySource, RetryConfig = retryConfig }; - _client = SDKConfiguration.InitHooks(_client); + InitHooks(); + Companies = new Companies(SDKConfiguration); - Companies = new Companies(_client, _securitySource, _serverUrl, SDKConfiguration); + Connections = new Connections(SDKConfiguration); + ConnectionManagement = new ConnectionManagement(SDKConfiguration); - Connections = new Connections(_client, _securitySource, _serverUrl, SDKConfiguration); + Cors = new Cors(SDKConfiguration); + Settings = new Settings(SDKConfiguration); - ConnectionManagement = new ConnectionManagement(_client, _securitySource, _serverUrl, SDKConfiguration); + RefreshData = new RefreshData(SDKConfiguration); + Webhooks = new Webhooks(SDKConfiguration); - RefreshData = new RefreshData(_client, _securitySource, _serverUrl, SDKConfiguration); + Integrations = new Integrations(SDKConfiguration); + ReadData = new ReadData(SDKConfiguration); - Webhooks = new Webhooks(_client, _securitySource, _serverUrl, SDKConfiguration); + PushData = new PushData(SDKConfiguration); + SupplementalData = new SupplementalData(SDKConfiguration); - Integrations = new Integrations(_client, _securitySource, _serverUrl, SDKConfiguration); + CustomDataType = new CustomDataType(SDKConfiguration); + } + private void InitHooks() + { + string preHooksUrl = SDKConfiguration.GetTemplatedServerUrl(); + var (postHooksUrl, postHooksClient) = SDKConfiguration.Hooks.SDKInit(preHooksUrl, SDKConfiguration.Client); + var config = SDKConfiguration; + if (preHooksUrl != postHooksUrl) + { + config.ServerUrl = postHooksUrl; + } + config.Client = postHooksClient; + SDKConfiguration = config; + } - Settings = new Settings(_client, _securitySource, _serverUrl, SDKConfiguration); + public class SDKBuilder + { + private SDKConfig _sdkConfig = new SDKConfig(client: new SpeakeasyHttpClient()); + public SDKBuilder() { } - PushData = new PushData(_client, _securitySource, _serverUrl, SDKConfiguration); + public SDKBuilder WithServerIndex(int serverIndex) + { + if (serverIndex < 0 || serverIndex >= SDKConfig.ServerList.Length) + { + throw new Exception($"Invalid server index {serverIndex}"); + } + _sdkConfig.ServerIndex = serverIndex; + return this; + } + public SDKBuilder WithServerUrl(string serverUrl, Dictionary? serverVariables = null) + { + if (serverVariables != null) + { + serverUrl = Utilities.TemplateUrl(serverUrl, serverVariables); + } + _sdkConfig.ServerUrl = serverUrl; + return this; + } + + public SDKBuilder WithAuthHeaderSource(Func authHeaderSource) + { + _sdkConfig.SecuritySource = () => new Codat.Platform.Models.Components.Security() { AuthHeader = authHeaderSource() }; + return this; + } + + public SDKBuilder WithAuthHeader(string authHeader) + { + _sdkConfig.SecuritySource = () => new Codat.Platform.Models.Components.Security() { AuthHeader = authHeader }; + return this; + } - SupplementalData = new SupplementalData(_client, _securitySource, _serverUrl, SDKConfiguration); + public SDKBuilder WithClient(ISpeakeasyHttpClient client) + { + _sdkConfig.Client = client; + return this; + } + public SDKBuilder WithRetryConfig(RetryConfig retryConfig) + { + _sdkConfig.RetryConfig = retryConfig; + return this; + } + + public CodatPlatform Build() + { + if (_sdkConfig.SecuritySource == null) { + throw new Exception("securitySource cannot be null. One of `AuthHeader` or `authHeaderSource` needs to be defined."); + } + return new CodatPlatform(_sdkConfig); + } - CustomDataType = new CustomDataType(_client, _securitySource, _serverUrl, SDKConfiguration); } + + public static SDKBuilder Builder() => new SDKBuilder(); } } \ No newline at end of file diff --git a/platform/Codat/Platform/Companies.cs b/platform/Codat/Platform/Companies.cs index 1786bceb1..08ebc4434 100644 --- a/platform/Codat/Platform/Companies.cs +++ b/platform/Codat/Platform/Companies.cs @@ -13,14 +13,14 @@ namespace Codat.Platform using Codat.Platform.Models.Components; using Codat.Platform.Models.Errors; using Codat.Platform.Models.Requests; - using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Create and manage your SMB users' companies. @@ -35,7 +35,20 @@ public interface ICompanies /// The *List companies* endpoint returns a list of companies associated to your instances.
///
/// A company represents a business sharing access to their data.
- /// 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. + /// 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.
+ ///
+ /// ## Filter by tags
+ ///
+ /// The *List companies* endpoint supports the filtering of companies using tags. It supports the following operators with Codat’s query language:
+ ///
+ /// - equals (`=`)
+ /// - not equals (`!=`)
+ /// - contains (`~`)
+ ///
+ /// For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team:
+ /// - Foreign key: `uid = {yourCustomerId}`
+ /// - Region: `region != uk`
+ /// - Owning team and region: `region = uk && owningTeam = invoice-finance` /// ///
Task ListAsync(ListCompaniesRequest? request = null, RetryConfig? retryConfig = null); @@ -81,15 +94,28 @@ public interface ICompanies Task DeleteAsync(DeleteCompanyRequest request, RetryConfig? retryConfig = null); /// - /// Update company + /// Replace company /// /// - /// Use the *Update company* endpoint to update both the name and description of the company.
+ /// Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload.
///
/// A company represents a business sharing access to their data.
/// 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 ReplaceAsync(ReplaceCompanyRequest request, RetryConfig? retryConfig = null); + + /// + /// Update company + /// + /// + /// Use the *Update company* endpoint to update the name, description, or tags of the company.
+ ///
+ /// The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update.
+ ///
+ /// A company represents a business sharing access to their data. + ///
+ ///
Task UpdateAsync(UpdateCompanyRequest request, RetryConfig? retryConfig = null); /// @@ -115,11 +141,27 @@ public interface ICompanies Task RemoveProductAsync(RemoveProductRequest request, RetryConfig? retryConfig = null); /// - /// Get company access token + /// Refresh product data /// /// - /// Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat's embedded UI products.
+ /// Use the **Refresh product data** endpoint to manually refresh data for a custom product for a specific company.
+ ///
+ /// ### Tips and traps
+ ///
+ /// - This endpoint only supports refreshing data for **custom products** and can't be used for Codat's standard solutions. Refer to individual solutions' documentation instead.
+ /// - If a data sync is already in progress for a custom product, the refresh request will return a `Bad request (400)` response.
+ /// - If a company has multiple custom products enabled, you can refresh data for each product individually. + ///
+ ///
+ Task RefreshProductDataAsync(RefreshProductDataRequest request, RetryConfig? retryConfig = null); + + /// + /// Get company access token /// + /// + /// Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day.
+ ///
+ /// The token is required by Codat's embeddable UIs (such as Connections SDK and Link SDK) to verify the identity of the user and improve the reliability of data provided by them. ///
///
Task GetAccessTokenAsync(GetCompanyAccessTokenRequest request, RetryConfig? retryConfig = null); @@ -132,19 +174,12 @@ public class Companies: ICompanies { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "6.0.0"; - private const string _sdkGenVersion = "2.462.1"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Companies(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Companies(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -154,14 +189,14 @@ public async Task ListAsync(ListCompaniesRequest? request var urlString = URLBuilder.Build(baseUrl, "/companies", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("list-companies", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-companies", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -195,8 +230,8 @@ public async Task ListAsync(ListCompaniesRequest? request Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -236,7 +271,17 @@ public async Task ListAsync(ListCompaniesRequest? request { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Components.Companies obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Components.Companies.", httpResponse, httpResponseBody, ex); + } + var response = new ListCompaniesResponse() { StatusCode = responseStatusCode, @@ -247,24 +292,58 @@ public async Task ListAsync(ListCompaniesRequest? request return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task CreateAsync(CompanyRequestBody? request = null, RetryConfig? retryConfig = null) @@ -274,7 +353,7 @@ public async Task CreateAsync(CompanyRequestBody? request var urlString = baseUrl + "/companies"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) @@ -282,12 +361,12 @@ public async Task CreateAsync(CompanyRequestBody? request httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("create-company", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "create-company", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -321,8 +400,8 @@ public async Task CreateAsync(CompanyRequestBody? request Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -362,7 +441,17 @@ public async Task CreateAsync(CompanyRequestBody? request { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Company obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Company.", httpResponse, httpResponseBody, ex); + } + var response = new CreateCompanyResponse() { StatusCode = responseStatusCode, @@ -373,24 +462,58 @@ public async Task CreateAsync(CompanyRequestBody? request return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{400, 401, 402, 403, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task GetAsync(GetCompanyRequest request, RetryConfig? retryConfig = null) @@ -399,14 +522,14 @@ public async Task GetAsync(GetCompanyRequest request, RetryC var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-company", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-company", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -440,8 +563,8 @@ public async Task GetAsync(GetCompanyRequest request, RetryC Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -481,7 +604,17 @@ public async Task GetAsync(GetCompanyRequest request, RetryC { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Company obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Company.", httpResponse, httpResponseBody, ex); + } + var response = new GetCompanyResponse() { StatusCode = responseStatusCode, @@ -492,24 +625,58 @@ public async Task GetAsync(GetCompanyRequest request, RetryC return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task DeleteAsync(DeleteCompanyRequest request, RetryConfig? retryConfig = null) @@ -518,14 +685,14 @@ public async Task DeleteAsync(DeleteCompanyRequest reques var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("delete-company", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "delete-company", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -559,8 +726,8 @@ public async Task DeleteAsync(DeleteCompanyRequest reques Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -597,7 +764,7 @@ public async Task DeleteAsync(DeleteCompanyRequest reques var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; if(responseStatusCode == 204) - { + { return new DeleteCompanyResponse() { StatusCode = responseStatusCode, @@ -605,31 +772,65 @@ public async Task DeleteAsync(DeleteCompanyRequest reques RawResponse = httpResponse }; } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - public async Task UpdateAsync(UpdateCompanyRequest request, RetryConfig? retryConfig = null) + public async Task ReplaceAsync(ReplaceCompanyRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "CompanyRequestBody", "json", false, true); if (serializedBody != null) @@ -637,12 +838,12 @@ public async Task UpdateAsync(UpdateCompanyRequest reques httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("update-company", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "replace-company", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -676,8 +877,8 @@ public async Task UpdateAsync(UpdateCompanyRequest reques Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -717,7 +918,186 @@ public async Task UpdateAsync(UpdateCompanyRequest reques { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Company obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Company.", httpResponse, httpResponseBody, ex); + } + + var response = new ReplaceCompanyResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.Company = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + + public async Task UpdateAsync(UpdateCompanyRequest request, RetryConfig? retryConfig = null) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Patch, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "CompanyUpdateRequest", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "update-company", null, SDKConfiguration.SecuritySource); + + 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 SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + + HttpResponseMessage httpResponse; + try + { + 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); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Company obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Company.", httpResponse, httpResponseBody, ex); + } + var response = new UpdateCompanyResponse() { StatusCode = responseStatusCode, @@ -728,24 +1108,58 @@ public async Task UpdateAsync(UpdateCompanyRequest reques return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task AddProductAsync(AddProductRequest request, RetryConfig? retryConfig = null) @@ -754,14 +1168,14 @@ public async Task AddProductAsync(AddProductRequest request, var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/products/{productIdentifier}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("add-product", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "add-product", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -795,8 +1209,8 @@ public async Task AddProductAsync(AddProductRequest request, Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -833,7 +1247,7 @@ public async Task AddProductAsync(AddProductRequest request, var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; if(responseStatusCode == 204) - { + { return new AddProductResponse() { StatusCode = responseStatusCode, @@ -841,22 +1255,56 @@ public async Task AddProductAsync(AddProductRequest request, RawResponse = httpResponse }; } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task RemoveProductAsync(RemoveProductRequest request, RetryConfig? retryConfig = null) @@ -865,14 +1313,14 @@ public async Task RemoveProductAsync(RemoveProductRequest var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/products/{productIdentifier}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("remove-product", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "remove-product", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -906,8 +1354,8 @@ public async Task RemoveProductAsync(RemoveProductRequest Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -944,7 +1392,7 @@ public async Task RemoveProductAsync(RemoveProductRequest var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; if(responseStatusCode == 204) - { + { return new RemoveProductResponse() { StatusCode = responseStatusCode, @@ -952,22 +1400,201 @@ public async Task RemoveProductAsync(RemoveProductRequest RawResponse = httpResponse }; } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + + public async Task RefreshProductDataAsync(RefreshProductDataRequest request, RetryConfig? retryConfig = null) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/products/{productIdentifier}/refresh", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "refresh-product-data", null, SDKConfiguration.SecuritySource); + + 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 SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + + HttpResponseMessage httpResponse; + try + { + 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); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 202) + { + return new RefreshProductDataResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + } + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task GetAccessTokenAsync(GetCompanyAccessTokenRequest request, RetryConfig? retryConfig = null) @@ -976,14 +1603,14 @@ public async Task GetAccessTokenAsync(GetCompanyA var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/accessToken", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-company-access-token", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-company-access-token", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -1017,8 +1644,8 @@ public async Task GetAccessTokenAsync(GetCompanyA Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -1058,7 +1685,17 @@ public async Task GetAccessTokenAsync(GetCompanyA { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + CompanyAccessToken obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into CompanyAccessToken.", httpResponse, httpResponseBody, ex); + } + var response = new GetCompanyAccessTokenResponse() { StatusCode = responseStatusCode, @@ -1069,24 +1706,58 @@ public async Task GetAccessTokenAsync(GetCompanyA return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } } } \ No newline at end of file diff --git a/platform/Codat/Platform/ConnectionManagement.cs b/platform/Codat/Platform/ConnectionManagement.cs index b9302a91f..91b324ef0 100644 --- a/platform/Codat/Platform/ConnectionManagement.cs +++ b/platform/Codat/Platform/ConnectionManagement.cs @@ -13,32 +13,29 @@ namespace Codat.Platform using Codat.Platform.Models.Components; using Codat.Platform.Models.Errors; using Codat.Platform.Models.Requests; - using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Configure UI and retrieve access tokens for authentication used by **Connections SDK**. /// public interface IConnectionManagement { - public ICorsSettings CorsSettings { get; } /// - /// Get access token + /// Get access token (old) /// /// - /// 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 embeddable Connections SDK lets your customers control access to their data by allowing them to manage their existing connections. + /// The new Get company access token endpoint replaces this endpoint and includes additional functionality. ///
///
- Task GetAccessTokenAsync(GetConnectionManagementAccessTokenRequest request, RetryConfig? retryConfig = null); + Task GetAsync(GetConnectionManagementAccessTokenRequest request, RetryConfig? retryConfig = null); } /// @@ -48,38 +45,30 @@ public class ConnectionManagement: IConnectionManagement { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "6.0.0"; - private const string _sdkGenVersion = "2.462.1"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public ICorsSettings CorsSettings { get; private set; } - public ConnectionManagement(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public ConnectionManagement(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; - CorsSettings = new CorsSettings(_client, _securitySource, _serverUrl, SDKConfiguration); } - public async Task GetAccessTokenAsync(GetConnectionManagementAccessTokenRequest request, RetryConfig? retryConfig = null) + [Obsolete("This method will be removed in a future release, please migrate away from it as soon as possible. Use GetAccessToken instead")] + public async Task GetAsync(GetConnectionManagementAccessTokenRequest request, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connectionManagement/accessToken", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-connection-management-access-token", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-connection-management-access-token", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -113,8 +102,8 @@ public async Task GetAccessTokenAsyn Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -154,7 +143,17 @@ public async Task GetAccessTokenAsyn { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ConnectionManagementAccessToken obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ConnectionManagementAccessToken.", httpResponse, httpResponseBody, ex); + } + var response = new GetConnectionManagementAccessTokenResponse() { StatusCode = responseStatusCode, @@ -165,24 +164,58 @@ public async Task GetAccessTokenAsyn return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Connections.cs b/platform/Codat/Platform/Connections.cs index c6a904ca4..ebbdad882 100644 --- a/platform/Codat/Platform/Connections.cs +++ b/platform/Codat/Platform/Connections.cs @@ -13,14 +13,14 @@ namespace Codat.Platform using Codat.Platform.Models.Components; using Codat.Platform.Models.Errors; using Codat.Platform.Models.Requests; - using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Create new and manage existing data connections for a company. @@ -93,19 +93,12 @@ public class Connections: IConnections { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "6.0.0"; - private const string _sdkGenVersion = "2.462.1"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Connections(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Connections(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -115,14 +108,14 @@ public async Task ListAsync(ListConnectionsRequest requ var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("list-connections", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-connections", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -156,8 +149,8 @@ public async Task ListAsync(ListConnectionsRequest requ Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -197,7 +190,17 @@ public async Task ListAsync(ListConnectionsRequest requ { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Components.Connections obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Components.Connections.", httpResponse, httpResponseBody, ex); + } + var response = new ListConnectionsResponse() { StatusCode = responseStatusCode, @@ -208,24 +211,58 @@ public async Task ListAsync(ListConnectionsRequest requ return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task CreateAsync(CreateConnectionRequest request, RetryConfig? retryConfig = null) @@ -234,7 +271,7 @@ public async Task CreateAsync(CreateConnectionRequest var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) @@ -242,12 +279,12 @@ public async Task CreateAsync(CreateConnectionRequest httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("create-connection", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "create-connection", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -281,8 +318,8 @@ public async Task CreateAsync(CreateConnectionRequest Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -322,7 +359,17 @@ public async Task CreateAsync(CreateConnectionRequest { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Connection obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Connection.", httpResponse, httpResponseBody, ex); + } + var response = new CreateConnectionResponse() { StatusCode = responseStatusCode, @@ -333,24 +380,58 @@ public async Task CreateAsync(CreateConnectionRequest return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task GetAsync(GetConnectionRequest request, RetryConfig? retryConfig = null) @@ -359,14 +440,14 @@ public async Task GetAsync(GetConnectionRequest request, var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-connection", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-connection", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -400,8 +481,8 @@ public async Task GetAsync(GetConnectionRequest request, Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -441,7 +522,17 @@ public async Task GetAsync(GetConnectionRequest request, { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Connection obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Connection.", httpResponse, httpResponseBody, ex); + } + var response = new GetConnectionResponse() { StatusCode = responseStatusCode, @@ -452,24 +543,58 @@ public async Task GetAsync(GetConnectionRequest request, return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task DeleteAsync(DeleteConnectionRequest request, RetryConfig? retryConfig = null) @@ -478,14 +603,14 @@ public async Task DeleteAsync(DeleteConnectionRequest var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("delete-connection", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "delete-connection", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -519,8 +644,8 @@ public async Task DeleteAsync(DeleteConnectionRequest Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -557,7 +682,7 @@ public async Task DeleteAsync(DeleteConnectionRequest var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; if(responseStatusCode == 200) - { + { return new DeleteConnectionResponse() { StatusCode = responseStatusCode, @@ -565,22 +690,56 @@ public async Task DeleteAsync(DeleteConnectionRequest RawResponse = httpResponse }; } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task UnlinkAsync(UnlinkConnectionRequest request, RetryConfig? retryConfig = null) @@ -589,7 +748,7 @@ public async Task UnlinkAsync(UnlinkConnectionRequest var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Patch, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "UpdateConnectionStatus", "json", false, true); if (serializedBody != null) @@ -597,12 +756,12 @@ public async Task UnlinkAsync(UnlinkConnectionRequest httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("unlink-connection", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "unlink-connection", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -636,8 +795,8 @@ public async Task UnlinkAsync(UnlinkConnectionRequest Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -677,7 +836,17 @@ public async Task UnlinkAsync(UnlinkConnectionRequest { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Connection obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Connection.", httpResponse, httpResponseBody, ex); + } + var response = new UnlinkConnectionResponse() { StatusCode = responseStatusCode, @@ -688,24 +857,58 @@ public async Task UnlinkAsync(UnlinkConnectionRequest return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task UpdateAuthorizationAsync(UpdateConnectionAuthorizationRequest request, RetryConfig? retryConfig = null) @@ -714,7 +917,7 @@ public async Task UpdateAuthorizationAsyn var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/authorization", request); var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json", false, true); if (serializedBody != null) @@ -722,12 +925,12 @@ public async Task UpdateAuthorizationAsyn httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("update-connection-authorization", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "update-connection-authorization", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -761,8 +964,8 @@ public async Task UpdateAuthorizationAsyn Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -802,7 +1005,17 @@ public async Task UpdateAuthorizationAsyn { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Connection obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Connection.", httpResponse, httpResponseBody, ex); + } + var response = new UpdateConnectionAuthorizationResponse() { StatusCode = responseStatusCode, @@ -813,24 +1026,58 @@ public async Task UpdateAuthorizationAsyn return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } } } \ No newline at end of file diff --git a/platform/Codat/Platform/CorsSettings.cs b/platform/Codat/Platform/Cors.cs similarity index 56% rename from platform/Codat/Platform/CorsSettings.cs rename to platform/Codat/Platform/Cors.cs index e50a9afe7..4efe0cf53 100644 --- a/platform/Codat/Platform/CorsSettings.cs +++ b/platform/Codat/Platform/Cors.cs @@ -13,65 +13,55 @@ namespace Codat.Platform using Codat.Platform.Models.Components; using Codat.Platform.Models.Errors; using Codat.Platform.Models.Requests; - using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; - public interface ICorsSettings + public interface ICors { /// - /// Get CORS settings + /// Get CORS settings (old) /// /// /// 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 embeddable Connections SDK to access Codat's API endpoints.
- ///
- /// The embeddable Connections SDK lets your customers control access to their data by allowing them to manage their existing connections. + /// Enabling CORS with Codat is required by our embeddable UIs (such as Connections SDK and Link SDK) to access Codat's API endpoints. ///
///
Task GetAsync(RetryConfig? retryConfig = null); /// - /// Set CORS settings + /// Set CORS settings (old) /// /// /// 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 embeddable Connections SDK to access Codat's API endpoints.
- ///
- /// The embeddable Connections SDK lets your customers control access to their data by allowing them to manage their existing connections. + /// Enabling CORS with Codat is required by our embeddable UIs (such as Connections SDK and Link SDK) to access Codat's API endpoints. ///
///
Task SetAsync(ConnectionManagementAllowedOrigins? request = null, RetryConfig? retryConfig = null); } - public class CorsSettings: ICorsSettings + public class Cors: ICors { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "6.0.0"; - private const string _sdkGenVersion = "2.462.1"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public CorsSettings(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Cors(SDKConfig config) { - _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. Use Get instead")] public async Task GetAsync(RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -79,14 +69,14 @@ public async Task GetAsync(RetryCon var urlString = baseUrl + "/connectionManagement/corsSettings"; var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-connection-management-cors-settings", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-connection-management-cors-settings", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -120,8 +110,8 @@ public async Task GetAsync(RetryCon Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -161,7 +151,17 @@ public async Task GetAsync(RetryCon { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ConnectionManagementAllowedOrigins obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ConnectionManagementAllowedOrigins.", httpResponse, httpResponseBody, ex); + } + var response = new GetConnectionManagementCorsSettingsResponse() { StatusCode = responseStatusCode, @@ -172,26 +172,61 @@ public async Task GetAsync(RetryCon return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } + [Obsolete("This method will be removed in a future release, please migrate away from it as soon as possible. Use Set instead")] public async Task SetAsync(ConnectionManagementAllowedOrigins? request = null, RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -199,7 +234,7 @@ public async Task SetAsync(Connecti var urlString = baseUrl + "/connectionManagement/corsSettings"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) @@ -207,12 +242,12 @@ public async Task SetAsync(Connecti httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("set-connection-management-cors-settings", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "set-connection-management-cors-settings", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -246,8 +281,8 @@ public async Task SetAsync(Connecti Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -287,7 +322,17 @@ public async Task SetAsync(Connecti { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ConnectionManagementAllowedOrigins obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ConnectionManagementAllowedOrigins.", httpResponse, httpResponseBody, ex); + } + var response = new SetConnectionManagementCorsSettingsResponse() { StatusCode = responseStatusCode, @@ -298,24 +343,58 @@ public async Task SetAsync(Connecti return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } } } \ No newline at end of file diff --git a/platform/Codat/Platform/CustomDataType.cs b/platform/Codat/Platform/CustomDataType.cs index 91fde8140..ba8208631 100644 --- a/platform/Codat/Platform/CustomDataType.cs +++ b/platform/Codat/Platform/CustomDataType.cs @@ -13,14 +13,14 @@ namespace Codat.Platform using Codat.Platform.Models.Components; using Codat.Platform.Models.Errors; using Codat.Platform.Models.Requests; - using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Configure and pull additional data types that are not included in Codat's standardized data model. @@ -86,19 +86,12 @@ public class CustomDataType: ICustomDataType { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "6.0.0"; - private const string _sdkGenVersion = "2.462.1"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public CustomDataType(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public CustomDataType(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -108,7 +101,7 @@ public async Task ConfigureAsync(ConfigureCusto var urlString = URLBuilder.Build(baseUrl, "/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "CustomDataTypeConfiguration", "json", false, true); if (serializedBody != null) @@ -116,12 +109,12 @@ public async Task ConfigureAsync(ConfigureCusto httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("configure-custom-data-type", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "configure-custom-data-type", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -155,8 +148,8 @@ public async Task ConfigureAsync(ConfigureCusto Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -196,7 +189,17 @@ public async Task ConfigureAsync(ConfigureCusto { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + CustomDataTypeConfiguration obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into CustomDataTypeConfiguration.", httpResponse, httpResponseBody, ex); + } + var response = new ConfigureCustomDataTypeResponse() { StatusCode = responseStatusCode, @@ -207,24 +210,58 @@ public async Task ConfigureAsync(ConfigureCusto return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task GetConfigurationAsync(GetCustomDataTypeConfigurationRequest request, RetryConfig? retryConfig = null) @@ -233,14 +270,14 @@ public async Task GetConfigurationAsync( var urlString = URLBuilder.Build(baseUrl, "/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-custom-data-type-configuration", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-custom-data-type-configuration", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -274,8 +311,8 @@ public async Task GetConfigurationAsync( Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -315,7 +352,17 @@ public async Task GetConfigurationAsync( { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + CustomDataTypeRecords obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into CustomDataTypeRecords.", httpResponse, httpResponseBody, ex); + } + var response = new GetCustomDataTypeConfigurationResponse() { StatusCode = responseStatusCode, @@ -326,24 +373,58 @@ public async Task GetConfigurationAsync( return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task RefreshAsync(RefreshCustomDataTypeRequest request, RetryConfig? retryConfig = null) @@ -352,14 +433,14 @@ public async Task RefreshAsync(RefreshCustomDataT var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/queue/custom/{customDataIdentifier}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("refresh-custom-data-type", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "refresh-custom-data-type", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -393,8 +474,8 @@ public async Task RefreshAsync(RefreshCustomDataT Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -434,7 +515,17 @@ public async Task RefreshAsync(RefreshCustomDataT { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + PullOperation obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into PullOperation.", httpResponse, httpResponseBody, ex); + } + var response = new RefreshCustomDataTypeResponse() { StatusCode = responseStatusCode, @@ -445,24 +536,58 @@ public async Task RefreshAsync(RefreshCustomDataT return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 451, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429, 451}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task ListAsync(ListCustomDataTypeRecordsRequest request, RetryConfig? retryConfig = null) @@ -471,14 +596,14 @@ public async Task ListAsync(ListCustomDataTyp var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/custom/{customDataIdentifier}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("list-custom-data-type-records", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-custom-data-type-records", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -512,8 +637,8 @@ public async Task ListAsync(ListCustomDataTyp Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -553,7 +678,17 @@ public async Task ListAsync(ListCustomDataTyp { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + CustomDataTypeRecords obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into CustomDataTypeRecords.", httpResponse, httpResponseBody, ex); + } + var response = new ListCustomDataTypeRecordsResponse() { StatusCode = responseStatusCode, @@ -564,24 +699,58 @@ public async Task ListAsync(ListCustomDataTyp return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{400, 401, 402, 403, 404, 429, 451}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 451, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Hooks/HookTypes.cs b/platform/Codat/Platform/Hooks/HookTypes.cs index 9355860c7..2d406a0d3 100644 --- a/platform/Codat/Platform/Hooks/HookTypes.cs +++ b/platform/Codat/Platform/Hooks/HookTypes.cs @@ -17,34 +17,47 @@ namespace Codat.Platform.Hooks public class HookContext { + public SDKConfig SDKConfiguration { get; set; } + public string BaseURL { get; set; } = ""; public string OperationID { get; set; } public List? Oauth2Scopes { get; set; } public Func? SecuritySource { get; set; } - public HookContext(string operationID, List? oauth2Scopes, Func? securitySource) + public HookContext(SDKConfig config, string baseURL, string operationID, List? oauth2Scopes, Func? securitySource) { + SDKConfiguration = config; + BaseURL = baseURL; OperationID = operationID; Oauth2Scopes = oauth2Scopes; SecuritySource = securitySource; } + + public HookContext(HookContext hookCtx) + { + SDKConfiguration = hookCtx.SDKConfiguration; + BaseURL = hookCtx.BaseURL; + OperationID = hookCtx.OperationID; + Oauth2Scopes = hookCtx.Oauth2Scopes; + SecuritySource = hookCtx.SecuritySource; + } } public class BeforeRequestContext : HookContext { public BeforeRequestContext(HookContext hookCtx) - : base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { } + : base(hookCtx) { } } public class AfterSuccessContext : HookContext { public AfterSuccessContext(HookContext hookCtx) - : base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { } + : base(hookCtx) { } } public class AfterErrorContext : HookContext { public AfterErrorContext(HookContext hookCtx) - : base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { } + : base(hookCtx) { } } /// diff --git a/platform/Codat/Platform/Hooks/SDKHooks.cs b/platform/Codat/Platform/Hooks/SDKHooks.cs index 9aa44d323..107565647 100644 --- a/platform/Codat/Platform/Hooks/SDKHooks.cs +++ b/platform/Codat/Platform/Hooks/SDKHooks.cs @@ -52,7 +52,7 @@ public void RegisterAfterErrorHook(IAfterErrorHook hook) { this.afterErrorHooks.Add(hook); } - + public (string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client) { var urlAndClient = (baseUrl, client); @@ -68,7 +68,7 @@ public void RegisterAfterErrorHook(IAfterErrorHook hook) } return urlAndClient; } - + public async Task BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request) { foreach (var hook in this.beforeRequestHooks) @@ -76,7 +76,8 @@ public async Task BeforeRequestAsync(BeforeRequestContext ho try { request = await hook.BeforeRequestAsync(hookCtx, request); - } catch (Exception ex) + } + catch (Exception ex) { throw new Exception("An error occurred while calling BeforeRequestAsync hook", ex); } @@ -102,17 +103,18 @@ public async Task AfterSuccessAsync(AfterSuccessContext hoo public async Task AfterErrorAsync(AfterErrorContext hookCtx, HttpResponseMessage? response, Exception? error) { - (HttpResponseMessage?, Exception?) responseAndError = (response, error); foreach (var hook in this.afterErrorHooks) { try { responseAndError = await hook.AfterErrorAsync(hookCtx, responseAndError.Item1, responseAndError.Item2); - } catch (FailEarlyException) + } + catch (FailEarlyException) { throw; - } catch (Exception ex) + } + catch (Exception ex) { throw new Exception("An error occurred while calling AfterErrorAsync hook", ex); } diff --git a/platform/Codat/Platform/Integrations.cs b/platform/Codat/Platform/Integrations.cs index 2a0a2180d..1841020c8 100644 --- a/platform/Codat/Platform/Integrations.cs +++ b/platform/Codat/Platform/Integrations.cs @@ -13,14 +13,14 @@ namespace Codat.Platform using Codat.Platform.Models.Components; using Codat.Platform.Models.Errors; using Codat.Platform.Models.Requests; - using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Get a list of integrations supported by Codat and their logos. @@ -63,19 +63,12 @@ public class Integrations: IIntegrations { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "6.0.0"; - private const string _sdkGenVersion = "2.462.1"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Integrations(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Integrations(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -85,14 +78,14 @@ public async Task ListAsync(ListIntegrationsRequest? r var urlString = URLBuilder.Build(baseUrl, "/integrations", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("list-integrations", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-integrations", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -126,8 +119,8 @@ public async Task ListAsync(ListIntegrationsRequest? r Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -167,7 +160,17 @@ public async Task ListAsync(ListIntegrationsRequest? r { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Components.Integrations obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Components.Integrations.", httpResponse, httpResponseBody, ex); + } + var response = new ListIntegrationsResponse() { StatusCode = responseStatusCode, @@ -178,24 +181,58 @@ public async Task ListAsync(ListIntegrationsRequest? r return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{400, 401, 402, 403, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task GetAsync(GetIntegrationRequest request, RetryConfig? retryConfig = null) @@ -204,14 +241,14 @@ public async Task GetAsync(GetIntegrationRequest request var urlString = URLBuilder.Build(baseUrl, "/integrations/{platformKey}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-integration", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-integration", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -245,8 +282,8 @@ public async Task GetAsync(GetIntegrationRequest request Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -286,7 +323,17 @@ public async Task GetAsync(GetIntegrationRequest request { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Integration obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Integration.", httpResponse, httpResponseBody, ex); + } + var response = new GetIntegrationResponse() { StatusCode = responseStatusCode, @@ -297,24 +344,58 @@ public async Task GetAsync(GetIntegrationRequest request return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task GetBrandingAsync(GetIntegrationsBrandingRequest request, RetryConfig? retryConfig = null) @@ -323,14 +404,14 @@ public async Task GetBrandingAsync(GetIntegrati var urlString = URLBuilder.Build(baseUrl, "/integrations/{platformKey}/branding", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-integrations-branding", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-integrations-branding", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -364,8 +445,8 @@ public async Task GetBrandingAsync(GetIntegrati Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -405,7 +486,17 @@ public async Task GetBrandingAsync(GetIntegrati { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Branding obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Branding.", httpResponse, httpResponseBody, ex); + } + var response = new GetIntegrationsBrandingResponse() { StatusCode = responseStatusCode, @@ -416,24 +507,58 @@ public async Task GetBrandingAsync(GetIntegrati return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/ApiKeys.cs b/platform/Codat/Platform/Models/Components/ApiKeys.cs index 11ab7371f..837cb9b0e 100644 --- a/platform/Codat/Platform/Models/Components/ApiKeys.cs +++ b/platform/Codat/Platform/Models/Components/ApiKeys.cs @@ -18,6 +18,6 @@ public class ApiKeys { [JsonProperty("results")] - public List? Results { get; set; } + public List? Results { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/ClientRateLimitReachedWebhook.cs b/platform/Codat/Platform/Models/Components/ClientRateLimitReachedWebhook.cs deleted file mode 100644 index 628913f2c..000000000 --- a/platform/Codat/Platform/Models/Components/ClientRateLimitReachedWebhook.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Models.Components; - using Codat.Platform.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Webhook request body for a client that has reached their rate limit. - /// - public class ClientRateLimitReachedWebhook - { - - /// - /// Unique identifier for your client in Codat. - /// - [JsonProperty("ClientId")] - public string? ClientId { get; set; } - - /// - /// Name of your client in Codat. - /// - [JsonProperty("ClientName")] - public string? ClientName { get; set; } - - /// - /// Unique identifier for the rule. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("RuleId")] - public string? RuleId { get; set; } - - /// - /// The type of rule. - /// - [JsonProperty("RuleType")] - public string? RuleType { get; set; } - - /// - /// Unique identifier of the webhook event. - /// - [JsonProperty("AlertId")] - public string? AlertId { get; set; } - - /// - /// A human-readable message about the webhook. - /// - [JsonProperty("Message")] - public string? Message { get; set; } - - [JsonProperty("Data")] - public ClientRateLimitReachedWebhookData? Data { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/ClientRateLimitReachedWebhookData.cs b/platform/Codat/Platform/Models/Components/ClientRateLimitReachedWebhookData.cs deleted file mode 100644 index 71a8bfe6a..000000000 --- a/platform/Codat/Platform/Models/Components/ClientRateLimitReachedWebhookData.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Utils; - using Newtonsoft.Json; - - public class ClientRateLimitReachedWebhookData - { - - /// - /// The number of available requests per day. - /// - [JsonProperty("DailyQuota")] - public long? DailyQuota { get; set; } - - /// - /// 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("ExpiresUtc")] - public string? ExpiresUtc { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/ClientRateLimitResetWebhook.cs b/platform/Codat/Platform/Models/Components/ClientRateLimitResetWebhook.cs deleted file mode 100644 index b035bae62..000000000 --- a/platform/Codat/Platform/Models/Components/ClientRateLimitResetWebhook.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Models.Components; - using Codat.Platform.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Webhook request body for a client that has had their rate limit reset. - /// - public class ClientRateLimitResetWebhook - { - - /// - /// Unique identifier for your client in Codat. - /// - [JsonProperty("ClientId")] - public string? ClientId { get; set; } - - /// - /// Name of your client in Codat. - /// - [JsonProperty("ClientName")] - public string? ClientName { get; set; } - - /// - /// Unique identifier for the rule. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("RuleId")] - public string? RuleId { get; set; } - - /// - /// The type of rule. - /// - [JsonProperty("RuleType")] - public string? RuleType { get; set; } - - /// - /// Unique identifier of the webhook event. - /// - [JsonProperty("AlertId")] - public string? AlertId { get; set; } - - /// - /// A human-readable message about the webhook. - /// - [JsonProperty("Message")] - public string? Message { get; set; } - - [JsonProperty("Data")] - public ClientRateLimitResetWebhookData? Data { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/ClientRateLimitResetWebhookData.cs b/platform/Codat/Platform/Models/Components/ClientRateLimitResetWebhookData.cs deleted file mode 100644 index 1388b1155..000000000 --- a/platform/Codat/Platform/Models/Components/ClientRateLimitResetWebhookData.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Utils; - using Newtonsoft.Json; - - public class ClientRateLimitResetWebhookData - { - - /// - /// Total number of requests remaining for your client. - /// - [JsonProperty("QuotaRemaining")] - public long? QuotaRemaining { get; set; } = null; - - /// - /// The reason for your rate limit quota being reset. - /// - [JsonProperty("ResetReason")] - public string? ResetReason { get; set; } - - /// - /// The number of available requests per day. - /// - [JsonProperty("DailyQuota")] - public long? DailyQuota { get; set; } - - /// - /// 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("ExpiresUtc")] - public string? ExpiresUtc { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/Webhooks.cs b/platform/Codat/Platform/Models/Components/CompanyUpdateRequest.cs similarity index 51% rename from platform/Codat/Platform/Models/Components/Webhooks.cs rename to platform/Codat/Platform/Models/Components/CompanyUpdateRequest.cs index 0a2eb3d1c..83e0a1713 100644 --- a/platform/Codat/Platform/Models/Components/Webhooks.cs +++ b/platform/Codat/Platform/Models/Components/CompanyUpdateRequest.cs @@ -9,36 +9,29 @@ #nullable enable namespace Codat.Platform.Models.Components { - using Codat.Platform.Models.Components; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; - public class Webhooks + public class CompanyUpdateRequest { - [JsonProperty("results")] - public List? Results { get; set; } - /// - /// Current page number. + /// Name of company being connected. /// - [JsonProperty("pageNumber")] - public long PageNumber { get; set; } = default!; + [JsonProperty("name")] + public string? Name { get; set; } /// - /// Number of items to return in results array. + /// Additional information about the company. This can be used to store foreign IDs, references, etc. /// - [JsonProperty("pageSize")] - public long PageSize { get; set; } = default!; + [JsonProperty("description")] + public string? Description { get; set; } /// - /// Total number of items. + /// A collection of user-defined key-value pairs that store custom metadata against the company. /// - [JsonProperty("totalResults")] - public long TotalResults { get; set; } = default!; - - [JsonProperty("_links")] - public Links Links { get; set; } = default!; + [JsonProperty("tags")] + public Dictionary? Tags { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/Connection.cs b/platform/Codat/Platform/Models/Components/Connection.cs index 01ddccc8c..715398cbb 100644 --- a/platform/Codat/Platform/Models/Components/Connection.cs +++ b/platform/Codat/Platform/Models/Components/Connection.cs @@ -138,6 +138,6 @@ public class Connection public List? DataConnectionErrors { get; set; } = null; [JsonProperty("connectionInfo")] - public Dictionary? ConnectionInfo { get; set; } = null; + public Dictionary? ConnectionInfo { get; set; } = null; } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/ConnectionStatusChangedWebhook.cs b/platform/Codat/Platform/Models/Components/ConnectionStatusChangedWebhook.cs deleted file mode 100644 index 04f8b7801..000000000 --- a/platform/Codat/Platform/Models/Components/ConnectionStatusChangedWebhook.cs +++ /dev/null @@ -1,75 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Models.Components; - using Codat.Platform.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Webhook request body for a company's data connection status changed. - /// - public class ConnectionStatusChangedWebhook - { - - /// - /// Unique identifier for your client in Codat. - /// - [JsonProperty("ClientId")] - public string? ClientId { get; set; } - - /// - /// Name of your client in Codat. - /// - [JsonProperty("ClientName")] - public string? ClientName { get; set; } - - /// - /// Unique identifier for your SMB in Codat. - /// - [JsonProperty("CompanyId")] - public string? CompanyId { get; set; } - - /// - /// Unique identifier for a company's data connection. - /// - [JsonProperty("DataConnectionId")] - public string? DataConnectionId { get; set; } - - /// - /// Unique identifier for the rule. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("RuleId")] - public string? RuleId { get; set; } - - /// - /// The type of rule. - /// - [JsonProperty("RuleType")] - public string? RuleType { get; set; } - - /// - /// Unique identifier of the webhook event. - /// - [JsonProperty("AlertId")] - public string? AlertId { get; set; } - - /// - /// A human-readable message about the webhook. - /// - [JsonProperty("Message")] - public string? Message { get; set; } - - [JsonProperty("Data")] - public ConnectionStatusChangedWebhookData? Data { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/ConnectionStatusChangedWebhookData.cs b/platform/Codat/Platform/Models/Components/ConnectionStatusChangedWebhookData.cs deleted file mode 100644 index cf3655d4d..000000000 --- a/platform/Codat/Platform/Models/Components/ConnectionStatusChangedWebhookData.cs +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Models.Components; - using Codat.Platform.Utils; - using Newtonsoft.Json; - - public class ConnectionStatusChangedWebhookData - { - - /// - /// Unique identifier for a company's data connection. - /// - [JsonProperty("dataConnectionId")] - public string? DataConnectionId { get; set; } - - /// - /// The current authorization status of the data connection. - /// - [JsonProperty("newStatus")] - public DataConnectionStatus? NewStatus { get; set; } - - /// - /// The current authorization status of the data connection. - /// - [JsonProperty("oldStatus")] - public DataConnectionStatus? OldStatus { get; set; } - - /// - /// A unique 4-letter key to represent a platform in each integration. View accounting, banking, and commerce platform keys. - /// - [JsonProperty("platformKey")] - public string? PlatformKey { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/DataStatus.cs b/platform/Codat/Platform/Models/Components/DataStatus.cs index f88885b27..8620eaa98 100644 --- a/platform/Codat/Platform/Models/Components/DataStatus.cs +++ b/platform/Codat/Platform/Models/Components/DataStatus.cs @@ -23,7 +23,7 @@ public class DataStatus /// Available data types ///
[JsonProperty("dataType")] - public DataStatusDataTypes DataType { get; set; } = default!; + public DataTypes DataType { get; set; } = default!; /// /// 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:
@@ -50,7 +50,7 @@ public class DataStatus /// ///
[JsonProperty("lastSuccessfulSync")] - public string LastSuccessfulSync { get; set; } = default!; + public string? LastSuccessfulSync { get; set; } /// /// The current status of the dataset. diff --git a/platform/Codat/Platform/Models/Components/DataStatusDataTypes.cs b/platform/Codat/Platform/Models/Components/DataStatusDataTypes.cs deleted file mode 100644 index 1535774dd..000000000 --- a/platform/Codat/Platform/Models/Components/DataStatusDataTypes.cs +++ /dev/null @@ -1,142 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Available data types - /// - public enum DataStatusDataTypes - { - [JsonProperty("accountTransactions")] - AccountTransactions, - [JsonProperty("balanceSheet")] - BalanceSheet, - [JsonProperty("bankAccounts")] - BankAccounts, - [JsonProperty("bankTransactions")] - BankTransactions, - [JsonProperty("billCreditNotes")] - BillCreditNotes, - [JsonProperty("billPayments")] - BillPayments, - [JsonProperty("bills")] - Bills, - [JsonProperty("cashFlowStatement")] - CashFlowStatement, - [JsonProperty("chartOfAccounts")] - ChartOfAccounts, - [JsonProperty("company")] - Company, - [JsonProperty("creditNotes")] - CreditNotes, - [JsonProperty("customers")] - Customers, - [JsonProperty("directCosts")] - DirectCosts, - [JsonProperty("directIncomes")] - DirectIncomes, - [JsonProperty("invoices")] - Invoices, - [JsonProperty("itemReceipts")] - ItemReceipts, - [JsonProperty("items")] - Items, - [JsonProperty("journalEntries")] - JournalEntries, - [JsonProperty("journals")] - Journals, - [JsonProperty("paymentMethods")] - PaymentMethods, - [JsonProperty("payments")] - Payments, - [JsonProperty("profitAndLoss")] - ProfitAndLoss, - [JsonProperty("purchaseOrders")] - PurchaseOrders, - [JsonProperty("salesOrders")] - SalesOrders, - [JsonProperty("suppliers")] - Suppliers, - [JsonProperty("taxRates")] - TaxRates, - [JsonProperty("trackingCategories")] - TrackingCategories, - [JsonProperty("transfers")] - Transfers, - [JsonProperty("banking-accountBalances")] - BankingAccountBalances, - [JsonProperty("banking-accounts")] - BankingAccounts, - [JsonProperty("banking-transactionCategories")] - BankingTransactionCategories, - [JsonProperty("banking-transactions")] - BankingTransactions, - [JsonProperty("commerce-companyInfo")] - CommerceCompanyInfo, - [JsonProperty("commerce-customers")] - CommerceCustomers, - [JsonProperty("commerce-disputes")] - CommerceDisputes, - [JsonProperty("commerce-locations")] - CommerceLocations, - [JsonProperty("commerce-orders")] - CommerceOrders, - [JsonProperty("commerce-paymentMethods")] - CommercePaymentMethods, - [JsonProperty("commerce-payments")] - CommercePayments, - [JsonProperty("commerce-productCategories")] - CommerceProductCategories, - [JsonProperty("commerce-products")] - CommerceProducts, - [JsonProperty("commerce-taxComponents")] - CommerceTaxComponents, - [JsonProperty("commerce-transactions")] - CommerceTransactions, - } - - public static class DataStatusDataTypesExtension - { - public static string Value(this DataStatusDataTypes value) - { - return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); - } - - public static DataStatusDataTypes ToEnum(this string value) - { - foreach(var field in typeof(DataStatusDataTypes).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 DataStatusDataTypes) - { - return (DataStatusDataTypes)enumVal; - } - } - } - - throw new Exception($"Unknown value {value} for enum DataStatusDataTypes"); - } - } - -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/DataSyncCompletedWebhook.cs b/platform/Codat/Platform/Models/Components/DataSyncCompletedWebhook.cs deleted file mode 100644 index 8bab649f8..000000000 --- a/platform/Codat/Platform/Models/Components/DataSyncCompletedWebhook.cs +++ /dev/null @@ -1,75 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Models.Components; - using Codat.Platform.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Webhook request body to notify the completion of a data sync. - /// - public class DataSyncCompletedWebhook - { - - /// - /// Unique identifier for your client in Codat. - /// - [JsonProperty("ClientId")] - public string? ClientId { get; set; } - - /// - /// Name of your client in Codat. - /// - [JsonProperty("ClientName")] - public string? ClientName { get; set; } - - /// - /// Unique identifier for your SMB in Codat. - /// - [JsonProperty("CompanyId")] - public string? CompanyId { get; set; } - - /// - /// Unique identifier for a company's data connection. - /// - [JsonProperty("DataConnectionId")] - public string? DataConnectionId { get; set; } - - /// - /// Unique identifier for the rule. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("RuleId")] - public string? RuleId { get; set; } - - /// - /// The type of rule. - /// - [JsonProperty("RuleType")] - public string? RuleType { get; set; } - - /// - /// Unique identifier of the webhook event. - /// - [JsonProperty("AlertId")] - public string? AlertId { get; set; } - - /// - /// A human-readable message about the webhook. - /// - [JsonProperty("Message")] - public string? Message { get; set; } - - [JsonProperty("Data")] - public DataSyncCompletedWebhookData? Data { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/DataTypeFeature.cs b/platform/Codat/Platform/Models/Components/DataTypeFeature.cs index 88e195919..7334a27c8 100644 --- a/platform/Codat/Platform/Models/Components/DataTypeFeature.cs +++ b/platform/Codat/Platform/Models/Components/DataTypeFeature.cs @@ -24,7 +24,7 @@ public class DataTypeFeature /// Available data types /// [JsonProperty("dataType")] - public PropertieDataType? DataType { get; set; } + public Models.Components.DataType? DataType { get; set; } [JsonProperty("supportedFeatures")] public List SupportedFeatures { get; set; } = default!; diff --git a/platform/Codat/Platform/Models/Components/DataTypeReadSummary.cs b/platform/Codat/Platform/Models/Components/DataTypeReadSummary.cs new file mode 100644 index 000000000..62e4e3962 --- /dev/null +++ b/platform/Codat/Platform/Models/Components/DataTypeReadSummary.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). 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.Components +{ + using Codat.Platform.Models.Components; + using Codat.Platform.Utils; + using Newtonsoft.Json; + using System.Collections.Generic; + + public class DataTypeReadSummary + { + + /// + /// Unique identifier for a company's data connection. + /// + [JsonProperty("connectionId")] + public string? ConnectionId { get; set; } + + /// + /// Available data types + /// + [JsonProperty("dataType")] + public Models.Components.DataType? DataType { get; set; } + + /// + /// `True` if records have been created, updated or deleted in Codat's cache. + /// + [JsonProperty("recordsModified")] + public bool? RecordsModified { get; set; } + + /// + /// The current status of the dataset. + /// + [JsonProperty("status")] + public Status? Status { get; set; } + + /// + /// A array of issues encountered during a data read. + /// + [JsonProperty("issues")] + public List? Issues { get; set; } = null; + } +} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/DataTypes.cs b/platform/Codat/Platform/Models/Components/DataTypes.cs index e18daa789..7dde1d6f7 100644 --- a/platform/Codat/Platform/Models/Components/DataTypes.cs +++ b/platform/Codat/Platform/Models/Components/DataTypes.cs @@ -9,35 +9,134 @@ #nullable enable namespace Codat.Platform.Models.Components { - using Codat.Platform.Models.Components; using Codat.Platform.Utils; using Newtonsoft.Json; + using System; - public class DataTypes + /// + /// Available data types + /// + public enum DataTypes { + [JsonProperty("accountTransactions")] + AccountTransactions, + [JsonProperty("balanceSheet")] + BalanceSheet, + [JsonProperty("bankAccounts")] + BankAccounts, + [JsonProperty("bankTransactions")] + BankTransactions, + [JsonProperty("billCreditNotes")] + BillCreditNotes, + [JsonProperty("billPayments")] + BillPayments, + [JsonProperty("bills")] + Bills, + [JsonProperty("cashFlowStatement")] + CashFlowStatement, + [JsonProperty("chartOfAccounts")] + ChartOfAccounts, + [JsonProperty("company")] + Company, + [JsonProperty("creditNotes")] + CreditNotes, + [JsonProperty("customers")] + Customers, + [JsonProperty("directCosts")] + DirectCosts, + [JsonProperty("directIncomes")] + DirectIncomes, + [JsonProperty("invoices")] + Invoices, + [JsonProperty("itemReceipts")] + ItemReceipts, + [JsonProperty("items")] + Items, + [JsonProperty("journalEntries")] + JournalEntries, + [JsonProperty("journals")] + Journals, + [JsonProperty("paymentMethods")] + PaymentMethods, + [JsonProperty("payments")] + Payments, + [JsonProperty("profitAndLoss")] + ProfitAndLoss, + [JsonProperty("purchaseOrders")] + PurchaseOrders, + [JsonProperty("salesOrders")] + SalesOrders, + [JsonProperty("suppliers")] + Suppliers, + [JsonProperty("taxRates")] + TaxRates, + [JsonProperty("trackingCategories")] + TrackingCategories, + [JsonProperty("transfers")] + Transfers, + [JsonProperty("banking-accountBalances")] + BankingAccountBalances, + [JsonProperty("banking-accounts")] + BankingAccounts, + [JsonProperty("banking-transactionCategories")] + BankingTransactionCategories, + [JsonProperty("banking-transactions")] + BankingTransactions, + [JsonProperty("commerce-companyInfo")] + CommerceCompanyInfo, + [JsonProperty("commerce-customers")] + CommerceCustomers, + [JsonProperty("commerce-disputes")] + CommerceDisputes, + [JsonProperty("commerce-locations")] + CommerceLocations, + [JsonProperty("commerce-orders")] + CommerceOrders, + [JsonProperty("commerce-paymentMethods")] + CommercePaymentMethods, + [JsonProperty("commerce-payments")] + CommercePayments, + [JsonProperty("commerce-productCategories")] + CommerceProductCategories, + [JsonProperty("commerce-products")] + CommerceProducts, + [JsonProperty("commerce-taxComponents")] + CommerceTaxComponents, + [JsonProperty("commerce-transactions")] + CommerceTransactions, + } + + public static class DataTypesExtension + { + public static string Value(this DataTypes value) + { + return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); + } - /// - /// Unique identifier for a company's data connection. - /// - [JsonProperty("connectionId")] - public string? ConnectionId { get; set; } + public static DataTypes ToEnum(this string value) + { + foreach(var field in typeof(DataTypes).GetFields()) + { + var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false); + if (attributes.Length == 0) + { + continue; + } - /// - /// Available data types - /// - [JsonProperty("dataType")] - public PropertieDataType? DataType { get; set; } + var attribute = attributes[0] as JsonPropertyAttribute; + if (attribute != null && attribute.PropertyName == value) + { + var enumVal = field.GetValue(null); - /// - /// `True` if records have been created, updated or deleted in Codat's cache. - /// - [JsonProperty("recordsModified")] - public bool? RecordsModified { get; set; } + if (enumVal is DataTypes) + { + return (DataTypes)enumVal; + } + } + } - /// - /// The current status of the dataset. - /// - [JsonProperty("status")] - public Status? Status { get; set; } + throw new Exception($"Unknown value {value} for enum DataTypes"); + } } + } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/DatasetDataChangedWebhook.cs b/platform/Codat/Platform/Models/Components/DatasetDataChangedWebhook.cs deleted file mode 100644 index 6f33eca10..000000000 --- a/platform/Codat/Platform/Models/Components/DatasetDataChangedWebhook.cs +++ /dev/null @@ -1,75 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Models.Components; - using Codat.Platform.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Webhook request body to notify that a data synchronization has completed. - /// - public class DatasetDataChangedWebhook - { - - /// - /// Unique identifier for your client in Codat. - /// - [JsonProperty("ClientId")] - public string? ClientId { get; set; } - - /// - /// Name of your client in Codat. - /// - [JsonProperty("ClientName")] - public string? ClientName { get; set; } - - /// - /// Unique identifier for your SMB in Codat. - /// - [JsonProperty("CompanyId")] - public string? CompanyId { get; set; } - - /// - /// Unique identifier for a company's data connection. - /// - [JsonProperty("DataConnectionId")] - public string? DataConnectionId { get; set; } - - /// - /// Unique identifier for the rule. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("RuleId")] - public string? RuleId { get; set; } - - /// - /// The type of rule. - /// - [JsonProperty("RuleType")] - public string? RuleType { get; set; } - - /// - /// Unique identifier of the webhook event. - /// - [JsonProperty("AlertId")] - public string? AlertId { get; set; } - - /// - /// A human-readable message about the webhook. - /// - [JsonProperty("Message")] - public string? Message { get; set; } - - [JsonProperty("Data")] - public DatasetDataChangedWebhookData? Data { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/DatasetStatusChangedErrorWebhook.cs b/platform/Codat/Platform/Models/Components/DatasetStatusChangedErrorWebhook.cs deleted file mode 100644 index 05c36cf97..000000000 --- a/platform/Codat/Platform/Models/Components/DatasetStatusChangedErrorWebhook.cs +++ /dev/null @@ -1,75 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Models.Components; - using Codat.Platform.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Webhook request body to notify that a data synchronization has completed. - /// - public class DatasetStatusChangedErrorWebhook - { - - /// - /// Unique identifier for your client in Codat. - /// - [JsonProperty("ClientId")] - public string? ClientId { get; set; } - - /// - /// Name of your client in Codat. - /// - [JsonProperty("ClientName")] - public string? ClientName { get; set; } - - /// - /// Unique identifier for your SMB in Codat. - /// - [JsonProperty("CompanyId")] - public string? CompanyId { get; set; } - - /// - /// Unique identifier for a company's data connection. - /// - [JsonProperty("DataConnectionId")] - public string? DataConnectionId { get; set; } - - /// - /// Unique identifier for the rule. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("RuleId")] - public string? RuleId { get; set; } - - /// - /// The type of rule. - /// - [JsonProperty("RuleType")] - public string? RuleType { get; set; } - - /// - /// Unique identifier of the webhook event. - /// - [JsonProperty("AlertId")] - public string? AlertId { get; set; } - - /// - /// A human-readable message about the webhook. - /// - [JsonProperty("Message")] - public string? Message { get; set; } - - [JsonProperty("Data")] - public DatasetStatusChangedErrorWebhookData? Data { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/CreateRule.cs b/platform/Codat/Platform/Models/Components/Issue.cs similarity index 62% rename from platform/Codat/Platform/Models/Components/CreateRule.cs rename to platform/Codat/Platform/Models/Components/Issue.cs index bba2fe9ae..1e873ea47 100644 --- a/platform/Codat/Platform/Models/Components/CreateRule.cs +++ b/platform/Codat/Platform/Models/Components/Issue.cs @@ -14,24 +14,24 @@ namespace Codat.Platform.Models.Components using Newtonsoft.Json; /// - /// Create a message that notifies a URL of an event based on its given type or condition. + /// Details of a problem encountered during a data read. /// - public class CreateRule + public class Issue { /// - /// The type of webhook. + /// The type of issue. /// [JsonProperty("type")] - public string Type { get; set; } = default!; + public string? Type { get; set; } /// - /// Unique identifier for your SMB in Codat. + /// A message describing the issue. /// - [JsonProperty("companyId")] - public string? CompanyId { get; set; } + [JsonProperty("message")] + public string? Message { get; set; } - [JsonProperty("notifiers")] - public WebhookNotifier Notifiers { get; set; } = default!; + [JsonProperty("links")] + public IssueLinks? Links { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/PushOperationStatusChangedWebhookData.cs b/platform/Codat/Platform/Models/Components/IssueLinks.cs similarity index 50% rename from platform/Codat/Platform/Models/Components/PushOperationStatusChangedWebhookData.cs rename to platform/Codat/Platform/Models/Components/IssueLinks.cs index e699333f5..76f129f21 100644 --- a/platform/Codat/Platform/Models/Components/PushOperationStatusChangedWebhookData.cs +++ b/platform/Codat/Platform/Models/Components/IssueLinks.cs @@ -9,29 +9,28 @@ #nullable enable namespace Codat.Platform.Models.Components { - using Codat.Platform.Models.Components; using Codat.Platform.Utils; using Newtonsoft.Json; - public class PushOperationStatusChangedWebhookData + public class IssueLinks { /// - /// Available data types + /// A link to the validation logs, providing details on any errors or warnings encountered. /// - [JsonProperty("dataType")] - public PropertieDataType? DataType { get; set; } + [JsonProperty("logs")] + public string? Logs { get; set; } /// - /// The current status of the push operation. + /// A link to the company's past data read history in the Codat portal. /// - [JsonProperty("status")] - public PushOperationStatus? Status { get; set; } + [JsonProperty("portal")] + public string? Portal { get; set; } /// - /// A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. + /// A link to Codat's documentation with additional information on how to troubleshoot this issue. /// - [JsonProperty("pushOperationKey")] - public string? PushOperationKey { get; set; } + [JsonProperty("readMore")] + public string? ReadMore { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/NewCompanySynchronizedWebhook.cs b/platform/Codat/Platform/Models/Components/NewCompanySynchronizedWebhook.cs deleted file mode 100644 index 1794d30ce..000000000 --- a/platform/Codat/Platform/Models/Components/NewCompanySynchronizedWebhook.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Webhook request body to notify that a new company has successfully synchronized at least one dataType for the first time. - /// - public class NewCompanySynchronizedWebhook - { - - /// - /// Unique identifier for your client in Codat. - /// - [JsonProperty("ClientId")] - public string? ClientId { get; set; } - - /// - /// Name of your client in Codat. - /// - [JsonProperty("ClientName")] - public string? ClientName { get; set; } - - /// - /// Unique identifier for your SMB in Codat. - /// - [JsonProperty("CompanyId")] - public string? CompanyId { get; set; } - - /// - /// Unique identifier for a company's data connection. - /// - [JsonProperty("DataConnectionId")] - public string? DataConnectionId { get; set; } - - /// - /// Unique identifier for the rule. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("RuleId")] - public string? RuleId { get; set; } - - /// - /// The type of rule. - /// - [JsonProperty("RuleType")] - public string? RuleType { get; set; } - - /// - /// Unique identifier of the webhook event. - /// - [JsonProperty("AlertId")] - public string? AlertId { get; set; } - - /// - /// A human-readable message about the webhook. - /// - [JsonProperty("Message")] - public string? Message { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/Profile.cs b/platform/Codat/Platform/Models/Components/Profile.cs index 5af897760..9fd417040 100644 --- a/platform/Codat/Platform/Models/Components/Profile.cs +++ b/platform/Codat/Platform/Models/Components/Profile.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Components { using Codat.Platform.Utils; using Newtonsoft.Json; - using System.Collections.Generic; using System; + using System.Collections.Generic; /// /// Describes your Codat client instance @@ -57,12 +57,6 @@ public class Profile [JsonProperty("apiKey")] public string? ApiKey { get; set; } - /// - /// Alert or webhooks authorization header. - /// - [JsonProperty("alertAuthHeader")] - public string? AlertAuthHeader { get; set; } - /// /// `True` if the company name has been confirmed. /// diff --git a/platform/Codat/Platform/Models/Components/PropertieDataType.cs b/platform/Codat/Platform/Models/Components/PropertieDataType.cs deleted file mode 100644 index 23d67e16a..000000000 --- a/platform/Codat/Platform/Models/Components/PropertieDataType.cs +++ /dev/null @@ -1,142 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Available data types - /// - public enum PropertieDataType - { - [JsonProperty("accountTransactions")] - AccountTransactions, - [JsonProperty("balanceSheet")] - BalanceSheet, - [JsonProperty("bankAccounts")] - BankAccounts, - [JsonProperty("bankTransactions")] - BankTransactions, - [JsonProperty("billCreditNotes")] - BillCreditNotes, - [JsonProperty("billPayments")] - BillPayments, - [JsonProperty("bills")] - Bills, - [JsonProperty("cashFlowStatement")] - CashFlowStatement, - [JsonProperty("chartOfAccounts")] - ChartOfAccounts, - [JsonProperty("company")] - Company, - [JsonProperty("creditNotes")] - CreditNotes, - [JsonProperty("customers")] - Customers, - [JsonProperty("directCosts")] - DirectCosts, - [JsonProperty("directIncomes")] - DirectIncomes, - [JsonProperty("invoices")] - Invoices, - [JsonProperty("itemReceipts")] - ItemReceipts, - [JsonProperty("items")] - Items, - [JsonProperty("journalEntries")] - JournalEntries, - [JsonProperty("journals")] - Journals, - [JsonProperty("paymentMethods")] - PaymentMethods, - [JsonProperty("payments")] - Payments, - [JsonProperty("profitAndLoss")] - ProfitAndLoss, - [JsonProperty("purchaseOrders")] - PurchaseOrders, - [JsonProperty("salesOrders")] - SalesOrders, - [JsonProperty("suppliers")] - Suppliers, - [JsonProperty("taxRates")] - TaxRates, - [JsonProperty("trackingCategories")] - TrackingCategories, - [JsonProperty("transfers")] - Transfers, - [JsonProperty("banking-accountBalances")] - BankingAccountBalances, - [JsonProperty("banking-accounts")] - BankingAccounts, - [JsonProperty("banking-transactionCategories")] - BankingTransactionCategories, - [JsonProperty("banking-transactions")] - BankingTransactions, - [JsonProperty("commerce-companyInfo")] - CommerceCompanyInfo, - [JsonProperty("commerce-customers")] - CommerceCustomers, - [JsonProperty("commerce-disputes")] - CommerceDisputes, - [JsonProperty("commerce-locations")] - CommerceLocations, - [JsonProperty("commerce-orders")] - CommerceOrders, - [JsonProperty("commerce-paymentMethods")] - CommercePaymentMethods, - [JsonProperty("commerce-payments")] - CommercePayments, - [JsonProperty("commerce-productCategories")] - CommerceProductCategories, - [JsonProperty("commerce-products")] - CommerceProducts, - [JsonProperty("commerce-taxComponents")] - CommerceTaxComponents, - [JsonProperty("commerce-transactions")] - CommerceTransactions, - } - - public static class PropertieDataTypeExtension - { - public static string Value(this PropertieDataType value) - { - return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString(); - } - - public static PropertieDataType ToEnum(this string value) - { - foreach(var field in typeof(PropertieDataType).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 PropertieDataType) - { - return (PropertieDataType)enumVal; - } - } - } - - throw new Exception($"Unknown value {value} for enum PropertieDataType"); - } - } - -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/PushOperation.cs b/platform/Codat/Platform/Models/Components/PushOperation.cs index 731d03fe6..2c7139b7f 100644 --- a/platform/Codat/Platform/Models/Components/PushOperation.cs +++ b/platform/Codat/Platform/Models/Components/PushOperation.cs @@ -12,8 +12,8 @@ namespace Codat.Platform.Models.Components using Codat.Platform.Models.Components; using Codat.Platform.Utils; using Newtonsoft.Json; - using System.Collections.Generic; using System; + using System.Collections.Generic; public class PushOperation { @@ -28,7 +28,7 @@ public class PushOperation /// Available data types /// [JsonProperty("dataType")] - public PropertieDataType? DataType { get; set; } + public Models.Components.DataType? DataType { get; set; } /// /// Unique identifier for your SMB in Codat. diff --git a/platform/Codat/Platform/Models/Components/PushOperationRef.cs b/platform/Codat/Platform/Models/Components/PushOperationRef.cs index 0ff99ac67..2bcc34d10 100644 --- a/platform/Codat/Platform/Models/Components/PushOperationRef.cs +++ b/platform/Codat/Platform/Models/Components/PushOperationRef.cs @@ -26,6 +26,6 @@ public class PushOperationRef /// Available data types /// [JsonProperty("dataType")] - public PropertieDataType? DataType { get; set; } + public Models.Components.DataType? DataType { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/PushOperationStatusChangedWebhook.cs b/platform/Codat/Platform/Models/Components/PushOperationStatusChangedWebhook.cs deleted file mode 100644 index f3300a8b4..000000000 --- a/platform/Codat/Platform/Models/Components/PushOperationStatusChangedWebhook.cs +++ /dev/null @@ -1,75 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Models.Components; - using Codat.Platform.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Webhook request body for a push operation status change. - /// - public class PushOperationStatusChangedWebhook - { - - /// - /// Unique identifier for your client in Codat. - /// - [JsonProperty("ClientId")] - public string? ClientId { get; set; } - - /// - /// Name of your client in Codat. - /// - [JsonProperty("ClientName")] - public string? ClientName { get; set; } - - /// - /// Unique identifier for your SMB in Codat. - /// - [JsonProperty("CompanyId")] - public string? CompanyId { get; set; } - - /// - /// Unique identifier for a company's data connection. - /// - [JsonProperty("DataConnectionId")] - public string? DataConnectionId { get; set; } - - /// - /// Unique identifier for the rule. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("RuleId")] - public string? RuleId { get; set; } - - /// - /// The type of rule. - /// - [JsonProperty("RuleType")] - public string? RuleType { get; set; } - - /// - /// Unique identifier of the webhook event. - /// - [JsonProperty("AlertId")] - public string? AlertId { get; set; } - - /// - /// A human-readable message about the webhook. - /// - [JsonProperty("Message")] - public string? Message { get; set; } - - [JsonProperty("Data")] - public PushOperationStatusChangedWebhookData? Data { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/PushOperationTimedOutWebhook.cs b/platform/Codat/Platform/Models/Components/PushOperationTimedOutWebhook.cs deleted file mode 100644 index 91a6a533e..000000000 --- a/platform/Codat/Platform/Models/Components/PushOperationTimedOutWebhook.cs +++ /dev/null @@ -1,75 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Models.Components; - using Codat.Platform.Utils; - using Newtonsoft.Json; - using System; - - /// - /// Webhook request body notifying that a push push operation has timed out. - /// - public class PushOperationTimedOutWebhook - { - - /// - /// Unique identifier for your client in Codat. - /// - [JsonProperty("ClientId")] - public string? ClientId { get; set; } - - /// - /// Name of your client in Codat. - /// - [JsonProperty("ClientName")] - public string? ClientName { get; set; } - - /// - /// Unique identifier for your SMB in Codat. - /// - [JsonProperty("CompanyId")] - public string? CompanyId { get; set; } - - /// - /// Unique identifier for a company's data connection. - /// - [JsonProperty("DataConnectionId")] - public string? DataConnectionId { get; set; } - - /// - /// Unique identifier for the rule. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("RuleId")] - public string? RuleId { get; set; } - - /// - /// The type of rule. - /// - [JsonProperty("RuleType")] - public string? RuleType { get; set; } - - /// - /// Unique identifier of the webhook event. - /// - [JsonProperty("AlertId")] - public string? AlertId { get; set; } - - /// - /// A human-readable message about the webhook. - /// - [JsonProperty("Message")] - public string? Message { get; set; } - - [JsonProperty("Data")] - public PushOperationTimedOutWebhookData? Data { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/PushOperationTimedOutWebhookData.cs b/platform/Codat/Platform/Models/Components/PushOperationTimedOutWebhookData.cs deleted file mode 100644 index be46f06b8..000000000 --- a/platform/Codat/Platform/Models/Components/PushOperationTimedOutWebhookData.cs +++ /dev/null @@ -1,37 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Models.Components; - using Codat.Platform.Utils; - using Newtonsoft.Json; - - public class PushOperationTimedOutWebhookData - { - - /// - /// Available data types - /// - [JsonProperty("dataType")] - public PropertieDataType? DataType { get; set; } - - /// - /// A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. - /// - [JsonProperty("pushOperationKey")] - public string? PushOperationKey { get; set; } - - /// - /// A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. - /// - [JsonProperty("pushOperationGuid")] - public string? PushOperationGuid { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/ReadCompletedWebhookPayload.cs b/platform/Codat/Platform/Models/Components/ReadCompletedWebhookPayload.cs index 423d57e4f..2f699cc65 100644 --- a/platform/Codat/Platform/Models/Components/ReadCompletedWebhookPayload.cs +++ b/platform/Codat/Platform/Models/Components/ReadCompletedWebhookPayload.cs @@ -48,6 +48,6 @@ public class ReadCompletedWebhookPayload public string? ModifiedFromDate { get; set; } [JsonProperty("dataTypes")] - public List? DataTypes { get; set; } + public List? DataTypes { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/SyncSetting.cs b/platform/Codat/Platform/Models/Components/SyncSetting.cs index 11d12a0a5..5065be279 100644 --- a/platform/Codat/Platform/Models/Components/SyncSetting.cs +++ b/platform/Codat/Platform/Models/Components/SyncSetting.cs @@ -23,7 +23,7 @@ public class SyncSetting /// Available data types ///
[JsonProperty("dataType")] - public PropertieDataType DataType { get; set; } = default!; + public Models.Components.DataType DataType { get; set; } = default!; /// /// Whether this data type should be queued after a company has authorized a connection. diff --git a/platform/Codat/Platform/Models/Components/Validation.cs b/platform/Codat/Platform/Models/Components/Validation.cs index 88486c556..a9e357179 100644 --- a/platform/Codat/Platform/Models/Components/Validation.cs +++ b/platform/Codat/Platform/Models/Components/Validation.cs @@ -21,9 +21,9 @@ public class Validation { [JsonProperty("errors")] - public List? Errors { get; set; } = null; + public List? Errors { get; set; } = null; [JsonProperty("warnings")] - public List? Warnings { get; set; } = null; + public List? Warnings { get; set; } = null; } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/ValidationItem.cs b/platform/Codat/Platform/Models/Components/ValidationItem.cs index 0d8d740d1..0a0b68901 100644 --- a/platform/Codat/Platform/Models/Components/ValidationItem.cs +++ b/platform/Codat/Platform/Models/Components/ValidationItem.cs @@ -16,21 +16,27 @@ public class ValidationItem { /// - /// Unique identifier for a validation item. + /// The unique identifier of the rule that wasn't met. + /// + [JsonProperty("ruleId")] + public string? RuleId { get; set; } + + /// + /// The unique identifier of the item that was validated. /// [JsonProperty("itemId")] - public string? ItemId { get; set; } = null; + public string? ItemId { get; set; } /// - /// A message outlining validation item's issue. + /// The message that describes the validation warning or error. /// [JsonProperty("message")] - public string? Message { get; set; } = null; + public string? Message { get; set; } /// - /// Name of validator. + /// The name of the validator that was used to validate the item. /// [JsonProperty("validatorName")] - public string? ValidatorName { get; set; } = null; + public string? ValidatorName { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/DatasetStatusChangedErrorWebhookData.cs b/platform/Codat/Platform/Models/Components/ValidationItem1.cs similarity index 55% rename from platform/Codat/Platform/Models/Components/DatasetStatusChangedErrorWebhookData.cs rename to platform/Codat/Platform/Models/Components/ValidationItem1.cs index de376c5c4..d2c6f9380 100644 --- a/platform/Codat/Platform/Models/Components/DatasetStatusChangedErrorWebhookData.cs +++ b/platform/Codat/Platform/Models/Components/ValidationItem1.cs @@ -9,29 +9,28 @@ #nullable enable namespace Codat.Platform.Models.Components { - using Codat.Platform.Models.Components; using Codat.Platform.Utils; using Newtonsoft.Json; - public class DatasetStatusChangedErrorWebhookData + public class ValidationItem1 { /// - /// Available data types + /// Unique identifier for a validation item. /// - [JsonProperty("dataType")] - public PropertieDataType? DataType { get; set; } + [JsonProperty("itemId")] + public string? ItemId { get; set; } = null; /// - /// The current status of the dataset's sync. + /// A message outlining validation item's issue. /// - [JsonProperty("datasetStatus")] - public string? DatasetStatus { get; set; } + [JsonProperty("message")] + public string? Message { get; set; } = null; /// - /// Unique identifier for the dataset that completed its sync. + /// Name of validator. /// - [JsonProperty("datasetId")] - public string? DatasetId { get; set; } + [JsonProperty("validatorName")] + public string? ValidatorName { get; set; } = null; } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/WebhookNotifier.cs b/platform/Codat/Platform/Models/Components/ValidationResult.cs similarity index 64% rename from platform/Codat/Platform/Models/Components/WebhookNotifier.cs rename to platform/Codat/Platform/Models/Components/ValidationResult.cs index c6605c3e5..03b87286c 100644 --- a/platform/Codat/Platform/Models/Components/WebhookNotifier.cs +++ b/platform/Codat/Platform/Models/Components/ValidationResult.cs @@ -9,20 +9,18 @@ #nullable enable namespace Codat.Platform.Models.Components { + using Codat.Platform.Models.Components; using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; - public class WebhookNotifier + public class ValidationResult { - [JsonProperty("emails")] - public List? Emails { get; set; } + [JsonProperty("errors")] + public List? Errors { get; set; } - /// - /// The URI the webhook service will use to post events. - /// - [JsonProperty("webhook")] - public string? Webhook { get; set; } + [JsonProperty("warnings")] + public List? Warnings { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/Webhook.cs b/platform/Codat/Platform/Models/Components/Webhook.cs deleted file mode 100644 index 9bfc0f90e..000000000 --- a/platform/Codat/Platform/Models/Components/Webhook.cs +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Components -{ - using Codat.Platform.Models.Components; - using Codat.Platform.Utils; - using Newtonsoft.Json; - - /// - /// Configuration to provide an event notification to a URL or list of email addresses based on the given type or condition. - /// - public class Webhook - { - - /// - /// Unique identifier for the configured notification. - /// - [JsonProperty("id")] - public string? Id { get; set; } - - /// - /// The type of webhook. - /// - [JsonProperty("type")] - public string Type { get; set; } = default!; - - /// - /// Unique identifier for your SMB in Codat. - /// - [JsonProperty("companyId")] - public string? CompanyId { get; set; } - - [JsonProperty("notifiers")] - public WebhookNotifier Notifiers { get; set; } = default!; - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/WebhookConsumer.cs b/platform/Codat/Platform/Models/Components/WebhookConsumer.cs index f563c131d..cc1a76542 100644 --- a/platform/Codat/Platform/Models/Components/WebhookConsumer.cs +++ b/platform/Codat/Platform/Models/Components/WebhookConsumer.cs @@ -12,7 +12,6 @@ namespace Codat.Platform.Models.Components using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; - using System; /// /// A webhook consumer is an HTTP endpoint that developers can configure to subscribe to Codat's supported event types.
@@ -54,13 +53,6 @@ public class WebhookConsumer /// Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. ///
[JsonProperty("companyTags")] - public List? CompanyTags { get; set; } - - /// - /// Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("companyId")] - public string? CompanyId { get; set; } = null; + public List? CompanyTags { get; set; } = null; } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Components/WebhookConsumerPrototype.cs b/platform/Codat/Platform/Models/Components/WebhookConsumerPrototype.cs index 9f5cf8525..6e7e80e19 100644 --- a/platform/Codat/Platform/Models/Components/WebhookConsumerPrototype.cs +++ b/platform/Codat/Platform/Models/Components/WebhookConsumerPrototype.cs @@ -12,7 +12,6 @@ namespace Codat.Platform.Models.Components using Codat.Platform.Utils; using Newtonsoft.Json; using System.Collections.Generic; - using System; public class WebhookConsumerPrototype { @@ -39,13 +38,6 @@ public class WebhookConsumerPrototype /// Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. ///
[JsonProperty("companyTags")] - public List? CompanyTags { get; set; } - - /// - /// Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID. - /// - [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible")] - [JsonProperty("companyId")] - public string? CompanyId { get; set; } = null; + public List? CompanyTags { get; set; } = null; } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Errors/CodatPlatformException.cs b/platform/Codat/Platform/Models/Errors/CodatPlatformException.cs new file mode 100644 index 000000000..ef4d8f5c3 --- /dev/null +++ b/platform/Codat/Platform/Models/Errors/CodatPlatformException.cs @@ -0,0 +1,80 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). 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.Errors +{ + using System; + using System.Net.Http; + using System.Net.Http.Headers; + + public class CodatPlatformException : Exception + { + /// + /// Error Message + /// + public override string Message { get; } + + /// + /// HTTP status code + /// + public int StatusCode { get; } + + /// + /// HTTP headers + /// + public HttpResponseHeaders Headers { get; } + + /// + /// HTTP content type + /// + public string? ContentType { get; } + + /// + /// Raw response + /// + public HttpResponseMessage RawResponse { get; } + + /// + /// HTTP response body + /// + public string Body { get; } + + public CodatPlatformException( + string message, + HttpResponseMessage rawResponse, + string body + ) : this(message, rawResponse, body, null) {} + + public CodatPlatformException( + string message, + HttpResponseMessage rawResponse, + string body, + Exception? innerException + ) : base(message, innerException) + { + Message = message; + RawResponse = rawResponse; + StatusCode = (int)rawResponse.StatusCode; + Headers = rawResponse.Headers; + ContentType = rawResponse.Content.Headers.ContentType?.MediaType; + Body = body; + } + + /// + /// Detailed Error Message + /// + public override string ToString() + { + var innerMessage = string.IsNullOrEmpty(InnerException?.Message) ? "" : $"\n{InnerException.Message}"; + return $"Status: {StatusCode}. {Message}{innerMessage}"; + } + + } +} diff --git a/platform/Codat/Platform/Models/Errors/ErrorMessage.cs b/platform/Codat/Platform/Models/Errors/ErrorMessage.cs index 7607512a7..959d74804 100644 --- a/platform/Codat/Platform/Models/Errors/ErrorMessage.cs +++ b/platform/Codat/Platform/Models/Errors/ErrorMessage.cs @@ -13,13 +13,10 @@ namespace Codat.Platform.Models.Errors using Codat.Platform.Utils; using Newtonsoft.Json; using System; - - /// - /// Your `query` parameter was not correctly formed - /// - public class ErrorMessage : Exception - { + using System.Net.Http; + public class ErrorMessagePayload + { /// /// The HTTP status code returned by the error. /// @@ -62,4 +59,52 @@ public class ErrorMessage : Exception [JsonProperty("detailedErrorCode")] public long? DetailedErrorCode { get; set; } } + + /// + /// Your `query` parameter was not correctly formed + /// + public class ErrorMessage : CodatPlatformException + { + /// + /// The original data that was passed to this exception. + /// + public ErrorMessagePayload Payload { get; } + + [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ErrorMessage.Payload.Service instead.")] + public string? Service { get; set; } + + [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ErrorMessage.Payload.Error instead.")] + public string? Error { get; set; } + + [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ErrorMessage.Payload.CorrelationId instead.")] + public string? CorrelationId { get; set; } + + [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ErrorMessage.Payload.Validation instead.")] + public ErrorValidation? Validation { get; set; } + + [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ErrorMessage.Payload.CanBeRetried instead.")] + public string? CanBeRetried { get; set; } + + [Obsolete("This field will be removed in a future release, please migrate away from it as soon as possible. Use ErrorMessage.Payload.DetailedErrorCode instead.")] + public long? DetailedErrorCode { get; set; } + + public ErrorMessage( + ErrorMessagePayload payload, + HttpResponseMessage rawResponse, + string body + ): base("API error occurred", rawResponse, body) + { + Payload = payload; + + #pragma warning disable CS0618 + Service = payload.Service; + Error = payload.Error; + CorrelationId = payload.CorrelationId; + Validation = payload.Validation; + CanBeRetried = payload.CanBeRetried; + DetailedErrorCode = payload.DetailedErrorCode; + #pragma warning restore CS0618 + } + } + } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Errors/ResponseValidationException.cs b/platform/Codat/Platform/Models/Errors/ResponseValidationException.cs new file mode 100644 index 000000000..149b8b700 --- /dev/null +++ b/platform/Codat/Platform/Models/Errors/ResponseValidationException.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). 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.Errors +{ + using System; + using System.Net.Http; + + /// + /// Raised if the response data could not be deserialized into the expected model. + /// + public class ResponseValidationException : CodatPlatformException + { + + public ResponseValidationException( + string message, + HttpResponseMessage rawResponse, + string body, + Exception innerException + ): base(message, rawResponse, body, innerException) {} + } +} diff --git a/platform/Codat/Platform/Models/Errors/SDKException.cs b/platform/Codat/Platform/Models/Errors/SDKException.cs index c9445f7f6..c4239a391 100644 --- a/platform/Codat/Platform/Models/Errors/SDKException.cs +++ b/platform/Codat/Platform/Models/Errors/SDKException.cs @@ -6,36 +6,22 @@ // the code is regenerated. // //------------------------------------------------------------------------------ + #nullable enable namespace Codat.Platform.Models.Errors { using System; using System.Net.Http; - public class SDKException : Exception + public class SDKException : CodatPlatformException { - - public override string Message { get; } - public int StatusCode { get; set; } - public string Body { get; set; } - public HttpResponseMessage RawResponse { get; set; } = default!; - public SDKException(string message, int statusCode, string body, HttpResponseMessage rawResponse) - { - Message = message; - this.StatusCode = statusCode; - StatusCode = statusCode; - Body = body; - RawResponse = rawResponse; - } - - public override string ToString(){ - var body = ""; - if (Body.Length > 0) - { - body += $"\n{Body}"; - } - return Message + ": Status " + StatusCode + body; - } - + /// + /// Default API exception. + /// + public SDKException( + string message, + HttpResponseMessage rawResponse, + string body + ): base(message, rawResponse, body) {} } } diff --git a/platform/Codat/Platform/Models/Requests/AddProductResponse.cs b/platform/Codat/Platform/Models/Requests/AddProductResponse.cs index 83110dfa4..d315ae4f7 100644 --- a/platform/Codat/Platform/Models/Requests/AddProductResponse.cs +++ b/platform/Codat/Platform/Models/Requests/AddProductResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class AddProductResponse { diff --git a/platform/Codat/Platform/Models/Requests/ConfigureCustomDataTypeResponse.cs b/platform/Codat/Platform/Models/Requests/ConfigureCustomDataTypeResponse.cs index 62fb991f8..963911b1b 100644 --- a/platform/Codat/Platform/Models/Requests/ConfigureCustomDataTypeResponse.cs +++ b/platform/Codat/Platform/Models/Requests/ConfigureCustomDataTypeResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ConfigureCustomDataTypeResponse { diff --git a/platform/Codat/Platform/Models/Requests/ConfigureSupplementalDataResponse.cs b/platform/Codat/Platform/Models/Requests/ConfigureSupplementalDataResponse.cs index de359256a..63df4968e 100644 --- a/platform/Codat/Platform/Models/Requests/ConfigureSupplementalDataResponse.cs +++ b/platform/Codat/Platform/Models/Requests/ConfigureSupplementalDataResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ConfigureSupplementalDataResponse { diff --git a/platform/Codat/Platform/Models/Requests/CreateApiKeyResponse.cs b/platform/Codat/Platform/Models/Requests/CreateApiKeyResponse.cs index cded3763c..dfea00259 100644 --- a/platform/Codat/Platform/Models/Requests/CreateApiKeyResponse.cs +++ b/platform/Codat/Platform/Models/Requests/CreateApiKeyResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class CreateApiKeyResponse { diff --git a/platform/Codat/Platform/Models/Requests/CreateCompanyResponse.cs b/platform/Codat/Platform/Models/Requests/CreateCompanyResponse.cs index d79d11c4e..d3e8f2304 100644 --- a/platform/Codat/Platform/Models/Requests/CreateCompanyResponse.cs +++ b/platform/Codat/Platform/Models/Requests/CreateCompanyResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class CreateCompanyResponse { diff --git a/platform/Codat/Platform/Models/Requests/CreateConnectionResponse.cs b/platform/Codat/Platform/Models/Requests/CreateConnectionResponse.cs index dd80fc5af..9c8c87e6e 100644 --- a/platform/Codat/Platform/Models/Requests/CreateConnectionResponse.cs +++ b/platform/Codat/Platform/Models/Requests/CreateConnectionResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class CreateConnectionResponse { diff --git a/platform/Codat/Platform/Models/Requests/CreateWebhookConsumerResponse.cs b/platform/Codat/Platform/Models/Requests/CreateWebhookConsumerResponse.cs index 325ef1925..d41711b28 100644 --- a/platform/Codat/Platform/Models/Requests/CreateWebhookConsumerResponse.cs +++ b/platform/Codat/Platform/Models/Requests/CreateWebhookConsumerResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class CreateWebhookConsumerResponse { diff --git a/platform/Codat/Platform/Models/Requests/DeleteApiKeyResponse.cs b/platform/Codat/Platform/Models/Requests/DeleteApiKeyResponse.cs index a44e3eb0a..d43f3f3d0 100644 --- a/platform/Codat/Platform/Models/Requests/DeleteApiKeyResponse.cs +++ b/platform/Codat/Platform/Models/Requests/DeleteApiKeyResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class DeleteApiKeyResponse { diff --git a/platform/Codat/Platform/Models/Requests/DeleteCompanyResponse.cs b/platform/Codat/Platform/Models/Requests/DeleteCompanyResponse.cs index ff584afb1..f6a9335df 100644 --- a/platform/Codat/Platform/Models/Requests/DeleteCompanyResponse.cs +++ b/platform/Codat/Platform/Models/Requests/DeleteCompanyResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class DeleteCompanyResponse { diff --git a/platform/Codat/Platform/Models/Requests/DeleteConnectionResponse.cs b/platform/Codat/Platform/Models/Requests/DeleteConnectionResponse.cs index 4744eb39e..3e3e920b6 100644 --- a/platform/Codat/Platform/Models/Requests/DeleteConnectionResponse.cs +++ b/platform/Codat/Platform/Models/Requests/DeleteConnectionResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class DeleteConnectionResponse { diff --git a/platform/Codat/Platform/Models/Requests/DeleteWebhookConsumerResponse.cs b/platform/Codat/Platform/Models/Requests/DeleteWebhookConsumerResponse.cs index a7f4220c9..f3ebeafcc 100644 --- a/platform/Codat/Platform/Models/Requests/DeleteWebhookConsumerResponse.cs +++ b/platform/Codat/Platform/Models/Requests/DeleteWebhookConsumerResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class DeleteWebhookConsumerResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetCompanyAccessTokenResponse.cs b/platform/Codat/Platform/Models/Requests/GetCompanyAccessTokenResponse.cs index 1fac08485..d05a2db4b 100644 --- a/platform/Codat/Platform/Models/Requests/GetCompanyAccessTokenResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetCompanyAccessTokenResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetCompanyAccessTokenResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetCompanyDataStatusResponse.cs b/platform/Codat/Platform/Models/Requests/GetCompanyDataStatusResponse.cs index 954e66d39..700d631b9 100644 --- a/platform/Codat/Platform/Models/Requests/GetCompanyDataStatusResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetCompanyDataStatusResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetCompanyDataStatusResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetCompanyPushHistoryResponse.cs b/platform/Codat/Platform/Models/Requests/GetCompanyPushHistoryResponse.cs index 5b7bd6a55..2551dba4e 100644 --- a/platform/Codat/Platform/Models/Requests/GetCompanyPushHistoryResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetCompanyPushHistoryResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetCompanyPushHistoryResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetCompanyResponse.cs b/platform/Codat/Platform/Models/Requests/GetCompanyResponse.cs index f03c80ed6..2ffdf1882 100644 --- a/platform/Codat/Platform/Models/Requests/GetCompanyResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetCompanyResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetCompanyResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetConnectionManagementAccessTokenResponse.cs b/platform/Codat/Platform/Models/Requests/GetConnectionManagementAccessTokenResponse.cs index 3fcf0b61c..52455e619 100644 --- a/platform/Codat/Platform/Models/Requests/GetConnectionManagementAccessTokenResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetConnectionManagementAccessTokenResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetConnectionManagementAccessTokenResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetConnectionManagementCorsSettingsResponse.cs b/platform/Codat/Platform/Models/Requests/GetConnectionManagementCorsSettingsResponse.cs index 443af778d..b9f6a8ae6 100644 --- a/platform/Codat/Platform/Models/Requests/GetConnectionManagementCorsSettingsResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetConnectionManagementCorsSettingsResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetConnectionManagementCorsSettingsResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetConnectionResponse.cs b/platform/Codat/Platform/Models/Requests/GetConnectionResponse.cs index 4efcebbd7..b89785d8a 100644 --- a/platform/Codat/Platform/Models/Requests/GetConnectionResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetConnectionResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetConnectionResponse { diff --git a/platform/Codat/Platform/Models/Requests/ListRulesResponse.cs b/platform/Codat/Platform/Models/Requests/GetCorsSettingsResponse.cs similarity index 87% rename from platform/Codat/Platform/Models/Requests/ListRulesResponse.cs rename to platform/Codat/Platform/Models/Requests/GetCorsSettingsResponse.cs index 05836fac3..65248d3e8 100644 --- a/platform/Codat/Platform/Models/Requests/ListRulesResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetCorsSettingsResponse.cs @@ -11,10 +11,10 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; - public class ListRulesResponse + public class GetCorsSettingsResponse { /// @@ -33,8 +33,8 @@ public class ListRulesResponse public HttpResponseMessage RawResponse { get; set; } = default!; /// - /// OK + /// Success /// - public Models.Components.Webhooks? Webhooks { get; set; } + public ConnectionManagementAllowedOrigins? ConnectionManagementAllowedOrigins { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Requests/GetCreateUpdateModelOptionsByDataTypeResponse.cs b/platform/Codat/Platform/Models/Requests/GetCreateUpdateModelOptionsByDataTypeResponse.cs index 9e0cf4269..497acba9d 100644 --- a/platform/Codat/Platform/Models/Requests/GetCreateUpdateModelOptionsByDataTypeResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetCreateUpdateModelOptionsByDataTypeResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetCreateUpdateModelOptionsByDataTypeResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetCustomDataTypeConfigurationResponse.cs b/platform/Codat/Platform/Models/Requests/GetCustomDataTypeConfigurationResponse.cs index 6a529b55b..f35a5d4ca 100644 --- a/platform/Codat/Platform/Models/Requests/GetCustomDataTypeConfigurationResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetCustomDataTypeConfigurationResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetCustomDataTypeConfigurationResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetIntegrationResponse.cs b/platform/Codat/Platform/Models/Requests/GetIntegrationResponse.cs index aedae4060..d6c286bc4 100644 --- a/platform/Codat/Platform/Models/Requests/GetIntegrationResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetIntegrationResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetIntegrationResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetIntegrationsBrandingResponse.cs b/platform/Codat/Platform/Models/Requests/GetIntegrationsBrandingResponse.cs index a4d260213..61c160d6e 100644 --- a/platform/Codat/Platform/Models/Requests/GetIntegrationsBrandingResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetIntegrationsBrandingResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetIntegrationsBrandingResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetProfileResponse.cs b/platform/Codat/Platform/Models/Requests/GetProfileResponse.cs index 3fdd2ac67..caee39f43 100644 --- a/platform/Codat/Platform/Models/Requests/GetProfileResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetProfileResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetProfileResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetProfileSyncSettingsResponse.cs b/platform/Codat/Platform/Models/Requests/GetProfileSyncSettingsResponse.cs index 1b24a01be..b830697d0 100644 --- a/platform/Codat/Platform/Models/Requests/GetProfileSyncSettingsResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetProfileSyncSettingsResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetProfileSyncSettingsResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetPullOperationResponse.cs b/platform/Codat/Platform/Models/Requests/GetPullOperationResponse.cs index 83a3570ee..b51417b58 100644 --- a/platform/Codat/Platform/Models/Requests/GetPullOperationResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetPullOperationResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetPullOperationResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetPushOperationResponse.cs b/platform/Codat/Platform/Models/Requests/GetPushOperationResponse.cs index b3ab8dfa6..85feba870 100644 --- a/platform/Codat/Platform/Models/Requests/GetPushOperationResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetPushOperationResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetPushOperationResponse { diff --git a/platform/Codat/Platform/Models/Components/DataSyncCompletedWebhookData.cs b/platform/Codat/Platform/Models/Requests/GetReadValidationResultsRequest.cs similarity index 59% rename from platform/Codat/Platform/Models/Components/DataSyncCompletedWebhookData.cs rename to platform/Codat/Platform/Models/Requests/GetReadValidationResultsRequest.cs index 36eebb6e5..0cecf54de 100644 --- a/platform/Codat/Platform/Models/Components/DataSyncCompletedWebhookData.cs +++ b/platform/Codat/Platform/Models/Requests/GetReadValidationResultsRequest.cs @@ -7,25 +7,23 @@ // //------------------------------------------------------------------------------ #nullable enable -namespace Codat.Platform.Models.Components +namespace Codat.Platform.Models.Requests { - using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using Newtonsoft.Json; - public class DataSyncCompletedWebhookData + public class GetReadValidationResultsRequest { /// - /// Available data types + /// Unique identifier for a company. /// - [JsonProperty("dataType")] - public PropertieDataType? DataType { get; set; } + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId")] + public string CompanyId { get; set; } = default!; /// /// Unique identifier for the dataset that completed its sync. /// - [JsonProperty("datasetId")] - public string? DatasetId { get; set; } + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=datasetId")] + public string DatasetId { get; set; } = default!; } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Requests/CreateRuleResponse.cs b/platform/Codat/Platform/Models/Requests/GetReadValidationResultsResponse.cs similarity index 91% rename from platform/Codat/Platform/Models/Requests/CreateRuleResponse.cs rename to platform/Codat/Platform/Models/Requests/GetReadValidationResultsResponse.cs index 3e9c7d2cb..e5b0e39c4 100644 --- a/platform/Codat/Platform/Models/Requests/CreateRuleResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetReadValidationResultsResponse.cs @@ -11,10 +11,10 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; - public class CreateRuleResponse + public class GetReadValidationResultsResponse { /// @@ -35,6 +35,6 @@ public class CreateRuleResponse /// /// OK /// - public Webhook? Webhook { get; set; } + public ValidationResult? ValidationResult { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Requests/GetSupplementalDataConfigurationResponse.cs b/platform/Codat/Platform/Models/Requests/GetSupplementalDataConfigurationResponse.cs index 8b508074c..7161b7542 100644 --- a/platform/Codat/Platform/Models/Requests/GetSupplementalDataConfigurationResponse.cs +++ b/platform/Codat/Platform/Models/Requests/GetSupplementalDataConfigurationResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class GetSupplementalDataConfigurationResponse { diff --git a/platform/Codat/Platform/Models/Requests/ListApiKeysResponse.cs b/platform/Codat/Platform/Models/Requests/ListApiKeysResponse.cs index 71d92e06d..d10436876 100644 --- a/platform/Codat/Platform/Models/Requests/ListApiKeysResponse.cs +++ b/platform/Codat/Platform/Models/Requests/ListApiKeysResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ListApiKeysResponse { diff --git a/platform/Codat/Platform/Models/Requests/ListCompaniesRequest.cs b/platform/Codat/Platform/Models/Requests/ListCompaniesRequest.cs index 18dd43938..7fb7166ec 100644 --- a/platform/Codat/Platform/Models/Requests/ListCompaniesRequest.cs +++ b/platform/Codat/Platform/Models/Requests/ListCompaniesRequest.cs @@ -37,5 +37,11 @@ public class ListCompaniesRequest /// [SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy")] public string? OrderBy { get; set; } + + /// + /// Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with Codat’s query language. + /// + [SpeakeasyMetadata("queryParam:style=form,explode=true,name=tags")] + public string? Tags { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Requests/ListCompaniesResponse.cs b/platform/Codat/Platform/Models/Requests/ListCompaniesResponse.cs index 73bd9b973..d03913fdf 100644 --- a/platform/Codat/Platform/Models/Requests/ListCompaniesResponse.cs +++ b/platform/Codat/Platform/Models/Requests/ListCompaniesResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ListCompaniesResponse { diff --git a/platform/Codat/Platform/Models/Requests/ListConnectionsResponse.cs b/platform/Codat/Platform/Models/Requests/ListConnectionsResponse.cs index a81ccfb4b..002556967 100644 --- a/platform/Codat/Platform/Models/Requests/ListConnectionsResponse.cs +++ b/platform/Codat/Platform/Models/Requests/ListConnectionsResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ListConnectionsResponse { diff --git a/platform/Codat/Platform/Models/Requests/ListCustomDataTypeRecordsResponse.cs b/platform/Codat/Platform/Models/Requests/ListCustomDataTypeRecordsResponse.cs index 16f16772d..f9df5842b 100644 --- a/platform/Codat/Platform/Models/Requests/ListCustomDataTypeRecordsResponse.cs +++ b/platform/Codat/Platform/Models/Requests/ListCustomDataTypeRecordsResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ListCustomDataTypeRecordsResponse { diff --git a/platform/Codat/Platform/Models/Requests/ListIntegrationsResponse.cs b/platform/Codat/Platform/Models/Requests/ListIntegrationsResponse.cs index 514e97d01..7541aac41 100644 --- a/platform/Codat/Platform/Models/Requests/ListIntegrationsResponse.cs +++ b/platform/Codat/Platform/Models/Requests/ListIntegrationsResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ListIntegrationsResponse { diff --git a/platform/Codat/Platform/Models/Requests/ListPullOperationsResponse.cs b/platform/Codat/Platform/Models/Requests/ListPullOperationsResponse.cs index 4d71ce912..915cce7d7 100644 --- a/platform/Codat/Platform/Models/Requests/ListPullOperationsResponse.cs +++ b/platform/Codat/Platform/Models/Requests/ListPullOperationsResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ListPullOperationsResponse { diff --git a/platform/Codat/Platform/Models/Requests/ListRulesRequest.cs b/platform/Codat/Platform/Models/Requests/ListRulesRequest.cs deleted file mode 100644 index 1f7784f87..000000000 --- a/platform/Codat/Platform/Models/Requests/ListRulesRequest.cs +++ /dev/null @@ -1,41 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Requests -{ - using Codat.Platform.Utils; - - public class ListRulesRequest - { - - /// - /// Page number. Read more. - /// - [SpeakeasyMetadata("queryParam:style=form,explode=true,name=page")] - public int? Page { get; set; } = 1; - - /// - /// Number of records to return in a page. Read more. - /// - [SpeakeasyMetadata("queryParam:style=form,explode=true,name=pageSize")] - public int? PageSize { get; set; } = 100; - - /// - /// Codat query string. Read more. - /// - [SpeakeasyMetadata("queryParam:style=form,explode=true,name=query")] - public string? Query { get; set; } - - /// - /// Field to order results by. Read more. - /// - [SpeakeasyMetadata("queryParam:style=form,explode=true,name=orderBy")] - public string? OrderBy { get; set; } - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Requests/ListWebhookConsumersResponse.cs b/platform/Codat/Platform/Models/Requests/ListWebhookConsumersResponse.cs index 495ea9a96..942c355d9 100644 --- a/platform/Codat/Platform/Models/Requests/ListWebhookConsumersResponse.cs +++ b/platform/Codat/Platform/Models/Requests/ListWebhookConsumersResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ListWebhookConsumersResponse { diff --git a/platform/Codat/Platform/Models/Requests/RefreshCompanyDataResponse.cs b/platform/Codat/Platform/Models/Requests/RefreshCompanyDataResponse.cs index 7435fbd72..9e43904c2 100644 --- a/platform/Codat/Platform/Models/Requests/RefreshCompanyDataResponse.cs +++ b/platform/Codat/Platform/Models/Requests/RefreshCompanyDataResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class RefreshCompanyDataResponse { diff --git a/platform/Codat/Platform/Models/Requests/RefreshCustomDataTypeResponse.cs b/platform/Codat/Platform/Models/Requests/RefreshCustomDataTypeResponse.cs index 7aacf2ac7..541774d97 100644 --- a/platform/Codat/Platform/Models/Requests/RefreshCustomDataTypeResponse.cs +++ b/platform/Codat/Platform/Models/Requests/RefreshCustomDataTypeResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class RefreshCustomDataTypeResponse { diff --git a/platform/Codat/Platform/Models/Requests/RefreshDataTypeResponse.cs b/platform/Codat/Platform/Models/Requests/RefreshDataTypeResponse.cs index c2e83d88e..479f99d72 100644 --- a/platform/Codat/Platform/Models/Requests/RefreshDataTypeResponse.cs +++ b/platform/Codat/Platform/Models/Requests/RefreshDataTypeResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class RefreshDataTypeResponse { diff --git a/platform/Codat/Platform/Models/Components/DatasetDataChangedWebhookData.cs b/platform/Codat/Platform/Models/Requests/RefreshProductDataRequest.cs similarity index 52% rename from platform/Codat/Platform/Models/Components/DatasetDataChangedWebhookData.cs rename to platform/Codat/Platform/Models/Requests/RefreshProductDataRequest.cs index 8d53b7017..b79bc114a 100644 --- a/platform/Codat/Platform/Models/Components/DatasetDataChangedWebhookData.cs +++ b/platform/Codat/Platform/Models/Requests/RefreshProductDataRequest.cs @@ -7,25 +7,23 @@ // //------------------------------------------------------------------------------ #nullable enable -namespace Codat.Platform.Models.Components +namespace Codat.Platform.Models.Requests { - using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using Newtonsoft.Json; - public class DatasetDataChangedWebhookData + public class RefreshProductDataRequest { /// - /// Available data types + /// Unique identifier for a company. /// - [JsonProperty("dataType")] - public PropertieDataType? DataType { get; set; } + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId")] + public string CompanyId { get; set; } = default!; /// - /// Unique identifier for the dataset that completed its sync. + /// Human-readable product identifier for a product. /// - [JsonProperty("datasetId")] - public string? DatasetId { get; set; } + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=productIdentifier")] + public string ProductIdentifier { get; set; } = default!; } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Webhooks/DatasetDataChangedResponse.cs b/platform/Codat/Platform/Models/Requests/RefreshProductDataResponse.cs similarity index 92% rename from platform/Codat/Platform/Models/Webhooks/DatasetDataChangedResponse.cs rename to platform/Codat/Platform/Models/Requests/RefreshProductDataResponse.cs index dbd75bc66..c648670f2 100644 --- a/platform/Codat/Platform/Models/Webhooks/DatasetDataChangedResponse.cs +++ b/platform/Codat/Platform/Models/Requests/RefreshProductDataResponse.cs @@ -7,13 +7,13 @@ // //------------------------------------------------------------------------------ #nullable enable -namespace Codat.Platform.Models.Webhooks +namespace Codat.Platform.Models.Requests { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; - public class DatasetDataChangedResponse + public class RefreshProductDataResponse { /// diff --git a/platform/Codat/Platform/Models/Requests/RemoveProductResponse.cs b/platform/Codat/Platform/Models/Requests/RemoveProductResponse.cs index 5dd4330d4..3c75d0edc 100644 --- a/platform/Codat/Platform/Models/Requests/RemoveProductResponse.cs +++ b/platform/Codat/Platform/Models/Requests/RemoveProductResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class RemoveProductResponse { diff --git a/platform/Codat/Platform/Models/Requests/GetWebhookRequest.cs b/platform/Codat/Platform/Models/Requests/ReplaceCompanyRequest.cs similarity index 64% rename from platform/Codat/Platform/Models/Requests/GetWebhookRequest.cs rename to platform/Codat/Platform/Models/Requests/ReplaceCompanyRequest.cs index 81c7450d9..33b489412 100644 --- a/platform/Codat/Platform/Models/Requests/GetWebhookRequest.cs +++ b/platform/Codat/Platform/Models/Requests/ReplaceCompanyRequest.cs @@ -9,15 +9,19 @@ #nullable enable namespace Codat.Platform.Models.Requests { + using Codat.Platform.Models.Components; using Codat.Platform.Utils; - public class GetWebhookRequest + public class ReplaceCompanyRequest { /// - /// Unique ID of the webhook or rule. + /// Unique identifier for a company. /// - [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ruleId")] - public string RuleId { get; set; } = default!; + [SpeakeasyMetadata("pathParam:style=simple,explode=false,name=companyId")] + public string CompanyId { get; set; } = default!; + + [SpeakeasyMetadata("request:mediaType=application/json")] + public CompanyRequestBody? CompanyRequestBody { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Requests/GetWebhookResponse.cs b/platform/Codat/Platform/Models/Requests/ReplaceCompanyResponse.cs similarity index 93% rename from platform/Codat/Platform/Models/Requests/GetWebhookResponse.cs rename to platform/Codat/Platform/Models/Requests/ReplaceCompanyResponse.cs index fbb4f0369..6a7bd5482 100644 --- a/platform/Codat/Platform/Models/Requests/GetWebhookResponse.cs +++ b/platform/Codat/Platform/Models/Requests/ReplaceCompanyResponse.cs @@ -11,10 +11,10 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; - public class GetWebhookResponse + public class ReplaceCompanyResponse { /// @@ -35,6 +35,6 @@ public class GetWebhookResponse /// /// OK /// - public Webhook? Webhook { get; set; } + public Company? Company { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Requests/SetConnectionManagementCorsSettingsResponse.cs b/platform/Codat/Platform/Models/Requests/SetConnectionManagementCorsSettingsResponse.cs index 1ad6a26b4..2b9bf91df 100644 --- a/platform/Codat/Platform/Models/Requests/SetConnectionManagementCorsSettingsResponse.cs +++ b/platform/Codat/Platform/Models/Requests/SetConnectionManagementCorsSettingsResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class SetConnectionManagementCorsSettingsResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse1.cs b/platform/Codat/Platform/Models/Requests/SetCorsSettingsResponse.cs similarity index 77% rename from platform/Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse1.cs rename to platform/Codat/Platform/Models/Requests/SetCorsSettingsResponse.cs index a1af47fd1..97643a30f 100644 --- a/platform/Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse1.cs +++ b/platform/Codat/Platform/Models/Requests/SetCorsSettingsResponse.cs @@ -7,13 +7,14 @@ // //------------------------------------------------------------------------------ #nullable enable -namespace Codat.Platform.Models.Webhooks +namespace Codat.Platform.Models.Requests { + using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; - public class ClientRateLimitReachedResponse1 + public class SetCorsSettingsResponse { /// @@ -30,5 +31,10 @@ public class ClientRateLimitReachedResponse1 /// Raw HTTP response; suitable for custom response parsing /// public HttpResponseMessage RawResponse { get; set; } = default!; + + /// + /// Success + /// + public ConnectionManagementAllowedOrigins? ConnectionManagementAllowedOrigins { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Requests/UnlinkConnectionResponse.cs b/platform/Codat/Platform/Models/Requests/UnlinkConnectionResponse.cs index d232e4da9..c146fb87f 100644 --- a/platform/Codat/Platform/Models/Requests/UnlinkConnectionResponse.cs +++ b/platform/Codat/Platform/Models/Requests/UnlinkConnectionResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class UnlinkConnectionResponse { diff --git a/platform/Codat/Platform/Models/Requests/UpdateCompanyRequest.cs b/platform/Codat/Platform/Models/Requests/UpdateCompanyRequest.cs index 20deeb89d..f58f20c6a 100644 --- a/platform/Codat/Platform/Models/Requests/UpdateCompanyRequest.cs +++ b/platform/Codat/Platform/Models/Requests/UpdateCompanyRequest.cs @@ -22,6 +22,6 @@ public class UpdateCompanyRequest public string CompanyId { get; set; } = default!; [SpeakeasyMetadata("request:mediaType=application/json")] - public CompanyRequestBody? CompanyRequestBody { get; set; } + public CompanyUpdateRequest? CompanyUpdateRequest { get; set; } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Requests/UpdateCompanyResponse.cs b/platform/Codat/Platform/Models/Requests/UpdateCompanyResponse.cs index 0be6f05a4..a353b748c 100644 --- a/platform/Codat/Platform/Models/Requests/UpdateCompanyResponse.cs +++ b/platform/Codat/Platform/Models/Requests/UpdateCompanyResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class UpdateCompanyResponse { diff --git a/platform/Codat/Platform/Models/Requests/UpdateConnectionAuthorizationResponse.cs b/platform/Codat/Platform/Models/Requests/UpdateConnectionAuthorizationResponse.cs index 7e2e7dae9..11d28ff4e 100644 --- a/platform/Codat/Platform/Models/Requests/UpdateConnectionAuthorizationResponse.cs +++ b/platform/Codat/Platform/Models/Requests/UpdateConnectionAuthorizationResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class UpdateConnectionAuthorizationResponse { diff --git a/platform/Codat/Platform/Models/Requests/UpdateProfileResponse.cs b/platform/Codat/Platform/Models/Requests/UpdateProfileResponse.cs index 7cad3634e..8980967e3 100644 --- a/platform/Codat/Platform/Models/Requests/UpdateProfileResponse.cs +++ b/platform/Codat/Platform/Models/Requests/UpdateProfileResponse.cs @@ -11,8 +11,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Models.Components; using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class UpdateProfileResponse { diff --git a/platform/Codat/Platform/Models/Requests/UpdateProfileSyncSettingsResponse.cs b/platform/Codat/Platform/Models/Requests/UpdateProfileSyncSettingsResponse.cs index 25ac6dfe4..5478414d7 100644 --- a/platform/Codat/Platform/Models/Requests/UpdateProfileSyncSettingsResponse.cs +++ b/platform/Codat/Platform/Models/Requests/UpdateProfileSyncSettingsResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Requests { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class UpdateProfileSyncSettingsResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse.cs b/platform/Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse.cs index b1a009440..5ceb5c527 100644 --- a/platform/Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/ClientRateLimitReachedResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ClientRateLimitReachedResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse.cs b/platform/Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse.cs index 3c4b3bff2..b0c8256cc 100644 --- a/platform/Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ClientRateLimitResetResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse1.cs b/platform/Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse1.cs deleted file mode 100644 index 83fe1c475..000000000 --- a/platform/Codat/Platform/Models/Webhooks/ClientRateLimitResetResponse1.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Webhooks -{ - using Codat.Platform.Utils; - using System.Net.Http; - using System; - - public class ClientRateLimitResetResponse1 - { - - /// - /// HTTP response content type for this operation - /// - public string? ContentType { get; set; } = default!; - - /// - /// HTTP response status code for this operation - /// - public int StatusCode { get; set; } = default!; - - /// - /// Raw HTTP response; suitable for custom response parsing - /// - public HttpResponseMessage RawResponse { get; set; } = default!; - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Webhooks/CompanyCreatedResponse.cs b/platform/Codat/Platform/Models/Webhooks/CompanyCreatedResponse.cs index f2c183c4e..a50823406 100644 --- a/platform/Codat/Platform/Models/Webhooks/CompanyCreatedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/CompanyCreatedResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class CompanyCreatedResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.cs b/platform/Codat/Platform/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.cs deleted file mode 100644 index ee7c4d414..000000000 --- a/platform/Codat/Platform/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Webhooks -{ - using Codat.Platform.Utils; - using System.Net.Http; - using System; - - public class CompanyDataConnectionStatusChangedResponse - { - - /// - /// HTTP response content type for this operation - /// - public string? ContentType { get; set; } = default!; - - /// - /// HTTP response status code for this operation - /// - public int StatusCode { get; set; } = default!; - - /// - /// Raw HTTP response; suitable for custom response parsing - /// - public HttpResponseMessage RawResponse { get; set; } = default!; - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Webhooks/CompanyDeletedResponse.cs b/platform/Codat/Platform/Models/Webhooks/CompanyDeletedResponse.cs index 9cc2b9944..e2ed87b21 100644 --- a/platform/Codat/Platform/Models/Webhooks/CompanyDeletedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/CompanyDeletedResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class CompanyDeletedResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/ConnectionConnectedResponse.cs b/platform/Codat/Platform/Models/Webhooks/ConnectionConnectedResponse.cs index 6fc95aecd..004dc52a9 100644 --- a/platform/Codat/Platform/Models/Webhooks/ConnectionConnectedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/ConnectionConnectedResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ConnectionConnectedResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/ConnectionCreatedResponse.cs b/platform/Codat/Platform/Models/Webhooks/ConnectionCreatedResponse.cs index 082746b53..43208d99b 100644 --- a/platform/Codat/Platform/Models/Webhooks/ConnectionCreatedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/ConnectionCreatedResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ConnectionCreatedResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/ConnectionDeletedResponse.cs b/platform/Codat/Platform/Models/Webhooks/ConnectionDeletedResponse.cs index 5e05dd825..a34159961 100644 --- a/platform/Codat/Platform/Models/Webhooks/ConnectionDeletedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/ConnectionDeletedResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ConnectionDeletedResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/ConnectionDisconnectedResponse.cs b/platform/Codat/Platform/Models/Webhooks/ConnectionDisconnectedResponse.cs index 336ce12d8..00b282564 100644 --- a/platform/Codat/Platform/Models/Webhooks/ConnectionDisconnectedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/ConnectionDisconnectedResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ConnectionDisconnectedResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/ConnectionFailedResponse.cs b/platform/Codat/Platform/Models/Webhooks/ConnectionFailedResponse.cs index f930ee92e..083ee29a9 100644 --- a/platform/Codat/Platform/Models/Webhooks/ConnectionFailedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/ConnectionFailedResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ConnectionFailedResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/ConnectionReconnectedResponse.cs b/platform/Codat/Platform/Models/Webhooks/ConnectionReconnectedResponse.cs index c5e18e014..961b9a1bf 100644 --- a/platform/Codat/Platform/Models/Webhooks/ConnectionReconnectedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/ConnectionReconnectedResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ConnectionReconnectedResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/DataSyncCompletedResponse.cs b/platform/Codat/Platform/Models/Webhooks/DataSyncCompletedResponse.cs deleted file mode 100644 index 6b3008f34..000000000 --- a/platform/Codat/Platform/Models/Webhooks/DataSyncCompletedResponse.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Webhooks -{ - using Codat.Platform.Utils; - using System.Net.Http; - using System; - - public class DataSyncCompletedResponse - { - - /// - /// HTTP response content type for this operation - /// - public string? ContentType { get; set; } = default!; - - /// - /// HTTP response status code for this operation - /// - public int StatusCode { get; set; } = default!; - - /// - /// Raw HTTP response; suitable for custom response parsing - /// - public HttpResponseMessage RawResponse { get; set; } = default!; - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Webhooks/DataTypeWriteSuccessfulResponse.cs b/platform/Codat/Platform/Models/Webhooks/DataTypeWriteSuccessfulResponse.cs index 81f1f257a..54c81ca8e 100644 --- a/platform/Codat/Platform/Models/Webhooks/DataTypeWriteSuccessfulResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/DataTypeWriteSuccessfulResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class DataTypeWriteSuccessfulResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/DataTypeWriteUnsuccessfulResponse.cs b/platform/Codat/Platform/Models/Webhooks/DataTypeWriteUnsuccessfulResponse.cs index f54a21f03..fe452c473 100644 --- a/platform/Codat/Platform/Models/Webhooks/DataTypeWriteUnsuccessfulResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/DataTypeWriteUnsuccessfulResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class DataTypeWriteUnsuccessfulResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.cs b/platform/Codat/Platform/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.cs deleted file mode 100644 index 81291faf2..000000000 --- a/platform/Codat/Platform/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Webhooks -{ - using Codat.Platform.Utils; - using System.Net.Http; - using System; - - public class DatasetStatusHasChangedToAnErrorStateResponse - { - - /// - /// HTTP response content type for this operation - /// - public string? ContentType { get; set; } = default!; - - /// - /// HTTP response status code for this operation - /// - public int StatusCode { get; set; } = default!; - - /// - /// Raw HTTP response; suitable for custom response parsing - /// - public HttpResponseMessage RawResponse { get; set; } = default!; - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Webhooks/NewCompanySynchronizedResponse.cs b/platform/Codat/Platform/Models/Webhooks/NewCompanySynchronizedResponse.cs deleted file mode 100644 index 09befe036..000000000 --- a/platform/Codat/Platform/Models/Webhooks/NewCompanySynchronizedResponse.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Webhooks -{ - using Codat.Platform.Utils; - using System.Net.Http; - using System; - - public class NewCompanySynchronizedResponse - { - - /// - /// HTTP response content type for this operation - /// - public string? ContentType { get; set; } = default!; - - /// - /// HTTP response status code for this operation - /// - public int StatusCode { get; set; } = default!; - - /// - /// Raw HTTP response; suitable for custom response parsing - /// - public HttpResponseMessage RawResponse { get; set; } = default!; - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Webhooks/PushOperationHasTimedOutResponse.cs b/platform/Codat/Platform/Models/Webhooks/PushOperationHasTimedOutResponse.cs deleted file mode 100644 index a5acbb2d6..000000000 --- a/platform/Codat/Platform/Models/Webhooks/PushOperationHasTimedOutResponse.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Webhooks -{ - using Codat.Platform.Utils; - using System.Net.Http; - using System; - - public class PushOperationHasTimedOutResponse - { - - /// - /// HTTP response content type for this operation - /// - public string? ContentType { get; set; } = default!; - - /// - /// HTTP response status code for this operation - /// - public int StatusCode { get; set; } = default!; - - /// - /// Raw HTTP response; suitable for custom response parsing - /// - public HttpResponseMessage RawResponse { get; set; } = default!; - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Webhooks/PushOperationStatusHasChangedResponse.cs b/platform/Codat/Platform/Models/Webhooks/PushOperationStatusHasChangedResponse.cs deleted file mode 100644 index f7e8eda28..000000000 --- a/platform/Codat/Platform/Models/Webhooks/PushOperationStatusHasChangedResponse.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by Speakeasy (https://speakeasy.com). 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.Webhooks -{ - using Codat.Platform.Utils; - using System.Net.Http; - using System; - - public class PushOperationStatusHasChangedResponse - { - - /// - /// HTTP response content type for this operation - /// - public string? ContentType { get; set; } = default!; - - /// - /// HTTP response status code for this operation - /// - public int StatusCode { get; set; } = default!; - - /// - /// Raw HTTP response; suitable for custom response parsing - /// - public HttpResponseMessage RawResponse { get; set; } = default!; - } -} \ No newline at end of file diff --git a/platform/Codat/Platform/Models/Webhooks/ReadCompletedInitialResponse.cs b/platform/Codat/Platform/Models/Webhooks/ReadCompletedInitialResponse.cs index 804590c68..0b22529ac 100644 --- a/platform/Codat/Platform/Models/Webhooks/ReadCompletedInitialResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/ReadCompletedInitialResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ReadCompletedInitialResponse { diff --git a/platform/Codat/Platform/Models/Webhooks/ReadCompletedResponse.cs b/platform/Codat/Platform/Models/Webhooks/ReadCompletedResponse.cs index 9689a053f..21a26428c 100644 --- a/platform/Codat/Platform/Models/Webhooks/ReadCompletedResponse.cs +++ b/platform/Codat/Platform/Models/Webhooks/ReadCompletedResponse.cs @@ -10,8 +10,8 @@ namespace Codat.Platform.Models.Webhooks { using Codat.Platform.Utils; - using System.Net.Http; using System; + using System.Net.Http; public class ReadCompletedResponse { diff --git a/platform/Codat/Platform/PushData.cs b/platform/Codat/Platform/PushData.cs index 82bcc08fe..002c0cf73 100644 --- a/platform/Codat/Platform/PushData.cs +++ b/platform/Codat/Platform/PushData.cs @@ -13,14 +13,14 @@ namespace Codat.Platform using Codat.Platform.Models.Components; using Codat.Platform.Models.Errors; using Codat.Platform.Models.Requests; - using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Initiate and monitor Create, Update, and Delete operations. @@ -36,12 +36,7 @@ public interface IPushData ///
/// Before pushing data into accounting software, it is often necessary to collect some details from the user as to how they would like the data to be inserted. This includes names and amounts on transactional entities, but also factors such as categorisation of entities, which is often handled differently between different accounting software. A good example of this is specifying where on the balance sheet/profit and loss reports the user would like a newly-created nominal account to appear.
///
- /// Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented "options" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field.
- ///
- ///
- /// > **Supported Integrations**
- /// >
- /// > Check out our coverage explorer for integrations that support push (POST/PUT methods). + /// Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented "options" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field. /// ///
Task GetModelOptionsAsync(GetCreateUpdateModelOptionsByDataTypeRequest request, RetryConfig? retryConfig = null); @@ -76,19 +71,12 @@ public class PushData: IPushData { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "6.0.0"; - private const string _sdkGenVersion = "2.462.1"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public PushData(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public PushData(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -98,14 +86,14 @@ public async Task GetModelOptions var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/options/{dataType}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-create-update-model-options-by-data-type", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-create-update-model-options-by-data-type", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -139,8 +127,8 @@ public async Task GetModelOptions Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -180,7 +168,17 @@ public async Task GetModelOptions { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + PushOption obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into PushOption.", httpResponse, httpResponseBody, ex); + } + var response = new GetCreateUpdateModelOptionsByDataTypeResponse() { StatusCode = responseStatusCode, @@ -191,24 +189,58 @@ public async Task GetModelOptions return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task ListOperationsAsync(GetCompanyPushHistoryRequest request, RetryConfig? retryConfig = null) @@ -217,14 +249,14 @@ public async Task ListOperationsAsync(GetCompanyP var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/push", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-company-push-history", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-company-push-history", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -258,8 +290,8 @@ public async Task ListOperationsAsync(GetCompanyP Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -299,7 +331,17 @@ public async Task ListOperationsAsync(GetCompanyP { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + PushOperations obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into PushOperations.", httpResponse, httpResponseBody, ex); + } + var response = new GetCompanyPushHistoryResponse() { StatusCode = responseStatusCode, @@ -310,24 +352,58 @@ public async Task ListOperationsAsync(GetCompanyP return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task GetOperationAsync(GetPushOperationRequest request, RetryConfig? retryConfig = null) @@ -336,14 +412,14 @@ public async Task GetOperationAsync(GetPushOperationRe var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/push/{pushOperationKey}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-push-operation", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-push-operation", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -377,8 +453,8 @@ public async Task GetOperationAsync(GetPushOperationRe Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -418,7 +494,17 @@ public async Task GetOperationAsync(GetPushOperationRe { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + PushOperation obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into PushOperation.", httpResponse, httpResponseBody, ex); + } + var response = new GetPushOperationResponse() { StatusCode = responseStatusCode, @@ -429,24 +515,58 @@ public async Task GetOperationAsync(GetPushOperationRe return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } } } \ No newline at end of file diff --git a/platform/Codat/Platform/ReadData.cs b/platform/Codat/Platform/ReadData.cs new file mode 100644 index 000000000..8569e026f --- /dev/null +++ b/platform/Codat/Platform/ReadData.cs @@ -0,0 +1,225 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). 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 +{ + using Codat.Platform.Hooks; + using Codat.Platform.Models.Components; + using Codat.Platform.Models.Errors; + using Codat.Platform.Models.Requests; + using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; + using Newtonsoft.Json; + using System; + using System.Collections.Generic; + using System.Net.Http; + using System.Net.Http.Headers; + using System.Threading.Tasks; + + /// + /// View validation outcomes for completed read data operations. + /// + public interface IReadData + { + + /// + /// Get validation results + /// + /// + /// Use the **Get validation results** endpoint to review warnings and errors encountered during the data type validation phase.
+ ///
+ /// The validation result schema contains two message arrays:
+ ///
+ /// - **`warnings`** array lists potential issues with the data type that may require attention but don't block usage.
+ /// - **`errors`** array contains critical issues that must be resolved before the data type can be used. + ///
+ ///
+ Task GetValidationResultsAsync(GetReadValidationResultsRequest request, RetryConfig? retryConfig = null); + } + + /// + /// View validation outcomes for completed read data operations. + /// + public class ReadData: IReadData + { + public SDKConfig SDKConfiguration { get; private set; } + private const string _language = "csharp"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; + private const string _openapiDocVersion = "3.0.0"; + + public ReadData(SDKConfig config) + { + SDKConfiguration = config; + } + + public async Task GetValidationResultsAsync(GetReadValidationResultsRequest request, RetryConfig? retryConfig = null) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/sync/{datasetId}/validation", request); + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-read-validation-results", null, SDKConfiguration.SecuritySource); + + 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 SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + + HttpResponseMessage httpResponse; + try + { + 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); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ValidationResult obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ValidationResult.", httpResponse, httpResponseBody, ex); + } + + var response = new GetReadValidationResultsResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.ValidationResult = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + } +} \ No newline at end of file diff --git a/platform/Codat/Platform/RefreshData.cs b/platform/Codat/Platform/RefreshData.cs index bab97410d..cd9df6c5e 100644 --- a/platform/Codat/Platform/RefreshData.cs +++ b/platform/Codat/Platform/RefreshData.cs @@ -13,14 +13,14 @@ namespace Codat.Platform using Codat.Platform.Models.Components; using Codat.Platform.Models.Errors; using Codat.Platform.Models.Requests; - using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Initiate data refreshes, view pull status and history. @@ -87,19 +87,12 @@ public class RefreshData: IRefreshData { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "6.0.0"; - private const string _sdkGenVersion = "2.462.1"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public RefreshData(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public RefreshData(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -109,14 +102,14 @@ public async Task AllAsync(RefreshCompanyDataRequest var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/data/all", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("refresh-company-data", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "refresh-company-data", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -150,8 +143,8 @@ public async Task AllAsync(RefreshCompanyDataRequest Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -161,7 +154,7 @@ public async Task AllAsync(RefreshCompanyDataRequest 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) + 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); if (_httpResponse != null) @@ -188,7 +181,7 @@ public async Task AllAsync(RefreshCompanyDataRequest var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; if(responseStatusCode == 204) - { + { return new RefreshCompanyDataResponse() { StatusCode = responseStatusCode, @@ -196,22 +189,56 @@ public async Task AllAsync(RefreshCompanyDataRequest RawResponse = httpResponse }; } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task ByDataTypeAsync(RefreshDataTypeRequest request, RetryConfig? retryConfig = null) @@ -220,14 +247,14 @@ public async Task ByDataTypeAsync(RefreshDataTypeReques var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/data/queue/{dataType}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("refresh-data-type", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "refresh-data-type", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -261,8 +288,8 @@ public async Task ByDataTypeAsync(RefreshDataTypeReques Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -272,7 +299,7 @@ public async Task ByDataTypeAsync(RefreshDataTypeReques 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) + 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); if (_httpResponse != null) @@ -302,7 +329,17 @@ public async Task ByDataTypeAsync(RefreshDataTypeReques { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + PullOperation obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into PullOperation.", httpResponse, httpResponseBody, ex); + } + var response = new RefreshDataTypeResponse() { StatusCode = responseStatusCode, @@ -313,24 +350,58 @@ public async Task ByDataTypeAsync(RefreshDataTypeReques return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task GetAsync(GetCompanyDataStatusRequest request, RetryConfig? retryConfig = null) @@ -339,14 +410,14 @@ public async Task GetAsync(GetCompanyDataStatusReq var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/dataStatus", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-company-data-status", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-company-data-status", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -380,8 +451,8 @@ public async Task GetAsync(GetCompanyDataStatusReq Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -421,7 +492,17 @@ public async Task GetAsync(GetCompanyDataStatusReq { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + DataStatuses obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into DataStatuses.", httpResponse, httpResponseBody, ex); + } + var response = new GetCompanyDataStatusResponse() { StatusCode = responseStatusCode, @@ -432,24 +513,58 @@ public async Task GetAsync(GetCompanyDataStatusReq return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task ListPullOperationsAsync(ListPullOperationsRequest request, RetryConfig? retryConfig = null) @@ -458,14 +573,14 @@ public async Task ListPullOperationsAsync(ListPullOp var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/data/history", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("list-pull-operations", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-pull-operations", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -499,8 +614,8 @@ public async Task ListPullOperationsAsync(ListPullOp Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -540,7 +655,17 @@ public async Task ListPullOperationsAsync(ListPullOp { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + PullOperations obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into PullOperations.", httpResponse, httpResponseBody, ex); + } + var response = new ListPullOperationsResponse() { StatusCode = responseStatusCode, @@ -551,24 +676,58 @@ public async Task ListPullOperationsAsync(ListPullOp return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{400, 401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task GetPullOperationAsync(GetPullOperationRequest request, RetryConfig? retryConfig = null) @@ -577,14 +736,14 @@ public async Task GetPullOperationAsync(GetPullOperati var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/data/history/{datasetId}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-pull-operation", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-pull-operation", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -618,8 +777,8 @@ public async Task GetPullOperationAsync(GetPullOperati Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -659,7 +818,17 @@ public async Task GetPullOperationAsync(GetPullOperati { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + PullOperation obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into PullOperation.", httpResponse, httpResponseBody, ex); + } + var response = new GetPullOperationResponse() { StatusCode = responseStatusCode, @@ -670,24 +839,58 @@ public async Task GetPullOperationAsync(GetPullOperati return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } } } \ No newline at end of file diff --git a/platform/Codat/Platform/SDKConfig.cs b/platform/Codat/Platform/SDKConfig.cs new file mode 100644 index 000000000..0002b8dc5 --- /dev/null +++ b/platform/Codat/Platform/SDKConfig.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). 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 +{ + using Codat.Platform.Hooks; + using Codat.Platform.Models.Components; + using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; + using System; + using System.Collections.Generic; + using System.Linq; + + public struct SDKConfig + { + /// + /// List of server URLs available to the SDK. + /// + public static readonly string[] ServerList = { + "https://api.codat.io", + }; + + public ISpeakeasyHttpClient Client; + public string ServerUrl; + public int ServerIndex; + public string UserAgent; + public Func? SecuritySource; + public SDKHooks Hooks; + public RetryConfig? RetryConfig; + + /// + /// Initializes a new instance of the SDKConfig struct with default values. + /// + public SDKConfig(ISpeakeasyHttpClient? client = null) + { + Client = client ?? new SpeakeasyHttpClient(); + ServerUrl = ""; + ServerIndex = 0; + UserAgent = "speakeasy-sdk/csharp 6.1.0 2.723.11 3.0.0 Codat.Platform"; + SecuritySource = null; + Hooks = new SDKHooks(); + RetryConfig = null; + } + + public string GetTemplatedServerUrl() + { + if (!String.IsNullOrEmpty(this.ServerUrl)) + { + return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary()); + } + return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], new Dictionary()); + } + } +} \ No newline at end of file diff --git a/platform/Codat/Platform/Settings.cs b/platform/Codat/Platform/Settings.cs index 3badafb26..e50d28eee 100644 --- a/platform/Codat/Platform/Settings.cs +++ b/platform/Codat/Platform/Settings.cs @@ -13,14 +13,14 @@ namespace Codat.Platform using Codat.Platform.Models.Components; using Codat.Platform.Models.Errors; using Codat.Platform.Models.Requests; - using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Manage company profile configuration, sync settings, and API keys. @@ -28,6 +28,28 @@ namespace Codat.Platform public interface ISettings { + /// + /// Get CORS settings + /// + /// + /// 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 embeddable UIs (such as Connections SDK and Link SDK) to access Codat's API endpoints. + ///
+ ///
+ Task GetAsync(RetryConfig? retryConfig = null); + + /// + /// Set CORS settings + /// + /// + /// 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 embeddable UIs (such as Connections SDK and Link SDK) to access Codat's API endpoints. + ///
+ ///
+ Task SetAsync(ConnectionManagementAllowedOrigins? request = null, RetryConfig? retryConfig = null); + /// /// Get profile /// @@ -122,22 +144,349 @@ public class Settings: ISettings { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "6.0.0"; - private const string _sdkGenVersion = "2.462.1"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Settings(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Settings(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } + public async Task GetAsync(RetryConfig? retryConfig = null) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/corsSettings"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-cors-settings", null, SDKConfiguration.SecuritySource); + + 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 SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + + HttpResponseMessage httpResponse; + try + { + 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); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ConnectionManagementAllowedOrigins obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ConnectionManagementAllowedOrigins.", httpResponse, httpResponseBody, ex); + } + + var response = new GetCorsSettingsResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.ConnectionManagementAllowedOrigins = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + + public async Task SetAsync(ConnectionManagementAllowedOrigins? request = null, RetryConfig? retryConfig = null) + { + string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); + + var urlString = baseUrl + "/corsSettings"; + + var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); + + var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); + if (serializedBody != null) + { + httpRequest.Content = serializedBody; + } + + if (SDKConfiguration.SecuritySource != null) + { + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); + } + + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "set-cors-settings", null, SDKConfiguration.SecuritySource); + + 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 SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); + }; + var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); + + HttpResponseMessage httpResponse; + try + { + 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); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + } + } + catch (Exception error) + { + var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); + if (_httpResponse != null) + { + httpResponse = _httpResponse; + } + else + { + throw; + } + } + + httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); + + var contentType = httpResponse.Content.Headers.ContentType?.MediaType; + int responseStatusCode = (int)httpResponse.StatusCode; + if(responseStatusCode == 200) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ConnectionManagementAllowedOrigins obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ConnectionManagementAllowedOrigins.", httpResponse, httpResponseBody, ex); + } + + var response = new SetCorsSettingsResponse() + { + StatusCode = responseStatusCode, + ContentType = contentType, + RawResponse = httpResponse + }; + response.ConnectionManagementAllowedOrigins = obj; + return response; + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + public async Task GetProfileAsync(RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); @@ -145,14 +494,14 @@ public async Task GetProfileAsync(RetryConfig? retryConfig = var urlString = baseUrl + "/profile"; var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-profile", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-profile", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -186,8 +535,8 @@ public async Task GetProfileAsync(RetryConfig? retryConfig = Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -227,7 +576,17 @@ public async Task GetProfileAsync(RetryConfig? retryConfig = { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Profile obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Profile.", httpResponse, httpResponseBody, ex); + } + var response = new GetProfileResponse() { StatusCode = responseStatusCode, @@ -238,24 +597,58 @@ public async Task GetProfileAsync(RetryConfig? retryConfig = return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task UpdateProfileAsync(Profile? request = null, RetryConfig? retryConfig = null) @@ -265,7 +658,7 @@ public async Task UpdateProfileAsync(Profile? request = n var urlString = baseUrl + "/profile"; var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) @@ -273,12 +666,12 @@ public async Task UpdateProfileAsync(Profile? request = n httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("update-profile", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "update-profile", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -312,8 +705,8 @@ public async Task UpdateProfileAsync(Profile? request = n Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -353,7 +746,17 @@ public async Task UpdateProfileAsync(Profile? request = n { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Profile obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Profile.", httpResponse, httpResponseBody, ex); + } + var response = new UpdateProfileResponse() { StatusCode = responseStatusCode, @@ -364,24 +767,58 @@ public async Task UpdateProfileAsync(Profile? request = n return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task GetSyncSettingsAsync(RetryConfig? retryConfig = null) @@ -391,14 +828,14 @@ public async Task GetSyncSettingsAsync(RetryConf var urlString = baseUrl + "/profile/syncSettings"; var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-profile-syncSettings", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-profile-syncSettings", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -432,8 +869,8 @@ public async Task GetSyncSettingsAsync(RetryConf Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -473,7 +910,17 @@ public async Task GetSyncSettingsAsync(RetryConf { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + SyncSettings obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into SyncSettings.", httpResponse, httpResponseBody, ex); + } + var response = new GetProfileSyncSettingsResponse() { StatusCode = responseStatusCode, @@ -484,24 +931,58 @@ public async Task GetSyncSettingsAsync(RetryConf return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task UpdateSyncSettingsAsync(UpdateProfileSyncSettingsRequestBody? request = null, RetryConfig? retryConfig = null) @@ -511,7 +992,7 @@ public async Task UpdateSyncSettingsAsync(Upd var urlString = baseUrl + "/profile/syncSettings"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) @@ -519,12 +1000,12 @@ public async Task UpdateSyncSettingsAsync(Upd httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("update-profile-syncSettings", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "update-profile-syncSettings", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -558,8 +1039,8 @@ public async Task UpdateSyncSettingsAsync(Upd Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -596,7 +1077,7 @@ public async Task UpdateSyncSettingsAsync(Upd var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; if(responseStatusCode == 204) - { + { return new UpdateProfileSyncSettingsResponse() { StatusCode = responseStatusCode, @@ -604,22 +1085,56 @@ public async Task UpdateSyncSettingsAsync(Upd RawResponse = httpResponse }; } - else if(new List{401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task ListApiKeysAsync(RetryConfig? retryConfig = null) @@ -629,14 +1144,14 @@ public async Task ListApiKeysAsync(RetryConfig? retryConfig var urlString = baseUrl + "/apiKeys"; var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("list-api-keys", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-api-keys", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -670,8 +1185,8 @@ public async Task ListApiKeysAsync(RetryConfig? retryConfig Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -711,7 +1226,17 @@ public async Task ListApiKeysAsync(RetryConfig? retryConfig { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ApiKeys obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ApiKeys.", httpResponse, httpResponseBody, ex); + } + var response = new ListApiKeysResponse() { StatusCode = responseStatusCode, @@ -722,24 +1247,58 @@ public async Task ListApiKeysAsync(RetryConfig? retryConfig return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task CreateApiKeyAsync(CreateApiKey? request = null, RetryConfig? retryConfig = null) @@ -749,7 +1308,7 @@ public async Task CreateApiKeyAsync(CreateApiKey? request var urlString = baseUrl + "/apiKeys"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) @@ -757,12 +1316,12 @@ public async Task CreateApiKeyAsync(CreateApiKey? request httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("create-api-key", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "create-api-key", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -796,8 +1355,8 @@ public async Task CreateApiKeyAsync(CreateApiKey? request Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -837,7 +1396,17 @@ public async Task CreateApiKeyAsync(CreateApiKey? request { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + ApiKeyDetails obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into ApiKeyDetails.", httpResponse, httpResponseBody, ex); + } + var response = new CreateApiKeyResponse() { StatusCode = responseStatusCode, @@ -848,24 +1417,58 @@ public async Task CreateApiKeyAsync(CreateApiKey? request return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 409, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 409, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(new List{500, 503}.Contains(responseStatusCode)) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 500 && responseStatusCode < 600) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task DeleteApiKeyAsync(DeleteApiKeyRequest request, RetryConfig? retryConfig = null) @@ -874,14 +1477,14 @@ public async Task DeleteApiKeyAsync(DeleteApiKeyRequest re var urlString = URLBuilder.Build(baseUrl, "/apiKeys/{apiKeyId}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("delete-api-key", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "delete-api-key", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -915,8 +1518,8 @@ public async Task DeleteApiKeyAsync(DeleteApiKeyRequest re Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -956,7 +1559,17 @@ public async Task DeleteApiKeyAsync(DeleteApiKeyRequest re { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Components.ErrorMessage obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Components.ErrorMessage.", httpResponse, httpResponseBody, ex); + } + var response = new DeleteApiKeyResponse() { StatusCode = responseStatusCode, @@ -967,24 +1580,58 @@ public async Task DeleteApiKeyAsync(DeleteApiKeyRequest re return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } } } \ No newline at end of file diff --git a/platform/Codat/Platform/SupplementalData.cs b/platform/Codat/Platform/SupplementalData.cs index 0b4a05744..e32945ba2 100644 --- a/platform/Codat/Platform/SupplementalData.cs +++ b/platform/Codat/Platform/SupplementalData.cs @@ -13,14 +13,14 @@ namespace Codat.Platform using Codat.Platform.Models.Components; using Codat.Platform.Models.Errors; using Codat.Platform.Models.Requests; - using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Configure and pull additional data you can include in Codat's standard data types. @@ -61,19 +61,12 @@ public class SupplementalData: ISupplementalData { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "6.0.0"; - private const string _sdkGenVersion = "2.462.1"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public SupplementalData(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public SupplementalData(SDKConfig config) { - _client = client; - _securitySource = securitySource; - _serverUrl = serverUrl; SDKConfiguration = config; } @@ -83,7 +76,7 @@ public async Task ConfigureAsync(ConfigureSup var urlString = URLBuilder.Build(baseUrl, "/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig", request); var httpRequest = new HttpRequestMessage(HttpMethod.Put, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "SupplementalDataConfiguration", "json", false, true); if (serializedBody != null) @@ -91,12 +84,12 @@ public async Task ConfigureAsync(ConfigureSup httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("configure-supplemental-data", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "configure-supplemental-data", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -130,8 +123,8 @@ public async Task ConfigureAsync(ConfigureSup Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -168,7 +161,7 @@ public async Task ConfigureAsync(ConfigureSup var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; if(responseStatusCode == 200) - { + { return new ConfigureSupplementalDataResponse() { StatusCode = responseStatusCode, @@ -176,22 +169,56 @@ public async Task ConfigureAsync(ConfigureSup RawResponse = httpResponse }; } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task GetConfigurationAsync(GetSupplementalDataConfigurationRequest request, RetryConfig? retryConfig = null) @@ -200,14 +227,14 @@ public async Task GetConfigurationAsyn var urlString = URLBuilder.Build(baseUrl, "/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig", request); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("get-supplemental-data-configuration", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "get-supplemental-data-configuration", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -241,8 +268,8 @@ public async Task GetConfigurationAsyn Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -282,7 +309,17 @@ public async Task GetConfigurationAsyn { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + SupplementalDataConfiguration obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into SupplementalDataConfiguration.", httpResponse, httpResponseBody, ex); + } + var response = new GetSupplementalDataConfigurationResponse() { StatusCode = responseStatusCode, @@ -293,24 +330,58 @@ public async Task GetConfigurationAsyn return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{500, 503}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } } } \ No newline at end of file diff --git a/platform/Codat/Platform/Utils/OpenEnumConverter.cs b/platform/Codat/Platform/Utils/OpenEnumConverter.cs new file mode 100644 index 000000000..d16e44094 --- /dev/null +++ b/platform/Codat/Platform/Utils/OpenEnumConverter.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// +// Changes to this file may cause incorrect behavior and will be lost when +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#nullable enable +using System; +using Newtonsoft.Json; +namespace Codat.Platform.Utils +{ + internal class OpenEnumConverter : JsonConverter + { + public override bool CanConvert(System.Type objectType) + { + return objectType.GetMethod("Of") != null && objectType.GetMethod("ToString") != null; + } + + public override object? ReadJson( + JsonReader reader, + System.Type objectType, + object? existingValue, + JsonSerializer serializer + ) + { + if (reader.Value == null) + { + return null; + } + + var method = objectType.GetMethod("Of"); + if (method == null) + { + throw new Exception($"Unable to find Of method on {objectType}"); + } + try { + return method.Invoke(null, new[] { reader.Value }); + } catch(System.Reflection.TargetInvocationException e) { + throw new Newtonsoft.Json.JsonSerializationException("Unable to convert value to open enum", e); + } + } + + public override void WriteJson(JsonWriter writer, object? obj, JsonSerializer serializer) + { + if (obj == null) + { + writer.WriteValue("null"); + return; + } + + var valueProp = obj.GetType().GetProperty("Value"); + if (valueProp == null) + { + throw new Exception($"{obj.GetType()} does not have a Value property"); + } + + writer.WriteValue(valueProp.GetValue(obj)); + } + } +} diff --git a/platform/Codat/Platform/Utils/RequestBodySerializer.cs b/platform/Codat/Platform/Utils/RequestBodySerializer.cs index adab2d09c..8f0c8555a 100644 --- a/platform/Codat/Platform/Utils/RequestBodySerializer.cs +++ b/platform/Codat/Platform/Utils/RequestBodySerializer.cs @@ -265,49 +265,44 @@ private static HttpContent SerializeMultipart(object request, string mediaType) if (metadata.File) { - if (!Utilities.IsClass(value)) + if (Utilities.IsList(value)) { - throw new Exception( - "Cannot serialize multipart file from type " + value.GetType().Name - ); - } - - var fileProps = value.GetType().GetProperties(); - - byte[]? content = null; - string fileName = ""; - string fieldName = ""; - - foreach (var fileProp in fileProps) - { - var fileMetadata = fileProp - .GetCustomAttribute() - ?.GetMultipartFormMetadata(); - if ( - fileMetadata == null - || (!fileMetadata.Content && fileMetadata.Name == "") - ) + // Handle array/list of files - similar to how normal lists are handled + foreach (var fileItem in (IList)value) { - continue; - } + if (!Utilities.IsClass(fileItem)) + { + throw new Exception( + "Cannot serialize multipart file from type " + fileItem.GetType().Name + ); + } - if (fileMetadata.Content) - { - content = (byte[]?)fileProp.GetValue(value); - } - else - { - fieldName = fileMetadata.Name ?? fileProp.Name; - fileName = fileProp.GetValue(value)?.ToString() ?? ""; + var fileProps = fileItem.GetType().GetProperties(); + var (fileName, content) = ExtractFileProperties(fileProps, fileItem); + string fieldName = (metadata.Name ?? prop.Name) + "[]"; + + var fileContent = new ByteArrayContent(content); + fileContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + formData.Add(fileContent, fieldName, fileName); } } - - if (fieldName == "" || fileName == "" || content == null) + else if (Utilities.IsClass(value)) { - throw new Exception("Invalid multipart/form-data file"); + // Handle single file + var fileProps = value.GetType().GetProperties(); + var (fileName, content) = ExtractFileProperties(fileProps, value); + string fieldName = metadata.Name; + + var fileContent = new ByteArrayContent(content); + fileContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream"); + formData.Add(fileContent, fieldName, fileName); + } + else + { + throw new Exception( + "Cannot serialize multipart file from type " + value.GetType().Name + ); } - - formData.Add(new ByteArrayContent(content), fieldName, fileName); } else if (metadata.Json) { @@ -521,6 +516,42 @@ ref Dictionary> form } } + private static (string fileName, byte[] content) ExtractFileProperties(PropertyInfo[] fileProps, object fileObject) + { + byte[]? content = null; + string fileName = ""; + + foreach (var fileProp in fileProps) + { + var fileMetadata = fileProp + .GetCustomAttribute() + ?.GetMultipartFormMetadata(); + if ( + fileMetadata == null + || (!fileMetadata.Content && fileMetadata.Name == "") + ) + { + continue; + } + + if (fileMetadata.Content) + { + content = (byte[]?)fileProp.GetValue(fileObject); + } + else + { + fileName = fileProp.GetValue(fileObject)?.ToString() ?? ""; + } + } + + if (fileName == "" || content == null) + { + throw new Exception("Invalid multipart/form-data file"); + } + + return (fileName, content); + } + private static PropertyInfo? GetPropertyInfo(object value, string propertyName) { try diff --git a/platform/Codat/Platform/Utils/ResponseBodyDeserializer.cs b/platform/Codat/Platform/Utils/ResponseBodyDeserializer.cs index 0d8bdd014..fa2f9140e 100644 --- a/platform/Codat/Platform/Utils/ResponseBodyDeserializer.cs +++ b/platform/Codat/Platform/Utils/ResponseBodyDeserializer.cs @@ -28,6 +28,16 @@ internal class ResponseBodyDeserializer return JsonConvert.DeserializeObject(json, new JsonSerializerSettings(){ NullValueHandling = nullValueHandling, MissingMemberHandling = missingMemberHandling, Converters = Utilities.GetJsonDeserializers(typeof(T))}); } + public static T DeserializeNotNull(string json, NullValueHandling nullValueHandling=NullValueHandling.Ignore, MissingMemberHandling missingMemberHandling=MissingMemberHandling.Ignore) + { + var result = ResponseBodyDeserializer.Deserialize(json, nullValueHandling, missingMemberHandling); + if (result == null) + { + throw new Exception($"Deserialization error: {typeof(T).Name} cannot be null."); + } + return result!; + } + public sealed class MissingMemberException : Exception { public MissingMemberException() : base("Missing member.") { } diff --git a/platform/Codat/Platform/Utils/SecurityMetadata.cs b/platform/Codat/Platform/Utils/SecurityMetadata.cs index 7801e433e..53c5730eb 100644 --- a/platform/Codat/Platform/Utils/SecurityMetadata.cs +++ b/platform/Codat/Platform/Utils/SecurityMetadata.cs @@ -196,6 +196,8 @@ object value case "bearer": headerParams.Add(key, Utilities.PrefixBearer(valStr)); break; + case "custom": + break; default: throw new Exception($"Unknown http subType: {schemeMetadata.SubType}"); } diff --git a/platform/Codat/Platform/Utils/SpeakeasyHttpClient.cs b/platform/Codat/Platform/Utils/SpeakeasyHttpClient.cs index 8dca1f438..c9810ea40 100644 --- a/platform/Codat/Platform/Utils/SpeakeasyHttpClient.cs +++ b/platform/Codat/Platform/Utils/SpeakeasyHttpClient.cs @@ -19,6 +19,9 @@ public interface ISpeakeasyHttpClient /// /// Sends an HTTP request asynchronously. /// + /// + /// When overriding this method, use HttpCompletionOption.ResponseHeadersRead to support streaming response bodies. + /// /// The HTTP request message to send. /// The value of the TResult parameter contains the HTTP response message. Task SendAsync(HttpRequestMessage request); @@ -46,7 +49,7 @@ public SpeakeasyHttpClient() public virtual async Task SendAsync(HttpRequestMessage request) { - return await httpClient.SendAsync(request); + return await httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead); } public virtual async Task CloneAsync(HttpRequestMessage request) diff --git a/platform/Codat/Platform/Utils/URLBuilder.cs b/platform/Codat/Platform/Utils/URLBuilder.cs index c8648c923..5fa333c91 100644 --- a/platform/Codat/Platform/Utils/URLBuilder.cs +++ b/platform/Codat/Platform/Utils/URLBuilder.cs @@ -55,7 +55,7 @@ public static string ReplaceParameters(string url, Dictionary pa { foreach (var key in parameters.Keys) { - url = url.Replace($"{{{key}}}", parameters[key]); + url = url.Replace($"{{{key}}}", Uri.EscapeDataString(parameters[key])); } return url; @@ -68,7 +68,7 @@ public static string SerializeQueryParams(Dictionary> query { foreach (var value in queryParams[key]) { - queries.Add($"{key}={value}"); + queries.Add($"{key}={WebUtility.UrlEncode(Utilities.ToString(value))}"); } } @@ -114,7 +114,7 @@ private static Dictionary GetPathParameters(object? request) case "json": parameters.Add( metadata.Name ?? prop.Name, - WebUtility.UrlEncode(Utilities.SerializeJSON(val)) + Utilities.SerializeJSON(val) ); break; default: diff --git a/platform/Codat/Platform/Webhooks.cs b/platform/Codat/Platform/Webhooks.cs index 2b0d87d6b..1266ad122 100644 --- a/platform/Codat/Platform/Webhooks.cs +++ b/platform/Codat/Platform/Webhooks.cs @@ -13,14 +13,14 @@ namespace Codat.Platform using Codat.Platform.Models.Components; using Codat.Platform.Models.Errors; using Codat.Platform.Models.Requests; - using Codat.Platform.Utils.Retries; using Codat.Platform.Utils; + using Codat.Platform.Utils.Retries; using Newtonsoft.Json; + using System; using System.Collections.Generic; - using System.Net.Http.Headers; using System.Net.Http; + using System.Net.Http.Headers; using System.Threading.Tasks; - using System; /// /// Create and manage webhooks that listen to Codat's events. @@ -28,39 +28,6 @@ namespace Codat.Platform public interface IWebhooks { - /// - /// List webhooks (legacy) - /// - /// - /// Use the *List webhooks (legacy)* endpoint to retrieve all existing rule-based webhooks for your client.
- ///
- /// **Note:** This endpoint has been deprecated. Please use the *List webhook consumers* endpoint for listing webhooks moving forward. - ///
- ///
- Task ListAsync(ListRulesRequest? request = null, RetryConfig? retryConfig = null); - - /// - /// Create webhook (legacy) - /// - /// - /// Use the *Create webhooks (legacy)* endpoint to create a rule-based webhook for your client.
- ///
- /// **Note:** This endpoint has been deprecated. Please use the *Create webhook consumer* endpoint to create a webhook moving forward. - ///
- ///
- Task CreateAsync(CreateRule? request = null, RetryConfig? retryConfig = null); - - /// - /// Get webhook (legacy) - /// - /// - /// Use the *Get webhook (legacy)* endpoint to retrieve a specific webhook for your client.
- ///
- /// **Note:** This endpoint has been deprecated. Please use the *List webhook consumers* endpoint for listing webhooks moving forward. - ///
- ///
- Task GetAsync(GetWebhookRequest request, RetryConfig? retryConfig = null); - /// /// List webhook consumers /// @@ -105,37 +72,30 @@ public class Webhooks: IWebhooks { public SDKConfig SDKConfiguration { get; private set; } private const string _language = "csharp"; - private const string _sdkVersion = "6.0.0"; - private const string _sdkGenVersion = "2.462.1"; + private const string _sdkVersion = "6.1.0"; + private const string _sdkGenVersion = "2.723.11"; private const string _openapiDocVersion = "3.0.0"; - private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform"; - private string _serverUrl = ""; - private ISpeakeasyHttpClient _client; - private Func? _securitySource; - public Webhooks(ISpeakeasyHttpClient client, Func? securitySource, string serverUrl, SDKConfig config) + public Webhooks(SDKConfig config) { - _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 ListAsync(ListRulesRequest? request = null, RetryConfig? retryConfig = null) + public async Task ListConsumersAsync(RetryConfig? retryConfig = null) { string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/rules", request); + + var urlString = baseUrl + "/webhooks"; var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("list-rules", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-webhook-consumers", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -169,8 +129,8 @@ public async Task ListAsync(ListRulesRequest? request = null, Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -180,7 +140,7 @@ public async Task ListAsync(ListRulesRequest? request = null, 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) + 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); if (_httpResponse != null) @@ -210,402 +170,79 @@ public async Task ListAsync(ListRulesRequest? request = null, { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - var response = new ListRulesResponse() + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + WebhookConsumers obj; + try { - StatusCode = responseStatusCode, - ContentType = contentType, - RawResponse = httpResponse - }; - response.Webhooks = obj; - return response; - } - - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } - else if(new List{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) - { - if(Utilities.IsContentTypeMatch("application/json", contentType)) - { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - throw obj!; - } - - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) - { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } - - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } - - [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, RetryConfig? retryConfig = null) - { - string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - - var urlString = baseUrl + "/rules"; - - var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); - - var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); - if (serializedBody != null) - { - httpRequest.Content = serializedBody; - } - - if (_securitySource != null) - { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); - } - - var hookCtx = new HookContext("create-rule", null, _securitySource); - - 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 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); - if (_httpResponse != null) + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) { - httpResponse = _httpResponse; + throw new ResponseValidationException("Failed to deserialize response body into WebhookConsumers.", httpResponse, httpResponseBody, ex); } - } - } - catch (Exception error) - { - var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); - if (_httpResponse != null) - { - httpResponse = _httpResponse; - } - else - { - throw; - } - } - - httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); - var contentType = httpResponse.Content.Headers.ContentType?.MediaType; - int responseStatusCode = (int)httpResponse.StatusCode; - if(responseStatusCode == 200) - { - if(Utilities.IsContentTypeMatch("application/json", contentType)) - { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - var response = new CreateRuleResponse() + var response = new ListWebhookConsumersResponse() { StatusCode = responseStatusCode, ContentType = contentType, RawResponse = httpResponse }; - response.Webhook = obj; + response.WebhookConsumers = obj; return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - throw obj!; - } - - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) - { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } - - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } - - [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, RetryConfig? retryConfig = null) - { - string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - var urlString = URLBuilder.Build(baseUrl, "/rules/{ruleId}", request); - - var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); - - if (_securitySource != null) - { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); - } - - var hookCtx = new HookContext("get-webhook", null, _securitySource); - - 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 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); - if (_httpResponse != null) + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try { - httpResponse = _httpResponse; + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); } - } - } - catch (Exception error) - { - var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); - if (_httpResponse != null) - { - httpResponse = _httpResponse; - } - else - { - throw; - } - } - - httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); - - var contentType = httpResponse.Content.Headers.ContentType?.MediaType; - int responseStatusCode = (int)httpResponse.StatusCode; - if(responseStatusCode == 200) - { - if(Utilities.IsContentTypeMatch("application/json", contentType)) - { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - var response = new GetWebhookResponse() + catch (Exception ex) { - StatusCode = responseStatusCode, - ContentType = contentType, - RawResponse = httpResponse - }; - response.Webhook = obj; - return response; - } + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) - { - if(Utilities.IsContentTypeMatch("application/json", contentType)) - { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) - { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } - - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); - } - - public async Task ListConsumersAsync(RetryConfig? retryConfig = null) - { - string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); - - var urlString = baseUrl + "/webhooks"; - - var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); - - if (_securitySource != null) - { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); - } - - var hookCtx = new HookContext("list-webhook-consumers", null, _securitySource); - - 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 + else if(new List{500, 503}.Contains(responseStatusCode)) { - 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) + if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null); - if (_httpResponse != null) + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try { - httpResponse = _httpResponse; + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); } - } - } - catch (Exception error) - { - var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error); - if (_httpResponse != null) - { - httpResponse = _httpResponse; - } - else - { - throw; - } - } - - httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse); - - var contentType = httpResponse.Content.Headers.ContentType?.MediaType; - int responseStatusCode = (int)httpResponse.StatusCode; - if(responseStatusCode == 200) - { - if(Utilities.IsContentTypeMatch("application/json", contentType)) - { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - var response = new ListWebhookConsumersResponse() + catch (Exception ex) { - StatusCode = responseStatusCode, - ContentType = contentType, - RawResponse = httpResponse - }; - response.WebhookConsumers = obj; - return response; + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) + else if(responseStatusCode >= 400 && responseStatusCode < 500) { - if(Utilities.IsContentTypeMatch("application/json", contentType)) - { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; - } - - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task CreateConsumerAsync(WebhookConsumerPrototype? request = null, RetryConfig? retryConfig = null) @@ -615,7 +252,7 @@ public async Task CreateConsumerAsync(WebhookCons var urlString = baseUrl + "/webhooks"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); var serializedBody = RequestBodySerializer.Serialize(request, "Request", "json", false, true); if (serializedBody != null) @@ -623,12 +260,12 @@ public async Task CreateConsumerAsync(WebhookCons httpRequest.Content = serializedBody; } - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("create-webhook-consumer", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "create-webhook-consumer", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -662,8 +299,8 @@ public async Task CreateConsumerAsync(WebhookCons Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -703,7 +340,17 @@ public async Task CreateConsumerAsync(WebhookCons { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + WebhookConsumer obj; + try + { + obj = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into WebhookConsumer.", httpResponse, httpResponseBody, ex); + } + var response = new CreateWebhookConsumerResponse() { StatusCode = responseStatusCode, @@ -714,24 +361,58 @@ public async Task CreateConsumerAsync(WebhookCons return response; } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(new List{400, 401, 402, 403, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{400, 401, 402, 403, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Include); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } public async Task DeleteConsumerAsync(DeleteWebhookConsumerRequest request, RetryConfig? retryConfig = null) @@ -740,14 +421,14 @@ public async Task DeleteConsumerAsync(DeleteWebho var urlString = URLBuilder.Build(baseUrl, "/webhooks/{webhookId}", request); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); - httpRequest.Headers.Add("user-agent", _userAgent); + httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent); - if (_securitySource != null) + if (SDKConfiguration.SecuritySource != null) { - httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); + httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest); } - var hookCtx = new HookContext("delete-webhook-consumer", null, _securitySource); + var hookCtx = new HookContext(SDKConfiguration, baseUrl, "delete-webhook-consumer", null, SDKConfiguration.SecuritySource); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); if (retryConfig == null) @@ -781,8 +462,8 @@ public async Task DeleteConsumerAsync(DeleteWebho Func> retrySend = async () => { - var _httpRequest = await _client.CloneAsync(httpRequest); - return await _client.SendAsync(_httpRequest); + var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest); + return await SDKConfiguration.Client.SendAsync(_httpRequest); }; var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes); @@ -819,7 +500,7 @@ public async Task DeleteConsumerAsync(DeleteWebho var contentType = httpResponse.Content.Headers.ContentType?.MediaType; int responseStatusCode = (int)httpResponse.StatusCode; if(responseStatusCode == 204) - { + { return new DeleteWebhookConsumerResponse() { StatusCode = responseStatusCode, @@ -827,22 +508,56 @@ public async Task DeleteConsumerAsync(DeleteWebho RawResponse = httpResponse }; } - else if(new List{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode)) + else if(new List{401, 402, 403, 404, 429}.Contains(responseStatusCode)) { if(Utilities.IsContentTypeMatch("application/json", contentType)) { - var obj = ResponseBodyDeserializer.Deserialize(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); - throw obj!; + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); } - throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(new List{500, 503}.Contains(responseStatusCode)) + { + if(Utilities.IsContentTypeMatch("application/json", contentType)) + { + var httpResponseBody = await httpResponse.Content.ReadAsStringAsync(); + Models.Errors.ErrorMessagePayload payload; + try + { + payload = ResponseBodyDeserializer.DeserializeNotNull(httpResponseBody, NullValueHandling.Ignore); + } + catch (Exception ex) + { + throw new ResponseValidationException("Failed to deserialize response body into Models.Errors.ErrorMessagePayload.", httpResponse, httpResponseBody, ex); + } + + throw new Models.Errors.ErrorMessage(payload, httpResponse, httpResponseBody); + } + + throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); + } + else if(responseStatusCode >= 400 && responseStatusCode < 500) + { + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) + else if(responseStatusCode >= 500 && responseStatusCode < 600) { - throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } - throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); + throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync()); } } } \ No newline at end of file diff --git a/platform/NUGET.md b/platform/NUGET.md index 6c31b35ad..0dcff4e5e 100644 --- a/platform/NUGET.md +++ b/platform/NUGET.md @@ -8,16 +8,15 @@ ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -34,16 +33,15 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an 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.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync( @@ -57,7 +55,7 @@ var res = await sdk.Companies.ListAsync( ), retryConnectionErrors: false ), - req + request: req ); // handle response @@ -66,8 +64,8 @@ var res = await sdk.Companies.ListAsync( 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.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform( retryConfig: new RetryConfig( @@ -84,10 +82,9 @@ var sdk = new CodatPlatform( ); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -99,62 +96,87 @@ var res = await sdk.Companies.ListAsync(req); ## Error Handling -Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception. - -By default, an API error will raise a `Codat.Platform.Models.Errors.SDKException` exception, which has the following properties: +[`CodatPlatformException`](./Codat/Platform/Models/Errors/CodatPlatformException.cs) is the base exception class for all HTTP error responses. It has the following properties: | Property | Type | Description | |---------------|-----------------------|-----------------------| -| `Message` | *string* | The error message | -| `StatusCode` | *int* | The HTTP status code | -| `RawResponse` | *HttpResponseMessage* | The raw HTTP response | -| `Body` | *string* | The response content | - -When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `ListAsync` method throws the following exceptions: +| `Message` | *string* | Error message | +| `StatusCode` | *int* | HTTP status code | +| `Headers` | *HttpResponseHeaders* | HTTP headers | +| `ContentType` | *string?* | HTTP content type | +| `RawResponse` | *HttpResponseMessage* | HTTP response object | +| `Body` | *string* | HTTP response body | -| Error Type | Status Code | Content Type | -| ----------------------------------------- | -------------------------------------- | ---------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | +Some exceptions in this SDK include an additional `Payload` field, which will contain deserialized custom error data when present. Possible exceptions are listed in the [Error Classes](#error-classes) section. ### Example ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; -using System; using Codat.Platform.Models.Errors; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); try { ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); // handle response } -catch (Exception ex) +catch (CodatPlatformException ex) // all SDK exceptions inherit from CodatPlatformException { - if (ex is Models.Errors.ErrorMessage) + // ex.ToString() provides a detailed error message + System.Console.WriteLine(ex); + + // Base exception fields + HttpResponseMessage rawResponse = ex.RawResponse; + HttpResponseHeaders headers = ex.Headers; + int statusCode = ex.StatusCode; + string? contentType = ex.ContentType; + var responseBody = ex.Body; + + if (ex is Models.Errors.ErrorMessage) // different exceptions may be thrown depending on the method { - // Handle exception data - throw; + // Check error data fields + Models.Errors.ErrorMessagePayload payload = ex.Payload; + long StatusCode = payload.StatusCode; + string Service = payload.Service; + // ... } - else if (ex is Codat.Platform.Models.Errors.SDKException) + + // An underlying cause may be provided + if (ex.InnerException != null) { - // Handle default exception - throw; + Exception cause = ex.InnerException; } } +catch (System.Net.Http.HttpRequestException ex) +{ + // Check ex.InnerException for Network connectivity errors +} ``` + +### Error Classes + +**Primary exceptions:** +* [`CodatPlatformException`](./Codat/Platform/Models/Errors/CodatPlatformException.cs): The base class for HTTP error responses. + * [`ErrorMessage`](./Codat/Platform/Models/Errors/ErrorMessage.cs): Your `query` parameter was not correctly formed. + +
Less common exceptions (2) + +* [`System.Net.Http.HttpRequestException`](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httprequestexception): Network connectivity error. For more details about the underlying cause, inspect the `ex.InnerException`. + +* Inheriting from [`CodatPlatformException`](./Codat/Platform/Models/Errors/CodatPlatformException.cs): + * [`ResponseValidationError`](./Codat/Platform/Models/Errors/ResponseValidationError.cs): Thrown when the response data could not be deserialized into the expected type. +
@@ -162,11 +184,11 @@ catch (Exception ex) ### Override Server URL Per-Client -The default server can also be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example: +The default server can be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example: ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform( serverUrl: "https://api.codat.io", @@ -174,10 +196,9 @@ var sdk = new CodatPlatform( ); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -200,16 +221,15 @@ This SDK supports the following security scheme globally: To authenticate with the API the `AuthHeader` parameter must be set when initializing the SDK client instance. For example: ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); diff --git a/platform/README.md b/platform/README.md index 9a01cbc98..c5329e358 100644 --- a/platform/README.md +++ b/platform/README.md @@ -36,14 +36,18 @@ These end points cover creating and managing your companies, data connections, a ## Table of Contents + +* [Platform](#platform) + * [Endpoints](#endpoints) + * [SDK Installation](#sdk-installation) + * [Example Usage](#example-usage) + * [SDK Example Usage](#sdk-example-usage) + * [Available Resources and Operations](#available-resources-and-operations) + * [Server Selection](#server-selection) + * [Authentication](#authentication) + * [Error Handling](#error-handling) + * [Retries](#retries) -* [SDK Installation](#sdk-installation) -* [SDK Example Usage](#sdk-example-usage) -* [Available Resources and Operations](#available-resources-and-operations) -* [Retries](#retries) -* [Error Handling](#error-handling) -* [Server Selection](#server-selection) -* [Authentication](#authentication) @@ -72,16 +76,15 @@ dotnet add reference Codat/Platform/Codat.Platform.csproj ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -96,26 +99,22 @@ var res = await sdk.Companies.ListAsync(req);
Available methods - ### [Companies](docs/sdks/companies/README.md) * [List](docs/sdks/companies/README.md#list) - List companies * [Create](docs/sdks/companies/README.md#create) - Create company * [Get](docs/sdks/companies/README.md#get) - Get company * [Delete](docs/sdks/companies/README.md#delete) - Delete a company +* [Replace](docs/sdks/companies/README.md#replace) - Replace company * [Update](docs/sdks/companies/README.md#update) - Update company * [AddProduct](docs/sdks/companies/README.md#addproduct) - Add product * [RemoveProduct](docs/sdks/companies/README.md#removeproduct) - Remove product +* [RefreshProductData](docs/sdks/companies/README.md#refreshproductdata) - Refresh product data * [GetAccessToken](docs/sdks/companies/README.md#getaccesstoken) - Get company access token -### [ConnectionManagement](docs/sdks/connectionmanagement/README.md) - -* [GetAccessToken](docs/sdks/connectionmanagement/README.md#getaccesstoken) - Get access token +### [~~ConnectionManagement~~](docs/sdks/connectionmanagement/README.md) -#### [ConnectionManagement.CorsSettings](docs/sdks/corssettings/README.md) - -* [Get](docs/sdks/corssettings/README.md#get) - Get CORS settings -* [Set](docs/sdks/corssettings/README.md#set) - Set CORS settings +* [~~Get~~](docs/sdks/connectionmanagement/README.md#get) - Get access token (old) :warning: **Deprecated** Use [GetAccessToken](docs/sdks/companies/README.md#getaccesstoken) instead. ### [Connections](docs/sdks/connections/README.md) @@ -126,6 +125,11 @@ var res = await sdk.Companies.ListAsync(req); * [Unlink](docs/sdks/connections/README.md#unlink) - Unlink connection * [UpdateAuthorization](docs/sdks/connections/README.md#updateauthorization) - Update authorization +### [~~Cors~~](docs/sdks/cors/README.md) + +* [~~Get~~](docs/sdks/cors/README.md#get) - Get CORS settings (old) :warning: **Deprecated** Use [Get](docs/sdks/settings/README.md#get) instead. +* [~~Set~~](docs/sdks/cors/README.md#set) - Set CORS settings (old) :warning: **Deprecated** Use [Set](docs/sdks/settings/README.md#set) instead. + ### [CustomDataType](docs/sdks/customdatatype/README.md) * [Configure](docs/sdks/customdatatype/README.md#configure) - Configure custom data type @@ -145,6 +149,10 @@ var res = await sdk.Companies.ListAsync(req); * [ListOperations](docs/sdks/pushdata/README.md#listoperations) - List push operations * [GetOperation](docs/sdks/pushdata/README.md#getoperation) - Get push operation +### [ReadData](docs/sdks/readdata/README.md) + +* [GetValidationResults](docs/sdks/readdata/README.md#getvalidationresults) - Get validation results + ### [RefreshData](docs/sdks/refreshdata/README.md) * [All](docs/sdks/refreshdata/README.md#all) - Refresh all data @@ -155,6 +163,8 @@ var res = await sdk.Companies.ListAsync(req); ### [Settings](docs/sdks/settings/README.md) +* [Get](docs/sdks/settings/README.md#get) - Get CORS settings +* [Set](docs/sdks/settings/README.md#set) - Set CORS settings * [GetProfile](docs/sdks/settings/README.md#getprofile) - Get profile * [UpdateProfile](docs/sdks/settings/README.md#updateprofile) - Update profile * [GetSyncSettings](docs/sdks/settings/README.md#getsyncsettings) - Get sync settings @@ -170,9 +180,6 @@ var res = await sdk.Companies.ListAsync(req); ### [Webhooks](docs/sdks/webhooks/README.md) -* [~~List~~](docs/sdks/webhooks/README.md#list) - List webhooks (legacy) :warning: **Deprecated** -* [~~Create~~](docs/sdks/webhooks/README.md#create) - Create webhook (legacy) :warning: **Deprecated** -* [~~Get~~](docs/sdks/webhooks/README.md#get) - Get webhook (legacy) :warning: **Deprecated** * [ListConsumers](docs/sdks/webhooks/README.md#listconsumers) - List webhook consumers * [CreateConsumer](docs/sdks/webhooks/README.md#createconsumer) - Create webhook consumer * [DeleteConsumer](docs/sdks/webhooks/README.md#deleteconsumer) - Delete webhook consumer @@ -185,11 +192,11 @@ var res = await sdk.Companies.ListAsync(req); ### Override Server URL Per-Client -The default server can also be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example: +The default server can be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example: ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform( serverUrl: "https://api.codat.io", @@ -197,10 +204,9 @@ var sdk = new CodatPlatform( ); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -223,16 +229,15 @@ This SDK supports the following security scheme globally: To authenticate with the API the `AuthHeader` parameter must be set when initializing the SDK client instance. For example: ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -244,62 +249,87 @@ var res = await sdk.Companies.ListAsync(req); ## Error Handling -Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception. - -By default, an API error will raise a `Codat.Platform.Models.Errors.SDKException` exception, which has the following properties: +[`CodatPlatformException`](./Codat/Platform/Models/Errors/CodatPlatformException.cs) is the base exception class for all HTTP error responses. It has the following properties: | Property | Type | Description | |---------------|-----------------------|-----------------------| -| `Message` | *string* | The error message | -| `StatusCode` | *int* | The HTTP status code | -| `RawResponse` | *HttpResponseMessage* | The raw HTTP response | -| `Body` | *string* | The response content | +| `Message` | *string* | Error message | +| `StatusCode` | *int* | HTTP status code | +| `Headers` | *HttpResponseHeaders* | HTTP headers | +| `ContentType` | *string?* | HTTP content type | +| `RawResponse` | *HttpResponseMessage* | HTTP response object | +| `Body` | *string* | HTTP response body | -When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `ListAsync` method throws the following exceptions: - -| Error Type | Status Code | Content Type | -| ----------------------------------------- | -------------------------------------- | ---------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | +Some exceptions in this SDK include an additional `Payload` field, which will contain deserialized custom error data when present. Possible exceptions are listed in the [Error Classes](#error-classes) section. ### Example ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; -using System; using Codat.Platform.Models.Errors; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); try { ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); // handle response } -catch (Exception ex) +catch (CodatPlatformException ex) // all SDK exceptions inherit from CodatPlatformException { - if (ex is Models.Errors.ErrorMessage) + // ex.ToString() provides a detailed error message + System.Console.WriteLine(ex); + + // Base exception fields + HttpResponseMessage rawResponse = ex.RawResponse; + HttpResponseHeaders headers = ex.Headers; + int statusCode = ex.StatusCode; + string? contentType = ex.ContentType; + var responseBody = ex.Body; + + if (ex is Models.Errors.ErrorMessage) // different exceptions may be thrown depending on the method { - // Handle exception data - throw; + // Check error data fields + Models.Errors.ErrorMessagePayload payload = ex.Payload; + long StatusCode = payload.StatusCode; + string Service = payload.Service; + // ... } - else if (ex is Codat.Platform.Models.Errors.SDKException) + + // An underlying cause may be provided + if (ex.InnerException != null) { - // Handle default exception - throw; + Exception cause = ex.InnerException; } } +catch (System.Net.Http.HttpRequestException ex) +{ + // Check ex.InnerException for Network connectivity errors +} ``` + +### Error Classes + +**Primary exceptions:** +* [`CodatPlatformException`](./Codat/Platform/Models/Errors/CodatPlatformException.cs): The base class for HTTP error responses. + * [`ErrorMessage`](./Codat/Platform/Models/Errors/ErrorMessage.cs): Your `query` parameter was not correctly formed. + +
Less common exceptions (2) + +* [`System.Net.Http.HttpRequestException`](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httprequestexception): Network connectivity error. For more details about the underlying cause, inspect the `ex.InnerException`. + +* Inheriting from [`CodatPlatformException`](./Codat/Platform/Models/Errors/CodatPlatformException.cs): + * [`ResponseValidationError`](./Codat/Platform/Models/Errors/ResponseValidationError.cs): Thrown when the response data could not be deserialized into the expected type. +
@@ -310,16 +340,15 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an 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.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync( @@ -333,7 +362,7 @@ var res = await sdk.Companies.ListAsync( ), retryConnectionErrors: false ), - req + request: req ); // handle response @@ -342,8 +371,8 @@ var res = await sdk.Companies.ListAsync( 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.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform( retryConfig: new RetryConfig( @@ -360,10 +389,9 @@ var sdk = new CodatPlatform( ); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); diff --git a/platform/RELEASES.md b/platform/RELEASES.md index 6b303a315..a30e6c355 100644 --- a/platform/RELEASES.md +++ b/platform/RELEASES.md @@ -206,4 +206,14 @@ Based on: ### Generated - [csharp v6.0.0] platform ### Releases -- [NuGet v6.0.0] https://www.nuget.org/packages/Codat.Platform/6.0.0 - platform \ No newline at end of file +- [NuGet v6.0.0] https://www.nuget.org/packages/Codat.Platform/6.0.0 - platform + +## 2025-10-15 09:33:37 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.636.3 (2.723.11) https://github.com/speakeasy-api/speakeasy +### Generated +- [csharp v6.1.0] platform +### Releases +- [NuGet v6.1.0] https://www.nuget.org/packages/Codat.Platform/6.1.0 - platform \ No newline at end of file diff --git a/platform/USAGE.md b/platform/USAGE.md index 00a60adff..2e0257e38 100644 --- a/platform/USAGE.md +++ b/platform/USAGE.md @@ -1,16 +1,15 @@ ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); diff --git a/platform/docs/Models/Components/ClientRateLimitReachedWebhook.md b/platform/docs/Models/Components/ClientRateLimitReachedWebhook.md deleted file mode 100644 index f9688f30c..000000000 --- a/platform/docs/Models/Components/ClientRateLimitReachedWebhook.md +++ /dev/null @@ -1,16 +0,0 @@ -# ClientRateLimitReachedWebhook - -Webhook request body for a client that has reached their rate limit. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ClientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | -| `ClientName` | *string* | :heavy_minus_sign: | Name of your client in Codat. | -| ~~`RuleId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | -| `RuleType` | *string* | :heavy_minus_sign: | The type of rule. | -| `AlertId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook event. | -| `Message` | *string* | :heavy_minus_sign: | A human-readable message about the webhook. | -| `Data` | [ClientRateLimitReachedWebhookData](../../Models/Components/ClientRateLimitReachedWebhookData.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/Models/Components/ClientRateLimitReachedWebhookData.md b/platform/docs/Models/Components/ClientRateLimitReachedWebhookData.md deleted file mode 100644 index 64767445b..000000000 --- a/platform/docs/Models/Components/ClientRateLimitReachedWebhookData.md +++ /dev/null @@ -1,9 +0,0 @@ -# ClientRateLimitReachedWebhookData - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `DailyQuota` | *long* | :heavy_minus_sign: | The number of available requests per day. | | -| `ExpiresUtc` | *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 | \ No newline at end of file diff --git a/platform/docs/Models/Components/ClientRateLimitResetWebhook.md b/platform/docs/Models/Components/ClientRateLimitResetWebhook.md deleted file mode 100644 index d78d8b131..000000000 --- a/platform/docs/Models/Components/ClientRateLimitResetWebhook.md +++ /dev/null @@ -1,16 +0,0 @@ -# ClientRateLimitResetWebhook - -Webhook request body for a client that has had their rate limit reset. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ClientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | -| `ClientName` | *string* | :heavy_minus_sign: | Name of your client in Codat. | -| ~~`RuleId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | -| `RuleType` | *string* | :heavy_minus_sign: | The type of rule. | -| `AlertId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook event. | -| `Message` | *string* | :heavy_minus_sign: | A human-readable message about the webhook. | -| `Data` | [ClientRateLimitResetWebhookData](../../Models/Components/ClientRateLimitResetWebhookData.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/Models/Components/CompanyUpdateRequest.md b/platform/docs/Models/Components/CompanyUpdateRequest.md new file mode 100644 index 000000000..2e5fa23d7 --- /dev/null +++ b/platform/docs/Models/Components/CompanyUpdateRequest.md @@ -0,0 +1,10 @@ +# CompanyUpdateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `Name` | *string* | :heavy_minus_sign: | Name of company being connected. | Bank of Dave | +| `Description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | +| `Tags` | Dictionary | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/platform/docs/Models/Components/Connection.md b/platform/docs/Models/Components/Connection.md index c8234ba5f..6c1b68359 100644 --- a/platform/docs/Models/Components/Connection.md +++ b/platform/docs/Models/Components/Connection.md @@ -27,4 +27,4 @@ Before you can use a data connection to pull or push data, the company must gran | `LastSync` | *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 | | `Created` | *string* | :heavy_check_mark: | 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 | | `DataConnectionErrors` | List<[DataConnectionError](../../Models/Components/DataConnectionError.md)> | :heavy_minus_sign: | N/A | | -| `ConnectionInfo` | Dictionary | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `ConnectionInfo` | Dictionary | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Components/ConnectionStatusChangedWebhook.md b/platform/docs/Models/Components/ConnectionStatusChangedWebhook.md deleted file mode 100644 index d41feed74..000000000 --- a/platform/docs/Models/Components/ConnectionStatusChangedWebhook.md +++ /dev/null @@ -1,18 +0,0 @@ -# ConnectionStatusChangedWebhook - -Webhook request body for a company's data connection status changed. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ClientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | | -| `ClientName` | *string* | :heavy_minus_sign: | Name of your client in Codat. | | -| `CompanyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `DataConnectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| ~~`RuleId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | | -| `RuleType` | *string* | :heavy_minus_sign: | The type of rule. | | -| `AlertId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook event. | | -| `Message` | *string* | :heavy_minus_sign: | A human-readable message about the webhook. | | -| `Data` | [ConnectionStatusChangedWebhookData](../../Models/Components/ConnectionStatusChangedWebhookData.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Components/ConnectionStatusChangedWebhookData.md b/platform/docs/Models/Components/ConnectionStatusChangedWebhookData.md deleted file mode 100644 index 22d2c3788..000000000 --- a/platform/docs/Models/Components/ConnectionStatusChangedWebhookData.md +++ /dev/null @@ -1,11 +0,0 @@ -# ConnectionStatusChangedWebhookData - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `DataConnectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `NewStatus` | [DataConnectionStatus](../../Models/Components/DataConnectionStatus.md) | :heavy_minus_sign: | The current authorization status of the data connection. | | -| `OldStatus` | [DataConnectionStatus](../../Models/Components/DataConnectionStatus.md) | :heavy_minus_sign: | The current authorization status of the data connection. | | -| `PlatformKey` | *string* | :heavy_minus_sign: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | \ No newline at end of file diff --git a/platform/docs/Models/Components/CreateRule.md b/platform/docs/Models/Components/CreateRule.md deleted file mode 100644 index 555816467..000000000 --- a/platform/docs/Models/Components/CreateRule.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateRule - -Create a message that notifies a URL of an event based on its given type or condition. - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `Type` | *string* | :heavy_check_mark: | The type of webhook. | | -| `CompanyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `Notifiers` | [WebhookNotifier](../../Models/Components/WebhookNotifier.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Components/DataStatus.md b/platform/docs/Models/Components/DataStatus.md index 8ff7f94b0..8c4efbd9a 100644 --- a/platform/docs/Models/Components/DataStatus.md +++ b/platform/docs/Models/Components/DataStatus.md @@ -7,8 +7,8 @@ Describes the state of data in the Codat cache for a company and data type | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `DataType` | [DataStatusDataTypes](../../Models/Components/DataStatusDataTypes.md) | :heavy_check_mark: | Available data types | invoices | -| `LastSuccessfulSync` | *string* | :heavy_check_mark: | 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 | +| `DataType` | [DataTypes](../../Models/Components/DataTypes.md) | :heavy_check_mark: | Available data types | invoices | +| `LastSuccessfulSync` | *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 | | `CurrentStatus` | [Status](../../Models/Components/Status.md) | :heavy_check_mark: | The current status of the dataset. | | | `LatestSyncId` | *string* | :heavy_minus_sign: | Unique identifier for most recent sync of data type. | ad474a37-2003-478e-baee-9af9f1ec2fe3 | | `LatestSuccessfulSyncId` | *string* | :heavy_minus_sign: | Unique identifier for the most recent successful sync of data type. | 8220fc90-55b6-47bc-9417-48ac6ea93101 | \ No newline at end of file diff --git a/platform/docs/Models/Components/DataStatusDataTypes.md b/platform/docs/Models/Components/DataStatusDataTypes.md deleted file mode 100644 index 50d77c535..000000000 --- a/platform/docs/Models/Components/DataStatusDataTypes.md +++ /dev/null @@ -1,52 +0,0 @@ -# DataStatusDataTypes - -Available data types - - -## Values - -| Name | Value | -| ------------------------------ | ------------------------------ | -| `AccountTransactions` | accountTransactions | -| `BalanceSheet` | balanceSheet | -| `BankAccounts` | bankAccounts | -| `BankTransactions` | bankTransactions | -| `BillCreditNotes` | billCreditNotes | -| `BillPayments` | billPayments | -| `Bills` | bills | -| `CashFlowStatement` | cashFlowStatement | -| `ChartOfAccounts` | chartOfAccounts | -| `Company` | company | -| `CreditNotes` | creditNotes | -| `Customers` | customers | -| `DirectCosts` | directCosts | -| `DirectIncomes` | directIncomes | -| `Invoices` | invoices | -| `ItemReceipts` | itemReceipts | -| `Items` | items | -| `JournalEntries` | journalEntries | -| `Journals` | journals | -| `PaymentMethods` | paymentMethods | -| `Payments` | payments | -| `ProfitAndLoss` | profitAndLoss | -| `PurchaseOrders` | purchaseOrders | -| `SalesOrders` | salesOrders | -| `Suppliers` | suppliers | -| `TaxRates` | taxRates | -| `TrackingCategories` | trackingCategories | -| `Transfers` | transfers | -| `BankingAccountBalances` | banking-accountBalances | -| `BankingAccounts` | banking-accounts | -| `BankingTransactionCategories` | banking-transactionCategories | -| `BankingTransactions` | banking-transactions | -| `CommerceCompanyInfo` | commerce-companyInfo | -| `CommerceCustomers` | commerce-customers | -| `CommerceDisputes` | commerce-disputes | -| `CommerceLocations` | commerce-locations | -| `CommerceOrders` | commerce-orders | -| `CommercePaymentMethods` | commerce-paymentMethods | -| `CommercePayments` | commerce-payments | -| `CommerceProductCategories` | commerce-productCategories | -| `CommerceProducts` | commerce-products | -| `CommerceTaxComponents` | commerce-taxComponents | -| `CommerceTransactions` | commerce-transactions | \ No newline at end of file diff --git a/platform/docs/Models/Components/DataSyncCompletedWebhook.md b/platform/docs/Models/Components/DataSyncCompletedWebhook.md deleted file mode 100644 index 530fb54f2..000000000 --- a/platform/docs/Models/Components/DataSyncCompletedWebhook.md +++ /dev/null @@ -1,18 +0,0 @@ -# DataSyncCompletedWebhook - -Webhook request body to notify the completion of a data sync. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ClientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | | -| `ClientName` | *string* | :heavy_minus_sign: | Name of your client in Codat. | | -| `CompanyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `DataConnectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| ~~`RuleId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | | -| `RuleType` | *string* | :heavy_minus_sign: | The type of rule. | | -| `AlertId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook event. | | -| `Message` | *string* | :heavy_minus_sign: | A human-readable message about the webhook. | | -| `Data` | [DataSyncCompletedWebhookData](../../Models/Components/DataSyncCompletedWebhookData.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Components/DataSyncCompletedWebhookData.md b/platform/docs/Models/Components/DataSyncCompletedWebhookData.md deleted file mode 100644 index 4571c0378..000000000 --- a/platform/docs/Models/Components/DataSyncCompletedWebhookData.md +++ /dev/null @@ -1,9 +0,0 @@ -# DataSyncCompletedWebhookData - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `DataType` | [PropertieDataType](../../Models/Components/PropertieDataType.md) | :heavy_minus_sign: | Available data types | invoices | -| `DatasetId` | *string* | :heavy_minus_sign: | Unique identifier for the dataset that completed its sync. | | \ No newline at end of file diff --git a/platform/docs/Models/Components/DataTypeFeature.md b/platform/docs/Models/Components/DataTypeFeature.md index 8d54e3e09..2d1514989 100644 --- a/platform/docs/Models/Components/DataTypeFeature.md +++ b/platform/docs/Models/Components/DataTypeFeature.md @@ -7,5 +7,5 @@ Describes support for a given datatype and associated operations | Field | Type | Required | Description | Example | | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `DataType` | [PropertieDataType](../../Models/Components/PropertieDataType.md) | :heavy_minus_sign: | Available data types | invoices | +| `DataType` | [Models.Components.DataType](../../Models/Components/DataType.md) | :heavy_minus_sign: | Available data types | invoices | | `SupportedFeatures` | List<[SupportedFeature](../../Models/Components/SupportedFeature.md)> | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Components/DataTypeReadSummary.md b/platform/docs/Models/Components/DataTypeReadSummary.md new file mode 100644 index 000000000..02b8cea3a --- /dev/null +++ b/platform/docs/Models/Components/DataTypeReadSummary.md @@ -0,0 +1,12 @@ +# DataTypeReadSummary + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `ConnectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `DataType` | [Models.Components.DataType](../../Models/Components/DataType.md) | :heavy_minus_sign: | Available data types | invoices | +| `RecordsModified` | *bool* | :heavy_minus_sign: | `True` if records have been created, updated or deleted in Codat's cache. | false | +| `Status` | [Status](../../Models/Components/Status.md) | :heavy_minus_sign: | The current status of the dataset. | | +| `Issues` | List<[Issue](../../Models/Components/Issue.md)> | :heavy_minus_sign: | A array of issues encountered during a data read. | | \ No newline at end of file diff --git a/platform/docs/Models/Components/DataTypes.md b/platform/docs/Models/Components/DataTypes.md index 413bff5fe..3ea6fa56e 100644 --- a/platform/docs/Models/Components/DataTypes.md +++ b/platform/docs/Models/Components/DataTypes.md @@ -1,11 +1,52 @@ # DataTypes +Available data types -## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `ConnectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `DataType` | [PropertieDataType](../../Models/Components/PropertieDataType.md) | :heavy_minus_sign: | Available data types | invoices | -| `RecordsModified` | *bool* | :heavy_minus_sign: | `True` if records have been created, updated or deleted in Codat's cache. | false | -| `Status` | [Status](../../Models/Components/Status.md) | :heavy_minus_sign: | The current status of the dataset. | | \ No newline at end of file +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `AccountTransactions` | accountTransactions | +| `BalanceSheet` | balanceSheet | +| `BankAccounts` | bankAccounts | +| `BankTransactions` | bankTransactions | +| `BillCreditNotes` | billCreditNotes | +| `BillPayments` | billPayments | +| `Bills` | bills | +| `CashFlowStatement` | cashFlowStatement | +| `ChartOfAccounts` | chartOfAccounts | +| `Company` | company | +| `CreditNotes` | creditNotes | +| `Customers` | customers | +| `DirectCosts` | directCosts | +| `DirectIncomes` | directIncomes | +| `Invoices` | invoices | +| `ItemReceipts` | itemReceipts | +| `Items` | items | +| `JournalEntries` | journalEntries | +| `Journals` | journals | +| `PaymentMethods` | paymentMethods | +| `Payments` | payments | +| `ProfitAndLoss` | profitAndLoss | +| `PurchaseOrders` | purchaseOrders | +| `SalesOrders` | salesOrders | +| `Suppliers` | suppliers | +| `TaxRates` | taxRates | +| `TrackingCategories` | trackingCategories | +| `Transfers` | transfers | +| `BankingAccountBalances` | banking-accountBalances | +| `BankingAccounts` | banking-accounts | +| `BankingTransactionCategories` | banking-transactionCategories | +| `BankingTransactions` | banking-transactions | +| `CommerceCompanyInfo` | commerce-companyInfo | +| `CommerceCustomers` | commerce-customers | +| `CommerceDisputes` | commerce-disputes | +| `CommerceLocations` | commerce-locations | +| `CommerceOrders` | commerce-orders | +| `CommercePaymentMethods` | commerce-paymentMethods | +| `CommercePayments` | commerce-payments | +| `CommerceProductCategories` | commerce-productCategories | +| `CommerceProducts` | commerce-products | +| `CommerceTaxComponents` | commerce-taxComponents | +| `CommerceTransactions` | commerce-transactions | \ No newline at end of file diff --git a/platform/docs/Models/Components/DatasetDataChangedWebhook.md b/platform/docs/Models/Components/DatasetDataChangedWebhook.md deleted file mode 100644 index e1da6d658..000000000 --- a/platform/docs/Models/Components/DatasetDataChangedWebhook.md +++ /dev/null @@ -1,18 +0,0 @@ -# DatasetDataChangedWebhook - -Webhook request body to notify that a data synchronization has completed. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ClientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | | -| `ClientName` | *string* | :heavy_minus_sign: | Name of your client in Codat. | | -| `CompanyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `DataConnectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| ~~`RuleId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | | -| `RuleType` | *string* | :heavy_minus_sign: | The type of rule. | | -| `AlertId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook event. | | -| `Message` | *string* | :heavy_minus_sign: | A human-readable message about the webhook. | | -| `Data` | [DatasetDataChangedWebhookData](../../Models/Components/DatasetDataChangedWebhookData.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Components/DatasetDataChangedWebhookData.md b/platform/docs/Models/Components/DatasetDataChangedWebhookData.md deleted file mode 100644 index 67897766d..000000000 --- a/platform/docs/Models/Components/DatasetDataChangedWebhookData.md +++ /dev/null @@ -1,9 +0,0 @@ -# DatasetDataChangedWebhookData - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `DataType` | [PropertieDataType](../../Models/Components/PropertieDataType.md) | :heavy_minus_sign: | Available data types | invoices | -| `DatasetId` | *string* | :heavy_minus_sign: | Unique identifier for the dataset that completed its sync. | | \ No newline at end of file diff --git a/platform/docs/Models/Components/DatasetStatusChangedErrorWebhook.md b/platform/docs/Models/Components/DatasetStatusChangedErrorWebhook.md deleted file mode 100644 index 308e72d53..000000000 --- a/platform/docs/Models/Components/DatasetStatusChangedErrorWebhook.md +++ /dev/null @@ -1,18 +0,0 @@ -# DatasetStatusChangedErrorWebhook - -Webhook request body to notify that a data synchronization has completed. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ClientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | | -| `ClientName` | *string* | :heavy_minus_sign: | Name of your client in Codat. | | -| `CompanyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `DataConnectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| ~~`RuleId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | | -| `RuleType` | *string* | :heavy_minus_sign: | The type of rule. | | -| `AlertId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook event. | | -| `Message` | *string* | :heavy_minus_sign: | A human-readable message about the webhook. | | -| `Data` | [DatasetStatusChangedErrorWebhookData](../../Models/Components/DatasetStatusChangedErrorWebhookData.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Components/DatasetStatusChangedErrorWebhookData.md b/platform/docs/Models/Components/DatasetStatusChangedErrorWebhookData.md deleted file mode 100644 index d91a74fb6..000000000 --- a/platform/docs/Models/Components/DatasetStatusChangedErrorWebhookData.md +++ /dev/null @@ -1,10 +0,0 @@ -# DatasetStatusChangedErrorWebhookData - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `DataType` | [PropertieDataType](../../Models/Components/PropertieDataType.md) | :heavy_minus_sign: | Available data types | invoices | -| `DatasetStatus` | *string* | :heavy_minus_sign: | The current status of the dataset's sync. | | -| `DatasetId` | *string* | :heavy_minus_sign: | Unique identifier for the dataset that completed its sync. | | \ No newline at end of file diff --git a/platform/docs/Models/Components/Issue.md b/platform/docs/Models/Components/Issue.md new file mode 100644 index 000000000..be81b88cb --- /dev/null +++ b/platform/docs/Models/Components/Issue.md @@ -0,0 +1,12 @@ +# Issue + +Details of a problem encountered during a data read. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `Type` | *string* | :heavy_minus_sign: | The type of issue. | warning.validation | +| `Message` | *string* | :heavy_minus_sign: | A message describing the issue. | Something doesn't look right about these accounts from Xero. You can see more information in the logs. | +| `Links` | [IssueLinks](../../Models/Components/IssueLinks.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Requests/ListRulesRequest.md b/platform/docs/Models/Components/IssueLinks.md similarity index 50% rename from platform/docs/Models/Requests/ListRulesRequest.md rename to platform/docs/Models/Components/IssueLinks.md index d44a59074..d4615337b 100644 --- a/platform/docs/Models/Requests/ListRulesRequest.md +++ b/platform/docs/Models/Components/IssueLinks.md @@ -1,11 +1,10 @@ -# ListRulesRequest +# IssueLinks ## Fields | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | -| `OrderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file +| `Logs` | *string* | :heavy_minus_sign: | A link to the validation logs, providing details on any errors or warnings encountered. | https://api.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/sync/{datasetId}/validation | +| `Portal` | *string* | :heavy_minus_sign: | A link to the company's past data read history in the Codat portal. | https://app.codat.io/companies/0498e921-9b53-4396-a412-4f2f5983b0a2/pull-history | +| `ReadMore` | *string* | :heavy_minus_sign: | A link to Codat's documentation with additional information on how to troubleshoot this issue. | https://docs.codat.io/using-the-api/get-data-troubleshooting#warning.validation | \ No newline at end of file diff --git a/platform/docs/Models/Components/ModifiedDate.md b/platform/docs/Models/Components/ModifiedDate.md index c7aeaef8c..61ef3bb07 100644 --- a/platform/docs/Models/Components/ModifiedDate.md +++ b/platform/docs/Models/Components/ModifiedDate.md @@ -5,4 +5,4 @@ | Field | Type | Required | Description | Example | | ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | -| `ModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file +| `ModifiedDateValue` | *string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/platform/docs/Models/Components/NewCompanySynchronizedWebhook.md b/platform/docs/Models/Components/NewCompanySynchronizedWebhook.md deleted file mode 100644 index c884530ac..000000000 --- a/platform/docs/Models/Components/NewCompanySynchronizedWebhook.md +++ /dev/null @@ -1,17 +0,0 @@ -# NewCompanySynchronizedWebhook - -Webhook request body to notify that a new company has successfully synchronized at least one dataType for the first time. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ClientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | | -| `ClientName` | *string* | :heavy_minus_sign: | Name of your client in Codat. | | -| `CompanyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `DataConnectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| ~~`RuleId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | | -| `RuleType` | *string* | :heavy_minus_sign: | The type of rule. | | -| `AlertId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook event. | | -| `Message` | *string* | :heavy_minus_sign: | A human-readable message about the webhook. | | \ No newline at end of file diff --git a/platform/docs/Models/Components/Profile.md b/platform/docs/Models/Components/Profile.md index f82136a69..70a75b305 100644 --- a/platform/docs/Models/Components/Profile.md +++ b/platform/docs/Models/Components/Profile.md @@ -13,5 +13,4 @@ Describes your Codat client instance | `RedirectUrl` | *string* | :heavy_check_mark: | The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB. | https://bobs-burgers.{countrySuffix}/{companyId} | | `WhiteListUrls` | List<*string*> | :heavy_minus_sign: | A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat. | | | ~~`ApiKey`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The API key for this Codat instance. | sartANTjHAkLdbyDfaynoTQb7pkmj6hXHmnQKMrB | -| `AlertAuthHeader` | *string* | :heavy_minus_sign: | Alert or webhooks authorization header. | Bearer tXEiHiRK7XCtI8TNHbpGs1LI1pumdb4Cl1QIo7B2 | | ~~`ConfirmCompanyName`~~ | *bool* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

`True` if the company name has been confirmed. | | \ No newline at end of file diff --git a/platform/docs/Models/Components/PropertieDataType.md b/platform/docs/Models/Components/PropertieDataType.md deleted file mode 100644 index 1defb94d6..000000000 --- a/platform/docs/Models/Components/PropertieDataType.md +++ /dev/null @@ -1,52 +0,0 @@ -# PropertieDataType - -Available data types - - -## Values - -| Name | Value | -| ------------------------------ | ------------------------------ | -| `AccountTransactions` | accountTransactions | -| `BalanceSheet` | balanceSheet | -| `BankAccounts` | bankAccounts | -| `BankTransactions` | bankTransactions | -| `BillCreditNotes` | billCreditNotes | -| `BillPayments` | billPayments | -| `Bills` | bills | -| `CashFlowStatement` | cashFlowStatement | -| `ChartOfAccounts` | chartOfAccounts | -| `Company` | company | -| `CreditNotes` | creditNotes | -| `Customers` | customers | -| `DirectCosts` | directCosts | -| `DirectIncomes` | directIncomes | -| `Invoices` | invoices | -| `ItemReceipts` | itemReceipts | -| `Items` | items | -| `JournalEntries` | journalEntries | -| `Journals` | journals | -| `PaymentMethods` | paymentMethods | -| `Payments` | payments | -| `ProfitAndLoss` | profitAndLoss | -| `PurchaseOrders` | purchaseOrders | -| `SalesOrders` | salesOrders | -| `Suppliers` | suppliers | -| `TaxRates` | taxRates | -| `TrackingCategories` | trackingCategories | -| `Transfers` | transfers | -| `BankingAccountBalances` | banking-accountBalances | -| `BankingAccounts` | banking-accounts | -| `BankingTransactionCategories` | banking-transactionCategories | -| `BankingTransactions` | banking-transactions | -| `CommerceCompanyInfo` | commerce-companyInfo | -| `CommerceCustomers` | commerce-customers | -| `CommerceDisputes` | commerce-disputes | -| `CommerceLocations` | commerce-locations | -| `CommerceOrders` | commerce-orders | -| `CommercePaymentMethods` | commerce-paymentMethods | -| `CommercePayments` | commerce-payments | -| `CommerceProductCategories` | commerce-productCategories | -| `CommerceProducts` | commerce-products | -| `CommerceTaxComponents` | commerce-taxComponents | -| `CommerceTransactions` | commerce-transactions | \ No newline at end of file diff --git a/platform/docs/Models/Components/PushOperation.md b/platform/docs/Models/Components/PushOperation.md index 20f657589..5e426fd1d 100644 --- a/platform/docs/Models/Components/PushOperation.md +++ b/platform/docs/Models/Components/PushOperation.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Changes` | List<[PushOperationChange](../../Models/Components/PushOperationChange.md)> | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `DataType` | [PropertieDataType](../../Models/Components/PropertieDataType.md) | :heavy_minus_sign: | Available data types | invoices | +| `DataType` | [Models.Components.DataType](../../Models/Components/DataType.md) | :heavy_minus_sign: | Available data types | invoices | | `CompanyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `PushOperationKey` | *string* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | | `DataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | diff --git a/platform/docs/Models/Components/PushOperationRef.md b/platform/docs/Models/Components/PushOperationRef.md index 484517235..261684686 100644 --- a/platform/docs/Models/Components/PushOperationRef.md +++ b/platform/docs/Models/Components/PushOperationRef.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | | `Id` | *string* | :heavy_minus_sign: | Unique identifier for a push operation. | | -| `DataType` | [PropertieDataType](../../Models/Components/PropertieDataType.md) | :heavy_minus_sign: | Available data types | invoices | \ No newline at end of file +| `DataType` | [Models.Components.DataType](../../Models/Components/DataType.md) | :heavy_minus_sign: | Available data types | invoices | \ No newline at end of file diff --git a/platform/docs/Models/Components/PushOperationStatusChangedWebhook.md b/platform/docs/Models/Components/PushOperationStatusChangedWebhook.md deleted file mode 100644 index 469ccb5fe..000000000 --- a/platform/docs/Models/Components/PushOperationStatusChangedWebhook.md +++ /dev/null @@ -1,18 +0,0 @@ -# PushOperationStatusChangedWebhook - -Webhook request body for a push operation status change. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ClientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | | -| `ClientName` | *string* | :heavy_minus_sign: | Name of your client in Codat. | | -| `CompanyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `DataConnectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| ~~`RuleId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | | -| `RuleType` | *string* | :heavy_minus_sign: | The type of rule. | | -| `AlertId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook event. | | -| `Message` | *string* | :heavy_minus_sign: | A human-readable message about the webhook. | | -| `Data` | [PushOperationStatusChangedWebhookData](../../Models/Components/PushOperationStatusChangedWebhookData.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Components/PushOperationStatusChangedWebhookData.md b/platform/docs/Models/Components/PushOperationStatusChangedWebhookData.md deleted file mode 100644 index b0727a99a..000000000 --- a/platform/docs/Models/Components/PushOperationStatusChangedWebhookData.md +++ /dev/null @@ -1,10 +0,0 @@ -# PushOperationStatusChangedWebhookData - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `DataType` | [PropertieDataType](../../Models/Components/PropertieDataType.md) | :heavy_minus_sign: | Available data types | invoices | -| `Status` | [PushOperationStatus](../../Models/Components/PushOperationStatus.md) | :heavy_minus_sign: | The current status of the push operation. | | -| `PushOperationKey` | *string* | :heavy_minus_sign: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | \ No newline at end of file diff --git a/platform/docs/Models/Components/PushOperationTimedOutWebhook.md b/platform/docs/Models/Components/PushOperationTimedOutWebhook.md deleted file mode 100644 index f653b2c61..000000000 --- a/platform/docs/Models/Components/PushOperationTimedOutWebhook.md +++ /dev/null @@ -1,18 +0,0 @@ -# PushOperationTimedOutWebhook - -Webhook request body notifying that a push push operation has timed out. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ClientId` | *string* | :heavy_minus_sign: | Unique identifier for your client in Codat. | | -| `ClientName` | *string* | :heavy_minus_sign: | Name of your client in Codat. | | -| `CompanyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `DataConnectionId` | *string* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| ~~`RuleId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | | -| `RuleType` | *string* | :heavy_minus_sign: | The type of rule. | | -| `AlertId` | *string* | :heavy_minus_sign: | Unique identifier of the webhook event. | | -| `Message` | *string* | :heavy_minus_sign: | A human-readable message about the webhook. | | -| `Data` | [PushOperationTimedOutWebhookData](../../Models/Components/PushOperationTimedOutWebhookData.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Components/PushOperationTimedOutWebhookData.md b/platform/docs/Models/Components/PushOperationTimedOutWebhookData.md deleted file mode 100644 index fb44a09be..000000000 --- a/platform/docs/Models/Components/PushOperationTimedOutWebhookData.md +++ /dev/null @@ -1,10 +0,0 @@ -# PushOperationTimedOutWebhookData - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `DataType` | [PropertieDataType](../../Models/Components/PropertieDataType.md) | :heavy_minus_sign: | Available data types | invoices | -| `PushOperationKey` | *string* | :heavy_minus_sign: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | -| `PushOperationGuid` | *string* | :heavy_minus_sign: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | \ No newline at end of file diff --git a/platform/docs/Models/Components/ReadCompletedWebhookPayload.md b/platform/docs/Models/Components/ReadCompletedWebhookPayload.md index 307d0c504..3f829137b 100644 --- a/platform/docs/Models/Components/ReadCompletedWebhookPayload.md +++ b/platform/docs/Models/Components/ReadCompletedWebhookPayload.md @@ -7,4 +7,4 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ReferenceCompany` | [CompanyReference](../../Models/Components/CompanyReference.md) | :heavy_minus_sign: | N/A | | | `ModifiedFromDate` | *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 | -| `DataTypes` | List<[DataTypes](../../Models/Components/DataTypes.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `DataTypes` | List<[DataTypeReadSummary](../../Models/Components/DataTypeReadSummary.md)> | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Components/SyncSetting.md b/platform/docs/Models/Components/SyncSetting.md index 2b22003fa..a6ffc93b3 100644 --- a/platform/docs/Models/Components/SyncSetting.md +++ b/platform/docs/Models/Components/SyncSetting.md @@ -7,7 +7,7 @@ Describes how often, and how much history, should be fetched for the given data | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `DataType` | [PropertieDataType](../../Models/Components/PropertieDataType.md) | :heavy_check_mark: | Available data types | invoices | +| `DataType` | [Models.Components.DataType](../../Models/Components/DataType.md) | :heavy_check_mark: | Available data types | invoices | | `FetchOnFirstLink` | *bool* | :heavy_check_mark: | Whether this data type should be queued after a company has authorized a connection. | | | `SyncSchedule` | *long* | :heavy_check_mark: | Number of hours after which this data type should be refreshed. | 24 | | `SyncOrder` | *long* | :heavy_check_mark: | The sync in which data types are queued for a sync. | | diff --git a/platform/docs/Models/Components/Validation.md b/platform/docs/Models/Components/Validation.md index bb042fd17..2cb56c6e5 100644 --- a/platform/docs/Models/Components/Validation.md +++ b/platform/docs/Models/Components/Validation.md @@ -5,7 +5,7 @@ A human-readable object describing validation decisions Codat has made when push ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `Errors` | List<[ValidationItem](../../Models/Components/ValidationItem.md)> | :heavy_minus_sign: | N/A | -| `Warnings` | List<[ValidationItem](../../Models/Components/ValidationItem.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Errors` | List<[ValidationItem1](../../Models/Components/ValidationItem1.md)> | :heavy_minus_sign: | N/A | +| `Warnings` | List<[ValidationItem1](../../Models/Components/ValidationItem1.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/Models/Components/ValidationItem.md b/platform/docs/Models/Components/ValidationItem.md index 99d285792..21ceb7e5f 100644 --- a/platform/docs/Models/Components/ValidationItem.md +++ b/platform/docs/Models/Components/ValidationItem.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `ItemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `Message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | -| `ValidatorName` | *string* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `RuleId` | *string* | :heavy_minus_sign: | The unique identifier of the rule that wasn't met. | +| `ItemId` | *string* | :heavy_minus_sign: | The unique identifier of the item that was validated. | +| `Message` | *string* | :heavy_minus_sign: | The message that describes the validation warning or error. | +| `ValidatorName` | *string* | :heavy_minus_sign: | The name of the validator that was used to validate the item. | \ No newline at end of file diff --git a/platform/docs/Models/Components/ValidationItem1.md b/platform/docs/Models/Components/ValidationItem1.md new file mode 100644 index 000000000..f84782ce6 --- /dev/null +++ b/platform/docs/Models/Components/ValidationItem1.md @@ -0,0 +1,10 @@ +# ValidationItem1 + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `ItemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `Message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | +| `ValidatorName` | *string* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/platform/docs/Models/Components/ValidationResult.md b/platform/docs/Models/Components/ValidationResult.md new file mode 100644 index 000000000..85bcef70e --- /dev/null +++ b/platform/docs/Models/Components/ValidationResult.md @@ -0,0 +1,9 @@ +# ValidationResult + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `Errors` | List<[ValidationItem](../../Models/Components/ValidationItem.md)> | :heavy_minus_sign: | N/A | +| `Warnings` | List<[ValidationItem](../../Models/Components/ValidationItem.md)> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/Models/Components/Webhook.md b/platform/docs/Models/Components/Webhook.md deleted file mode 100644 index 1092f632d..000000000 --- a/platform/docs/Models/Components/Webhook.md +++ /dev/null @@ -1,13 +0,0 @@ -# Webhook - -Configuration to provide an event notification to a URL or list of email addresses based on the given type or condition. - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `Id` | *string* | :heavy_minus_sign: | Unique identifier for the configured notification. | ff89c50e-a719-4ef5-a182-9917e53927b6 | -| `Type` | *string* | :heavy_check_mark: | The type of webhook. | | -| `CompanyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `Notifiers` | [WebhookNotifier](../../Models/Components/WebhookNotifier.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Components/WebhookConsumer.md b/platform/docs/Models/Components/WebhookConsumer.md index bf5cbdd0f..b74e974b1 100644 --- a/platform/docs/Models/Components/WebhookConsumer.md +++ b/platform/docs/Models/Components/WebhookConsumer.md @@ -8,11 +8,10 @@ See our documentation for more details on [Codat's webhook service](https://docs ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Id` | *string* | :heavy_minus_sign: | Unique identifier for the webhook consumer. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `Url` | *string* | :heavy_minus_sign: | The URL that will consume webhook events dispatched by Codat. | | -| `Disabled` | *bool* | :heavy_minus_sign: | Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. | | -| `EventTypes` | List<*string*> | :heavy_minus_sign: | An array of event types the webhook consumer subscribes to. | | -| `CompanyTags` | List<*string*> | :heavy_minus_sign: | Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. | | -| ~~`CompanyId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Id` | *string* | :heavy_minus_sign: | Unique identifier for the webhook consumer. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `Url` | *string* | :heavy_minus_sign: | The URL that will consume webhook events dispatched by Codat. | | +| `Disabled` | *bool* | :heavy_minus_sign: | Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. | | +| `EventTypes` | List<*string*> | :heavy_minus_sign: | An array of event types the webhook consumer subscribes to. | | +| `CompanyTags` | List<*string*> | :heavy_minus_sign: | Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. | | \ No newline at end of file diff --git a/platform/docs/Models/Components/WebhookConsumerPrototype.md b/platform/docs/Models/Components/WebhookConsumerPrototype.md index 6c2034d9d..d9c195f9a 100644 --- a/platform/docs/Models/Components/WebhookConsumerPrototype.md +++ b/platform/docs/Models/Components/WebhookConsumerPrototype.md @@ -3,10 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Url` | *string* | :heavy_minus_sign: | The URL that will consume webhook events dispatched by Codat. | | -| `Disabled` | *bool* | :heavy_minus_sign: | Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. | | -| `EventTypes` | List<*string*> | :heavy_minus_sign: | An array of event types the webhook consumer subscribes to. | | -| `CompanyTags` | List<*string*> | :heavy_minus_sign: | Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. | | -| ~~`CompanyId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Url` | *string* | :heavy_minus_sign: | The URL that will consume webhook events dispatched by Codat. | +| `Disabled` | *bool* | :heavy_minus_sign: | Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. | +| `EventTypes` | List<*string*> | :heavy_minus_sign: | An array of event types the webhook consumer subscribes to. | +| `CompanyTags` | List<*string*> | :heavy_minus_sign: | Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. | \ No newline at end of file diff --git a/platform/docs/Models/Components/WebhookNotifier.md b/platform/docs/Models/Components/WebhookNotifier.md deleted file mode 100644 index 89013efb3..000000000 --- a/platform/docs/Models/Components/WebhookNotifier.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookNotifier - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `Emails` | List<*string*> | :heavy_minus_sign: | N/A | | -| `Webhook` | *string* | :heavy_minus_sign: | The URI the webhook service will use to post events. | https://webhook.client.com | \ No newline at end of file diff --git a/platform/docs/Models/Components/Webhooks.md b/platform/docs/Models/Components/Webhooks.md deleted file mode 100644 index f2298ff7e..000000000 --- a/platform/docs/Models/Components/Webhooks.md +++ /dev/null @@ -1,12 +0,0 @@ -# Webhooks - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `Results` | List<[Webhook](../../Models/Components/Webhook.md)> | :heavy_minus_sign: | N/A | | -| `PageNumber` | *long* | :heavy_check_mark: | Current page number. | | -| `PageSize` | *long* | :heavy_check_mark: | Number of items to return in results array. | | -| `TotalResults` | *long* | :heavy_check_mark: | Total number of items. | | -| `Links` | [Links](../../Models/Components/Links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file diff --git a/platform/docs/Models/Requests/CreateCompanyResponse.md b/platform/docs/Models/Requests/CreateCompanyResponse.md index def78685c..ebbbbda7f 100644 --- a/platform/docs/Models/Requests/CreateCompanyResponse.md +++ b/platform/docs/Models/Requests/CreateCompanyResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"tags": {
"region": "us",
"uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"
},
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
]
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"tags": {
"region": "us",
"uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"
},
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
],
"products": [
"spend-insights",
"lending"
]
} | \ No newline at end of file diff --git a/platform/docs/Models/Requests/CreateRuleResponse.md b/platform/docs/Models/Requests/CreateRuleResponse.md deleted file mode 100644 index 88d6afe42..000000000 --- a/platform/docs/Models/Requests/CreateRuleResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateRuleResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `Webhook` | [Webhook](../../Models/Components/Webhook.md) | :heavy_minus_sign: | OK | {
"type": "DataConnectionStatusChanged",
"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e",
"notifiers": {
"emails": [
"info@client.com"
],
"webhook": "https://webhook.client.com"
}
} | \ No newline at end of file diff --git a/platform/docs/Models/Requests/GetCompanyResponse.md b/platform/docs/Models/Requests/GetCompanyResponse.md index 2151d7b95..816d16523 100644 --- a/platform/docs/Models/Requests/GetCompanyResponse.md +++ b/platform/docs/Models/Requests/GetCompanyResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"tags": {
"region": "us",
"uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"
},
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
]
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"tags": {
"region": "us",
"uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"
},
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
],
"products": [
"spend-insights",
"lending"
]
} | \ No newline at end of file diff --git a/platform/docs/Models/Webhooks/ClientRateLimitReachedResponse1.md b/platform/docs/Models/Requests/GetCorsSettingsResponse.md similarity index 62% rename from platform/docs/Models/Webhooks/ClientRateLimitReachedResponse1.md rename to platform/docs/Models/Requests/GetCorsSettingsResponse.md index be0a6f609..aa21ef750 100644 --- a/platform/docs/Models/Webhooks/ClientRateLimitReachedResponse1.md +++ b/platform/docs/Models/Requests/GetCorsSettingsResponse.md @@ -1,10 +1,11 @@ -# ClientRateLimitReachedResponse1 +# GetCorsSettingsResponse ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `ConnectionManagementAllowedOrigins` | [ConnectionManagementAllowedOrigins](../../Models/Components/ConnectionManagementAllowedOrigins.md) | :heavy_minus_sign: | Success | {
"allowedOrigins": [
"https://www.bank-of-dave.com"
]
} | \ No newline at end of file diff --git a/platform/docs/Models/Requests/GetReadValidationResultsRequest.md b/platform/docs/Models/Requests/GetReadValidationResultsRequest.md new file mode 100644 index 000000000..40521bd71 --- /dev/null +++ b/platform/docs/Models/Requests/GetReadValidationResultsRequest.md @@ -0,0 +1,9 @@ +# GetReadValidationResultsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `CompanyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `DatasetId` | *string* | :heavy_check_mark: | Unique identifier for the dataset that completed its sync. | | \ No newline at end of file diff --git a/platform/docs/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.md b/platform/docs/Models/Requests/GetReadValidationResultsResponse.md similarity index 82% rename from platform/docs/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.md rename to platform/docs/Models/Requests/GetReadValidationResultsResponse.md index 59c6f8917..d9aadad10 100644 --- a/platform/docs/Models/Webhooks/CompanyDataConnectionStatusChangedResponse.md +++ b/platform/docs/Models/Requests/GetReadValidationResultsResponse.md @@ -1,4 +1,4 @@ -# CompanyDataConnectionStatusChangedResponse +# GetReadValidationResultsResponse ## Fields @@ -7,4 +7,5 @@ | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `ValidationResult` | [ValidationResult](../../Models/Components/ValidationResult.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/platform/docs/Models/Requests/GetWebhookRequest.md b/platform/docs/Models/Requests/GetWebhookRequest.md deleted file mode 100644 index 5e0f4c7ac..000000000 --- a/platform/docs/Models/Requests/GetWebhookRequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetWebhookRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `RuleId` | *string* | :heavy_check_mark: | Unique ID of the webhook or rule. | 7318949f-c008-4936-a8ff-10d7ab563fa6 | \ No newline at end of file diff --git a/platform/docs/Models/Requests/GetWebhookResponse.md b/platform/docs/Models/Requests/GetWebhookResponse.md deleted file mode 100644 index a730453de..000000000 --- a/platform/docs/Models/Requests/GetWebhookResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetWebhookResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `Webhook` | [Webhook](../../Models/Components/Webhook.md) | :heavy_minus_sign: | OK | {
"type": "DataConnectionStatusChanged",
"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e",
"notifiers": {
"emails": [
"info@client.com"
],
"webhook": "https://webhook.client.com"
}
} | \ No newline at end of file diff --git a/platform/docs/Models/Requests/ListCompaniesRequest.md b/platform/docs/Models/Requests/ListCompaniesRequest.md index edfdc6b36..350f218c0 100644 --- a/platform/docs/Models/Requests/ListCompaniesRequest.md +++ b/platform/docs/Models/Requests/ListCompaniesRequest.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | -| `OrderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +| `OrderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `Tags` | *string* | :heavy_minus_sign: | Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying). | region=uk && team=invoice-finance | \ No newline at end of file diff --git a/platform/docs/Models/Requests/ListRulesResponse.md b/platform/docs/Models/Requests/ListRulesResponse.md deleted file mode 100644 index 732555abf..000000000 --- a/platform/docs/Models/Requests/ListRulesResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListRulesResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `Webhooks` | [Models.Components.Webhooks](../../Models/Components/Webhooks.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/platform/docs/Models/Requests/RefreshProductDataRequest.md b/platform/docs/Models/Requests/RefreshProductDataRequest.md new file mode 100644 index 000000000..9cc787bcf --- /dev/null +++ b/platform/docs/Models/Requests/RefreshProductDataRequest.md @@ -0,0 +1,9 @@ +# RefreshProductDataRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `CompanyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `ProductIdentifier` | *string* | :heavy_check_mark: | Human-readable product identifier for a product. | bank-feeds | \ No newline at end of file diff --git a/platform/docs/Models/Webhooks/DatasetDataChangedResponse.md b/platform/docs/Models/Requests/RefreshProductDataResponse.md similarity index 98% rename from platform/docs/Models/Webhooks/DatasetDataChangedResponse.md rename to platform/docs/Models/Requests/RefreshProductDataResponse.md index d87361051..6ff51304a 100644 --- a/platform/docs/Models/Webhooks/DatasetDataChangedResponse.md +++ b/platform/docs/Models/Requests/RefreshProductDataResponse.md @@ -1,4 +1,4 @@ -# DatasetDataChangedResponse +# RefreshProductDataResponse ## Fields diff --git a/platform/docs/Models/Requests/ReplaceCompanyRequest.md b/platform/docs/Models/Requests/ReplaceCompanyRequest.md new file mode 100644 index 000000000..b3b949cbb --- /dev/null +++ b/platform/docs/Models/Requests/ReplaceCompanyRequest.md @@ -0,0 +1,9 @@ +# ReplaceCompanyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `CompanyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `CompanyRequestBody` | [CompanyRequestBody](../../Models/Components/CompanyRequestBody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Components/ClientRateLimitResetWebhookData.md b/platform/docs/Models/Requests/ReplaceCompanyResponse.md similarity index 79% rename from platform/docs/Models/Components/ClientRateLimitResetWebhookData.md rename to platform/docs/Models/Requests/ReplaceCompanyResponse.md index b6cadb02d..46ff9ecba 100644 --- a/platform/docs/Models/Components/ClientRateLimitResetWebhookData.md +++ b/platform/docs/Models/Requests/ReplaceCompanyResponse.md @@ -1,11 +1,11 @@ -# ClientRateLimitResetWebhookData +# ReplaceCompanyResponse ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `QuotaRemaining` | *long* | :heavy_minus_sign: | Total number of requests remaining for your client. | | -| `ResetReason` | *string* | :heavy_minus_sign: | The reason for your rate limit quota being reset. | | -| `DailyQuota` | *long* | :heavy_minus_sign: | The number of available requests per day. | | -| `ExpiresUtc` | *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 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"tags": {
"region": "us",
"uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"
},
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
],
"products": [
"spend-insights",
"lending"
]
} | \ No newline at end of file diff --git a/platform/docs/Models/Webhooks/ClientRateLimitResetResponse1.md b/platform/docs/Models/Requests/SetCorsSettingsResponse.md similarity index 62% rename from platform/docs/Models/Webhooks/ClientRateLimitResetResponse1.md rename to platform/docs/Models/Requests/SetCorsSettingsResponse.md index 5a6778e68..526d424af 100644 --- a/platform/docs/Models/Webhooks/ClientRateLimitResetResponse1.md +++ b/platform/docs/Models/Requests/SetCorsSettingsResponse.md @@ -1,10 +1,11 @@ -# ClientRateLimitResetResponse1 +# SetCorsSettingsResponse ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `ConnectionManagementAllowedOrigins` | [ConnectionManagementAllowedOrigins](../../Models/Components/ConnectionManagementAllowedOrigins.md) | :heavy_minus_sign: | Success | {
"allowedOrigins": [
"https://www.bank-of-dave.com"
]
} | \ No newline at end of file diff --git a/platform/docs/Models/Requests/UpdateCompanyRequest.md b/platform/docs/Models/Requests/UpdateCompanyRequest.md index 70ad89eee..2351dd6e6 100644 --- a/platform/docs/Models/Requests/UpdateCompanyRequest.md +++ b/platform/docs/Models/Requests/UpdateCompanyRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `CompanyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `CompanyRequestBody` | [CompanyRequestBody](../../Models/Components/CompanyRequestBody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `CompanyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `CompanyUpdateRequest` | [CompanyUpdateRequest](../../Models/Components/CompanyUpdateRequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/Models/Requests/UpdateCompanyResponse.md b/platform/docs/Models/Requests/UpdateCompanyResponse.md index 1605884f0..7df91368d 100644 --- a/platform/docs/Models/Requests/UpdateCompanyResponse.md +++ b/platform/docs/Models/Requests/UpdateCompanyResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"tags": {
"region": "us",
"uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"
},
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
]
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Company` | [Company](../../Models/Components/Company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"tags": {
"region": "us",
"uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"
},
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
],
"products": [
"spend-insights",
"lending"
]
} | \ No newline at end of file diff --git a/platform/docs/Models/Webhooks/DataSyncCompletedResponse.md b/platform/docs/Models/Webhooks/DataSyncCompletedResponse.md deleted file mode 100644 index d39b04721..000000000 --- a/platform/docs/Models/Webhooks/DataSyncCompletedResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DataSyncCompletedResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/platform/docs/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.md b/platform/docs/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.md deleted file mode 100644 index 29668cfcf..000000000 --- a/platform/docs/Models/Webhooks/DatasetStatusHasChangedToAnErrorStateResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DatasetStatusHasChangedToAnErrorStateResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/platform/docs/Models/Webhooks/NewCompanySynchronizedResponse.md b/platform/docs/Models/Webhooks/NewCompanySynchronizedResponse.md deleted file mode 100644 index a535903c8..000000000 --- a/platform/docs/Models/Webhooks/NewCompanySynchronizedResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# NewCompanySynchronizedResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/platform/docs/Models/Webhooks/PushOperationHasTimedOutResponse.md b/platform/docs/Models/Webhooks/PushOperationHasTimedOutResponse.md deleted file mode 100644 index ebf308200..000000000 --- a/platform/docs/Models/Webhooks/PushOperationHasTimedOutResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# PushOperationHasTimedOutResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/platform/docs/Models/Webhooks/PushOperationStatusHasChangedResponse.md b/platform/docs/Models/Webhooks/PushOperationStatusHasChangedResponse.md deleted file mode 100644 index 08d588ddb..000000000 --- a/platform/docs/Models/Webhooks/PushOperationStatusHasChangedResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# PushOperationStatusHasChangedResponse - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/platform/docs/sdks/codatplatform/README.md b/platform/docs/sdks/codatplatform/README.md deleted file mode 100644 index 3c1d88259..000000000 --- a/platform/docs/sdks/codatplatform/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# CodatPlatform SDK - -## Overview - -An API for the common components of all of Codat's products. - -These end points cover creating and managing your companies, data connections, and integrations. - -[Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) - ---- - -## Endpoints - -| Endpoints | Description | -| :- |:- | -| Companies | Create and manage your SMB users' companies. | -| Connections | Create new and manage existing data connections for a company. | -| Connection management | Configure connection management UI and retrieve access tokens for authentication. | -| Webhooks | Create and manage webhooks that listen to Codat's events. | -| Integrations | Get a list of integrations supported by Codat and their logos. | -| Refresh data | Initiate data refreshes, view pull status and history. | -| Settings | Manage company profile configuration, sync settings, and API keys. | -| Push data | Initiate and monitor Create, Update, and Delete operations. | -| Supplemental data | Configure and pull additional data you can include in Codat's standard data types. | -| Custom data type | Configure and pull additional data types that are not included in Codat's standardized data model. | - - -### Available Operations diff --git a/platform/docs/sdks/companies/README.md b/platform/docs/sdks/companies/README.md index 2195360eb..5f305694d 100644 --- a/platform/docs/sdks/companies/README.md +++ b/platform/docs/sdks/companies/README.md @@ -11,9 +11,11 @@ Create and manage your SMB users' companies. * [Create](#create) - Create company * [Get](#get) - Get company * [Delete](#delete) - Delete a company +* [Replace](#replace) - Replace company * [Update](#update) - Update company * [AddProduct](#addproduct) - Add product * [RemoveProduct](#removeproduct) - Remove product +* [RefreshProductData](#refreshproductdata) - Refresh product data * [GetAccessToken](#getaccesstoken) - Get company access token ## List @@ -23,20 +25,33 @@ Create and manage your SMB users' companies. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) 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. +## Filter by tags + +The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): + +- equals (`=`) +- not equals (`!=`) +- contains (`~`) + +For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: +- Foreign key: `uid = {yourCustomerId}` +- Region: `region != uk` +- Owning team and region: `region = uk && owningTeam = invoice-finance` + ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListCompaniesRequest req = new ListCompaniesRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", + Tags = "region=uk && team=invoice-finance", }; var res = await sdk.Companies.ListAsync(req); @@ -58,7 +73,8 @@ var res = await sdk.Companies.ListAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Create @@ -72,16 +88,15 @@ If forbidden characters (see `name` pattern) are present in the request, a compa ### Example Usage + ```csharp using Codat.Platform; using Codat.Platform.Models.Components; -using System.Collections.Generic; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); CompanyRequestBody req = new CompanyRequestBody() { - Name = "Bank of Dave", - Description = "Requested early access to the new financing scheme.", + Name = "Technicalium", }; var res = await sdk.Companies.CreateAsync(req); @@ -103,7 +118,8 @@ var res = await sdk.Companies.CreateAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Get @@ -116,10 +132,11 @@ Each company can have multiple [connections](https://docs.codat.io/platform-api# ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -146,7 +163,8 @@ var res = await sdk.Companies.GetAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Delete @@ -159,10 +177,11 @@ Each company can have multiple [connections](https://docs.codat.io/platform-api# ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -189,31 +208,82 @@ var res = await sdk.Companies.DeleteAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | -## Update +## Replace -Use the *Update company* endpoint to update both the name and description of the company. +Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) 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. ### Example Usage + ```csharp using Codat.Platform; +using Codat.Platform.Models.Components; using Codat.Platform.Models.Requests; + +var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ReplaceCompanyRequest req = new ReplaceCompanyRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + CompanyRequestBody = new CompanyRequestBody() { + Name = "New Name", + }, +}; + +var res = await sdk.Companies.ReplaceAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `request` | [ReplaceCompanyRequest](../../Models/Requests/ReplaceCompanyRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[ReplaceCompanyResponse](../../Models/Requests/ReplaceCompanyResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | +| Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | + +## Update + +Use the *Update company* endpoint to update the name, description, or tags of the company. + +The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. + +A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. + +### Example Usage + + +```csharp +using Codat.Platform; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; using System.Collections.Generic; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); UpdateCompanyRequest req = new UpdateCompanyRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", - CompanyRequestBody = new CompanyRequestBody() { - Name = "Bank of Dave", - Description = "Requested early access to the new financing scheme.", + CompanyUpdateRequest = new CompanyUpdateRequest() { + Tags = new Dictionary() { + { "refrence", "new reference" }, + }, }, }; @@ -236,7 +306,8 @@ var res = await sdk.Companies.UpdateAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## AddProduct @@ -247,16 +318,17 @@ Use the *Add product* endpoint to enable a product for the company specified by ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); AddProductRequest req = new AddProductRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", - ProductIdentifier = "lending", + ProductIdentifier = "bank-feeds", }; var res = await sdk.Companies.AddProductAsync(req); @@ -278,7 +350,8 @@ var res = await sdk.Companies.AddProductAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## RemoveProduct @@ -289,16 +362,17 @@ Use the *Remove product* endpoint to disable a product for the company specified ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); RemoveProductRequest req = new RemoveProductRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", - ProductIdentifier = "expenses", + ProductIdentifier = "bank-feeds", }; var res = await sdk.Companies.RemoveProductAsync(req); @@ -320,20 +394,71 @@ var res = await sdk.Companies.RemoveProductAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | -## GetAccessToken +## RefreshProductData + +Use the **Refresh product data** endpoint to manually refresh data for a custom product for a specific company. -Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat's embedded UI products. +### Tips and traps +- This endpoint only supports refreshing data for **custom products** and can't be used for Codat's standard solutions. Refer to [individual solutions' documentation](https://docs.codat.io/) instead. +- If a data sync is already in progress for a custom product, the refresh request will return a `Bad request (400)` response. +- If a company has multiple custom products enabled, you can refresh data for each product individually. ### Example Usage + ```csharp using Codat.Platform; +using Codat.Platform.Models.Components; using Codat.Platform.Models.Requests; + +var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +RefreshProductDataRequest req = new RefreshProductDataRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + ProductIdentifier = "bank-feeds", +}; + +var res = await sdk.Companies.RefreshProductDataAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `request` | [RefreshProductDataRequest](../../Models/Requests/RefreshProductDataRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[RefreshProductDataResponse](../../Models/Requests/RefreshProductDataResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | +| Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | + +## GetAccessToken + +Use the _Get company access token_ endpoint to return an access token for the specified company ID. The token is valid for one day. + +The token is required by Codat's embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to verify the identity of the user and improve the reliability of data provided by them. + +### Example Usage + + +```csharp +using Codat.Platform; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -360,5 +485,6 @@ var res = await sdk.Companies.GetAccessTokenAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/connectionmanagement/README.md b/platform/docs/sdks/connectionmanagement/README.md index e474920c3..9fd739546 100644 --- a/platform/docs/sdks/connectionmanagement/README.md +++ b/platform/docs/sdks/connectionmanagement/README.md @@ -7,20 +7,24 @@ Configure UI and retrieve access tokens for authentication used by **Connections ### Available Operations -* [GetAccessToken](#getaccesstoken) - Get access token +* [~~Get~~](#get) - Get access token (old) :warning: **Deprecated** Use [GetAccessToken](docs/sdks/companies/README.md#getaccesstoken) instead. -## GetAccessToken +## ~~Get~~ -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 new [Get company access token](https://docs.codat.io/platform-api#/operations/get-company-access-token) endpoint replaces this endpoint and includes additional functionality. -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. +> :warning: **DEPRECATED**: The endpoint for generating company-specific connection management access tokens has been deprecated. +Codat now supports a global company access token, providing seamless access across multiple products. +Update your integration to use the global token for improved efficiency and consistency. +. Use `GetAccessToken` instead. ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -28,7 +32,7 @@ GetConnectionManagementAccessTokenRequest req = new GetConnectionManagementAcces CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", }; -var res = await sdk.ConnectionManagement.GetAccessTokenAsync(req); +var res = await sdk.ConnectionManagement.GetAsync(req); // handle response ``` @@ -47,5 +51,6 @@ var res = await sdk.ConnectionManagement.GetAccessTokenAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/connections/README.md b/platform/docs/sdks/connections/README.md index 08f48e8db..147f75b29 100644 --- a/platform/docs/sdks/connections/README.md +++ b/platform/docs/sdks/connections/README.md @@ -20,17 +20,16 @@ Create new and manage existing data connections for a company. ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListConnectionsRequest req = new ListConnectionsRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", }; @@ -54,7 +53,8 @@ var res = await sdk.Connections.ListAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Create @@ -65,10 +65,11 @@ Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list- ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -98,7 +99,8 @@ var res = await sdk.Connections.CreateAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Get @@ -107,10 +109,11 @@ var res = await sdk.Connections.CreateAsync(req); ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -138,7 +141,8 @@ var res = await sdk.Connections.GetAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Delete @@ -148,10 +152,11 @@ This operation is not reversible. The end user would need to reauthorize a new d ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -179,7 +184,8 @@ var res = await sdk.Connections.DeleteAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Unlink @@ -188,16 +194,20 @@ var res = await sdk.Connections.DeleteAsync(req); ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); UnlinkConnectionRequest req = new UnlinkConnectionRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", + UpdateConnectionStatus = new UpdateConnectionStatus() { + Status = DataConnectionStatus.Unlinked, + }, }; var res = await sdk.Connections.UnlinkAsync(req); @@ -219,7 +229,8 @@ var res = await sdk.Connections.UnlinkAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## UpdateAuthorization @@ -228,11 +239,11 @@ Update data connection's authorization. ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; -using System.Collections.Generic; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -260,5 +271,6 @@ var res = await sdk.Connections.UpdateAuthorizationAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/corssettings/README.md b/platform/docs/sdks/cors/README.md similarity index 61% rename from platform/docs/sdks/corssettings/README.md rename to platform/docs/sdks/cors/README.md index 8915664b4..6ca7da579 100644 --- a/platform/docs/sdks/corssettings/README.md +++ b/platform/docs/sdks/cors/README.md @@ -1,30 +1,33 @@ -# CorsSettings -(*ConnectionManagement.CorsSettings*) +# Cors +(*Cors*) ## Overview ### Available Operations -* [Get](#get) - Get CORS settings -* [Set](#set) - Set CORS settings +* [~~Get~~](#get) - Get CORS settings (old) :warning: **Deprecated** Use [Get](docs/sdks/settings/README.md#get) instead. +* [~~Set~~](#set) - Set CORS settings (old) :warning: **Deprecated** Use [Set](docs/sdks/settings/README.md#set) instead. -## Get +## ~~Get~~ 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 embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. +Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. -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. +> :warning: **DEPRECATED**: The new [Get CORS settings](https://docs.codat.io/platform-api#/operations/get-cors-settings) endpoint replaces this endpoint and includes additional functionality. +Update your integrations to use the new path `/corsSettings` as the existing route will be removed in a future release. +. Use `Get` instead. ### Example Usage + ```csharp using Codat.Platform; using Codat.Platform.Models.Components; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); -var res = await sdk.ConnectionManagement.CorsSettings.GetAsync(); +var res = await sdk.Cors.GetAsync(); // handle response ``` @@ -37,19 +40,23 @@ var res = await sdk.ConnectionManagement.CorsSettings.GetAsync(); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | -## Set +## ~~Set~~ 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 embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. +Enabling CORS with Codat is required by our embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. -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. +> :warning: **DEPRECATED**: The new [Set CORS settings](https://docs.codat.io/platform-api#/operations/set-cors-settings) endpoint replaces this endpoint and includes additional functionality. +Update your integrations to use the new path `/corsSettings` as the existing route will be removed in a future release. +. Use `Set` instead. ### Example Usage + ```csharp using Codat.Platform; using Codat.Platform.Models.Components; @@ -63,7 +70,7 @@ ConnectionManagementAllowedOrigins req = new ConnectionManagementAllowedOrigins( }, }; -var res = await sdk.ConnectionManagement.CorsSettings.SetAsync(req); +var res = await sdk.Cors.SetAsync(req); // handle response ``` @@ -82,5 +89,6 @@ var res = await sdk.ConnectionManagement.CorsSettings.SetAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/customdatatype/README.md b/platform/docs/sdks/customdatatype/README.md index 8c54f1699..75bc25952 100644 --- a/platform/docs/sdks/customdatatype/README.md +++ b/platform/docs/sdks/customdatatype/README.md @@ -28,10 +28,11 @@ A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an addi ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; using System.Collections.Generic; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -40,15 +41,14 @@ ConfigureCustomDataTypeRequest req = new ConfigureCustomDataTypeRequest() { PlatformKey = "gbol", CustomDataIdentifier = "DynamicsPurchaseOrders", CustomDataTypeConfiguration = new CustomDataTypeConfiguration() { - DataSource = "api/purchaseOrders?$filter=currencyCode eq 'NOK'", + DataSource = "api/purchaseOrders", RequiredData = new Dictionary() { - { "currencyCode", "$[*].currencyCode" }, - { "id", "$[*].id" }, { "number", "$[*].number" }, - { "orderDate", "$[*].orderDate" }, - { "totalAmountExcludingTax", "$[*].totalAmountExcludingTax" }, - { "totalTaxAmount", "$[*].totalTaxAmount" }, - { "vendorName", "$[*].number" }, + { "date", "$[*].orderDate" }, + { "totalexvat", "$[*].totalAmountExcludingTax" }, + { "totaltax", "$[*].totalTaxAmount" }, + { "vendor", "$[*].number" }, + { "currency", "$[*].currencyCode" }, }, KeyBy = new List() { "$[*].id", @@ -78,7 +78,8 @@ var res = await sdk.CustomDataType.ConfigureAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## GetConfiguration @@ -89,10 +90,11 @@ A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an addi ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -120,7 +122,8 @@ var res = await sdk.CustomDataType.GetConfigurationAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Refresh @@ -129,10 +132,11 @@ The *Refresh custom data type* endpoint refreshes the specified custom data type ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -161,7 +165,8 @@ var res = await sdk.CustomDataType.RefreshAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 451, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 451 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## List @@ -172,10 +177,11 @@ A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an addi ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -183,8 +189,6 @@ ListCustomDataTypeRecordsRequest req = new ListCustomDataTypeRecordsRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", ConnectionId = "2e9d2c44-f675-40ba-8049-353bfcb5e171", CustomDataIdentifier = "DynamicsPurchaseOrders", - Page = 1, - PageSize = 100, }; var res = await sdk.CustomDataType.ListAsync(req); @@ -204,7 +208,8 @@ var res = await sdk.CustomDataType.ListAsync(req); ### Errors -| Error Type | Status Code | Content Type | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 451, 500, 503 | application/json | -| Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 451 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | +| Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/integrations/README.md b/platform/docs/sdks/integrations/README.md index da174f18d..6d9605da6 100644 --- a/platform/docs/sdks/integrations/README.md +++ b/platform/docs/sdks/integrations/README.md @@ -17,16 +17,15 @@ List your available integrations ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListIntegrationsRequest req = new ListIntegrationsRequest() { - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", }; @@ -50,7 +49,8 @@ var res = await sdk.Integrations.ListAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Get @@ -59,10 +59,11 @@ Get single integration, by platformKey ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -89,7 +90,8 @@ var res = await sdk.Integrations.GetAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## GetBranding @@ -98,10 +100,11 @@ Get branding for platform. ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -128,5 +131,6 @@ var res = await sdk.Integrations.GetBrandingAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/pushdata/README.md b/platform/docs/sdks/pushdata/README.md index de392b74b..f77460404 100644 --- a/platform/docs/sdks/pushdata/README.md +++ b/platform/docs/sdks/pushdata/README.md @@ -19,17 +19,13 @@ Before pushing data into accounting software, it is often necessary to collect s Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented "options" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field. - -> **Supported Integrations** -> -> Check out our [coverage explorer](https://knowledge.codat.io/) for integrations that support push (POST/PUT methods). - ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -58,7 +54,8 @@ var res = await sdk.PushData.GetModelOptionsAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## ListOperations @@ -69,17 +66,16 @@ Write operations are actions that send requests to Codat, enabling the creation, ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); GetCompanyPushHistoryRequest req = new GetCompanyPushHistoryRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", }; @@ -103,7 +99,8 @@ var res = await sdk.PushData.ListOperationsAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## GetOperation @@ -114,16 +111,17 @@ Write operations are actions that send requests to Codat, enabling the creation, ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); GetPushOperationRequest req = new GetPushOperationRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", - PushOperationKey = "5ad92d18-1314-44b7-bd71-2a11cd0470da", + PushOperationKey = "660e8684-c0fb-4468-9e2a-b2e3b115d747", }; var res = await sdk.PushData.GetOperationAsync(req); @@ -145,5 +143,6 @@ var res = await sdk.PushData.GetOperationAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/readdata/README.md b/platform/docs/sdks/readdata/README.md new file mode 100644 index 000000000..5c110609b --- /dev/null +++ b/platform/docs/sdks/readdata/README.md @@ -0,0 +1,57 @@ +# ReadData +(*ReadData*) + +## Overview + +View validation outcomes for completed read data operations. + +### Available Operations + +* [GetValidationResults](#getvalidationresults) - Get validation results + +## GetValidationResults + +Use the **Get validation results** endpoint to review warnings and errors encountered during the data type validation phase. + +The validation result [schema](https://docs.codat.io/platform-api#/schemas/ValidationResult) contains two message arrays: + +- **`warnings`** array lists potential issues with the data type that may require attention but don't block usage. +- **`errors`** array contains critical issues that must be resolved before the data type can be used. + +### Example Usage + + +```csharp +using Codat.Platform; +using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; + +var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +GetReadValidationResultsRequest req = new GetReadValidationResultsRequest() { + CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", + DatasetId = "0812af6e-436a-491f-9056-db91cb961ad3", +}; + +var res = await sdk.ReadData.GetValidationResultsAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `request` | [GetReadValidationResultsRequest](../../Models/Requests/GetReadValidationResultsRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[GetReadValidationResultsResponse](../../Models/Requests/GetReadValidationResultsResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | +| Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/refreshdata/README.md b/platform/docs/sdks/refreshdata/README.md index e82e08933..2b135eae6 100644 --- a/platform/docs/sdks/refreshdata/README.md +++ b/platform/docs/sdks/refreshdata/README.md @@ -23,10 +23,11 @@ This is an asynchronous operation, and will bring updated data into Codat from t ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -53,7 +54,8 @@ var res = await sdk.RefreshData.AllAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## ByDataType @@ -64,10 +66,11 @@ This is an asynchronous operation, and will bring updated data into Codat from t ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -95,7 +98,8 @@ var res = await sdk.RefreshData.ByDataTypeAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## Get @@ -104,10 +108,11 @@ Get the state of each data type for a company ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -134,7 +139,8 @@ var res = await sdk.RefreshData.GetAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## ListPullOperations @@ -143,17 +149,16 @@ Gets the pull operation history (datasets) for a given company. ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ListPullOperationsRequest req = new ListPullOperationsRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", - Page = 1, - PageSize = 100, Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", OrderBy = "-modifiedDate", }; @@ -177,7 +182,8 @@ var res = await sdk.RefreshData.ListPullOperationsAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## GetPullOperation @@ -186,16 +192,17 @@ Retrieve information about a single dataset or pull operation. ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); GetPullOperationRequest req = new GetPullOperationRequest() { CompanyId = "8a210b68-6988-11ed-a1eb-0242ac120002", - DatasetId = "71a4c0fb-8e15-45bd-958d-330b4e6e9f07", + DatasetId = "fa5f3e86-bd80-49b8-853c-5fbba4b201f5", }; var res = await sdk.RefreshData.GetPullOperationAsync(req); @@ -217,5 +224,6 @@ var res = await sdk.RefreshData.GetPullOperationAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/settings/README.md b/platform/docs/sdks/settings/README.md index aa4c193fd..a62891369 100644 --- a/platform/docs/sdks/settings/README.md +++ b/platform/docs/sdks/settings/README.md @@ -7,6 +7,8 @@ Manage company profile configuration, sync settings, and API keys. ### Available Operations +* [Get](#get) - Get CORS settings +* [Set](#set) - Set CORS settings * [GetProfile](#getprofile) - Get profile * [UpdateProfile](#updateprofile) - Update profile * [GetSyncSettings](#getsyncsettings) - Get sync settings @@ -15,12 +17,90 @@ Manage company profile configuration, sync settings, and API keys. * [CreateApiKey](#createapikey) - Create API key * [DeleteApiKey](#deleteapikey) - Delete API key +## Get + +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 embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. + +### Example Usage + + +```csharp +using Codat.Platform; +using Codat.Platform.Models.Components; + +var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +var res = await sdk.Settings.GetAsync(); + +// handle response +``` + +### Response + +**[GetCorsSettingsResponse](../../Models/Requests/GetCorsSettingsResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | +| Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | + +## Set + +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 embeddable UIs (such as [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) and [Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link)) to access Codat's API endpoints. + +### Example Usage + + +```csharp +using Codat.Platform; +using Codat.Platform.Models.Components; +using System.Collections.Generic; + +var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); + +ConnectionManagementAllowedOrigins req = new ConnectionManagementAllowedOrigins() { + AllowedOrigins = new List() { + "https://www.bank-of-dave.com", + }, +}; + +var res = await sdk.Settings.SetAsync(req); + +// handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `request` | [ConnectionManagementAllowedOrigins](../../Models/Components/ConnectionManagementAllowedOrigins.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[SetCorsSettingsResponse](../../Models/Requests/SetCorsSettingsResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | +| Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | + ## GetProfile Fetch your Codat profile. ### Example Usage + ```csharp using Codat.Platform; using Codat.Platform.Models.Components; @@ -40,7 +120,8 @@ var res = await sdk.Settings.GetProfileAsync(); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## UpdateProfile @@ -49,6 +130,7 @@ Update your Codat profile ### Example Usage + ```csharp using Codat.Platform; using Codat.Platform.Models.Components; @@ -87,7 +169,8 @@ var res = await sdk.Settings.UpdateProfileAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## GetSyncSettings @@ -96,6 +179,7 @@ Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync- ### Example Usage + ```csharp using Codat.Platform; using Codat.Platform.Models.Components; @@ -115,7 +199,8 @@ var res = await sdk.Settings.GetSyncSettingsAsync(); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## UpdateSyncSettings @@ -124,19 +209,20 @@ Update sync settings for all data types. ### Example Usage + ```csharp using Codat.Platform; +using Codat.Platform.Models.Components; using Codat.Platform.Models.Requests; using System.Collections.Generic; -using Codat.Platform.Models.Components; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); UpdateProfileSyncSettingsRequestBody req = new UpdateProfileSyncSettingsRequestBody() { - ClientId = "c4907f05-7024-4fc0-bf55-4785be5c9671", + ClientId = "9807ce3e-cfa5-4370-b4f2-09c282b1598b", Settings = new List() { new SyncSetting() { - DataType = Codat.Platform.Models.Components.PropertieDataType.Invoices, + DataType = Codat.Platform.Models.Components.DataType.Invoices, FetchOnFirstLink = true, SyncSchedule = 24, SyncOrder = 0, @@ -167,7 +253,8 @@ var res = await sdk.Settings.UpdateSyncSettingsAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## ListApiKeys @@ -180,6 +267,7 @@ You can [read more](https://docs.codat.io/using-the-api/authentication) about au ### Example Usage + ```csharp using Codat.Platform; using Codat.Platform.Models.Components; @@ -199,7 +287,8 @@ var res = await sdk.Settings.ListApiKeysAsync(); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## CreateApiKey @@ -218,6 +307,7 @@ You can [read more](https://docs.codat.io/using-the-api/authentication) about au ### Example Usage + ```csharp using Codat.Platform; using Codat.Platform.Models.Components; @@ -247,7 +337,8 @@ var res = await sdk.Settings.CreateApiKeyAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 409, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 409, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## DeleteApiKey @@ -265,10 +356,11 @@ You can [read more](https://docs.codat.io/using-the-api/authentication) about au ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -295,5 +387,6 @@ var res = await sdk.Settings.DeleteApiKeyAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/supplementaldata/README.md b/platform/docs/sdks/supplementaldata/README.md index 8df7c02af..4aefd76dd 100644 --- a/platform/docs/sdks/supplementaldata/README.md +++ b/platform/docs/sdks/supplementaldata/README.md @@ -21,30 +21,18 @@ See the *examples* for integration-specific frequently requested properties. ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; -using System.Collections.Generic; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); ConfigureSupplementalDataRequest req = new ConfigureSupplementalDataRequest() { PlatformKey = "gbol", DataType = Codat.Platform.Models.Requests.DataType.Invoices, - SupplementalDataConfiguration = new SupplementalDataConfiguration() { - SupplementalDataConfig = new Dictionary() { - { "orders-supplemental-data", new SupplementalDataSourceConfiguration() { - DataSource = "/orders", - PullData = new Dictionary() { - { "orderNumber", "order_num" }, - }, - PushData = new Dictionary() { - { "orderNumber", "order_num" }, - }, - } }, - }, - }, + SupplementalDataConfiguration = new SupplementalDataConfiguration() {}, }; var res = await sdk.SupplementalData.ConfigureAsync(req); @@ -66,7 +54,8 @@ var res = await sdk.SupplementalData.ConfigureAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## GetConfiguration @@ -77,16 +66,17 @@ The *Get configuration* endpoint returns supplemental data configuration previou ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); GetSupplementalDataConfigurationRequest req = new GetSupplementalDataConfigurationRequest() { PlatformKey = "gbol", - DataType = Codat.Platform.Models.Requests.PathParamDataType.Invoices, + DataType = PathParamDataType.Invoices, }; var res = await sdk.SupplementalData.GetConfigurationAsync(req); @@ -108,5 +98,6 @@ var res = await sdk.SupplementalData.GetConfigurationAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/webhooks/README.md b/platform/docs/sdks/webhooks/README.md index d68b2d340..473601f25 100644 --- a/platform/docs/sdks/webhooks/README.md +++ b/platform/docs/sdks/webhooks/README.md @@ -7,152 +7,10 @@ Create and manage webhooks that listen to Codat's events. ### Available Operations -* [~~List~~](#list) - List webhooks (legacy) :warning: **Deprecated** -* [~~Create~~](#create) - Create webhook (legacy) :warning: **Deprecated** -* [~~Get~~](#get) - Get webhook (legacy) :warning: **Deprecated** * [ListConsumers](#listconsumers) - List webhook consumers * [CreateConsumer](#createconsumer) - Create webhook consumer * [DeleteConsumer](#deleteconsumer) - Delete webhook consumer -## ~~List~~ - -Use the *List webhooks (legacy)* endpoint to retrieve all existing rule-based webhooks for your client. - -**Note:** This endpoint has been deprecated. Please use the [*List webhook consumers*](https://docs.codat.io/platform-api#/operations/list-webhook-consumers) endpoint for listing webhooks moving forward. - -> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -### Example Usage - -```csharp -using Codat.Platform; -using Codat.Platform.Models.Requests; -using Codat.Platform.Models.Components; - -var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); - -ListRulesRequest req = new ListRulesRequest() { - Page = 1, - PageSize = 100, - Query = "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - OrderBy = "-modifiedDate", -}; - -var res = await sdk.Webhooks.ListAsync(req); - -// handle response -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `request` | [ListRulesRequest](../../Models/Requests/ListRulesRequest.md) | :heavy_check_mark: | The request object to use for the request. | - -### Response - -**[ListRulesResponse](../../Models/Requests/ListRulesResponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | -| Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | - -## ~~Create~~ - -Use the *Create webhooks (legacy)* endpoint to create a rule-based webhook for your client. - -**Note:** This endpoint has been deprecated. Please use the [*Create webhook consumer*](https://docs.codat.io/platform-api#/operations/create-webhook-consumer) endpoint to create a webhook moving forward. - -> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -### Example Usage - -```csharp -using Codat.Platform; -using Codat.Platform.Models.Components; -using System.Collections.Generic; - -var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); - -CreateRule req = new CreateRule() { - Type = "DataConnectionStatusChanged", - CompanyId = "39b73b17-cc2e-429e-915d-71654e9dcd1e", - Notifiers = new WebhookNotifier() { - Emails = new List() { - "info@client.com", - }, - Webhook = "https://webhook.client.com", - }, -}; - -var res = await sdk.Webhooks.CreateAsync(req); - -// handle response -``` - -### Parameters - -| Parameter | Type | Required | Description | -| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | -| `request` | [CreateRule](../../Models/Components/CreateRule.md) | :heavy_check_mark: | The request object to use for the request. | - -### Response - -**[CreateRuleResponse](../../Models/Requests/CreateRuleResponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json | -| Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | - -## ~~Get~~ - -Use the *Get webhook (legacy)* endpoint to retrieve a specific webhook for your client. - -**Note:** This endpoint has been deprecated. Please use the [*List webhook consumers*](https://docs.codat.io/platform-api#/operations/list-webhook-consumers) endpoint for listing webhooks moving forward. - -> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -### Example Usage - -```csharp -using Codat.Platform; -using Codat.Platform.Models.Requests; -using Codat.Platform.Models.Components; - -var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); - -GetWebhookRequest req = new GetWebhookRequest() { - RuleId = "7318949f-c008-4936-a8ff-10d7ab563fa6", -}; - -var res = await sdk.Webhooks.GetAsync(req); - -// handle response -``` - -### Parameters - -| Parameter | Type | Required | Description | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `request` | [GetWebhookRequest](../../Models/Requests/GetWebhookRequest.md) | :heavy_check_mark: | The request object to use for the request. | - -### Response - -**[GetWebhookResponse](../../Models/Requests/GetWebhookResponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | -| Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | - ## ListConsumers Use the *List webhook consumers* endpoint to return a list of all webhook consumers that currently exist for your client. @@ -161,6 +19,7 @@ var res = await sdk.Webhooks.GetAsync(req); ### Example Usage + ```csharp using Codat.Platform; using Codat.Platform.Models.Components; @@ -180,7 +39,8 @@ var res = await sdk.Webhooks.ListConsumersAsync(); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## CreateConsumer @@ -194,6 +54,7 @@ var res = await sdk.Webhooks.ListConsumersAsync(); ### Example Usage + ```csharp using Codat.Platform; using Codat.Platform.Models.Components; @@ -201,7 +62,13 @@ using System.Collections.Generic; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); -WebhookConsumerPrototype req = new WebhookConsumerPrototype() {}; +WebhookConsumerPrototype req = new WebhookConsumerPrototype() { + Url = "https://example.com/webhoook-consumer", + EventTypes = new List() { + "DataSyncCompleted", + "Dataset data changed", + }, +}; var res = await sdk.Webhooks.CreateConsumerAsync(req); @@ -222,7 +89,8 @@ var res = await sdk.Webhooks.CreateConsumerAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | ## DeleteConsumer @@ -233,10 +101,11 @@ var res = await sdk.Webhooks.CreateConsumerAsync(req); ### Example Usage + ```csharp using Codat.Platform; -using Codat.Platform.Models.Requests; using Codat.Platform.Models.Components; +using Codat.Platform.Models.Requests; var sdk = new CodatPlatform(authHeader: "Basic BASE_64_ENCODED(API_KEY)"); @@ -263,5 +132,6 @@ var res = await sdk.Webhooks.DeleteConsumerAsync(req); | Error Type | Status Code | Content Type | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| Codat.Platform.Models.Errors.ErrorMessage | 500, 503 | application/json | | Codat.Platform.Models.Errors.SDKException | 4XX, 5XX | \*/\* | \ No newline at end of file