Skip to content

Commit

Permalink
Merge pull request #2 from formancehq/speakeasy-sdk-regen-1727265003
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate 0.0.3
  • Loading branch information
flemzord authored Sep 25, 2024
2 parents cff93ae + 7fe3602 commit d49e5c5
Show file tree
Hide file tree
Showing 29 changed files with 188 additions and 110 deletions.
18 changes: 9 additions & 9 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
lockVersion: 2.0.0
id: bb4a1c17-4efb-4cf4-a5bb-53737f9f624b
management:
docChecksum: da9839425759ec1e92b6441bb2f3ca7c
docVersion: v2.1.0-beta.2
speakeasyVersion: 1.401.4
generationVersion: 2.421.3
releaseVersion: 0.0.2
configChecksum: c4f741a6d40c958756f9625b5345c2d9
docChecksum: d5d12540f5ed5f4996d23aae4cd97c31
docVersion: v2.1.0-beta.3
speakeasyVersion: 1.402.14
generationVersion: 2.422.22
releaseVersion: 0.0.3
configChecksum: 1b11249cd08c25b537f2ed034dd465c0
repoURL: https://github.com/formancehq/formance-sdk-csharp.git
published: true
features:
csharp:
additionalDependencies: 0.1.0
constsAndDefaults: 0.0.1
core: 3.10.0
core: 3.10.1
deprecations: 2.81.2
errors: 0.0.2
flattening: 2.81.3
Expand All @@ -25,7 +25,7 @@ features:
intellisenseMarkdownSupport: 0.1.0
nameOverrides: 2.81.2
nullables: 0.1.0
oauth2ClientCredentials: 0.1.0
oauth2ClientCredentials: 0.1.1
responseFormat: 0.0.4
sdkHooks: 0.1.0
unions: 0.2.1
Expand Down Expand Up @@ -3200,7 +3200,7 @@ examples:
instanceID: "xxx"
responses:
"200":
application/json: {"data": [{"name": "<value>", "input": {"event": "<value>"}, "terminated": false, "startedAt": "2022-01-03T13:54:16.848Z"}, {"name": "<value>", "terminated": true, "startedAt": "2022-01-08T05:52:07.535Z"}]}
application/json: {"data": [{"name": "<value>", "input": {"event": "<value>"}, "terminated": false, "startedAt": "2022-01-03T13:54:16.848Z"}, {"name": "<value>", "input": {"event": "<value>"}, "terminated": true, "startedAt": "2022-01-08T05:52:07.535Z"}]}
default:
application/json: {"errorCode": "INTERNAL", "errorMessage": "<value>"}
v2GetInstanceStageHistory:
Expand Down
12 changes: 6 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
speakeasyVersion: 1.401.4
speakeasyVersion: 1.402.14
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:eacef62629ebc564b8234a7c34fbeaac25283252087bb94d0ca3070261202d3b
sourceBlobDigest: sha256:d381055f92cce103e8bd74a08b227de17950d63394bdf06c5d5e0709fb8d9fa8
sourceRevisionDigest: sha256:241aefe756c723c6bc27fe0cde9bd081837d85951af400475627b2dd8296f5d5
sourceBlobDigest: sha256:289baef68db829be9ab3b7d551c2c8f06c9adf872c08c55eb3d4fb8cc570d555
tags:
- latest
- main
targets:
formance:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:eacef62629ebc564b8234a7c34fbeaac25283252087bb94d0ca3070261202d3b
sourceBlobDigest: sha256:d381055f92cce103e8bd74a08b227de17950d63394bdf06c5d5e0709fb8d9fa8
sourceRevisionDigest: sha256:241aefe756c723c6bc27fe0cde9bd081837d85951af400475627b2dd8296f5d5
sourceBlobDigest: sha256:289baef68db829be9ab3b7d551c2c8f06c9adf872c08c55eb3d4fb8cc570d555
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
my-source:
inputs:
- location: https://github.com/formancehq/stack/releases/download/v2.1.0-beta.2/generate.json
- location: https://github.com/formancehq/stack/releases/download/v2.1.0-beta.3/generate.json
registry:
location: registry.speakeasyapi.dev/formance/formance/my-source
targets:
Expand Down
7 changes: 6 additions & 1 deletion NUGET.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,15 @@ You can override the default server globally by passing a server index to the `s
| # | Server | Variables |
| - | ------ | --------- |
| 0 | `http://localhost` | None |
| 1 | `https://{stack}.sandbox.formance.cloud` | None |
| 1 | `https://{organization}.{environment}.formance.cloud` | `organization` (default is `orgID-stackID`), `environment` (default is `sandbox`) |



