Skip to content

Commit 8e6f059

Browse files
## Csharp SDK Changes: (#340)
* `Codat.lending.Loan-Writeback.Source-Accounts.Create()`: * `request.RequestBody` **Changed** **Breaking** ⚠️ * `Codat.lending.Companies.List()`: `response.results.[].DataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.lending.Companies.Create()`: `response.dataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.lending.Companies.Update()`: * `request` **Changed** **Breaking** ⚠️ * `response.dataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.lending.Companies.Get()`: `response.dataConnections.[].ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.lending.Connections.List()`: `response.results.[].ConnectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.lending.Connections.Create()`: `response.connectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.lending.Connections.Get()`: `response.connectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.lending.Connections.Unlink()`: `response.connectionInfo.{}` **Changed** **Breaking** ⚠️ * `Codat.lending.Manage-Data.Refresh.All-Data-Types()`: `error.status[400]` **Added** * `Codat.lending.Companies.Replace()`: **Added** * `Codat.lending.Manage-Data.Refresh.Data-Type()`: `error.status[400]` **Added** * `Codat.lending.Financial-Statements.Profit-And-Loss.Get()`: `response.currency` **Changed** * `Codat.lending.Financial-Statements.Balance-Sheet.Get()`: `response.currency` **Changed** * `Codat.lending.Financial-Statements.Cash-Flow.Get()`: `response.currency` **Changed** * `Codat.lending.Transactions.Journal-Entries.List()`: `response.results.[].JournalLines.[]` **Changed** * `Codat.lending.Transactions.Journal-Entries.Get()`: `response.journalLines.[]` **Changed** * `Codat.lending.Accounts-Payable.Bills.List()`: `response.results.[].LineItems.[]` **Changed** * `Codat.lending.Accounts-Payable.Bills.Get()`: `response.lineItems.[]` **Changed** * `Codat.lending.Manage-Data.Get-Status()`: `response.accountTransactions.LastSuccessfulSync` **Changed** * `Codat.lending.Loan-Writeback.Source-Accounts.Create-Mapping()`: * `request.BankFeedBankAccountMapping.FeedStartDate` **Added** * `Codat.lending.ManageReports.Generate-Report()`: `error.status[409]` **Added** Co-authored-by: speakeasybot <[email protected]>
1 parent f8b699f commit 8e6f059

File tree

358 files changed

+22034
-7934
lines changed

Some content is hidden

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

358 files changed

+22034
-7934
lines changed

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.636.3
1+
speakeasyVersion: 1.692.0
22
sources:
33
bank-feeds-source:
44
sourceNamespace: bank-feeds-source
@@ -10,11 +10,11 @@ sources:
1010
- 3.0.0
1111
lending-source:
1212
sourceNamespace: lending-source
13-
sourceRevisionDigest: sha256:0ffdf563c3bee5e3fb4069ee4196700256c8040a9a1a4f0273f07f58de310cbf
14-
sourceBlobDigest: sha256:c099262909612a8421934ac332897e738611c24f1d6f3878de41ec219fd78b48
13+
sourceRevisionDigest: sha256:e0aed482c0ce3a529744105147d2857d2fcd03a79bd8e8d82b07892cffe0bb9e
14+
sourceBlobDigest: sha256:d1d88be3211e4012cc3f3beab27e7d09c3a7a20b5c5eccc31eda1bab664f033d
1515
tags:
1616
- latest
17-
- speakeasy-sdk-regen-1736154674
17+
- speakeasy-sdk-regen-1769004467
1818
- 3.0.0
1919
platform-source:
2020
sourceNamespace: platform-source
@@ -73,10 +73,10 @@ targets:
7373
lending-library:
7474
source: lending-source
7575
sourceNamespace: lending-source
76-
sourceRevisionDigest: sha256:0ffdf563c3bee5e3fb4069ee4196700256c8040a9a1a4f0273f07f58de310cbf
77-
sourceBlobDigest: sha256:c099262909612a8421934ac332897e738611c24f1d6f3878de41ec219fd78b48
76+
sourceRevisionDigest: sha256:e0aed482c0ce3a529744105147d2857d2fcd03a79bd8e8d82b07892cffe0bb9e
77+
sourceBlobDigest: sha256:d1d88be3211e4012cc3f3beab27e7d09c3a7a20b5c5eccc31eda1bab664f033d
7878
codeSamplesNamespace: lending-source-csharp-code-samples
79-
codeSamplesRevisionDigest: sha256:a5abf9b800f1aef21c4488262f50872aa79efcea862e28f2b5f399b667497dec
79+
codeSamplesRevisionDigest: sha256:b89807e35987cc337e034d681db52964baae2d83eac9e41fa6e0442cbf3c88f6
8080
platform-library:
8181
source: platform-source
8282
sourceNamespace: platform-source

