Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.396.6 (#303)
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 Sep 13, 2024
1 parent b7d8379 commit 54c071c
Show file tree
Hide file tree
Showing 671 changed files with 8,401 additions and 8,325 deletions.
14 changes: 14 additions & 0 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ sources:
tags:
- latest
- main
sync-for-payables-version-1-source:
sourceNamespace: sync-for-payables-version-1-source
sourceRevisionDigest: sha256:ab5650b5c0dfbe48558138381e9a3ca6930965548c7bc14a3f5e21e90fa746b1
sourceBlobDigest: sha256:e1fb1fe0af40cf137b8b320fd75e913c83e54e0a2bb2e80a5af69e0bce409e71
tags:
- latest
- main
targets:
bank-feeds-library:
source: bank-feeds-source
Expand All @@ -61,6 +68,11 @@ targets:
sourceNamespace: sync-for-expenses-source
sourceRevisionDigest: sha256:ce40190cfe78e3f220050ea0830074c03d674b25d5760a37c9263161fc97e292
sourceBlobDigest: sha256:7f399328e7bf537a3e5ee884667234673d34c00e889182df4e2b0500bb91dcfd
sync-for-payables-version-1-library:
source: sync-for-payables-version-1-source
sourceNamespace: sync-for-payables-version-1-source
sourceRevisionDigest: sha256:ab5650b5c0dfbe48558138381e9a3ca6930965548c7bc14a3f5e21e90fa746b1
sourceBlobDigest: sha256:e1fb1fe0af40cf137b8b320fd75e913c83e54e0a2bb2e80a5af69e0bce409e71
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down Expand Up @@ -96,6 +108,8 @@ workflow:
sync-for-payables-version-1-source:
inputs:
- location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payables-v1.yaml
registry:
location: registry.speakeasyapi.dev/codat/codat/sync-for-payables-version-1-source
sync-for-payroll-source:
inputs:
- location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payroll.yaml
Expand Down
2 changes: 2 additions & 0 deletions .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ sources:
sync-for-payables-version-1-source:
inputs:
- location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payables-v1.yaml
registry:
location: registry.speakeasyapi.dev/codat/codat/sync-for-payables-version-1-source
sync-for-payroll-source:
inputs:
- location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payroll.yaml
Expand Down
2,136 changes: 1,072 additions & 1,064 deletions previous-versions/sync-for-payables-version-1/.speakeasy/gen.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
namespace Codat.Sync.Payables.V1
{
using Codat.Sync.Payables.V1.Hooks;
using Codat.Sync.Payables.V1.Models.Components;
using Codat.Sync.Payables.V1.Models.Errors;
using Codat.Sync.Payables.V1.Models.Operations;
using Codat.Sync.Payables.V1.Models.Shared;
using Codat.Sync.Payables.V1.Models.Requests;
using Codat.Sync.Payables.V1.Utils.Retries;
using Codat.Sync.Payables.V1.Utils;
using Newtonsoft.Json;
Expand All @@ -29,22 +29,17 @@ public interface IAccounts
{

/// <summary>
/// Create account
/// List accounts
///
/// <remarks>
/// The *Create account* endpoint creates a new <a href="https://docs.codat.io/sync-for-payables-api#/schemas/Account">account</a> for a given company&apos;s connection.<br/>
/// The *List accounts* endpoint returns a list of <a href="https://docs.codat.io/sync-for-payables-api#/schemas/Account">accounts</a> for a given company&apos;s connection.<br/>
/// <br/>
/// <a href="https://docs.codat.io/sync-for-payables-api#/schemas/Account">Accounts</a> are the categories a business uses to record accounting transactions.<br/>
/// <br/>
/// **Integration-specific behaviour**<br/>
/// <br/>
/// Required data may vary by integration. To see what data to post, first call <a href="https://docs.codat.io/sync-for-payables-api#/operations/get-create-chartOfAccounts-model">Get create account model</a>.<br/>
/// <br/>
/// Check out our <a href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&amp;dataType=chartOfAccounts">coverage explorer</a> for integrations that support creating an account.<br/>
///
/// Before using this endpoint, you must have <a href="https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data">retrieved data for the company</a>.
/// </remarks>
/// </summary>
Task<Models.Operations.CreateAccountResponse> CreateAsync(CreateAccountRequest request, RetryConfig? retryConfig = null);
Task<ListAccountsResponse> ListAsync(ListAccountsRequest request, RetryConfig? retryConfig = null);

/// <summary>
/// Get account
Expand Down Expand Up @@ -81,17 +76,22 @@ public interface IAccounts
Task<GetCreateAccountModelResponse> GetCreateModelAsync(GetCreateAccountModelRequest request, RetryConfig? retryConfig = null);

/// <summary>
/// List accounts
/// Create account
///
/// <remarks>
/// The *List accounts* endpoint returns a list of <a href="https://docs.codat.io/sync-for-payables-api#/schemas/Account">accounts</a> for a given company&apos;s connection.<br/>
/// The *Create account* endpoint creates a new <a href="https://docs.codat.io/sync-for-payables-api#/schemas/Account">account</a> for a given company&apos;s connection.<br/>
/// <br/>
/// <a href="https://docs.codat.io/sync-for-payables-api#/schemas/Account">Accounts</a> are the categories a business uses to record accounting transactions.<br/>
/// <br/>
/// Before using this endpoint, you must have <a href="https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data">retrieved data for the company</a>.
/// **Integration-specific behaviour**<br/>
/// <br/>
/// Required data may vary by integration. To see what data to post, first call <a href="https://docs.codat.io/sync-for-payables-api#/operations/get-create-chartOfAccounts-model">Get create account model</a>.<br/>
/// <br/>
/// Check out our <a href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&amp;dataType=chartOfAccounts">coverage explorer</a> for integrations that support creating an account.<br/>
///
/// </remarks>
/// </summary>
Task<ListAccountsResponse> ListAsync(ListAccountsRequest request, RetryConfig? retryConfig = null);
Task<Models.Requests.CreateAccountResponse> CreateAsync(CreateAccountRequest request, RetryConfig? retryConfig = null);
}

/// <summary>
Expand All @@ -101,42 +101,36 @@ public class Accounts: IAccounts
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "3.3.1";
private const string _sdkGenVersion = "2.413.0";
private const string _sdkVersion = "4.0.0";
private const string _sdkGenVersion = "2.415.6";
private const string _openapiDocVersion = "3.0.0";
private const string _userAgent = "speakeasy-sdk/csharp 3.3.1 2.413.0 3.0.0 Codat.Sync.Payables.V1";
private const string _userAgent = "speakeasy-sdk/csharp 4.0.0 2.415.6 3.0.0 Codat.Sync.Payables.V1";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<Codat.Sync.Payables.V1.Models.Shared.Security>? _securitySource;
private Func<Codat.Sync.Payables.V1.Models.Components.Security>? _securitySource;

public Accounts(ISpeakeasyHttpClient client, Func<Codat.Sync.Payables.V1.Models.Shared.Security>? securitySource, string serverUrl, SDKConfig config)
public Accounts(ISpeakeasyHttpClient client, Func<Codat.Sync.Payables.V1.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
{
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config;
}

public async Task<Models.Operations.CreateAccountResponse> CreateAsync(CreateAccountRequest request, RetryConfig? retryConfig = null)
public async Task<ListAccountsResponse> ListAsync(ListAccountsRequest request, RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/push/accounts", request);
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/data/accounts", request);

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

var serializedBody = RequestBodySerializer.Serialize(request, "AccountPrototype", "json", false, true);
if (serializedBody != null)
{
httpRequest.Content = serializedBody;
}

if (_securitySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}

var hookCtx = new HookContext("create-account", null, _securitySource);
var hookCtx = new HookContext("list-accounts", null, _securitySource);

httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
Expand Down Expand Up @@ -181,7 +175,7 @@ public Accounts(ISpeakeasyHttpClient client, Func<Codat.Sync.Payables.V1.Models.
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;

if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600)
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 409 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
Expand Down Expand Up @@ -211,22 +205,22 @@ public Accounts(ISpeakeasyHttpClient client, Func<Codat.Sync.Payables.V1.Models.
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<Models.Shared.CreateAccountResponse>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new Models.Operations.CreateAccountResponse()
var obj = ResponseBodyDeserializer.Deserialize<Models.Components.Accounts>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new ListAccountsResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.CreateAccountResponseValue = obj;
response.Accounts = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else if(new List<int>{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode))
else if(new List<int>{400, 401, 402, 403, 404, 409, 429, 500, 503}.Contains(responseStatusCode))
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
Expand Down Expand Up @@ -498,20 +492,26 @@ public async Task<GetCreateAccountModelResponse> GetCreateModelAsync(GetCreateAc
}
}

public async Task<ListAccountsResponse> ListAsync(ListAccountsRequest request, RetryConfig? retryConfig = null)
public async Task<Models.Requests.CreateAccountResponse> CreateAsync(CreateAccountRequest request, RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/data/accounts", request);
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/push/accounts", request);

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

var serializedBody = RequestBodySerializer.Serialize(request, "AccountPrototype", "json", false, true);
if (serializedBody != null)
{
httpRequest.Content = serializedBody;
}

if (_securitySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}

var hookCtx = new HookContext("list-accounts", null, _securitySource);
var hookCtx = new HookContext("create-account", null, _securitySource);

httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
Expand Down Expand Up @@ -556,7 +556,7 @@ public async Task<ListAccountsResponse> ListAsync(ListAccountsRequest request, R
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;

if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 409 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600)
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 402 || _statusCode == 403 || _statusCode == 404 || _statusCode == 429 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode == 503 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
Expand Down Expand Up @@ -586,22 +586,22 @@ public async Task<ListAccountsResponse> ListAsync(ListAccountsRequest request, R
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<Models.Shared.Accounts>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new ListAccountsResponse()
var obj = ResponseBodyDeserializer.Deserialize<Models.Components.CreateAccountResponse>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new Models.Requests.CreateAccountResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Accounts = obj;
response.CreateAccountResponseValue = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else if(new List<int>{400, 401, 402, 403, 404, 409, 429, 500, 503}.Contains(responseStatusCode))
else if(new List<int>{400, 401, 402, 403, 404, 429, 500, 503}.Contains(responseStatusCode))
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
Expand Down
Loading

0 comments on commit 54c071c

Please sign in to comment.