Skip to content

Commit 995c0b4

Browse files
ci: regenerated with OpenAPI Doc prealpha, Speakeasy CLI 1.214.0 (#257)
Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
1 parent a19ebdc commit 995c0b4

File tree

138 files changed

+812
-690
lines changed

Some content is hidden

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

138 files changed

+812
-690
lines changed

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
lockVersion: 2.0.0
22
id: 18b9d064-aee3-46b6-b773-6d0ab95e296c
33
management:
4-
docChecksum: cd6fa6671764b38bed9a8592c0f117ad
4+
docChecksum: f7909a451d1597b90dec569f16a52c39
55
docVersion: prealpha
6-
speakeasyVersion: internal
7-
generationVersion: 2.257.2
8-
releaseVersion: 5.1.0
9-
configChecksum: bf2e9b4d2b7342b0024cf499f9ef09f6
6+
speakeasyVersion: 1.214.0
7+
generationVersion: 2.286.2
8+
releaseVersion: 5.2.0
9+
configChecksum: fe759e3700991ca9b6120e29fae8da94
1010
repoURL: https://github.com/codatio/client-sdk-csharp.git
1111
repoSubDirectory: sync-for-expenses
1212
published: true
1313
features:
1414
csharp:
15-
core: 3.3.2
15+
core: 3.4.3
16+
decimal: 0.1.0
1617
deprecations: 2.81.2
1718
examples: 2.81.3
18-
globalSecurity: 2.83.0
19-
globalServerURLs: 2.82.2
19+
globalSecurity: 2.83.4
20+
globalServerURLs: 2.82.3
2021
inputOutputModels: 2.83.0
2122
nameOverrides: 2.81.1
23+
webhooks: 1.0.0
2224
generatedFiles:
2325
- CodatSyncExpenses/Companies.cs
2426
- CodatSyncExpenses/Connections.cs
@@ -32,6 +34,7 @@ generatedFiles:
3234
- CodatSyncExpenses/Sync.cs
3335
- CodatSyncExpenses/TransactionStatus.cs
3436
- CodatSyncExpenses/CodatSyncExpenses.cs
37+
- global.json
3538
- CodatSyncExpenses/Utils/BigIntSerializer.cs
3639
- CodatSyncExpenses/Utils/DecimalSerializer.cs
3740
- CodatSyncExpenses/Utils/EnumSerializer.cs

sync-for-expenses/CodatSyncExpenses/Accounts.cs

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public interface IAccounts
4141
///
4242
/// </remarks>
4343
/// </summary>
44-
Task<Models.Operations.CreateAccountResponse> CreateAsync(CreateAccountRequest? request = null);
44+
Task<Models.Operations.CreateAccountResponse> CreateAsync(CreateAccountRequest request);
4545

4646
/// <summary>
4747
/// Get create account model
@@ -59,7 +59,7 @@ public interface IAccounts
5959
///
6060
/// </remarks>
6161
/// </summary>
62-
Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest? request = null);
62+
Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest request);
6363
}
6464

6565
/// <summary>
@@ -69,10 +69,10 @@ public class Accounts: IAccounts
6969
{
7070
public SDKConfig SDKConfiguration { get; private set; }
7171
private const string _language = "csharp";
72-
private const string _sdkVersion = "5.1.0";
73-
private const string _sdkGenVersion = "2.257.2";
72+
private const string _sdkVersion = "5.2.0";
73+
private const string _sdkGenVersion = "2.286.2";
7474
private const string _openapiDocVersion = "prealpha";
75-
private const string _userAgent = "speakeasy-sdk/csharp 5.1.0 2.257.2 prealpha Codat.Sync.Expenses";
75+
private const string _userAgent = "speakeasy-sdk/csharp 5.2.0 2.286.2 prealpha Codat.Sync.Expenses";
7676
private string _serverUrl = "";
7777
private ISpeakeasyHttpClient _defaultClient;
7878
private Func<Security>? _securitySource;
@@ -84,22 +84,21 @@ public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySour
8484
_serverUrl = serverUrl;
8585
SDKConfiguration = config;
8686
}
87-
8887

