Skip to content

Commit 9740466

Browse files
ci: regenerated with OpenAPI Doc 3.0.0, Speakeasy CLI 1.121.3 (#199)
Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
1 parent a6e1f18 commit 9740466

File tree

193 files changed

+752
-798
lines changed

Some content is hidden

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

193 files changed

+752
-798
lines changed

bank-feeds/.gitattributes

100755100644
File mode changed.

bank-feeds/CodatBankFeeds.sln

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodatBankFeeds", "CodatBankFeeds\CodatBankFeeds.csproj", "{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}"
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Codat.BankFeeds", "CodatBankFeeds\CodatBankFeeds.csproj", "{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}"
44
EndProject
55

66
Global

bank-feeds/CodatBankFeeds/AccountMapping.cs

100755100644
Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
// </auto-generated>
99
//------------------------------------------------------------------------------
1010
#nullable enable
11-
namespace CodatBankFeeds
11+
namespace Codat.BankFeeds
1212
{
13-
using CodatBankFeeds.Models.Operations;
14-
using CodatBankFeeds.Models.Shared;
15-
using CodatBankFeeds.Utils;
13+
using Codat.BankFeeds.Models.Operations;
14+
using Codat.BankFeeds.Models.Shared;
15+
using Codat.BankFeeds.Utils;
1616
using Newtonsoft.Json;
1717
using System.Net.Http.Headers;
1818
using System.Net.Http;
@@ -22,7 +22,7 @@ namespace CodatBankFeeds
2222
/// <summary>
2323
/// Bank feed bank account mapping.
2424
/// </summary>
25-
public interface IAccountMappingSDK
25+
public interface IAccountMapping
2626
{
2727

2828
/// <summary>
@@ -57,19 +57,19 @@ public interface IAccountMappingSDK
5757
/// <summary>
5858
/// Bank feed bank account mapping.
5959
/// </summary>
60-
public class AccountMappingSDK: IAccountMappingSDK
60+
public class AccountMapping: IAccountMapping
6161
{
6262
public SDKConfig Config { get; private set; }
6363
private const string _language = "csharp";
64-
private const string _sdkVersion = "2.2.0";
65-
private const string _sdkGenVersion = "2.159.2";
64+
private const string _sdkVersion = "3.0.0";
65+
private const string _sdkGenVersion = "2.195.2";
6666
private const string _openapiDocVersion = "3.0.0";
67-
private const string _userAgent = "speakeasy-sdk/csharp 2.2.0 2.159.2 3.0.0 Codat.BankFeeds";
67+
private const string _userAgent = "speakeasy-sdk/csharp 3.0.0 2.195.2 3.0.0 Codat.BankFeeds";
6868
private string _serverUrl = "";
6969
private ISpeakeasyHttpClient _defaultClient;
7070
private ISpeakeasyHttpClient _securityClient;
7171

72-
public AccountMappingSDK(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
72+
public AccountMapping(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
7373
{
7474
_defaultClient = defaultClient;
7575
_securityClient = securityClient;
@@ -80,18 +80,13 @@ public AccountMappingSDK(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClien
8080

8181
public async Task<CreateBankAccountMappingResponse> CreateAsync(CreateBankAccountMappingRequest? request = null)
8282
{
83-
string baseUrl = _serverUrl;
84-
if (baseUrl.EndsWith("/"))
85-
{
86-
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
87-
}
83+
string baseUrl = this.Config.GetTemplatedServerDetails();
8884
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/mapping", request);
8985

90-
9186
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
9287
httpRequest.Headers.Add("user-agent", _userAgent);
9388

94-
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "json");
89+
var serializedBody = RequestBodySerializer.Serialize(request, "Zero", "json");
9590
if (serializedBody != null)
9691
{
9792
httpRequest.Content = serializedBody;
@@ -119,7 +114,7 @@ public async Task<CreateBankAccountMappingResponse> CreateAsync(CreateBankAccoun
119114

120115
return response;
121116
}
122-
if((response.StatusCode == 400) || (response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 429))
117+
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))
123118
{
124119
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
125120
{
@@ -134,14 +129,9 @@ public async Task<CreateBankAccountMappingResponse> CreateAsync(CreateBankAccoun
134129

135130
public async Task<GetBankAccountMappingResponse> GetAsync(GetBankAccountMappingRequest? request = null)
136131
{
137-
string baseUrl = _serverUrl;
138-
if (baseUrl.EndsWith("/"))
139-
{
140-
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
141-
}
132+
string baseUrl = this.Config.GetTemplatedServerDetails();
142133
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/mapping", request);
143134

144-
145135
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
146136
httpRequest.Headers.Add("user-agent", _userAgent);
147137

@@ -168,7 +158,7 @@ public async Task<GetBankAccountMappingResponse> GetAsync(GetBankAccountMappingR
168158

169159
return response;
170160
}
171-
if((response.StatusCode == 401) || (response.StatusCode == 429))
161+
if((response.StatusCode == 401) || (response.StatusCode == 402) || (response.StatusCode == 403) || (response.StatusCode == 404) || (response.StatusCode == 429) || (response.StatusCode == 500) || (response.StatusCode == 503))
172162
{
173163
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
174164
{

bank-feeds/CodatBankFeeds/CodatBankFeedsSDK.cs renamed to bank-feeds/CodatBankFeeds/CodatBankFeeds.cs

Lines changed: 52 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@
88
// </auto-generated>
99
//------------------------------------------------------------------------------
1010
#nullable enable
11-
namespace CodatBankFeeds
11+
namespace Codat.BankFeeds
1212
{
13-
using CodatBankFeeds.Models.Shared;
14-
using CodatBankFeeds.Utils;
13+
using Codat.BankFeeds.Models.Shared;
14+
using Codat.BankFeeds.Utils;
1515
using System.Collections.Generic;
1616
using System.Net.Http;
1717
using System.Threading.Tasks;
1818
using System;
1919

20+
21+
2022
/// <summary>
2123
/// Bank Feeds API: Bank Feeds API enables your SMB users to set up bank feeds from accounts in your application to supported accounting platforms.<br/>
2224
///
@@ -39,37 +41,53 @@ namespace CodatBankFeeds
3941
/// | Account mapping | Extra functionality for building an account management UI |
4042
/// </remarks>
4143
/// </summary>
42-
public interface ICodatBankFeedsSDK
44+
public interface ICodatBankFeeds
4345
{
4446

4547
/// <summary>
46-
/// Bank feed bank account mapping.
48+
/// Create and manage your Codat companies.
4749
/// </summary>
48-
public IAccountMappingSDK AccountMapping { get; }
50+
public ICompanies Companies { get; }
4951

5052
/// <summary>
51-
/// Create and manage your Codat companies.
53+
/// Manage your companies&apos; data connections.
5254
/// </summary>
53-
public ICompaniesSDK Companies { get; }
55+
public IConnections Connections { get; }
5456

5557
/// <summary>
56-
/// Manage your companies&apos; data connections.
58+
/// Bank feed bank account mapping.
5759
/// </summary>
58-
public IConnectionsSDK Connections { get; }
60+
public IAccountMapping AccountMapping { get; }
5961

6062
/// <summary>
6163
/// Source accounts act as a bridge to bank accounts in accounting software.
6264
/// </summary>
63-
public ISourceAccountsSDK SourceAccounts { get; }
65+
public ISourceAccounts SourceAccounts { get; }
6466

6567
/// <summary>
6668
/// Transactions represent debits and credits from a source account.
6769
/// </summary>
68-
public ITransactionsSDK Transactions { get; }
70+
public ITransactions Transactions { get; }
6971
}
7072

7173
public class SDKConfig
7274
{
75+
public static string[] ServerList = new string[]
76+
{
77+
"https://api.codat.io",
78+
};
79+
/// Contains the list of servers available to the SDK
80+
public string serverUrl = "";
81+
public int serverIndex = 0;
82+
83+
public string GetTemplatedServerDetails()
84+
{
85+
if (!String.IsNullOrEmpty(this.serverUrl))
86+
{
87+
return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.serverUrl, "/"), new Dictionary<string, string>());
88+
}
89+
return Utilities.TemplateUrl(SDKConfig.ServerList[this.serverIndex], new Dictionary<string, string>());
90+
}
7391
}
7492

7593
/// <summary>
@@ -94,31 +112,32 @@ public class SDKConfig
94112
/// | Account mapping | Extra functionality for building an account management UI |
95113
/// </remarks>
96114
/// </summary>
97-
public class CodatBankFeedsSDK: ICodatBankFeedsSDK
115+
public class CodatBankFeeds: ICodatBankFeeds
98116
{
99117
public SDKConfig Config { get; private set; }
100-
public static List<string> ServerList = new List<string>()
101-
{
102-
"https://api.codat.io",
103-
};
104118

105119
private const string _language = "csharp";
106-
private const string _sdkVersion = "2.2.0";
107-
private const string _sdkGenVersion = "2.159.2";
120+
private const string _sdkVersion = "3.0.0";
121+
private const string _sdkGenVersion = "2.195.2";
108122
private const string _openapiDocVersion = "3.0.0";
109-
private const string _userAgent = "speakeasy-sdk/csharp 2.2.0 2.159.2 3.0.0 Codat.BankFeeds";
123+
private const string _userAgent = "speakeasy-sdk/csharp 3.0.0 2.195.2 3.0.0 Codat.BankFeeds";
110124
private string _serverUrl = "";
111125
private ISpeakeasyHttpClient _defaultClient;
112126
private ISpeakeasyHttpClient _securityClient;
113-
public IAccountMappingSDK AccountMapping { get; private set; }
114-
public ICompaniesSDK Companies { get; private set; }
115-
public IConnectionsSDK Connections { get; private set; }
116-
public ISourceAccountsSDK SourceAccounts { get; private set; }
117-
public ITransactionsSDK Transactions { get; private set; }
127+
public ICompanies Companies { get; private set; }
128+
public IConnections Connections { get; private set; }
129+
public IAccountMapping AccountMapping { get; private set; }
130+
public ISourceAccounts SourceAccounts { get; private set; }
131+
public ITransactions Transactions { get; private set; }
118132

119-
public CodatBankFeedsSDK(Security? security = null, string? serverUrl = null, ISpeakeasyHttpClient? client = null)
133+
public CodatBankFeeds(Security? security = null, int? serverIndex = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null)
120134
{
121-
_serverUrl = serverUrl ?? CodatBankFeedsSDK.ServerList[0];
135+
if (serverUrl != null) {
136+
if (urlParams != null) {
137+
serverUrl = Utilities.TemplateUrl(serverUrl, urlParams);
138+
}
139+
_serverUrl = serverUrl;
140+
}
122141

123142
_defaultClient = new SpeakeasyHttpClient(client);
124143
_securityClient = _defaultClient;
@@ -130,13 +149,14 @@ public CodatBankFeedsSDK(Security? security = null, string? serverUrl = null, IS
130149

131150
Config = new SDKConfig()
132151
{
152+
serverUrl = _serverUrl
133153
};
134154

135-
AccountMapping = new AccountMappingSDK(_defaultClient, _securityClient, _serverUrl, Config);
136-
Companies = new CompaniesSDK(_defaultClient, _securityClient, _serverUrl, Config);
137-
Connections = new ConnectionsSDK(_defaultClient, _securityClient, _serverUrl, Config);
138-
SourceAccounts = new SourceAccountsSDK(_defaultClient, _securityClient, _serverUrl, Config);
139-
Transactions = new TransactionsSDK(_defaultClient, _securityClient, _serverUrl, Config);
155+
Companies = new Companies(_defaultClient, _securityClient, _serverUrl, Config);
156+
Connections = new Connections(_defaultClient, _securityClient, _serverUrl, Config);
157+
AccountMapping = new AccountMapping(_defaultClient, _securityClient, _serverUrl, Config);
158+
SourceAccounts = new SourceAccounts(_defaultClient, _securityClient, _serverUrl, Config);
159+
Transactions = new Transactions(_defaultClient, _securityClient, _serverUrl, Config);
140160
}
141161
}
142162
}

bank-feeds/CodatBankFeeds/CodatBankFeeds.csproj

100755100644
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
<PropertyGroup>
33
<IsPackable>true</IsPackable>
44
<PackageId>Codat.BankFeeds</PackageId>
5-
<Version>2.2.0</Version>
5+
<Version>3.0.0</Version>
66
<Authors>Codat</Authors>
77
<TargetFramework>net6.0</TargetFramework>
88
<Nullable>enable</Nullable>
99
<PackageReadmeFile>README.md</PackageReadmeFile>
1010
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1111
<NoWarn>1591</NoWarn>
12+
<RepositoryUrl>https://github.com/codatio/client-sdk-csharp</RepositoryUrl>
1213
</PropertyGroup>
1314

1415
<ItemGroup>

0 commit comments

Comments
 (0)