Skip to content

Commit

Permalink
Merge pull request #32 from StyraInc/speakeasy-sdk-regen-1714682323
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate
  • Loading branch information
chendrix committed May 2, 2024
2 parents 66ac420 + 8283021 commit 3ce07bb
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 18 deletions.
12 changes: 6 additions & 6 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ id: f1a8c321-72a7-41c5-8f5e-3d925aeafa1a
management:
docChecksum: 2422daf10293e923232daf08349ae0ae
docVersion: 0.2.0
speakeasyVersion: 1.277.4
generationVersion: 2.318.3
releaseVersion: 0.7.3
configChecksum: a3a70f59d35cd12ea9b8afa2bd47a842
speakeasyVersion: 1.277.8
generationVersion: 2.319.10
releaseVersion: 0.7.4
configChecksum: 10454f2a0951dbb3c7dcbd7bbab40df8
repoURL: https://github.com/StyraInc/opa-csharp.git
repoSubDirectory: Styra/Opa/OpenApi/
published: true
features:
csharp:
constsAndDefaults: 0.0.1
core: 3.8.0
core: 3.8.3
examples: 2.81.3
flattening: 2.81.1
flattening: 2.81.2
globalServerURLs: 2.82.3
responseFormat: 0.0.2
unions: 0.0.2
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
csharp:
version: 0.7.3
version: 0.7.4
additionalDependencies: []
author: Styra
clientServerStatusCodesAsErrors: true
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
speakeasyVersion: 1.277.4
speakeasyVersion: 1.277.8
sources: {}
targets: {}
workflow:
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,14 @@ Based on:
### Generated
- [csharp v0.7.3] .
### Releases
- [NuGet v0.7.3] https://www.nuget.org/packages/Styra.Opa.OpenApi/0.7.3 - .
- [NuGet v0.7.3] https://www.nuget.org/packages/Styra.Opa.OpenApi/0.7.3 - .

## 2024-05-02 20:38:41
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.277.8 (2.319.10) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.7.4] .
### Releases
- [NuGet v0.7.4] https://www.nuget.org/packages/Styra.Opa.OpenApi/0.7.4 - .
6 changes: 3 additions & 3 deletions Styra/Opa/OpenApi/OpaApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ public class OpaApiClient: IOpaApiClient
public SDKConfig SDKConfiguration { get; private set; }

private const string _language = "csharp";
private const string _sdkVersion = "0.7.3";
private const string _sdkGenVersion = "2.318.3";
private const string _sdkVersion = "0.7.4";
private const string _sdkGenVersion = "2.319.10";
private const string _openapiDocVersion = "0.2.0";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.3 2.318.3 0.2.0 Styra.Opa.OpenApi";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.4 2.319.10 0.2.0 Styra.Opa.OpenApi";
private string _serverUrl = "";
private int _serverIndex = 0;
private ISpeakeasyHttpClient _defaultClient;
Expand Down
27 changes: 21 additions & 6 deletions Styra/Opa/OpenApi/Utils/SpeakeasyHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,36 @@ public interface ISpeakeasyHttpClient

public class SpeakeasyHttpClient : ISpeakeasyHttpClient
{
private class HttpClient : ISpeakeasyHttpClient
{
private System.Net.Http.HttpClient client;

public HttpClient()
{
client = new System.Net.Http.HttpClient();
}

public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request)
{
return await client.SendAsync(request);
}
}

private ISpeakeasyHttpClient? client;

internal SpeakeasyHttpClient(ISpeakeasyHttpClient? client = null)
{
if (client == null)
{
client = new HttpClient();
}

this.client = client;
}

public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request)
{
if (client != null)
{
return await client.SendAsync(request);
}

return await new HttpClient().SendAsync(request);
return await client?.SendAsync(request);

Check warning on line 54 in Styra/Opa/OpenApi/Utils/SpeakeasyHttpClient.cs

View workflow job for this annotation

GitHub Actions / publish / Publish C# SDK

Dereference of a possibly null reference.
}
}
}

0 comments on commit 3ce07bb

Please sign in to comment.