Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.396.6 (#302)
Browse files Browse the repository at this point in the history
Co-authored-by: speakeasybot <[email protected]>
  • Loading branch information
github-actions[bot] and speakeasybot authored Sep 13, 2024
1 parent fc053f2 commit b7d8379
Show file tree
Hide file tree
Showing 577 changed files with 12,624 additions and 6,103 deletions.
14 changes: 14 additions & 0 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ sources:
tags:
- latest
- main
sync-for-expenses-source:
sourceNamespace: sync-for-expenses-source
sourceRevisionDigest: sha256:ce40190cfe78e3f220050ea0830074c03d674b25d5760a37c9263161fc97e292
sourceBlobDigest: sha256:7f399328e7bf537a3e5ee884667234673d34c00e889182df4e2b0500bb91dcfd
tags:
- latest
- main
targets:
bank-feeds-library:
source: bank-feeds-source
Expand All @@ -49,6 +56,11 @@ targets:
sourceNamespace: sync-for-commerce-source
sourceRevisionDigest: sha256:25f68f6f72e255804ffe90049b3b15b1dd8dcb78e7f96954e1ec5852799fc13f
sourceBlobDigest: sha256:ab64a148f650a63d3411abb1686ffdcc252ddb1525415957d2dcd7e818882594
sync-for-expenses-library:
source: sync-for-expenses-source
sourceNamespace: sync-for-expenses-source
sourceRevisionDigest: sha256:ce40190cfe78e3f220050ea0830074c03d674b25d5760a37c9263161fc97e292
sourceBlobDigest: sha256:7f399328e7bf537a3e5ee884667234673d34c00e889182df4e2b0500bb91dcfd
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down Expand Up @@ -76,6 +88,8 @@ workflow:
sync-for-expenses-source:
inputs:
- location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Expenses.yaml
registry:
location: registry.speakeasyapi.dev/codat/codat/sync-for-expenses-source
sync-for-payables-source:
inputs:
- location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payables.yaml
Expand Down
2 changes: 2 additions & 0 deletions .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ sources:
sync-for-expenses-source:
inputs:
- location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Expenses.yaml
registry:
location: registry.speakeasyapi.dev/codat/codat/sync-for-expenses-source
sync-for-payables-source:
inputs:
- location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payables.yaml
Expand Down
2,749 changes: 2,294 additions & 455 deletions sync-for-expenses/.speakeasy/gen.lock

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions sync-for-expenses/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Contributing to This Repository

Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements.

## How to Report Issues

If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes:

- A clear and descriptive title
- Steps to reproduce the issue
- Expected and actual behavior
- Any relevant logs, screenshots, or error messages
- Information about your environment (e.g., operating system, software versions)
- For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed

## Issue Triage and Upstream Fixes

We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code.

## Contact

If you have any questions or need further assistance, please feel free to reach out by opening an issue.

Thank you for your understanding and cooperation!

The Maintainers
130 changes: 101 additions & 29 deletions sync-for-expenses/Codat/Sync/Expenses/Accounts.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
Expand All @@ -11,9 +10,10 @@
namespace Codat.Sync.Expenses
{
using Codat.Sync.Expenses.Hooks;
using Codat.Sync.Expenses.Models.Components;
using Codat.Sync.Expenses.Models.Errors;
using Codat.Sync.Expenses.Models.Operations;
using Codat.Sync.Expenses.Models.Shared;
using Codat.Sync.Expenses.Models.Requests;
using Codat.Sync.Expenses.Utils.Retries;
using Codat.Sync.Expenses.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
Expand All @@ -23,7 +23,7 @@ namespace Codat.Sync.Expenses
using System;

/// <summary>
/// Create accounts and view account schemas.
/// Create accounts and view create account options.
/// </summary>
public interface IAccounts
{
Expand All @@ -44,7 +44,7 @@ public interface IAccounts
///
/// </remarks>
/// </summary>
Task<Models.Operations.CreateAccountResponse> CreateAsync(CreateAccountRequest request);
Task<Models.Requests.CreateAccountResponse> CreateAsync(CreateAccountRequest request, RetryConfig? retryConfig = null);

/// <summary>
/// Get create account model
Expand All @@ -62,33 +62,33 @@ public interface IAccounts
///
/// </remarks>
/// </summary>
Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest request);
Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest request, RetryConfig? retryConfig = null);
}

