Skip to content

Commit f8b699f

Browse files
## Csharp SDK Changes Detected: (#339)
* `Codat.platform.Connection.Created()`: * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Settings.Update-Profile()`: * `request.AlertAuthHeader` **Removed** **Breaking** ⚠️ * `response.alertAuthHeader` **Removed** **Breaking** ⚠️ * `Codat.platform.Settings.Get-Profile()`: `response.alertAuthHeader` **Removed** **Breaking** ⚠️ * `Codat.platform.Webhooks.Create-Consumer()`: * `request` **Changed** **Breaking** ⚠️ * `response` **Changed** **Breaking** ⚠️ * `Codat.platform.Webhooks.List-Consumers()`: `response.results.[]` **Changed** **Breaking** ⚠️ * `Codat.platform.Connections.Update-Authorization()`: `response.connectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Connections.Unlink()`: `response.connectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Connections.Get()`: `response.connectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Connections.Create()`: `response.connectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Connections.List()`: `response.results.[].ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Companies.Update()`: * `request` **Changed** **Breaking** ⚠️ * `response.dataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Companies.Get()`: `response.dataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Companies.Create()`: `response.dataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Companies.List()`: * `request.Tags` **Added** * `response.results.[].DataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Connection.Deleted()`: * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Connection.Reconnected()`: * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Connection.Disconnected()`: * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Connection.Failed()`: * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.Connection.Connected()`: * `request.Payload.Connection.ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.platform.DatasetStatusHasChangedToAnErrorState()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.NewCompanySynchronized()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.Webhooks.Create()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.Webhooks.Get()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.ConnectionManagement.Cors-Settings.Set()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.ConnectionManagement.Cors-Settings.Get()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.ConnectionManagement.Get-Access-Token()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.ClientRateLimitReset()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.ClientRateLimitReached()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.PushOperationHasTimedOut()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.Read.Completed()`: * `request.Payload.DataTypes.[].Issues` **Added** * `Codat.platform.Read.Completed.Initial()`: * `request.Payload.DataTypes.[].Issues` **Added** * `Codat.platform.PushOperationStatusHasChanged()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.Webhooks.List()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.Companies.Replace()`: **Added** * `Codat.platform.DatasetDataChanged()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.DataSyncCompleted()`: **Deleted** **Breaking** ⚠️ * `Codat.platform.CompanyDataConnectionStatusChanged()`: **Deleted** **Breaking** ⚠️ * `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** Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
1 parent 6abb3d7 commit f8b699f

File tree

224 files changed

+6019
-4777
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+6019
-4777
lines changed

.speakeasy/workflow.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.544.0
1+
speakeasyVersion: 1.636.3
22
sources:
33
bank-feeds-source:
44
sourceNamespace: bank-feeds-source
@@ -18,11 +18,11 @@ sources:
1818
- 3.0.0
1919
platform-source:
2020
sourceNamespace: platform-source
21-
sourceRevisionDigest: sha256:22a642c12144b2db0229ae5cd0f7f387de2337e5483b7d9d67894510ab466434
22-
sourceBlobDigest: sha256:d80a27e44fffb9c61f16a99e7d25c294f39be1a5a761d51a87c76477f8589f54
21+
sourceRevisionDigest: sha256:0f78aa549819043f4ba97e688320aad9a246b4f96dd9427dddcc76973ac48cd2
22+
sourceBlobDigest: sha256:b1168d9a178d8cca7ff8fea320ab38bbc14b279b8ef463011adf760747529c64
2323
tags:
2424
- latest
25-
- speakeasy-sdk-regen-1732624920
25+
- speakeasy-sdk-regen-1760520838
2626
- 3.0.0
2727
sync-for-commerce-source:
2828
sourceNamespace: sync-for-commerce-source
@@ -80,10 +80,10 @@ targets:
8080
platform-library:
8181
source: platform-source
8282
sourceNamespace: platform-source
83-
sourceRevisionDigest: sha256:22a642c12144b2db0229ae5cd0f7f387de2337e5483b7d9d67894510ab466434
84-
sourceBlobDigest: sha256:d80a27e44fffb9c61f16a99e7d25c294f39be1a5a761d51a87c76477f8589f54
85-
codeSamplesNamespace: platform-source-code-samples
86-
codeSamplesRevisionDigest: sha256:2ab0377bf53e999f63ed07738a6d8ab38a44b9aa133d0016d3326255c06acf68
83+
sourceRevisionDigest: sha256:0f78aa549819043f4ba97e688320aad9a246b4f96dd9427dddcc76973ac48cd2
84+
sourceBlobDigest: sha256:b1168d9a178d8cca7ff8fea320ab38bbc14b279b8ef463011adf760747529c64
85+
codeSamplesNamespace: platform-source-csharp-code-samples
86+
codeSamplesRevisionDigest: sha256:e9ac2ef0069007a2dd268e98934f1a19b0539db33822de0873a5625440a98cfd
8787
sync-for-commerce-library:
8888
source: sync-for-commerce-source
8989
sourceNamespace: sync-for-commerce-source

