Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.299.7 (#48)
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 committed Jun 4, 2024
1 parent 9f2447e commit 7432f58
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 44 deletions.
12 changes: 6 additions & 6 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ id: f1a8c321-72a7-41c5-8f5e-3d925aeafa1a
management:
docChecksum: 11b8c1e1d3f9d5dab18c36b33f81200d
docVersion: 0.2.0
speakeasyVersion: 1.295.2
generationVersion: 2.335.5
releaseVersion: 0.8.1
configChecksum: 36fc1881544d38c2661b0493d15135cf
speakeasyVersion: 1.299.7
generationVersion: 2.338.12
releaseVersion: 1.0.0
configChecksum: 9df4269ceaa81c9a0ed56676e4845fc0
repoURL: https://github.com/StyraInc/opa-csharp.git
repoSubDirectory: Styra/Opa/OpenApi/
published: true
features:
csharp:
additionalDependencies: 0.1.0
constsAndDefaults: 0.0.1
core: 3.8.3
core: 3.9.3
examples: 2.81.3
flattening: 2.81.2
globalSecurityCallbacks: 0.1.0
globalServerURLs: 2.82.3
intellisenseMarkdownSupport: 0.1.0
responseFormat: 0.0.4
sdkHooks: 0.1.0
unions: 0.0.4
unions: 0.0.5
generatedFiles:
- Styra/Opa/OpenApi/OpaApiClient.cs
- global.json
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
speakeasyVersion: 1.293.0
speakeasyVersion: 1.299.7
sources:
openapi:
sourceNamespace: openapi
sourceRevisionDigest: sha256:2e01fc68b2207d99f4fd5c9edc3b7cf5be6ddc8a729982001b5f00e39825fd4a
sourceBlobDigest: sha256:2c2c749185949d6e826af23e2013a40a0f2d86db0d8da7e2c5790577d409f19e
sourceRevisionDigest: sha256:4932d4ab7fc975b378bae8a9220a32e37ce501a414cea9555769714cdd471556
sourceBlobDigest: sha256:5e23321d0a2a70af23e824774c98915cfd7de8a9a5fd45efe5edbc3c427c5ab8
tags:
- latest
- main
targets:
first-target:
source: openapi
sourceNamespace: openapi
sourceRevisionDigest: sha256:2e01fc68b2207d99f4fd5c9edc3b7cf5be6ddc8a729982001b5f00e39825fd4a
sourceBlobDigest: sha256:2c2c749185949d6e826af23e2013a40a0f2d86db0d8da7e2c5790577d409f19e
sourceRevisionDigest: sha256:4932d4ab7fc975b378bae8a9220a32e37ce501a414cea9555769714cdd471556
sourceBlobDigest: sha256:5e23321d0a2a70af23e824774c98915cfd7de8a9a5fd45efe5edbc3c427c5ab8
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,14 @@ Based on:
### Generated
- [csharp v0.8.1] .
### Releases
- [NuGet v0.8.1] https://www.nuget.org/packages/Styra.Opa.OpenApi/0.8.1 - .
- [NuGet v0.8.1] https://www.nuget.org/packages/Styra.Opa.OpenApi/0.8.1 - .

## 2024-06-04 19:41:50
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.299.7 (2.338.12) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v1.0.0] .
### Releases
- [NuGet v1.0.0] https://www.nuget.org/packages/Styra.Opa.OpenApi/1.0.0 - .
20 changes: 10 additions & 10 deletions Styra/Opa/OpenApi/OpaApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ public class OpaApiClient: IOpaApiClient
public SDKConfig SDKConfiguration { get; private set; }

private const string _language = "csharp";
private const string _sdkVersion = "0.8.1";
private const string _sdkGenVersion = "2.335.5";
private const string _sdkVersion = "1.0.0";
private const string _sdkGenVersion = "2.338.12";
private const string _openapiDocVersion = "0.2.0";
private const string _userAgent = "speakeasy-sdk/csharp 0.8.1 2.335.5 0.2.0 Styra.Opa.OpenApi";
private const string _userAgent = "speakeasy-sdk/csharp 1.0.0 2.338.12 0.2.0 Styra.Opa.OpenApi";
private string _serverUrl = "";
private int _serverIndex = 0;
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _client;

