Skip to content

Commit eec9eb0

Browse files
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.446.1 (#325)
Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
1 parent 7ea7a41 commit eec9eb0

35 files changed

+531
-129
lines changed

.speakeasy/workflow.lock

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.440.1
1+
speakeasyVersion: 1.446.1
22
sources:
33
bank-feeds-source:
44
sourceNamespace: bank-feeds-source
@@ -16,11 +16,12 @@ sources:
1616
- speakeasy-sdk-regen-1731929413
1717
platform-source:
1818
sourceNamespace: platform-source
19-
sourceRevisionDigest: sha256:79a4904b9895618d236f55146f7a48a82d552ac798f86927edd76800692421c6
20-
sourceBlobDigest: sha256:e4fb24c2ca300a5005adef27857ad9afba70f056e51a84fb38368609c61cafc8
19+
sourceRevisionDigest: sha256:22a642c12144b2db0229ae5cd0f7f387de2337e5483b7d9d67894510ab466434
20+
sourceBlobDigest: sha256:d80a27e44fffb9c61f16a99e7d25c294f39be1a5a761d51a87c76477f8589f54
2121
tags:
2222
- latest
23-
- main
23+
- speakeasy-sdk-regen-1732624920
24+
- 3.0.0
2425
sync-for-commerce-source:
2526
sourceNamespace: sync-for-commerce-source
2627
sourceRevisionDigest: sha256:25f68f6f72e255804ffe90049b3b15b1dd8dcb78e7f96954e1ec5852799fc13f
@@ -72,8 +73,10 @@ targets:
7273
platform-library:
7374
source: platform-source
7475
sourceNamespace: platform-source
75-
sourceRevisionDigest: sha256:79a4904b9895618d236f55146f7a48a82d552ac798f86927edd76800692421c6
76-
sourceBlobDigest: sha256:e4fb24c2ca300a5005adef27857ad9afba70f056e51a84fb38368609c61cafc8
76+
sourceRevisionDigest: sha256:22a642c12144b2db0229ae5cd0f7f387de2337e5483b7d9d67894510ab466434
77+
sourceBlobDigest: sha256:d80a27e44fffb9c61f16a99e7d25c294f39be1a5a761d51a87c76477f8589f54
78+
codeSamplesNamespace: platform-source-code-samples
79+
codeSamplesRevisionDigest: sha256:2ab0377bf53e999f63ed07738a6d8ab38a44b9aa133d0016d3326255c06acf68
7780
sync-for-commerce-library:
7881
source: sync-for-commerce-source
7982
sourceNamespace: sync-for-commerce-source

platform/.speakeasy/gen.lock

Lines changed: 55 additions & 18 deletions
Large diffs are not rendered by default.

platform/.speakeasy/gen.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@ generation:
1111
requestResponseComponentNamesFeb2024: true
1212
auth:
1313
oAuth2ClientCredentialsEnabled: false
14+
oAuth2PasswordEnabled: false
1415
csharp:
15-
version: 5.0.0
16+
version: 6.0.0
1617
additionalDependencies: []
1718
author: Codat
1819
clientServerStatusCodesAsErrors: true
20+
defaultErrorName: SDKException
1921
description: Manage the building blocks of Codat, including companies, connections, and more.
2022
disableNamespacePascalCasingApr2024: true
2123
dotnetVersion: net8.0
2224
enableSourceLink: false
2325
flattenGlobalSecurity: true
26+
flatteningOrder: ""
2427
imports:
2528
option: openapi
2629
paths:
@@ -32,6 +35,7 @@ csharp:
3235
includeDebugSymbols: false
3336
inputModelSuffix: input
3437
maxMethodParams: 0
38+
methodArguments: infer-optional-args
3539
outputModelSuffix: output
3640
packageName: Codat.Platform
3741
packageTags: ""

platform/Codat/Platform/Codat.Platform.csproj

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,35 @@
33
<PropertyGroup>
44
<IsPackable>true</IsPackable>
55
<PackageId>Codat.Platform</PackageId>
6-
<Version>5.0.0</Version>
6+
<Version>6.0.0</Version>
77
<TargetFramework>net8.0</TargetFramework>
88
<Authors>Codat</Authors>
99
<Copyright>Copyright (c) Codat 2024</Copyright>
1010
<RepositoryUrl>https://github.com/codatio/client-sdk-csharp.git</RepositoryUrl>
1111
<RepositoryType>git</RepositoryType>
12-
<Description>An API for the common components of all of Codat's products.
13-
14-
These end points cover creating and managing your companies, data connections, and integrations.
15-
16-
[Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas)
17-
18-
---
19-
<!-- Start Codat Tags Table -->
20-
## Endpoints
21-
22-
| Endpoints | Description |
23-
| :- |:- |
24-
| Companies | Create and manage your SMB users' companies. |
25-
| Connections | Create new and manage existing data connections for a company. |
26-
| Connection management | Configure connection management UI and retrieve access tokens for authentication. |
27-
| Webhooks | Create and manage webhooks that listen to Codat's events. |
28-
| Integrations | Get a list of integrations supported by Codat and their logos. |
29-
| Refresh data | Initiate data refreshes, view pull status and history. |
30-
| Settings | Manage company profile configuration, sync settings, and API keys. |
31-
| Push data | Initiate and monitor Create, Update, and Delete operations. |
32-
| Supplemental data | Configure and pull additional data you can include in Codat's standard data types. |
33-
| Custom data type | Configure and pull additional data types that are not included in Codat's standardized data model. |
34-
<!-- End Codat Tags Table --></Description>
12+
<Description>An API for the common components of all of Codat&apos;s products.<br/>
13+
<br/>
14+
These end points cover creating and managing your companies, data connections, and integrations.<br/>
15+
<br/>
16+
<a href="https://docs.codat.io/core-concepts/companies">Read about the building blocks of Codat...</a> | <a href="https://github.com/codatio/oas">See our OpenAPI spec</a> <br/>
17+
<br/>
18+
---<br/>
19+
&lt;!-- Start Codat Tags Table --&gt;<br/>
20+
## Endpoints<br/>
21+
<br/>
22+
| Endpoints | Description |<br/>
23+
| :- |:- |<br/>
24+
| Companies | Create and manage your SMB users&apos; companies. |<br/>
25+
| Connections | Create new and manage existing data connections for a company. |<br/>
26+
| Connection management | Configure connection management UI and retrieve access tokens for authentication. |<br/>
27+
| Webhooks | Create and manage webhooks that listen to Codat&apos;s events. |<br/>
28+
| Integrations | Get a list of integrations supported by Codat and their logos. |<br/>
29+
| Refresh data | Initiate data refreshes, view pull status and history. |<br/>
30+
| Settings | Manage company profile configuration, sync settings, and API keys. |<br/>
31+
| Push data | Initiate and monitor Create, Update, and Delete operations. |<br/>
32+
| Supplemental data | Configure and pull additional data you can include in Codat&apos;s standard data types. |<br/>
33+
| Custom data type | Configure and pull additional data types that are not included in Codat&apos;s standardized data model. |<br/>
34+
&lt;!-- End Codat Tags Table --&gt;</Description>
3535
</PropertyGroup>
3636

3737
<PropertyGroup>

platform/Codat/Platform/CodatPlatform.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ public class CodatPlatform: ICodatPlatform
172172
public SDKConfig SDKConfiguration { get; private set; }
173173

174174
private const string _language = "csharp";
175-
private const string _sdkVersion = "5.0.0";
176-
private const string _sdkGenVersion = "2.442.11";
175+
private const string _sdkVersion = "6.0.0";
176+
private const string _sdkGenVersion = "2.462.1";
177177
private const string _openapiDocVersion = "3.0.0";
178-
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0 2.442.11 3.0.0 Codat.Platform";
178+
private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform";
179179
private string _serverUrl = "";
180180
private int _serverIndex = 0;
181181
private ISpeakeasyHttpClient _client;

platform/Codat/Platform/Companies.cs

Lines changed: 133 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public interface ICompanies
3232
/// List companies
3333
///
3434
/// <remarks>
35-
/// The *List companies* endpoint returns a list of [companies] associated to your instances.<br/>
35+
/// The *List companies* endpoint returns a list of <a href="https://docs.codat.io/platform-api#/schemas/Company">companies</a> associated to your instances.<br/>
3636
/// <br/>
3737
/// A <a href="https://docs.codat.io/platform-api#/schemas/Company">company</a> represents a business sharing access to their data.<br/>
3838
/// Each company can have multiple <a href="https://docs.codat.io/platform-api#/schemas/Connection">connections</a> 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.
@@ -113,6 +113,16 @@ public interface ICompanies
113113
/// </remarks>
114114
/// </summary>
115115
Task<RemoveProductResponse> RemoveProductAsync(RemoveProductRequest request, RetryConfig? retryConfig = null);
116+
117+
/// <summary>
118+
/// Get company access token
119+
///
120+
/// <remarks>
121+
/// Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat&apos;s embedded UI products.<br/>
122+
///
123+
/// </remarks>
124+
/// </summary>
125+
Task<GetCompanyAccessTokenResponse> GetAccessTokenAsync(GetCompanyAccessTokenRequest request, RetryConfig? retryConfig = null);
116126
}
117127

