Skip to content

Commit b7d8379

Browse files
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.396.6 (#302)
Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
1 parent fc053f2 commit b7d8379

File tree

577 files changed

+12624
-6103
lines changed

Some content is hidden

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

577 files changed

+12624
-6103
lines changed

.speakeasy/workflow.lock

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ sources:
2828
tags:
2929
- latest
3030
- main
31+
sync-for-expenses-source:
32+
sourceNamespace: sync-for-expenses-source
33+
sourceRevisionDigest: sha256:ce40190cfe78e3f220050ea0830074c03d674b25d5760a37c9263161fc97e292
34+
sourceBlobDigest: sha256:7f399328e7bf537a3e5ee884667234673d34c00e889182df4e2b0500bb91dcfd
35+
tags:
36+
- latest
37+
- main
3138
targets:
3239
bank-feeds-library:
3340
source: bank-feeds-source
@@ -49,6 +56,11 @@ targets:
4956
sourceNamespace: sync-for-commerce-source
5057
sourceRevisionDigest: sha256:25f68f6f72e255804ffe90049b3b15b1dd8dcb78e7f96954e1ec5852799fc13f
5158
sourceBlobDigest: sha256:ab64a148f650a63d3411abb1686ffdcc252ddb1525415957d2dcd7e818882594
59+
sync-for-expenses-library:
60+
source: sync-for-expenses-source
61+
sourceNamespace: sync-for-expenses-source
62+
sourceRevisionDigest: sha256:ce40190cfe78e3f220050ea0830074c03d674b25d5760a37c9263161fc97e292
63+
sourceBlobDigest: sha256:7f399328e7bf537a3e5ee884667234673d34c00e889182df4e2b0500bb91dcfd
5264
workflow:
5365
workflowVersion: 1.0.0
5466
speakeasyVersion: latest
@@ -76,6 +88,8 @@ workflow:
7688
sync-for-expenses-source:
7789
inputs:
7890
- location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Expenses.yaml
91+
registry:
92+
location: registry.speakeasyapi.dev/codat/codat/sync-for-expenses-source
7993
sync-for-payables-source:
8094
inputs:
8195
- location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payables.yaml

.speakeasy/workflow.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ sources:
2424
sync-for-expenses-source:
2525
inputs:
2626
- location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Expenses.yaml
27+
registry:
28+
location: registry.speakeasyapi.dev/codat/codat/sync-for-expenses-source
2729
sync-for-payables-source:
2830
inputs:
2931
- location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payables.yaml

sync-for-expenses/.speakeasy/gen.lock

Lines changed: 2294 additions & 455 deletions
Large diffs are not rendered by default.

sync-for-expenses/CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Contributing to This Repository
2+
3+
Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements.
4+
5+
## How to Report Issues
6+
7+
If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes:
8+
9+
- A clear and descriptive title
10+
- Steps to reproduce the issue
11+
- Expected and actual behavior
12+
- Any relevant logs, screenshots, or error messages
13+
- Information about your environment (e.g., operating system, software versions)
14+
- For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed
15+
16+
## Issue Triage and Upstream Fixes
17+
18+
We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code.
19+
20+
## Contact
21+
22+
If you have any questions or need further assistance, please feel free to reach out by opening an issue.
23+
24+
Thank you for your understanding and cooperation!
25+
26+
The Maintainers

sync-for-expenses/Codat/Sync/Expenses/Accounts.cs

Lines changed: 101 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
21
//------------------------------------------------------------------------------
32
// <auto-generated>
4-
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
3+
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
54
//
65
// Changes to this file may cause incorrect behavior and will be lost when
76
// the code is regenerated.
@@ -11,9 +10,10 @@
1110
namespace Codat.Sync.Expenses
1211
{
1312
using Codat.Sync.Expenses.Hooks;
13+
using Codat.Sync.Expenses.Models.Components;
1414
using Codat.Sync.Expenses.Models.Errors;
15-
using Codat.Sync.Expenses.Models.Operations;
16-
using Codat.Sync.Expenses.Models.Shared;
15+
using Codat.Sync.Expenses.Models.Requests;
16+
using Codat.Sync.Expenses.Utils.Retries;
1717
using Codat.Sync.Expenses.Utils;
1818
using Newtonsoft.Json;
1919
using System.Collections.Generic;
@@ -23,7 +23,7 @@ namespace Codat.Sync.Expenses
2323
using System;
2424

2525
/// <summary>
26-
/// Create accounts and view account schemas.
26+
/// Create accounts and view create account options.
2727
/// </summary>
2828
public interface IAccounts
2929
{
@@ -44,7 +44,7 @@ public interface IAccounts
4444
///
4545
/// </remarks>
4646
/// </summary>
47-
Task<Models.Operations.CreateAccountResponse> CreateAsync(CreateAccountRequest request);
47+
Task<Models.Requests.CreateAccountResponse> CreateAsync(CreateAccountRequest request, RetryConfig? retryConfig = null);
4848

4949
/// <summary>
5050
/// Get create account model
@@ -62,33 +62,33 @@ public interface IAccounts
6262
///
6363
/// </remarks>
6464
/// </summary>
65-
Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest request);
65+
Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest request, RetryConfig? retryConfig = null);
6666
}
6767