public OpaApiClient(int? serverIndex = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
{
Expand All @@ -126,7 +126,7 @@ public OpaApiClient(int? serverIndex = null, string? serverUrl = null, Dictionar
_serverUrl = serverUrl;
}

_defaultClient = new SpeakeasyHttpClient(client);
_client = client ?? new SpeakeasyHttpClient();

SDKConfiguration = new SDKConfig()
{
Expand All @@ -135,7 +135,7 @@ public OpaApiClient(int? serverIndex = null, string? serverUrl = null, Dictionar
RetryConfig = retryConfig
};

_defaultClient = SDKConfiguration.InitHooks(_defaultClient);
_client = SDKConfiguration.InitHooks(_client);
}

public async Task<ExecuteDefaultPolicyWithInputResponse> ExecuteDefaultPolicyWithInputAsync(Input input, bool? pretty = null, GzipAcceptEncoding? acceptEncoding = null)
Expand Down Expand Up @@ -166,7 +166,7 @@ public async Task<ExecuteDefaultPolicyWithInputResponse> ExecuteDefaultPolicyWit
HttpResponseMessage httpResponse;
try
{
httpResponse = await _defaultClient.SendAsync(httpRequest);
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;

if (_statusCode == 400 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode >= 500 && _statusCode < 600)
Expand Down Expand Up @@ -264,7 +264,7 @@ public async Task<ExecutePolicyResponse> ExecutePolicyAsync(ExecutePolicyRequest
HttpResponseMessage httpResponse;
try
{
httpResponse = await _defaultClient.SendAsync(httpRequest);
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;

if (_statusCode == 400 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode >= 500 && _statusCode < 600)
Expand Down Expand Up @@ -368,7 +368,7 @@ public async Task<ExecutePolicyWithInputResponse> ExecutePolicyWithInputAsync(Ex
HttpResponseMessage httpResponse;
try
{
httpResponse = await _defaultClient.SendAsync(httpRequest);
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;

if (_statusCode == 400 || _statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode >= 500 && _statusCode < 600)
Expand Down Expand Up @@ -471,7 +471,7 @@ public async Task<HealthResponse> HealthAsync(bool? bundles = null, bool? plugin
HttpResponseMessage httpResponse;
try
{
httpResponse = await _defaultClient.SendAsync(httpRequest);
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;

if (_statusCode >= 400 && _statusCode < 500 || _statusCode == 500 || _statusCode >= 500 && _statusCode < 600)
Expand Down
19 changes: 2 additions & 17 deletions Styra/Opa/OpenApi/Utils/SpeakeasyHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public interface ISpeakeasyHttpClient
Task<HttpRequestMessage> CloneAsync(HttpRequestMessage request);
}

public class BaseHttpClient : ISpeakeasyHttpClient
internal class SpeakeasyHttpClient : ISpeakeasyHttpClient
{
protected readonly HttpClient httpClient;

public BaseHttpClient()
public SpeakeasyHttpClient()
{
httpClient = new System.Net.Http.HttpClient();
}
Expand Down Expand Up @@ -78,19 +78,4 @@ public virtual async Task<HttpRequestMessage> CloneAsync(HttpRequestMessage requ
return clone;
}
}

public class SpeakeasyHttpClient : BaseHttpClient
{
private ISpeakeasyHttpClient client;

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

this.client = client;
}
}
}
17 changes: 13 additions & 4 deletions Styra/Opa/OpenApi/Utils/URLBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Styra.Opa.OpenApi.Utils

internal static class URLBuilder
{
public static string Build(string baseUrl, string path, object? request)
public static string Build(string baseUrl, string relativeUrl, object? request)
{
var url = baseUrl;

Expand All @@ -26,19 +26,28 @@ public static string Build(string baseUrl, string path, object? request)
url = url.Substring(0, url.Length - 1);
}

url += path;
var pathAndFragment = relativeUrl.Split('#');
if (pathAndFragment.Length > 2)
{
throw new ArgumentException($"Malformed URL: {relativeUrl}");
}

var parameters = GetPathParameters(request);
url += pathAndFragment[0];

var parameters = GetPathParameters(request);
url = ReplaceParameters(url, parameters);

var queryParams = SerializeQueryParams(TrySerializeQueryParams(request));

if (queryParams != "")
{
url += $"?{queryParams}";
}

if (pathAndFragment.Length == 2)
{
url += $"#{pathAndFragment[1]}";
}

return url;
}

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"version": "6.0.0",
"rollForward": "latestMinor"
}
}
}

0 comments on commit 7432f58

Please sign in to comment.