118128
/// <summary>
@@ -122,10 +132,10 @@ public class Companies: ICompanies
122132
{
123133
public SDKConfig SDKConfiguration { get; private set; }
124134
private const string _language = "csharp";
125-
private const string _sdkVersion = "5.0.0";
126-
private const string _sdkGenVersion = "2.442.11";
135+
private const string _sdkVersion = "6.0.0";
136+
private const string _sdkGenVersion = "2.462.1";
127137
private const string _openapiDocVersion = "3.0.0";
128-
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0 2.442.11 3.0.0 Codat.Platform";
138+
private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform";
129139
private string _serverUrl = "";
130140
private ISpeakeasyHttpClient _client;
131141
private Func<Codat.Platform.Models.Components.Security>? _securitySource;
@@ -959,5 +969,124 @@ public async Task<RemoveProductResponse> RemoveProductAsync(RemoveProductRequest
959969

960970
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
961971
}
972+
973+
public async Task<GetCompanyAccessTokenResponse> GetAccessTokenAsync(GetCompanyAccessTokenRequest request, RetryConfig? retryConfig = null)
974+
{
975+
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
976+
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/accessToken", request);
977+
978+
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
979+
httpRequest.Headers.Add("user-agent", _userAgent);
980+
981+
if (_securitySource != null)
982+
{
983+
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
984+
}
985+
986+
var hookCtx = new HookContext("get-company-access-token", null, _securitySource);
987+
988+
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
989+
if (retryConfig == null)
990+
{
991+
if (this.SDKConfiguration.RetryConfig != null)
992+
{
993+
retryConfig = this.SDKConfiguration.RetryConfig;
994+
}
995+
else
996+
{
997+
var backoff = new BackoffStrategy(
998+
initialIntervalMs: 500L,
999+
maxIntervalMs: 60000L,
1000+
maxElapsedTimeMs: 3600000L,
1001+
exponent: 1.5
1002+
);
1003+
retryConfig = new RetryConfig(
1004+
strategy: RetryConfig.RetryStrategy.BACKOFF,
1005+
backoff: backoff,
1006+
retryConnectionErrors: true
1007+
);
1008+
}
1009+
}
1010+
1011+
List<string> statusCodes = new List<string>
1012+
{
1013+
"408",
1014+
"429",
1015+
"5XX",
1016+
};
1017+
1018+
Func<Task<HttpResponseMessage>> retrySend = async () =>
1019+
{
1020+
var _httpRequest = await _client.CloneAsync(httpRequest);
1021+
return await _client.SendAsync(_httpRequest);
1022+
};
1023+
var retries = new Codat.Platform.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);
1024+
1025+
HttpResponseMessage httpResponse;
1026+
try
1027+
{
1028+
httpResponse = await retries.Run();
1029+
int _statusCode = (int)httpResponse.StatusCode;
1030+
1031+
if (_statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600)
1032+
{
1033+
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
1034+
if (_httpResponse != null)
1035+
{
1036+
httpResponse = _httpResponse;
1037+
}
1038+
}
1039+
}
1040+
catch (Exception error)
1041+
{
1042+
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
1043+
if (_httpResponse != null)
1044+
{
1045+
httpResponse = _httpResponse;
1046+
}
1047+
else
1048+
{
1049+
throw;
1050+
}
1051+
}
1052+
1053+
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
1054+
1055+
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
1056+
int responseStatusCode = (int)httpResponse.StatusCode;
1057+
if(responseStatusCode == 200)
1058+
{
1059+
if(Utilities.IsContentTypeMatch("application/json", contentType))
1060+
{
1061+
var obj = ResponseBodyDeserializer.Deserialize<CompanyAccessToken>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
1062+
var response = new GetCompanyAccessTokenResponse()
1063+
{
1064+
StatusCode = responseStatusCode,
1065+
ContentType = contentType,
1066+
RawResponse = httpResponse
1067+
};
1068+
response.CompanyAccessToken = obj;
1069+
return response;
1070+
}
1071+
1072+
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
1073+
}
1074+
else if(new List<int>{401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode))
1075+
{
1076+
if(Utilities.IsContentTypeMatch("application/json", contentType))
1077+
{
1078+
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
1079+
throw obj!;
1080+
}
1081+
1082+
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
1083+
}
1084+
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
1085+
{
1086+
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
1087+
}
1088+
1089+
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
1090+
}
9621091
}
9631092
}