lending/.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/

lending/.speakeasy/gen.lock

Lines changed: 9599 additions & 2708 deletions
Large diffs are not rendered by default.

lending/.speakeasy/gen.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,43 @@ 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
16+
sharedNestedComponentsJan2026: false
1217
auth:
1318
oAuth2ClientCredentialsEnabled: false
1419
oAuth2PasswordEnabled: false
20+
hoistGlobalSecurity: true
21+
schemas:
22+
allOfMergeStrategy: shallowMerge
23+
requestBodyFieldName: ""
24+
persistentEdits: {}
25+
tests:
26+
generateTests: true
27+
generateNewTests: false
28+
skipResponseBodyAssertions: false
1529
csharp:
16-
version: 9.0.2
30+
version: 10.0.0
1731
additionalDependencies: []
1832
author: Codat
33+
baseErrorName: CodatLendingException
1934
clientServerStatusCodesAsErrors: true
2035
defaultErrorName: SDKException
2136
description: Make credit decisions backed by enhanced financials, metrics, reports, and data integrity features.
2237
disableNamespacePascalCasingApr2024: true
2338
dotnetVersion: net8.0
39+
enableCancellationToken: false
2440
enableSourceLink: false
2541
flattenGlobalSecurity: true
2642
flatteningOrder: ""
43+
httpClientPrefix: Speakeasy
2744
imports:
2845
option: openapi
2946
paths:
@@ -33,11 +50,14 @@ csharp:
3350
shared: Models/Components
3451
webhooks: Models/Webhooks
3552
includeDebugSymbols: false
53+
inferUnionDiscriminators: false
3654
inputModelSuffix: input
3755
maxMethodParams: 0
3856
methodArguments: infer-optional-args
57+
multipartArrayFormat: legacy
3958
outputModelSuffix: output
4059
packageName: Codat.Lending
4160
packageTags: ""
4261
responseFormat: envelope
4362
sourceDirectory: ""
63+
useNodatime: true

lending/Codat/Lending/AccountBalances.cs

