Skip to content

Commit

Permalink
chore: speakeasy sdk regeneration - Generate Lending library (#52)
Browse files Browse the repository at this point in the history
* 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 <bot@speakeasyapi.dev>
  • Loading branch information
github-actions[bot] and speakeasybot authored Sep 13, 2023
1 parent 6bda6d2 commit bac3411
Show file tree
Hide file tree
Showing 730 changed files with 14,716 additions and 12,017 deletions.
135 changes: 7 additions & 128 deletions lending/CodatLending/AccountingBankData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,150 +21,29 @@ namespace CodatLending

public interface IAccountingBankDataSDK
{
Task<GetAccountingBankAccountResponse> GetAccountAsync(GetAccountingBankAccountRequest? request = null);
Task<ListAccountingBankAccountsResponse> ListAccountsAsync(ListAccountingBankAccountsRequest? request = null);
public IAccountingBankDataAccountsSDK Accounts { get; }
Task<ListAccountingBankAccountTransactionsResponse> ListTransactionsAsync(ListAccountingBankAccountTransactionsRequest? request = null);
}

public class AccountingBankDataSDK: IAccountingBankDataSDK
{
public SDKConfig Config { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.91.4";
private const string _sdkVersion = "1.2.0";
private const string _sdkGenVersion = "2.109.3";
private const string _openapiDocVersion = "3.0.0";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;
public IAccountingBankDataAccountsSDK Accounts { get; private set; }

public AccountingBankDataSDK(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
{
_defaultClient = defaultClient;
_securityClient = securityClient;
_serverUrl = serverUrl;
Config = config;
}


/// <summary>
/// Get bank account
///
/// <remarks>
/// The *Get bank account* endpoint returns a single account for a given accountId.
///
/// [Bank accounts](https://docs.codat.io/accounting-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution.
///
/// 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.
///
/// Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
///
/// </remarks>
/// </summary>
public async Task<GetAccountingBankAccountResponse> GetAccountAsync(GetAccountingBankAccountRequest? request = null)
{
string baseUrl = _serverUrl;
if (baseUrl.EndsWith("/"))
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts/{accountId}", request);


var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", $"speakeasy-sdk/{_language} {_sdkVersion} {_sdkGenVersion} {_openapiDocVersion}");


var client = _securityClient;

var httpResponse = await client.SendAsync(httpRequest);

var contentType = httpResponse.Content.Headers.ContentType?.MediaType;

var response = new GetAccountingBankAccountResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.AccountingBankAccount = JsonConvert.DeserializeObject<AccountingBankAccount>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
if((response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 409) || (response.StatusCode == 429))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.ErrorMessage = JsonConvert.DeserializeObject<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
return response;
}


/// <summary>
/// List bank accounts
///
/// <remarks>
/// 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.
///
/// [Bank accounts](https://docs.codat.io/accounting-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution.
///
/// Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
///
/// </remarks>
/// </summary>
public async Task<ListAccountingBankAccountsResponse> ListAccountsAsync(ListAccountingBankAccountsRequest? request = null)
{
string baseUrl = _serverUrl;
if (baseUrl.EndsWith("/"))
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts", request);


var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", $"speakeasy-sdk/{_language} {_sdkVersion} {_sdkGenVersion} {_openapiDocVersion}");


var client = _securityClient;

var httpResponse = await client.SendAsync(httpRequest);

var contentType = httpResponse.Content.Headers.ContentType?.MediaType;

var response = new ListAccountingBankAccountsResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.AccountingBankAccounts = JsonConvert.DeserializeObject<AccountingBankAccounts>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
if((response.StatusCode == 400) || (response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 409))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.ErrorMessage = JsonConvert.DeserializeObject<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
return response;
Accounts = new AccountingBankDataAccountsSDK(_defaultClient, _securityClient, _serverUrl, Config);
}


Expand Down Expand Up @@ -210,7 +89,7 @@ public async Task<ListAccountingBankAccountTransactionsResponse> ListTransaction
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
if(Utilities.IsContentTypeMatch("application/json", response.ContentType))
{
response.AccountingBankTransactions = JsonConvert.DeserializeObject<AccountingBankTransactions>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}
Expand All @@ -219,7 +98,7 @@ public async Task<ListAccountingBankAccountTransactionsResponse> ListTransaction
}
if((response.StatusCode == 400) || (response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 409) || (response.StatusCode == 429))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
if(Utilities.IsContentTypeMatch("application/json", response.ContentType))
{
response.ErrorMessage = JsonConvert.DeserializeObject<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}
Expand Down
170 changes: 170 additions & 0 deletions lending/CodatLending/AccountingBankDataAccounts.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace CodatLending
{
using CodatLending.Models.Operations;
using CodatLending.Models.Shared;
using CodatLending.Utils;
using Newtonsoft.Json;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
using System;

public interface IAccountingBankDataAccountsSDK
{
Task<GetAccountingBankAccountResponse> GetAsync(GetAccountingBankAccountRequest? request = null);
Task<ListAccountingBankAccountsResponse> ListAsync(ListAccountingBankAccountsRequest? request = null);
}

public class AccountingBankDataAccountsSDK: IAccountingBankDataAccountsSDK
{
public SDKConfig Config { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "1.2.0";
private const string _sdkGenVersion = "2.109.3";
private const string _openapiDocVersion = "3.0.0";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

public AccountingBankDataAccountsSDK(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
{
_defaultClient = defaultClient;
_securityClient = securityClient;
_serverUrl = serverUrl;
Config = config;
}


/// <summary>
/// Get bank account
///
/// <remarks>
/// The *Get bank account* endpoint returns a single account for a given accountId.
///
/// [Bank accounts](https://docs.codat.io/accounting-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution.
///
/// 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.
///
/// Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
///
/// </remarks>
/// </summary>
public async Task<GetAccountingBankAccountResponse> GetAsync(GetAccountingBankAccountRequest? request = null)
{
string baseUrl = _serverUrl;
if (baseUrl.EndsWith("/"))
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts/{accountId}", request);


var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", $"speakeasy-sdk/{_language} {_sdkVersion} {_sdkGenVersion} {_openapiDocVersion}");


var client = _securityClient;

var httpResponse = await client.SendAsync(httpRequest);

var contentType = httpResponse.Content.Headers.ContentType?.MediaType;

var response = new GetAccountingBankAccountResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json", response.ContentType))
{
response.AccountingBankAccount = JsonConvert.DeserializeObject<AccountingBankAccount>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
if((response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 409) || (response.StatusCode == 429))
{
if(Utilities.IsContentTypeMatch("application/json", response.ContentType))
{
response.ErrorMessage = JsonConvert.DeserializeObject<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
return response;
}


/// <summary>
/// List bank accounts
///
/// <remarks>
/// 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.
///
/// [Bank accounts](https://docs.codat.io/accounting-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution.
///
/// Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).
///
/// </remarks>
/// </summary>
public async Task<ListAccountingBankAccountsResponse> ListAsync(ListAccountingBankAccountsRequest? request = null)
{
string baseUrl = _serverUrl;
if (baseUrl.EndsWith("/"))
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/data/bankAccounts", request);


var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", $"speakeasy-sdk/{_language} {_sdkVersion} {_sdkGenVersion} {_openapiDocVersion}");


var client = _securityClient;

var httpResponse = await client.SendAsync(httpRequest);

var contentType = httpResponse.Content.Headers.ContentType?.MediaType;

var response = new ListAccountingBankAccountsResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json", response.ContentType))
{
response.AccountingBankAccounts = JsonConvert.DeserializeObject<AccountingBankAccounts>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
if((response.StatusCode == 400) || (response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 409))
{
if(Utilities.IsContentTypeMatch("application/json", response.ContentType))
{
response.ErrorMessage = JsonConvert.DeserializeObject<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
return response;
}

}
}
Loading

0 comments on commit bac3411

Please sign in to comment.