Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc prealpha, Speakeasy CLI 1.126.3 (#222)
Browse files Browse the repository at this point in the history
Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
  • Loading branch information
github-actions[bot] and speakeasybot authored Dec 14, 2023
1 parent fafa2b0 commit 532b839
Show file tree
Hide file tree
Showing 435 changed files with 2,840 additions and 2,222 deletions.
Empty file modified sync-for-expenses/.gitattributes
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion sync-for-expenses/CodatSyncExpenses.sln
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodatSyncExpenses", "CodatSyncExpenses\CodatSyncExpenses.csproj", "{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Codat.Sync.Expenses", "CodatSyncExpenses\CodatSyncExpenses.csproj", "{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}"
EndProject

Global
Expand Down
44 changes: 17 additions & 27 deletions sync-for-expenses/CodatSyncExpenses/Accounts.cs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace CodatSyncExpenses
namespace Codat.Sync.Expenses
{
using CodatSyncExpenses.Models.Operations;
using CodatSyncExpenses.Models.Shared;
using CodatSyncExpenses.Utils;
using Codat.Sync.Expenses.Models.Operations;
using Codat.Sync.Expenses.Models.Shared;
using Codat.Sync.Expenses.Utils;
using Newtonsoft.Json;
using System.Net.Http.Headers;
using System.Net.Http;
Expand All @@ -22,7 +22,7 @@ namespace CodatSyncExpenses
/// <summary>
/// Accounts
/// </summary>
public interface IAccountsSDK
public interface IAccounts
{

/// <summary>
Expand Down Expand Up @@ -65,41 +65,36 @@ public interface IAccountsSDK
/// <summary>
/// Accounts
/// </summary>
public class AccountsSDK: IAccountsSDK
public class Accounts: IAccounts
{
public SDKConfig Config { get; private set; }
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "3.2.0";
private const string _sdkGenVersion = "2.159.2";
private const string _sdkVersion = "4.0.0";
private const string _sdkGenVersion = "2.214.3";
private const string _openapiDocVersion = "prealpha";
private const string _userAgent = "speakeasy-sdk/csharp 3.2.0 2.159.2 prealpha Codat.Sync.Expenses";
private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.214.3 prealpha Codat.Sync.Expenses";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

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


public async Task<Models.Operations.CreateAccountResponse> CreateAsync(CreateAccountRequest? request = null)
{
string baseUrl = _serverUrl;
if (baseUrl.EndsWith("/"))
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/push/accounts", request);


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

var serializedBody = RequestBodySerializer.Serialize(request, "Account", "json");
var serializedBody = RequestBodySerializer.Serialize(request, "AccountPrototype", "json");
if (serializedBody != null)
{
httpRequest.Content = serializedBody;
Expand Down Expand Up @@ -127,7 +122,7 @@ public AccountsSDK(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient secu

return response;
}
if((response.StatusCode == 400) || (response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 429))
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))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
Expand All @@ -142,14 +137,9 @@ public AccountsSDK(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient secu

public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest? request = null)
{
string baseUrl = _serverUrl;
if (baseUrl.EndsWith("/"))
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", request);


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

Expand All @@ -176,7 +166,7 @@ public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(Get

return response;
}
if((response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 429))
if((response.StatusCode == 401) || (response.StatusCode == 402) || (response.StatusCode == 403) || (response.StatusCode == 404) || (response.StatusCode == 429) || (response.StatusCode == 500) || (response.StatusCode == 503))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
Expand Down
141 changes: 81 additions & 60 deletions ...CodatSyncExpenses/CodatSyncExpensesSDK.cs → ...es/CodatSyncExpenses/CodatSyncExpenses.cs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace CodatSyncExpenses
namespace Codat.Sync.Expenses
{
using CodatSyncExpenses.Models.Shared;
using CodatSyncExpenses.Utils;
using Codat.Sync.Expenses.Models.Shared;
using Codat.Sync.Expenses.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using System;



/// <summary>
/// Sync for Expenses: The API for Sync for Expenses.<br/>
///
Expand All @@ -30,70 +33,86 @@ namespace CodatSyncExpenses
/// <br/>
/// <a href="https://github.com/codatio/oas">See our OpenAPI spec</a><br/>
/// <br/>
/// Not seeing the endpoints you&apos;re expecting? We&apos;ve <a href="https://docs.codat.io/updates/230901-new-products">reorganized our products</a>, and you may be using a <a href="https://docs.codat.io/sync-for-expenses-v1-api#/">different version of Sync for Commerce</a>.
/// Not seeing the endpoints you&apos;re expecting? We&apos;ve <a href="https://docs.codat.io/updates/230901-new-products">reorganized our products</a>, and you may be using a <a href="https://docs.codat.io/sync-for-expenses-v1-api#/">different version of Sync for Expenses</a>.
/// </remarks>
/// </summary>
public interface ICodatSyncExpensesSDK
public interface ICodatSyncExpenses
{

/// <summary>
/// Accounts
/// </summary>
public IAccountsSDK Accounts { get; }

/// <summary>
/// Create and manage your Codat companies.
/// </summary>
public ICompaniesSDK Companies { get; }
public ICompanies Companies { get; }

/// <summary>
/// Manage mapping options and sync configuration.
/// Create and manage partner expense connection.
/// </summary>
public IConfigurationSDK Configuration { get; }
public IConnections Connections { get; }

/// <summary>
/// Create and manage partner expense connection.
/// Accounts
/// </summary>
public IConnectionsSDK Connections { get; }
public IAccounts Accounts { get; }

/// <summary>
/// Customers
/// </summary>
public ICustomersSDK Customers { get; }
public ICustomers Customers { get; }

/// <summary>
/// Create expense datasets and upload receipts.
/// Suppliers
/// </summary>
public IExpensesSDK Expenses { get; }
public ISuppliers Suppliers { get; }

/// <summary>
/// Asynchronously retrieve data from an integration to refresh data in Codat.
/// </summary>
public IManageDataSDK ManageData { get; }
public IManageData ManageData { get; }

/// <summary>
/// Access create, update and delete operations made to an SMB&apos;s data connection.
/// </summary>
public IPushOperationsSDK PushOperations { get; }
public IPushOperations PushOperations { get; }

/// <summary>
/// Suppliers
/// Manage mapping options and sync configuration.
/// </summary>
public IConfiguration Configuration { get; }

/// <summary>
/// Create expense datasets and upload receipts.
/// </summary>
public ISuppliersSDK Suppliers { get; }
public IExpenses Expenses { get; }

/// <summary>
/// Trigger and monitor expense syncs to accounting software.
/// </summary>
public ISyncSDK Sync { get; }
public ISync Sync { get; }

/// <summary>
/// Retrieve the status of transactions within a sync.
/// </summary>
public ITransactionStatusSDK TransactionStatus { get; }
public ITransactionStatus TransactionStatus { get; }
}

public class SDKConfig
{
public static string[] ServerList = new string[]
{
"https://api.codat.io",
};
/// Contains the list of servers available to the SDK
public string serverUrl = "";
public int serverIndex = 0;

public string GetTemplatedServerDetails()
{
if (!String.IsNullOrEmpty(this.serverUrl))
{
return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.serverUrl, "/"), new Dictionary<string, string>());
}
return Utilities.TemplateUrl(SDKConfig.ServerList[this.serverIndex], new Dictionary<string, string>());
}
}

/// <summary>
Expand All @@ -109,40 +128,41 @@ public class SDKConfig
/// <br/>
/// <a href="https://github.com/codatio/oas">See our OpenAPI spec</a><br/>
/// <br/>
/// Not seeing the endpoints you&apos;re expecting? We&apos;ve <a href="https://docs.codat.io/updates/230901-new-products">reorganized our products</a>, and you may be using a <a href="https://docs.codat.io/sync-for-expenses-v1-api#/">different version of Sync for Commerce</a>.
/// Not seeing the endpoints you&apos;re expecting? We&apos;ve <a href="https://docs.codat.io/updates/230901-new-products">reorganized our products</a>, and you may be using a <a href="https://docs.codat.io/sync-for-expenses-v1-api#/">different version of Sync for Expenses</a>.
/// </remarks>
/// </summary>
public class CodatSyncExpensesSDK: ICodatSyncExpensesSDK
public class CodatSyncExpenses: ICodatSyncExpenses
{
public SDKConfig Config { get; private set; }
public static List<string> ServerList = new List<string>()
{
"https://api.codat.io",
};
public SDKConfig SDKConfiguration { get; private set; }

private const string _language = "csharp";
private const string _sdkVersion = "3.2.0";
private const string _sdkGenVersion = "2.159.2";
private const string _sdkVersion = "4.0.0";
private const string _sdkGenVersion = "2.214.3";
private const string _openapiDocVersion = "prealpha";
private const string _userAgent = "speakeasy-sdk/csharp 3.2.0 2.159.2 prealpha Codat.Sync.Expenses";
private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.214.3 prealpha Codat.Sync.Expenses";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;
public IAccountsSDK Accounts { get; private set; }
public ICompaniesSDK Companies { get; private set; }
public IConfigurationSDK Configuration { get; private set; }
public IConnectionsSDK Connections { get; private set; }
public ICustomersSDK Customers { get; private set; }
public IExpensesSDK Expenses { get; private set; }
public IManageDataSDK ManageData { get; private set; }
public IPushOperationsSDK PushOperations { get; private set; }
public ISuppliersSDK Suppliers { get; private set; }
public ISyncSDK Sync { get; private set; }
public ITransactionStatusSDK TransactionStatus { get; private set; }

public CodatSyncExpensesSDK(Security? security = null, string? serverUrl = null, ISpeakeasyHttpClient? client = null)
public ICompanies Companies { get; private set; }
public IConnections Connections { get; private set; }
public IAccounts Accounts { get; private set; }
public ICustomers Customers { get; private set; }
public ISuppliers Suppliers { get; private set; }
public IManageData ManageData { get; private set; }
public IPushOperations PushOperations { get; private set; }
public IConfiguration Configuration { get; private set; }
public IExpenses Expenses { get; private set; }
public ISync Sync { get; private set; }
public ITransactionStatus TransactionStatus { get; private set; }

public CodatSyncExpenses(Security? security = null, int? serverIndex = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null)
{
_serverUrl = serverUrl ?? CodatSyncExpensesSDK.ServerList[0];
if (serverUrl != null) {
if (urlParams != null) {
serverUrl = Utilities.TemplateUrl(serverUrl, urlParams);
}
_serverUrl = serverUrl;
}

_defaultClient = new SpeakeasyHttpClient(client);
_securityClient = _defaultClient;
Expand All @@ -152,21 +172,22 @@ public CodatSyncExpensesSDK(Security? security = null, string? serverUrl = null,
_securityClient = SecuritySerializer.Apply(_defaultClient, security);
}

Config = new SDKConfig()
SDKConfiguration = new SDKConfig()
{
serverUrl = _serverUrl
};

Accounts = new AccountsSDK(_defaultClient, _securityClient, _serverUrl, Config);
Companies = new CompaniesSDK(_defaultClient, _securityClient, _serverUrl, Config);
Configuration = new ConfigurationSDK(_defaultClient, _securityClient, _serverUrl, Config);
Connections = new ConnectionsSDK(_defaultClient, _securityClient, _serverUrl, Config);
Customers = new CustomersSDK(_defaultClient, _securityClient, _serverUrl, Config);
Expenses = new ExpensesSDK(_defaultClient, _securityClient, _serverUrl, Config);
ManageData = new ManageDataSDK(_defaultClient, _securityClient, _serverUrl, Config);
PushOperations = new PushOperationsSDK(_defaultClient, _securityClient, _serverUrl, Config);
Suppliers = new SuppliersSDK(_defaultClient, _securityClient, _serverUrl, Config);
Sync = new SyncSDK(_defaultClient, _securityClient, _serverUrl, Config);
TransactionStatus = new TransactionStatusSDK(_defaultClient, _securityClient, _serverUrl, Config);
Companies = new Companies(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Connections = new Connections(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Accounts = new Accounts(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Customers = new Customers(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Suppliers = new Suppliers(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
ManageData = new ManageData(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
PushOperations = new PushOperations(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Configuration = new Configuration(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Expenses = new Expenses(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Sync = new Sync(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
TransactionStatus = new TransactionStatus(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
}
}
}
3 changes: 2 additions & 1 deletion sync-for-expenses/CodatSyncExpenses/CodatSyncExpenses.csproj
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>Codat.Sync.Expenses</PackageId>
<Version>3.2.0</Version>
<Version>4.0.0</Version>
<Authors>Codat</Authors>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<PackageReadmeFile>README.md</PackageReadmeFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1591</NoWarn>
<RepositoryUrl>https://github.com/codatio/client-sdk-csharp</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 532b839

Please sign in to comment.