platform/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
.DS_Store
2+
**/.speakeasy/temp/
3+
**/.speakeasy/logs/
4+
.env
5+
.env.local
16
obj/
27
bin/
38
debug/

platform/.speakeasy/gen.lock

Lines changed: 731 additions & 750 deletions
Large diffs are not rendered by default.

platform/.speakeasy/gen.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,38 @@ generation:
44
maintainOpenAPIOrder: true
55
usageSnippets:
66
optionalPropertyRendering: withExample
7+
sdkInitStyle: constructor
78
useClassNamesForArrayFields: true
89
fixes:
910
nameResolutionDec2023: true
11+
nameResolutionFeb2025: false
1012
parameterOrderingFeb2024: true
1113
requestResponseComponentNamesFeb2024: true
14+
securityFeb2025: false
15+
sharedErrorComponentsApr2025: false
1216
auth:
1317
oAuth2ClientCredentialsEnabled: false
1418
oAuth2PasswordEnabled: false
19+
hoistGlobalSecurity: true
20+
tests:
21+
generateTests: true
22+
generateNewTests: false
23+
skipResponseBodyAssertions: false
1524
csharp:
16-
version: 6.0.0
25+
version: 6.1.0
1726
additionalDependencies: []
1827
author: Codat
28+
baseErrorName: CodatPlatformException
1929
clientServerStatusCodesAsErrors: true
2030
defaultErrorName: SDKException
2131
description: Manage the building blocks of Codat, including companies, connections, and more.
2232
disableNamespacePascalCasingApr2024: true
2333
dotnetVersion: net8.0
34+
enableCancellationToken: false
2435
enableSourceLink: false
2536
flattenGlobalSecurity: true
2637
flatteningOrder: ""
38+
httpClientPrefix: Speakeasy
2739
imports:
2840
option: openapi
2941
paths:
@@ -41,3 +53,4 @@ csharp:
4153
packageTags: ""
4254
responseFormat: envelope
4355
sourceDirectory: ""
56+
useNodatime: true

platform/Codat/Platform/Codat.Platform.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
<PropertyGroup>
44
<IsPackable>true</IsPackable>
55
<PackageId>Codat.Platform</PackageId>
6-
<Version>6.0.0</Version>
6+
<Version>6.1.0</Version>
77
<TargetFramework>net8.0</TargetFramework>
88
<Authors>Codat</Authors>
9-
<Copyright>Copyright (c) Codat 2024</Copyright>
9+
<Copyright>Copyright (c) Codat 2025</Copyright>
1010
<RepositoryUrl>https://github.com/codatio/client-sdk-csharp.git</RepositoryUrl>
1111
<RepositoryType>git</RepositoryType>
1212
<Description>An API for the common components of all of Codat&apos;s products.<br/>

platform/Codat/Platform/CodatPlatform.cs