#### Variables

Some of the server options above contain variables. If you want to set the values of those variables, the following options are provided for doing so:
* `organization: string`
* `environment: ServerEnvironment`

### Override Server URL Per-Client

Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,15 @@ You can override the default server globally by passing a server index to the `s
| # | Server | Variables |
| - | ------ | --------- |
| 0 | `http://localhost` | None |
| 1 | `https://{stack}.sandbox.formance.cloud` | None |
| 1 | `https://{organization}.{environment}.formance.cloud` | `organization` (default is `orgID-stackID`), `environment` (default is `sandbox`) |



#### Variables

Some of the server options above contain variables. If you want to set the values of those variables, the following options are provided for doing so:
* `organization: string`
* `environment: ServerEnvironment`

### Override Server URL Per-Client

Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ Based on:
### Generated
- [csharp v0.0.2] .
### Releases
- [NuGet v0.0.2] https://www.nuget.org/packages/formance/0.0.2 - .
- [NuGet v0.0.2] https://www.nuget.org/packages/formance/0.0.2 - .

## 2024-09-25 11:49:57
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.402.14 (2.422.22) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.0.3] .
### Releases
- [NuGet v0.0.3] https://www.nuget.org/packages/formance/0.0.3 - .
6 changes: 3 additions & 3 deletions docs/Models/Components/Security.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `ClientID` | *string* | :heavy_check_mark: | N/A |
| `ClientSecret` | *string* | :heavy_check_mark: | N/A |
| `TokenURL` | *string* | :heavy_check_mark: | N/A |
| `ClientID` | *string* | :heavy_minus_sign: | N/A |
| `ClientSecret` | *string* | :heavy_minus_sign: | N/A |
| `TokenURL` | *string* | :heavy_minus_sign: | N/A |
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
csharp:
version: 0.0.2
version: 0.0.3
additionalDependencies: []
author: Formance
clientServerStatusCodesAsErrors: true
Expand Down
8 changes: 4 additions & 4 deletions src/formance/Auth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public class Auth: IAuth
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.0.2";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "v2.1.0-beta.2";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.2 2.421.3 v2.1.0-beta.2 formance";
private const string _sdkVersion = "0.0.3";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "v2.1.0-beta.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.3 2.422.22 v2.1.0-beta.3 formance";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<formance.Models.Components.Security>? _securitySource;
Expand Down
78 changes: 67 additions & 11 deletions src/formance/Formance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,53 @@ namespace formance
using formance.Utils.Retries;
using formance.Utils;


/// <summary>
/// The environment name. Defaults to the production environment.
/// </summary>
public enum ServerEnvironment
{
[JsonProperty("sandbox")]
Sandbox,
[JsonProperty("eu-west-1")]
EuWest1,
[JsonProperty("us-east-1")]
UsEast1,
}

public static class ServerEnvironmentExtension
{
public static string Value(this ServerEnvironment value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}

public static ServerEnvironment ToEnum(this string value)
{
foreach(var field in typeof(ServerEnvironment).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}

var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);

if (enumVal is ServerEnvironment)
{
return (ServerEnvironment)enumVal;
}
}
}

throw new Exception($"Unknown value {value} for enum ServerEnvironment");
}
}

/// <summary>
/// Formance Stack API: Open, modular foundation for unique payments flows<br/>
///
Expand Down Expand Up @@ -62,11 +109,12 @@ public class SDKConfig
/// </summary>
public static readonly string[] ServerList = {
"http://localhost",
"https://{stack}.sandbox.formance.cloud",
"https://{organization}.{environment}.formance.cloud",
};

public string ServerUrl = "";
public int ServerIndex = 0;
public List<Dictionary<string, string>> ServerDefaults = new List<Dictionary<string, string>>();
public SDKHooks Hooks = new SDKHooks();
public RetryConfig? RetryConfig = null;

Expand All @@ -76,7 +124,7 @@ public string GetTemplatedServerUrl()
{
return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary<string, string>());
}
return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], new Dictionary<string, string>());
return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], this.ServerDefaults[this.ServerIndex]);
}

public ISpeakeasyHttpClient InitHooks(ISpeakeasyHttpClient client)
Expand Down Expand Up @@ -113,10 +161,10 @@ public class Formance: IFormance
public SDKConfig SDKConfiguration { get; private set; }

private const string _language = "csharp";
private const string _sdkVersion = "0.0.2";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "v2.1.0-beta.2";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.2 2.421.3 v2.1.0-beta.2 formance";
private const string _sdkVersion = "0.0.3";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "v2.1.0-beta.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.3 2.422.22 v2.1.0-beta.3 formance";
private string _serverUrl = "";
private int _serverIndex = 0;
private ISpeakeasyHttpClient _client;
Expand All @@ -130,7 +178,7 @@ public class Formance: IFormance
public IOrchestration Orchestration { get; private set; }
public IReconciliation Reconciliation { get; private set; }