platform/Codat/Platform/ConnectionManagement.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ public class ConnectionManagement: IConnectionManagement
4848
{
4949
public SDKConfig SDKConfiguration { get; private set; }
5050
private const string _language = "csharp";
51-
private const string _sdkVersion = "5.0.0";
52-
private const string _sdkGenVersion = "2.442.11";
51+
private const string _sdkVersion = "6.0.0";
52+
private const string _sdkGenVersion = "2.462.1";
5353
private const string _openapiDocVersion = "3.0.0";
54-
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0 2.442.11 3.0.0 Codat.Platform";
54+
private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform";
5555
private string _serverUrl = "";
5656
private ISpeakeasyHttpClient _client;
5757
private Func<Codat.Platform.Models.Components.Security>? _securitySource;

platform/Codat/Platform/Connections.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ public class Connections: IConnections
9393
{
9494
public SDKConfig SDKConfiguration { get; private set; }
9595
private const string _language = "csharp";
96-
private const string _sdkVersion = "5.0.0";
97-
private const string _sdkGenVersion = "2.442.11";
96+
private const string _sdkVersion = "6.0.0";
97+
private const string _sdkGenVersion = "2.462.1";
9898
private const string _openapiDocVersion = "3.0.0";
99-
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0 2.442.11 3.0.0 Codat.Platform";
99+
private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform";
100100
private string _serverUrl = "";
101101
private ISpeakeasyHttpClient _client;
102102
private Func<Codat.Platform.Models.Components.Security>? _securitySource;

platform/Codat/Platform/CorsSettings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ public class CorsSettings: ICorsSettings
5656
{
5757
public SDKConfig SDKConfiguration { get; private set; }
5858
private const string _language = "csharp";
59-
private const string _sdkVersion = "5.0.0";
60-
private const string _sdkGenVersion = "2.442.11";
59+
private const string _sdkVersion = "6.0.0";
60+
private const string _sdkGenVersion = "2.462.1";
6161
private const string _openapiDocVersion = "3.0.0";
62-
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0 2.442.11 3.0.0 Codat.Platform";
62+
private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform";
6363
private string _serverUrl = "";
6464
private ISpeakeasyHttpClient _client;
6565
private Func<Codat.Platform.Models.Components.Security>? _securitySource;

platform/Codat/Platform/CustomDataType.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ public class CustomDataType: ICustomDataType
8686
{
8787
public SDKConfig SDKConfiguration { get; private set; }
8888
private const string _language = "csharp";
89-
private const string _sdkVersion = "5.0.0";
90-
private const string _sdkGenVersion = "2.442.11";
89+
private const string _sdkVersion = "6.0.0";
90+
private const string _sdkGenVersion = "2.462.1";
9191
private const string _openapiDocVersion = "3.0.0";
92-
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0 2.442.11 3.0.0 Codat.Platform";
92+
private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform";
9393
private string _serverUrl = "";
9494
private ISpeakeasyHttpClient _client;
9595
private Func<Codat.Platform.Models.Components.Security>? _securitySource;

platform/Codat/Platform/Integrations.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ public class Integrations: IIntegrations
6363
{
6464
public SDKConfig SDKConfiguration { get; private set; }
6565
private const string _language = "csharp";
66-
private const string _sdkVersion = "5.0.0";
67-
private const string _sdkGenVersion = "2.442.11";
66+
private const string _sdkVersion = "6.0.0";
67+
private const string _sdkGenVersion = "2.462.1";
6868
private const string _openapiDocVersion = "3.0.0";
69-
private const string _userAgent = "speakeasy-sdk/csharp 5.0.0 2.442.11 3.0.0 Codat.Platform";
69+
private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.462.1 3.0.0 Codat.Platform";
7070
private string _serverUrl = "";
7171
private ISpeakeasyHttpClient _client;
7272
private Func<Codat.Platform.Models.Components.Security>? _securitySource;

platform/Codat/Platform/Models/Components/Company.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ public class Company
123123
[JsonProperty("tags")]
124124
public Dictionary<string, string>? Tags { get; set; }
125125

126+
[JsonProperty("referenceParentCompany")]
127+
public CompanyReference? ReferenceParentCompany { get; set; }
128+
129+
/// <summary>
130+
/// A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children.
131+
/// </summary>
132+
[JsonProperty("referenceSubsidiaryCompanies")]
133+
public List<CompanyReference>? ReferenceSubsidiaryCompanies { get; set; }
134+
126135
[JsonProperty("dataConnections")]
127136
public List<Connection>? DataConnections { get; set; }
128137
}

0 commit comments

Comments
 (0)