Lines changed: 130 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ namespace Codat.Platform
1212
using Codat.Platform.Hooks;
1313
using Codat.Platform.Models.Components;
1414
using Codat.Platform.Models.Errors;
15-
using Codat.Platform.Utils.Retries;
1615
using Codat.Platform.Utils;
16+
using Codat.Platform.Utils.Retries;
1717
using Newtonsoft.Json;
18+
using System;
1819
using System.Collections.Generic;
1920
using System.Net.Http;
2021
using System.Threading.Tasks;
21-
using System;
2222

2323
/// <summary>
2424
/// Platform API: Platform API
@@ -66,6 +66,12 @@ public interface ICodatPlatform
6666
/// Configure UI and retrieve access tokens for authentication used by **Connections SDK**.
6767
/// </summary>
6868
public IConnectionManagement ConnectionManagement { get; }
69+
public ICors Cors { get; }
70+
71+
/// <summary>
72+
/// Manage company profile configuration, sync settings, and API keys.
73+
/// </summary>
74+
public ISettings Settings { get; }
6975

7076
/// <summary>
7177
/// Initiate data refreshes, view pull status and history.
@@ -83,9 +89,9 @@ public interface ICodatPlatform
8389
public IIntegrations Integrations { get; }
8490

8591
/// <summary>
86-
/// Manage company profile configuration, sync settings, and API keys.
92+
/// View validation outcomes for completed read data operations.
8793
/// </summary>
88-
public ISettings Settings { get; }
94+
public IReadData ReadData { get; }
8995

9096
/// <summary>
9197
/// Initiate and monitor Create, Update, and Delete operations.
@@ -103,40 +109,6 @@ public interface ICodatPlatform
103109
public ICustomDataType CustomDataType { get; }
104110
}
105111

106-
public class SDKConfig
107-
{
108-
/// <summary>
109-
/// List of server URLs available to the SDK.
110-
/// </summary>
111-
public static readonly string[] ServerList = {
112-
"https://api.codat.io",
113-
};
114-
115-
public string ServerUrl = "";
116-
public int ServerIndex = 0;
117-
public SDKHooks Hooks = new SDKHooks();
118-
public RetryConfig? RetryConfig = null;
119-
120-
public string GetTemplatedServerUrl()
121-
{
122-
if (!String.IsNullOrEmpty(this.ServerUrl))
123-
{
124-
return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary<string, string>());
125-
}
126-
return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], new Dictionary<string, string>());
127-
}
128-
129-
public ISpeakeasyHttpClient InitHooks(ISpeakeasyHttpClient client)
130-
{
131-
string preHooksUrl = GetTemplatedServerUrl();
132-
var (postHooksUrl, postHooksClient) = this.Hooks.SDKInit(preHooksUrl, client);
133-
if (preHooksUrl != postHooksUrl)
134-
{
135-
this.ServerUrl = postHooksUrl;
136-
}
137-
return postHooksClient;
138-
}
139-
}
140112

141113
/// <summary>
142114
/// Platform API: Platform API
@@ -172,25 +144,52 @@ public class CodatPlatform: ICodatPlatform
172144
public SDKConfig SDKConfiguration { get; private set; }
173145

174146
private const string _language = "csharp";
175-
private const string _sdkVersion = "6.0.0";
176-
private const string _sdkGenVersion = "2.462.1";
147+
private const string _sdkVersion = "6.1.0";
148+
private const string _sdkGenVersion = "2.723.11";
177149
private const string _openapiDocVersion = "3.0.0";
178-
private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform";
179-
private string _serverUrl = "";
180-
private int _serverIndex = 0;
181-
private ISpeakeasyHttpClient _client;
182-
private Func<Codat.Platform.Models.Components.Security>? _securitySource;
183150
public ICompanies Companies { get; private set; }
184151
public IConnections Connections { get; private set; }
185152
public IConnectionManagement ConnectionManagement { get; private set; }
153+
public ICors Cors { get; private set; }
154+
public ISettings Settings { get; private set; }
186155
public IRefreshData RefreshData { get; private set; }
187156
public IWebhooks Webhooks { get; private set; }
188157
public IIntegrations Integrations { get; private set; }
189-
public ISettings Settings { get; private set; }
158+
public IReadData ReadData { get; private set; }
190159
public IPushData PushData { get; private set; }
191160
public ISupplementalData SupplementalData { get; private set; }
192161
public ICustomDataType CustomDataType { get; private set; }
193162