public Formance(formance.Models.Components.Security? security = null, Func<formance.Models.Components.Security>? securitySource = null, int? serverIndex = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
public Formance(formance.Models.Components.Security? security = null, Func<formance.Models.Components.Security>? securitySource = null, int? serverIndex = null, string? organization = null, ServerEnvironment? environment = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
{
if (serverIndex != null)
{
Expand All @@ -149,6 +197,17 @@ public Formance(formance.Models.Components.Security? security = null, Func<forma
}
_serverUrl = serverUrl;
}
List<Dictionary<string, string>> serverDefaults = new List<Dictionary<string, string>>()
{
new Dictionary<string, string>()
{
},
new Dictionary<string, string>()
{
{"organization", organization == null ? "orgID-stackID" : organization},
{"environment", environment == null ? "sandbox" : ServerEnvironmentExtension.Value(environment.Value)},
},
};

_client = client ?? new SpeakeasyHttpClient();

Expand All @@ -160,13 +219,10 @@ public Formance(formance.Models.Components.Security? security = null, Func<forma
{
_securitySource = () => security;
}
else
{
throw new Exception("security and securitySource cannot both be null");
}

SDKConfiguration = new SDKConfig()
{
ServerDefaults = serverDefaults,
ServerIndex = _serverIndex,
ServerUrl = _serverUrl,
RetryConfig = retryConfig
Expand Down
8 changes: 4 additions & 4 deletions src/formance/FormanceOrchestrationV1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ public class FormanceOrchestrationV1: IFormanceOrchestrationV1
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.0.2";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "v2.1.0-beta.2";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.2 2.421.3 v2.1.0-beta.2 formance";
private const string _sdkVersion = "0.0.3";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "v2.1.0-beta.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.3 2.422.22 v2.1.0-beta.3 formance";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<formance.Models.Components.Security>? _securitySource;
Expand Down
8 changes: 4 additions & 4 deletions src/formance/FormancePaymentsV1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,10 @@ public class FormancePaymentsV1: IFormancePaymentsV1
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.0.2";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "v2.1.0-beta.2";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.2 2.421.3 v2.1.0-beta.2 formance";
private const string _sdkVersion = "0.0.3";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "v2.1.0-beta.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.3 2.422.22 v2.1.0-beta.3 formance";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<formance.Models.Components.Security>? _securitySource;
Expand Down
8 changes: 4 additions & 4 deletions src/formance/FormanceReconciliationV1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ public class FormanceReconciliationV1: IFormanceReconciliationV1
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.0.2";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "v2.1.0-beta.2";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.2 2.421.3 v2.1.0-beta.2 formance";
private const string _sdkVersion = "0.0.3";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "v2.1.0-beta.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.3 2.422.22 v2.1.0-beta.3 formance";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<formance.Models.Components.Security>? _securitySource;
Expand Down
8 changes: 4 additions & 4 deletions src/formance/FormanceSearchV1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public class FormanceSearchV1: IFormanceSearchV1
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.0.2";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "v2.1.0-beta.2";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.2 2.421.3 v2.1.0-beta.2 formance";
private const string _sdkVersion = "0.0.3";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "v2.1.0-beta.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.3 2.422.22 v2.1.0-beta.3 formance";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<formance.Models.Components.Security>? _securitySource;
Expand Down
8 changes: 4 additions & 4 deletions src/formance/FormanceV1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ public class FormanceV1: IFormanceV1
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.0.2";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "v2.1.0-beta.2";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.2 2.421.3 v2.1.0-beta.2 formance";
private const string _sdkVersion = "0.0.3";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "v2.1.0-beta.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.3 2.422.22 v2.1.0-beta.3 formance";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<formance.Models.Components.Security>? _securitySource;
Expand Down
8 changes: 4 additions & 4 deletions src/formance/FormanceV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ public class FormanceV2: IFormanceV2
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.0.2";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "v2.1.0-beta.2";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.2 2.421.3 v2.1.0-beta.2 formance";
private const string _sdkVersion = "0.0.3";
private const string _sdkGenVersion = "2.422.22";
private const string _openapiDocVersion = "v2.1.0-beta.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.0.3 2.422.22 v2.1.0-beta.3 formance";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<formance.Models.Components.Security>? _securitySource;
Expand Down
Loading

0 comments on commit d49e5c5

Please sign in to comment.