Lines changed: 69 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -43,37 +43,33 @@ public interface IAccountBalances
4343
public class AccountBalances: IAccountBalances
4444
{
4545
public SDKConfig SDKConfiguration { get; private set; }
46-
private const string _language = "csharp";
47-
private const string _sdkVersion = "9.0.2";
48-
private const string _sdkGenVersion = "2.486.1";
49-
private const string _openapiDocVersion = "3.0.0";
50-
private const string _userAgent = "speakeasy-sdk/csharp 9.0.2 2.486.1 3.0.0 Codat.Lending";
51-
private string _serverUrl = "";
52-
private ISpeakeasyHttpClient _client;
53-
private Func<Codat.Lending.Models.Components.Security>? _securitySource;
54-
55-
public AccountBalances(ISpeakeasyHttpClient client, Func<Codat.Lending.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
46+
47+
private const string _language = Constants.Language;
48+
private const string _sdkVersion = Constants.SdkVersion;
49+
private const string _sdkGenVersion = Constants.SdkGenVersion;
50+
private const string _openapiDocVersion = Constants.OpenApiDocVersion;
51+
52+
public AccountBalances(SDKConfig config)
5653
{
57-
_client = client;
58-
_securitySource = securitySource;
59-
_serverUrl = serverUrl;
6054
SDKConfiguration = config;
6155
}
6256

6357
public async Task<ListBankingAccountBalancesResponse> ListAsync(ListBankingAccountBalancesRequest request, RetryConfig? retryConfig = null)
6458
{
59+
if (request == null) throw new ArgumentNullException(nameof(request));
60+
6561
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
66-
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/banking-accountBalances", request);
62+
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/banking-accountBalances", request, null);
6763

6864
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
69-
httpRequest.Headers.Add("user-agent", _userAgent);
65+
httpRequest.Headers.Add("user-agent", SDKConfiguration.UserAgent);
7066

71-
if (_securitySource != null)
67+
if (SDKConfiguration.SecuritySource != null)
7268
{
73-
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
69+
httpRequest = new SecurityMetadata(SDKConfiguration.SecuritySource).Apply(httpRequest);
7470
}
7571

76-
var hookCtx = new HookContext("list-banking-account-balances", null, _securitySource);
72+
var hookCtx = new HookContext(SDKConfiguration, baseUrl, "list-banking-account-balances", null, SDKConfiguration.SecuritySource);
7773

7874
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
7975
if (retryConfig == null)
@@ -107,8 +103,8 @@ public async Task<ListBankingAccountBalancesResponse> ListAsync(ListBankingAccou
107103

108104
Func<Task<HttpResponseMessage>> retrySend = async () =>
109105
{
110-
var _httpRequest = await _client.CloneAsync(httpRequest);
111-
return await _client.SendAsync(_httpRequest);
106+
var _httpRequest = await SDKConfiguration.Client.CloneAsync(httpRequest);
107+
return await SDKConfiguration.Client.SendAsync(_httpRequest);
112108
};
113109
var retries = new Codat.Lending.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
114110

@@ -148,7 +144,17 @@ public async Task<ListBankingAccountBalancesResponse> ListAsync(ListBankingAccou
148144
{
149145
if(Utilities.IsContentTypeMatch("application/json", contentType))
150146
{
151-
var obj = ResponseBodyDeserializer.Deserialize<BankingAccountBalances>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
147+
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
148+
BankingAccountBalances obj;
149+
try
150+
{
151+
obj = ResponseBodyDeserializer.DeserializeNotNull<BankingAccountBalances>(httpResponseBody, NullValueHandling.Ignore);
152+
}
153+
catch (Exception ex)
154+
{
155+
throw new ResponseValidationException("Failed to deserialize response body into BankingAccountBalances.", httpResponse, httpResponseBody, ex);
156+
}
157+
152158
var response = new ListBankingAccountBalancesResponse()
153159
{
154160
StatusCode = responseStatusCode,
@@ -159,24 +165,58 @@ public async Task<ListBankingAccountBalancesResponse> ListAsync(ListBankingAccou
159165
return response;
160166
}
161167

162-
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
168+
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
169+
}
170+
else if(new List<int>{400, 401, 402, 403, 404, 409, 429}.Contains(responseStatusCode))
171+
{
172+
if(Utilities.IsContentTypeMatch("application/json", contentType))
173+
{
174+
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
175+
ErrorMessagePayload payload;
176+
try
177+
{
178+
payload = ResponseBodyDeserializer.DeserializeNotNull<ErrorMessagePayload>(httpResponseBody, NullValueHandling.Ignore);
179+
}
180+
catch (Exception ex)
181+
{
182+
throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex);
183+
}
184+
185+
throw new ErrorMessage(payload, httpResponse, httpResponseBody);
186+
}
187+
188+
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
163189
}
164-
else if(new List<int>{400, 401, 402, 403, 404, 409, 429, 500, 503}.Contains(responseStatusCode))
190+
else if(new List<int>{500, 503}.Contains(responseStatusCode))
165191
{
166192
if(Utilities.IsContentTypeMatch("application/json", contentType))
167193
{
168-
var obj = ResponseBodyDeserializer.Deserialize<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
169-
throw obj!;
194+
var httpResponseBody = await httpResponse.Content.ReadAsStringAsync();
195+
ErrorMessagePayload payload;
196+
try
197+
{
198+
payload = ResponseBodyDeserializer.DeserializeNotNull<ErrorMessagePayload>(httpResponseBody, NullValueHandling.Ignore);
199+
}
200+
catch (Exception ex)
201+
{
202+
throw new ResponseValidationException("Failed to deserialize response body into ErrorMessagePayload.", httpResponse, httpResponseBody, ex);
203+
}
204+
205+
throw new ErrorMessage(payload, httpResponse, httpResponseBody);
170206
}
171207

172-
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
208+
throw new Models.Errors.SDKException("Unknown content type received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
209+
}
210+
else if(responseStatusCode >= 400 && responseStatusCode < 500)
211+
{
212+
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
173213
}
174-
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
214+
else if(responseStatusCode >= 500 && responseStatusCode < 600)
175215
{
176-
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
216+
throw new Models.Errors.SDKException("API error occurred", httpResponse, await httpResponse.Content.ReadAsStringAsync());
177217
}
178218

179-
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
219+
throw new Models.Errors.SDKException("Unknown status code received", httpResponse, await httpResponse.Content.ReadAsStringAsync());
180220
}
181221
}
182222
}

0 commit comments

Comments
 (0)