163+
public CodatPlatform(SDKConfig config)
164+
{
165+
SDKConfiguration = config;
166+
InitHooks();
167+
168+
Companies = new Companies(SDKConfiguration);
169+
170+
Connections = new Connections(SDKConfiguration);
171+
172+
ConnectionManagement = new ConnectionManagement(SDKConfiguration);
173+
174+
Cors = new Cors(SDKConfiguration);
175+
176+
Settings = new Settings(SDKConfiguration);
177+
178+
RefreshData = new RefreshData(SDKConfiguration);
179+
180+
Webhooks = new Webhooks(SDKConfiguration);
181+
182+
Integrations = new Integrations(SDKConfiguration);
183+
184+
ReadData = new ReadData(SDKConfiguration);
185+
186+
PushData = new PushData(SDKConfiguration);
187+
188+
SupplementalData = new SupplementalData(SDKConfiguration);
189+
190+
CustomDataType = new CustomDataType(SDKConfiguration);
191+
}
192+
194193
public CodatPlatform(string? authHeader = null, Func<string>? authHeaderSource = null, int? serverIndex = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
195194
{
196195
if (serverIndex != null)
@@ -199,7 +198,6 @@ public CodatPlatform(string? authHeader = null, Func<string>? authHeaderSource =
199198
{
200199
throw new Exception($"Invalid server index {serverIndex.Value}");
201200
}
202-
_serverIndex = serverIndex.Value;
203201
}
204202

205203
if (serverUrl != null)
@@ -208,10 +206,8 @@ public CodatPlatform(string? authHeader = null, Func<string>? authHeaderSource =
208206
{
209207
serverUrl = Utilities.TemplateUrl(serverUrl, urlParams);
210208
}
211-
_serverUrl = serverUrl;
212209
}
213-
214-
_client = client ?? new SpeakeasyHttpClient();
210+
Func<Codat.Platform.Models.Components.Security>? _securitySource = null;
215211

216212
if(authHeaderSource != null)
217213
{
@@ -226,44 +222,114 @@ public CodatPlatform(string? authHeader = null, Func<string>? authHeaderSource =
226222
throw new Exception("authHeader and authHeaderSource cannot both be null");
227223
}
228224

229-
SDKConfiguration = new SDKConfig()
225+
SDKConfiguration = new SDKConfig(client)
230226
{
231-
ServerIndex = _serverIndex,
232-
ServerUrl = _serverUrl,
227+
ServerIndex = serverIndex == null ? 0 : serverIndex.Value,
228+
ServerUrl = serverUrl == null ? "" : serverUrl,
229+
SecuritySource = _securitySource,
233230
RetryConfig = retryConfig
234231
};
235232

236-
_client = SDKConfiguration.InitHooks(_client);
233+
InitHooks();
237234

235+
Companies = new Companies(SDKConfiguration);
238236

239-
Companies = new Companies(_client, _securitySource, _serverUrl, SDKConfiguration);
237+
Connections = new Connections(SDKConfiguration);
240238

239+
ConnectionManagement = new ConnectionManagement(SDKConfiguration);
241240

242-
Connections = new Connections(_client, _securitySource, _serverUrl, SDKConfiguration);
241+
Cors = new Cors(SDKConfiguration);
243242

243+
Settings = new Settings(SDKConfiguration);
244244

245-
ConnectionManagement = new ConnectionManagement(_client, _securitySource, _serverUrl, SDKConfiguration);
245+
RefreshData = new RefreshData(SDKConfiguration);
246246

247+
Webhooks = new Webhooks(SDKConfiguration);
247248

248-
RefreshData = new RefreshData(_client, _securitySource, _serverUrl, SDKConfiguration);
249+
Integrations = new Integrations(SDKConfiguration);
249250

251+
ReadData = new ReadData(SDKConfiguration);
250252

251-
Webhooks = new Webhooks(_client, _securitySource, _serverUrl, SDKConfiguration);
253+
PushData = new PushData(SDKConfiguration);
252254

255+
SupplementalData = new SupplementalData(SDKConfiguration);
253256

254-
Integrations = new Integrations(_client, _securitySource, _serverUrl, SDKConfiguration);
257+
CustomDataType = new CustomDataType(SDKConfiguration);
258+
}
255259

260+
private void InitHooks()
261+
{
262+
string preHooksUrl = SDKConfiguration.GetTemplatedServerUrl();
263+
var (postHooksUrl, postHooksClient) = SDKConfiguration.Hooks.SDKInit(preHooksUrl, SDKConfiguration.Client);
264+
var config = SDKConfiguration;
265+
if (preHooksUrl != postHooksUrl)
266+
{
267+
config.ServerUrl = postHooksUrl;
268+
}
269+
config.Client = postHooksClient;
270+
SDKConfiguration = config;
271+
}
256272

257-
Settings = new Settings(_client, _securitySource, _serverUrl, SDKConfiguration);
273+
public class SDKBuilder
274+
{
275+
private SDKConfig _sdkConfig = new SDKConfig(client: new SpeakeasyHttpClient());
258276

277+
public SDKBuilder() { }
259278

260-
PushData = new PushData(_client, _securitySource, _serverUrl, SDKConfiguration);
279+
public SDKBuilder WithServerIndex(int serverIndex)
280+
{
281+
if (serverIndex < 0 || serverIndex >= SDKConfig.ServerList.Length)
282+
{
283+
throw new Exception($"Invalid server index {serverIndex}");
284+
}
285+
_sdkConfig.ServerIndex = serverIndex;
286+
return this;
287+
}
261288

289+
public SDKBuilder WithServerUrl(string serverUrl, Dictionary<string, string>? serverVariables = null)
290+
{
291+
if (serverVariables != null)
292+
{
293+
serverUrl = Utilities.TemplateUrl(serverUrl, serverVariables);
294+
}
295+
_sdkConfig.ServerUrl = serverUrl;
296+
return this;
297+
}
298+
299+
public SDKBuilder WithAuthHeaderSource(Func<string> authHeaderSource)
300+
{
301+
_sdkConfig.SecuritySource = () => new Codat.Platform.Models.Components.Security() { AuthHeader = authHeaderSource() };
302+
return this;
303+
}
304+
305+
public SDKBuilder WithAuthHeader(string authHeader)
306+
{
307+
_sdkConfig.SecuritySource = () => new Codat.Platform.Models.Components.Security() { AuthHeader = authHeader };
308+
return this;
309+
}
262310

263-
SupplementalData = new SupplementalData(_client, _securitySource, _serverUrl, SDKConfiguration);
311+
public SDKBuilder WithClient(ISpeakeasyHttpClient client)
312+
{
313+
_sdkConfig.Client = client;
314+
return this;
315+
}
264316

317+
public SDKBuilder WithRetryConfig(RetryConfig retryConfig)
318+
{
319+
_sdkConfig.RetryConfig = retryConfig;
320+
return this;
321+
}
322+
323+
public CodatPlatform Build()
324+
{
325+
if (_sdkConfig.SecuritySource == null) {
326+
throw new Exception("securitySource cannot be null. One of `AuthHeader` or `authHeaderSource` needs to be defined.");
327+
}
328+
return new CodatPlatform(_sdkConfig);
329+
}
265330

266-
CustomDataType = new CustomDataType(_client, _securitySource, _serverUrl, SDKConfiguration);
267331
}
332+
333+
public static SDKBuilder Builder() => new SDKBuilder();
268334
}
269335
}

0 commit comments

Comments
 (0)