6868
/// <summary>
69-
/// Create accounts and view account schemas.
69+
/// Create accounts and view create account options.
7070
/// </summary>
7171
public class Accounts: IAccounts
7272
{
7373
public SDKConfig SDKConfiguration { get; private set; }
7474
private const string _language = "csharp";
75-
private const string _sdkVersion = "5.4.0";
76-
private const string _sdkGenVersion = "2.319.7";
75+
private const string _sdkVersion = "6.0.0";
76+
private const string _sdkGenVersion = "2.415.6";
7777
private const string _openapiDocVersion = "prealpha";
78-
private const string _userAgent = "speakeasy-sdk/csharp 5.4.0 2.319.7 prealpha Codat.Sync.Expenses";
78+
private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.415.6 prealpha Codat.Sync.Expenses";
7979
private string _serverUrl = "";
80-
private ISpeakeasyHttpClient _defaultClient;
81-
private Func<Security>? _securitySource;
80+
private ISpeakeasyHttpClient _client;
81+
private Func<Codat.Sync.Expenses.Models.Components.Security>? _securitySource;
8282

83-
public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
83+
public Accounts(ISpeakeasyHttpClient client, Func<Codat.Sync.Expenses.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
8484
{
85-
_defaultClient = defaultClient;
85+
_client = client;
8686
_securitySource = securitySource;
8787
_serverUrl = serverUrl;
8888
SDKConfiguration = config;
8989
}
9090

91-
public async Task<Models.Operations.CreateAccountResponse> CreateAsync(CreateAccountRequest request)
91+
public async Task<Models.Requests.CreateAccountResponse> CreateAsync(CreateAccountRequest request, RetryConfig? retryConfig = null)
9292
{
9393
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
9494
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/push/accounts", request);
@@ -109,16 +109,52 @@ public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySour
109109

110110
var hookCtx = new HookContext("create-account", null, _securitySource);
111111

112-
httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
112+
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
113+
if (retryConfig == null)
114+
{
115+
if (this.SDKConfiguration.RetryConfig != null)
116+
{
117+
retryConfig = this.SDKConfiguration.RetryConfig;
118+
}
119+
else
120+
{
121+
var backoff = new BackoffStrategy(
122+
initialIntervalMs: 500L,
123+
maxIntervalMs: 60000L,
124+
maxElapsedTimeMs: 3600000L,
125+
exponent: 1.5
126+
);
127+
retryConfig = new RetryConfig(
128+
strategy: RetryConfig.RetryStrategy.BACKOFF,
129+
backoff: backoff,
130+
retryConnectionErrors: true
131+
);
132+
}
133+
}
134+
135+
List<string> statusCodes = new List<string>
136+
{
137+
"408",
138+
"429",
139+
"5XX",
140+
};
141+
142+
Func<Task<HttpResponseMessage>> retrySend = async () =>
143+
{
144+
var _httpRequest = await _client.CloneAsync(httpRequest);
145+
return await _client.SendAsync(_httpRequest);
146+
};
147+
var retries = new Codat.Sync.Expenses.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
148+
113149
HttpResponseMessage httpResponse;
114150
try
115151
{
116-
httpResponse = await _defaultClient.SendAsync(httpRequest);
152+
httpResponse = await retries.Run();
117153
int _statusCode = (int)httpResponse.StatusCode;
118154

119155
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)
120156
{
121-
var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
157+
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
122158
if (_httpResponse != null)
123159
{
124160
httpResponse = _httpResponse;
@@ -127,7 +163,7 @@ public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySour
127163
}
128164
catch (Exception error)
129165
{
130-
var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
166+
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
131167
if (_httpResponse != null)
132168
{
133169
httpResponse = _httpResponse;
@@ -138,16 +174,16 @@ public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySour
138174
}
139175
}
140176

141-
httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
177+
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
142178

143179
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
144180
int responseStatusCode = (int)httpResponse.StatusCode;
145181
if(responseStatusCode == 200)
146182
{
147183
if(Utilities.IsContentTypeMatch("application/json", contentType))
148184
{
149-
var obj = ResponseBodyDeserializer.Deserialize<Models.Shared.CreateAccountResponse>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
150-
var response = new Models.Operations.CreateAccountResponse()
185+
var obj = ResponseBodyDeserializer.Deserialize<Models.Components.CreateAccountResponse>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
186+
var response = new Models.Requests.CreateAccountResponse()
151187
{
152188
StatusCode = responseStatusCode,
153189
ContentType = contentType,
@@ -183,7 +219,7 @@ public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySour
183219
}
184220
}
185221

186-
public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest request)
222+
public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest request, RetryConfig? retryConfig = null)
187223
{
188224
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
189225
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", request);
@@ -198,16 +234,52 @@ public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(Get
198234

199235
var hookCtx = new HookContext("get-create-chartOfAccounts-model", null, _securitySource);
200236

201-
httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
237+
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
238+
if (retryConfig == null)
239+
{
240+
if (this.SDKConfiguration.RetryConfig != null)
241+
{
242+
retryConfig = this.SDKConfiguration.RetryConfig;
243+
}
244+
else
245+
{
246+
var backoff = new BackoffStrategy(
247+
initialIntervalMs: 500L,
248+
maxIntervalMs: 60000L,
249+
maxElapsedTimeMs: 3600000L,
250+
exponent: 1.5
251+
);
252+
retryConfig = new RetryConfig(
253+
strategy: RetryConfig.RetryStrategy.BACKOFF,
254+
backoff: backoff,
255+
retryConnectionErrors: true
256+
);
257+
}
258+
}
259+
260+
List<string> statusCodes = new List<string>
261+
{
262+
"408",
263+
"429",
264+
"5XX",
265+
};
266+
267+
Func<Task<HttpResponseMessage>> retrySend = async () =>
268+
{
269+
var _httpRequest = await _client.CloneAsync(httpRequest);
270+
return await _client.SendAsync(_httpRequest);
271+
};
272+
var retries = new Codat.Sync.Expenses.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
273+
202274
HttpResponseMessage httpResponse;
203275
try
204276
{
205-
httpResponse = await _defaultClient.SendAsync(httpRequest);
277+
httpResponse = await retries.Run();
206278
int _statusCode = (int)httpResponse.StatusCode;
207279

208280
if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600)
209281
{
210-
var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
282+
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
211283
if (_httpResponse != null)
212284
{
213285
httpResponse = _httpResponse;
@@ -216,7 +288,7 @@ public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(Get
216288
}
217289
catch (Exception error)
218290
{
219-
var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
291+
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
220292
if (_httpResponse != null)
221293
{
222294
httpResponse = _httpResponse;
@@ -227,7 +299,7 @@ public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(Get
227299
}
228300
}
229301

230-
httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
302+
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
231303

232304
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
233305
int responseStatusCode = (int)httpResponse.StatusCode;

0 commit comments

Comments
 (0)