89-
public async Task<Models.Operations.CreateAccountResponse> CreateAsync(CreateAccountRequest? request = null)
88+
public async Task<Models.Operations.CreateAccountResponse> CreateAsync(CreateAccountRequest request)
9089
{
9190
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
9291
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/push/accounts", request);
93-
92+
9493
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
9594
httpRequest.Headers.Add("user-agent", _userAgent);
96-
97-
var serializedBody = RequestBodySerializer.Serialize(request, "AccountPrototype", "json");
95+
96+
var serializedBody = RequestBodySerializer.Serialize(request, "AccountPrototype", "json", false, true);
9897
if (serializedBody != null)
9998
{
10099
httpRequest.Content = serializedBody;
101100
}
102-
101+
103102
var client = _defaultClient;
104103
if (_securitySource != null)
105104
{
@@ -109,14 +108,14 @@ public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySour
109108
var httpResponse = await client.SendAsync(httpRequest);
110109

111110
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
112-
111+
113112
var response = new Models.Operations.CreateAccountResponse
114113
{
115114
StatusCode = (int)httpResponse.StatusCode,
116115
ContentType = contentType,
117116
RawResponse = httpResponse
118117
};
119-
118+
120119
if((response.StatusCode == 200))
121120
{
122121
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
@@ -126,6 +125,7 @@ public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySour
126125

127126
return response;
128127
}
128+
129129
if((response.StatusCode == 400) || (response.StatusCode == 401) || (response.StatusCode == 402) || (response.StatusCode == 403) || (response.StatusCode == 404) || (response.StatusCode == 429) || (response.StatusCode == 500) || (response.StatusCode == 503))
130130
{
131131
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
@@ -138,17 +138,15 @@ public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySour
138138
return response;
139139
}
140140

141-
142141

143-
public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest? request = null)
142+
public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest request)
144143
{
145144
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
146145
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", request);
147-
146+
148147
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
149148
httpRequest.Headers.Add("user-agent", _userAgent);
150-
151-
149+
152150
var client = _defaultClient;
153151
if (_securitySource != null)
154152
{
@@ -158,14 +156,14 @@ public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(Get
158156
var httpResponse = await client.SendAsync(httpRequest);
159157

160158
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
161-
159+
162160
var response = new GetCreateChartOfAccountsModelResponse
163161
{
164162
StatusCode = (int)httpResponse.StatusCode,
165163
ContentType = contentType,
166164
RawResponse = httpResponse
167165
};
168-
166+
169167
if((response.StatusCode == 200))
170168
{
171169
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
@@ -175,6 +173,7 @@ public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(Get
175173

176174
return response;
177175
}
176+
178177
if((response.StatusCode == 401) || (response.StatusCode == 402) || (response.StatusCode == 403) || (response.StatusCode == 404) || (response.StatusCode == 429) || (response.StatusCode == 500) || (response.StatusCode == 503))
179178
{
180179
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
@@ -187,6 +186,5 @@ public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(Get
187186
return response;
188187
}
189188

190-
191189
}
192190
}

sync-for-expenses/CodatSyncExpenses/CodatSyncExpenses.cs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ namespace Codat.Sync.Expenses
1818
using System.Threading.Tasks;
1919
using System;
2020

21-
22-
2321
/// <summary>
2422
/// Sync for Expenses: The API for Sync for Expenses.<br/>
2523
///
@@ -94,14 +92,16 @@ public interface ICodatSyncExpenses
9492
/// </summary>
9593
public ITransactionStatus TransactionStatus { get; }
9694
}
97-
95+
9896
public class SDKConfig
9997
{
100-
public static string[] ServerList = new string[]
101-
{
98+
/// <summary>
99+
/// List of server URLs available to the SDK.
100+
/// </summary>
101+
public static readonly string[] ServerList = {
102102
"https://api.codat.io",
103103
};
104-
/// Contains the list of servers available to the SDK
104+
105105
public string serverUrl = "";
106106
public int serverIndex = 0;
107107

@@ -136,10 +136,10 @@ public class CodatSyncExpenses: ICodatSyncExpenses
136136
public SDKConfig SDKConfiguration { get; private set; }
137137

138138
private const string _language = "csharp";
139-
private const string _sdkVersion = "5.1.0";
140-
private const string _sdkGenVersion = "2.257.2";
139+
private const string _sdkVersion = "5.2.0";
140+
private const string _sdkGenVersion = "2.286.2";
141141
private const string _openapiDocVersion = "prealpha";
142-
private const string _userAgent = "speakeasy-sdk/csharp 5.1.0 2.257.2 prealpha Codat.Sync.Expenses";
142+
private const string _userAgent = "speakeasy-sdk/csharp 5.2.0 2.286.2 prealpha Codat.Sync.Expenses";
143143
private string _serverUrl = "";
144144
private int _serverIndex = 0;
145145
private ISpeakeasyHttpClient _defaultClient;
@@ -160,6 +160,10 @@ public CodatSyncExpenses(Security? security = null, Func<Security>? securitySour
160160
{
161161
if (serverIndex != null)
162162
{
163+
if (serverIndex.Value < 0 || serverIndex.Value >= SDKConfig.ServerList.Length)
164+
{
165+
throw new Exception($"Invalid server index {serverIndex.Value}");
166+
}
163167
_serverIndex = serverIndex.Value;
164168
}
165169

@@ -182,6 +186,10 @@ public CodatSyncExpenses(Security? security = null, Func<Security>? securitySour
182186
{
183187
_securitySource = () => security;
184188
}
189+
else
190+
{
191+
throw new Exception("security and securitySource cannot both be null");
192+
}
185193

186194
SDKConfiguration = new SDKConfig()
187195
{

sync-for-expenses/CodatSyncExpenses/CodatSyncExpenses.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<IsPackable>true</IsPackable>
44
<PackageId>Codat.Sync.Expenses</PackageId>
5-
<Version>5.1.0</Version>
5+
<Version>5.2.0</Version>
66
<Authors>Codat</Authors>
77
<TargetFramework>net6.0</TargetFramework>
88
<Nullable>enable</Nullable>

0 commit comments

Comments
 (0)