/// <summary>
/// Create accounts and view account schemas.
/// Create accounts and view create account options.
/// </summary>
public class Accounts: IAccounts
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "5.4.0";
private const string _sdkGenVersion = "2.319.7";
private const string _sdkVersion = "6.0.0";
private const string _sdkGenVersion = "2.415.6";
private const string _openapiDocVersion = "prealpha";
private const string _userAgent = "speakeasy-sdk/csharp 5.4.0 2.319.7 prealpha Codat.Sync.Expenses";
private const string _userAgent = "speakeasy-sdk/csharp 6.0.0 2.415.6 prealpha Codat.Sync.Expenses";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private Func<Security>? _securitySource;
private ISpeakeasyHttpClient _client;
private Func<Codat.Sync.Expenses.Models.Components.Security>? _securitySource;

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

public async Task<Models.Operations.CreateAccountResponse> CreateAsync(CreateAccountRequest request)
public async Task<Models.Requests.CreateAccountResponse> CreateAsync(CreateAccountRequest request, RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/push/accounts", request);
Expand All @@ -109,16 +109,52 @@ public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySour

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

httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}

List<string> statusCodes = new List<string>
{
"408",
"429",
"5XX",
};

Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new Codat.Sync.Expenses.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);

HttpResponseMessage httpResponse;
try
{
httpResponse = await _defaultClient.SendAsync(httpRequest);
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)
{
var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
Expand All @@ -127,7 +163,7 @@ public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySour
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
Expand All @@ -138,16 +174,16 @@ public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySour
}
}

httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);

var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
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.CreateAccountResponse>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new Models.Requests.CreateAccountResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
Expand Down Expand Up @@ -183,7 +219,7 @@ public Accounts(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySour
}
}

public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest request)
public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(GetCreateChartOfAccountsModelRequest request, RetryConfig? retryConfig = null)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", request);
Expand All @@ -198,16 +234,52 @@ public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(Get

var hookCtx = new HookContext("get-create-chartOfAccounts-model", null, _securitySource);

httpRequest = await this.SDKConfiguration.hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
if (retryConfig == null)
{
if (this.SDKConfiguration.RetryConfig != null)
{
retryConfig = this.SDKConfiguration.RetryConfig;
}
else
{
var backoff = new BackoffStrategy(
initialIntervalMs: 500L,
maxIntervalMs: 60000L,
maxElapsedTimeMs: 3600000L,
exponent: 1.5
);
retryConfig = new RetryConfig(
strategy: RetryConfig.RetryStrategy.BACKOFF,
backoff: backoff,
retryConnectionErrors: true
);
}
}

List<string> statusCodes = new List<string>
{
"408",
"429",
"5XX",
};

Func<Task<HttpResponseMessage>> retrySend = async () =>
{
var _httpRequest = await _client.CloneAsync(httpRequest);
return await _client.SendAsync(_httpRequest);
};
var retries = new Codat.Sync.Expenses.Utils.Retries.Retries(retrySend, retryConfig, statusCodes);

HttpResponseMessage httpResponse;
try
{
httpResponse = await _defaultClient.SendAsync(httpRequest);
httpResponse = await retries.Run();
int _statusCode = (int)httpResponse.StatusCode;

if (_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);
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
Expand All @@ -216,7 +288,7 @@ public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(Get
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
Expand All @@ -227,7 +299,7 @@ public async Task<GetCreateChartOfAccountsModelResponse> GetCreateModelAsync(Get
}
}

httpResponse = await this.SDKConfiguration.hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);

var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
Expand Down
Loading

0 comments on commit b7d8379

Please sign in to comment.