Skip to content

Commit bac3411

Browse files
chore: speakeasy sdk regeneration - Generate Lending library (#52)
* ci: regenerated with OpenAPI Doc 3.0.0, Speakeay CLI 1.83.0 * ci: regenerated with OpenAPI Doc 3.0.0, Speakeay CLI 1.83.2 --------- Co-authored-by: speakeasybot <[email protected]>
1 parent 6bda6d2 commit bac3411

File tree

730 files changed

+14716
-12017
lines changed

Some content is hidden

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

730 files changed

+14716
-12017
lines changed

lending/CodatLending/AccountingBankData.cs

Lines changed: 7 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -21,150 +21,29 @@ namespace CodatLending
2121

2222
public interface IAccountingBankDataSDK
2323
{
24-
Task<GetAccountingBankAccountResponse> GetAccountAsync(GetAccountingBankAccountRequest? request = null);
25-
Task<ListAccountingBankAccountsResponse> ListAccountsAsync(ListAccountingBankAccountsRequest? request = null);
24+
public IAccountingBankDataAccountsSDK Accounts { get; }
2625
Task<ListAccountingBankAccountTransactionsResponse> ListTransactionsAsync(ListAccountingBankAccountTransactionsRequest? request = null);
2726
}
2827

2928
public class AccountingBankDataSDK: IAccountingBankDataSDK
3029
{
3130
public SDKConfig Config { get; private set; }
3231
private const string _language = "csharp";
33-
private const string _sdkVersion = "0.2.0";
34-
private const string _sdkGenVersion = "2.91.4";
32+
private const string _sdkVersion = "1.2.0";
33+
private const string _sdkGenVersion = "2.109.3";
3534
private const string _openapiDocVersion = "3.0.0";
3635
private string _serverUrl = "";
3736
private ISpeakeasyHttpClient _defaultClient;
3837
private ISpeakeasyHttpClient _securityClient;
38+
public IAccountingBankDataAccountsSDK Accounts { get; private set; }
3939

4040
public AccountingBankDataSDK(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
4141
{
4242
_defaultClient = defaultClient;
4343
_securityClient = securityClient;
4444
_serverUrl = serverUrl;
4545
Config = config;
46-
}
47-
48-
49-
/// <summary>
50-
/// Get bank account
51-
///
52-
/// <remarks>
53-
/// The *Get bank account* endpoint returns a single account for a given accountId.
54-
///
55-
/// [Bank accounts](https://docs.codat.io/accounting-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution.
56-
///
57-
/// Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support getting a specific bank account.
58-
///
59-
/// Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
60-
///
61-
/// </remarks>
62-
/// </summary>
63-
public async Task<GetAccountingBankAccountResponse> GetAccountAsync(GetAccountingBankAccountRequest? request = null)
64-
{
65-
string baseUrl = _serverUrl;
66-
if (baseUrl.EndsWith("/"))
67-
{
68-
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
69-
}
70-
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts/{accountId}", request);
71-
72-
73-
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
74-
httpRequest.Headers.Add("user-agent", $"speakeasy-sdk/{_language} {_sdkVersion} {_sdkGenVersion} {_openapiDocVersion}");
75-
76-
77-
var client = _securityClient;
78-
79-
var httpResponse = await client.SendAsync(httpRequest);
80-
81-
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
82-
83-
var response = new GetAccountingBankAccountResponse
84-
{
85-
StatusCode = (int)httpResponse.StatusCode,
86-
ContentType = contentType,
87-
RawResponse = httpResponse
88-
};
89-
if((response.StatusCode == 200))
90-
{
91-
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
92-
{
93-
response.AccountingBankAccount = JsonConvert.DeserializeObject<AccountingBankAccount>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
94-
}
95-
96-
return response;
97-
}
98-
if((response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 409) || (response.StatusCode == 429))
99-
{
100-
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
101-
{
102-
response.ErrorMessage = JsonConvert.DeserializeObject<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
103-
}
104-
105-
return response;
106-
}
107-
return response;
108-
}
109-
110-
111-
/// <summary>
112-
/// List bank accounts
113-
///
114-
/// <remarks>
115-
/// The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/accounting-api#/schemas/BankAccount) for a given company's connection.
116-
///
117-
/// [Bank accounts](https://docs.codat.io/accounting-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution.
118-
///
119-
/// Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
120-
///
121-
/// </remarks>
122-
/// </summary>
123-
public async Task<ListAccountingBankAccountsResponse> ListAccountsAsync(ListAccountingBankAccountsRequest? request = null)
124-
{
125-
string baseUrl = _serverUrl;
126-
if (baseUrl.EndsWith("/"))
127-
{
128-
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
129-
}
130-
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts", request);
131-
132-
133-
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
134-
httpRequest.Headers.Add("user-agent", $"speakeasy-sdk/{_language} {_sdkVersion} {_sdkGenVersion} {_openapiDocVersion}");
135-
136-
137-
var client = _securityClient;
138-
139-
var httpResponse = await client.SendAsync(httpRequest);
140-
141-
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
142-
143-
var response = new ListAccountingBankAccountsResponse
144-
{
145-
StatusCode = (int)httpResponse.StatusCode,
146-
ContentType = contentType,
147-
RawResponse = httpResponse
148-
};
149-
if((response.StatusCode == 200))
150-
{
151-
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
152-
{
153-
response.AccountingBankAccounts = JsonConvert.DeserializeObject<AccountingBankAccounts>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
154-
}
155-
156-
return response;
157-
}
158-
if((response.StatusCode == 400) || (response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 409))
159-
{
160-
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
161-
{
162-
response.ErrorMessage = JsonConvert.DeserializeObject<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
163-
}
164-
165-
return response;
166-
}
167-
return response;
46+
Accounts = new AccountingBankDataAccountsSDK(_defaultClient, _securityClient, _serverUrl, Config);
16847
}
16948

17049

@@ -210,7 +89,7 @@ public async Task<ListAccountingBankAccountTransactionsResponse> ListTransaction
21089
};
21190
if((response.StatusCode == 200))
21291
{
213-
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
92+
if(Utilities.IsContentTypeMatch("application/json", response.ContentType))
21493
{
21594
response.AccountingBankTransactions = JsonConvert.DeserializeObject<AccountingBankTransactions>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
21695
}
@@ -219,7 +98,7 @@ public async Task<ListAccountingBankAccountTransactionsResponse> ListTransaction
21998
}
22099
if((response.StatusCode == 400) || (response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 409) || (response.StatusCode == 429))
221100
{
222-
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
101+
if(Utilities.IsContentTypeMatch("application/json", response.ContentType))
223102
{
224103
response.ErrorMessage = JsonConvert.DeserializeObject<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
225104
}
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
2+
//------------------------------------------------------------------------------
3+
// <auto-generated>
4+
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
5+
//
6+
// Changes to this file may cause incorrect behavior and will be lost when
7+
// the code is regenerated.
8+
// </auto-generated>
9+
//------------------------------------------------------------------------------
10+
#nullable enable
11+
namespace CodatLending
12+
{
13+
using CodatLending.Models.Operations;
14+
using CodatLending.Models.Shared;
15+
using CodatLending.Utils;
16+
using Newtonsoft.Json;
17+
using System.Net.Http.Headers;
18+
using System.Net.Http;
19+
using System.Threading.Tasks;
20+
using System;
21+
22+
public interface IAccountingBankDataAccountsSDK
23+
{
24+
Task<GetAccountingBankAccountResponse> GetAsync(GetAccountingBankAccountRequest? request = null);
25+
Task<ListAccountingBankAccountsResponse> ListAsync(ListAccountingBankAccountsRequest? request = null);
26+
}
27+
28+
public class AccountingBankDataAccountsSDK: IAccountingBankDataAccountsSDK
29+
{
30+
public SDKConfig Config { get; private set; }
31+
private const string _language = "csharp";
32+
private const string _sdkVersion = "1.2.0";
33+
private const string _sdkGenVersion = "2.109.3";
34+
private const string _openapiDocVersion = "3.0.0";
35+
private string _serverUrl = "";
36+
private ISpeakeasyHttpClient _defaultClient;
37+
private ISpeakeasyHttpClient _securityClient;
38+
39+
public AccountingBankDataAccountsSDK(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
40+
{
41+
_defaultClient = defaultClient;
42+
_securityClient = securityClient;
43+
_serverUrl = serverUrl;
44+
Config = config;
45+
}
46+
47+
48+
/// <summary>
49+
/// Get bank account
50+
///
51+
/// <remarks>
52+
/// The *Get bank account* endpoint returns a single account for a given accountId.
53+
///
54+
/// [Bank accounts](https://docs.codat.io/accounting-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution.
55+
///
56+
/// Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support getting a specific bank account.
57+
///
58+
/// Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
59+
///
60+
/// </remarks>
61+
/// </summary>
62+
public async Task<GetAccountingBankAccountResponse> GetAsync(GetAccountingBankAccountRequest? request = null)
63+
{
64+
string baseUrl = _serverUrl;
65+
if (baseUrl.EndsWith("/"))
66+
{
67+
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
68+
}
69+
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts/{accountId}", request);
70+
71+
72+
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
73+
httpRequest.Headers.Add("user-agent", $"speakeasy-sdk/{_language} {_sdkVersion} {_sdkGenVersion} {_openapiDocVersion}");
74+
75+
76+
var client = _securityClient;
77+
78+
var httpResponse = await client.SendAsync(httpRequest);
79+
80+
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
81+
82+
var response = new GetAccountingBankAccountResponse
83+
{
84+
StatusCode = (int)httpResponse.StatusCode,
85+
ContentType = contentType,
86+
RawResponse = httpResponse
87+
};
88+
if((response.StatusCode == 200))
89+
{
90+
if(Utilities.IsContentTypeMatch("application/json", response.ContentType))
91+
{
92+
response.AccountingBankAccount = JsonConvert.DeserializeObject<AccountingBankAccount>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
93+
}
94+
95+
return response;
96+
}
97+
if((response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 409) || (response.StatusCode == 429))
98+
{
99+
if(Utilities.IsContentTypeMatch("application/json", response.ContentType))
100+
{
101+
response.ErrorMessage = JsonConvert.DeserializeObject<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
102+
}
103+
104+
return response;
105+
}
106+
return response;
107+
}
108+
109+
110+
/// <summary>
111+
/// List bank accounts
112+
///
113+
/// <remarks>
114+
/// The *List bank accounts* endpoint returns a list of [bank accounts](https://docs.codat.io/accounting-api#/schemas/BankAccount) for a given company's connection.
115+
///
116+
/// [Bank accounts](https://docs.codat.io/accounting-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution.
117+
///
118+
/// Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
119+
///
120+
/// </remarks>
121+
/// </summary>
122+
public async Task<ListAccountingBankAccountsResponse> ListAsync(ListAccountingBankAccountsRequest? request = null)
123+
{
124+
string baseUrl = _serverUrl;
125+
if (baseUrl.EndsWith("/"))
126+
{
127+
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
128+
}
129+
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts", request);
130+
131+
132+
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
133+
httpRequest.Headers.Add("user-agent", $"speakeasy-sdk/{_language} {_sdkVersion} {_sdkGenVersion} {_openapiDocVersion}");
134+
135+
136+
var client = _securityClient;
137+
138+
var httpResponse = await client.SendAsync(httpRequest);
139+
140+
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
141+
142+
var response = new ListAccountingBankAccountsResponse
143+
{
144+
StatusCode = (int)httpResponse.StatusCode,
145+
ContentType = contentType,
146+
RawResponse = httpResponse
147+
};
148+
if((response.StatusCode == 200))
149+
{
150+
if(Utilities.IsContentTypeMatch("application/json", response.ContentType))
151+
{
152+
response.AccountingBankAccounts = JsonConvert.DeserializeObject<AccountingBankAccounts>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
153+
}
154+
155+
return response;
156+
}
157+
if((response.StatusCode == 400) || (response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 409))
158+
{
159+
if(Utilities.IsContentTypeMatch("application/json", response.ContentType))
160+
{
161+
response.ErrorMessage = JsonConvert.DeserializeObject<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
162+
}
163+
164+
return response;
165+
}
166+
return response;
167+
}
168+
169+
}
170+
}

0 commit comments

Comments
 (0)