Skip to content

Commit

Permalink
chore: 🐝 Update SDK - 1 - Generate 1.3.0 (#65)
Browse files Browse the repository at this point in the history
* ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.376.0

* Update project file to version 1.3.0

---------

Co-authored-by: speakeasybot <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
3 people authored Aug 19, 2024
1 parent c7dd475 commit cc66a14
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 23 deletions.
14 changes: 7 additions & 7 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ id: f1a8c321-72a7-41c5-8f5e-3d925aeafa1a
management:
docChecksum: 553ed43ff98c81b3e770c34850f0b5f5
docVersion: 0.2.0
speakeasyVersion: 1.352.2
generationVersion: 2.385.2
releaseVersion: 1.2.0
configChecksum: 659ee3d7309818ed01bc14bb1b03e0c3
speakeasyVersion: 1.376.0
generationVersion: 2.402.5
releaseVersion: 1.3.0
configChecksum: 8bf5fcab319b53e5be5a8ead50747add
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.9.13
core: 3.9.14
examples: 2.81.3
flattening: 2.81.2
globalSecurity: 2.83.5
globalSecurity: 2.83.6
globalSecurityCallbacks: 0.1.0
globalSecurityFlattening: 0.1.0
globalServerURLs: 2.82.3
intellisenseMarkdownSupport: 0.1.0
responseFormat: 0.0.4
sdkHooks: 0.1.0
unions: 0.1.3
unions: 0.2.1
generatedFiles:
- Styra/Opa/OpenApi/OpaApiClient.cs
- global.json
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: 1.2.0
version: 1.3.0
additionalDependencies: []
author: Styra
clientServerStatusCodesAsErrors: true
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.352.2
speakeasyVersion: 1.376.0
sources:
openapi:
sourceNamespace: openapi
sourceRevisionDigest: sha256:1ea271533d89cb4fb0eb21aebd9f29faf57ceb1e10c0dc409e24b0e388f0f55e
sourceBlobDigest: sha256:98a8568956da7c8d356c615d9fb29a0977a42a0240bac354ba65f5282005b5d6
sourceRevisionDigest: sha256:76713cfaf47149b60b8bc5b10e999975d990f679fdb446fc0a6ee6835fa9c1e0
sourceBlobDigest: sha256:1d6f0889215e37eb283c5904aec019dae6cb01c589ba6afdc0d51d95d6539ec7
tags:
- latest
- main
targets:
first-target:
source: openapi
sourceNamespace: openapi
sourceRevisionDigest: sha256:1ea271533d89cb4fb0eb21aebd9f29faf57ceb1e10c0dc409e24b0e388f0f55e
sourceBlobDigest: sha256:98a8568956da7c8d356c615d9fb29a0977a42a0240bac354ba65f5282005b5d6
sourceRevisionDigest: sha256:76713cfaf47149b60b8bc5b10e999975d990f679fdb446fc0a6ee6835fa9c1e0
sourceBlobDigest: sha256:1d6f0889215e37eb283c5904aec019dae6cb01c589ba6afdc0d51d95d6539ec7
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion NUGET.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ This SDK supports the following security scheme globally:
| ------------ | ------------ | ------------ |
| `BearerAuth` | http | HTTP Bearer |

To authenticate with the API the `Null` parameter must be set when initializing the SDK client instance. For example:
To authenticate with the API the `BearerAuth` parameter must be set when initializing the SDK client instance. For example:
```csharp
using Styra.Opa.OpenApi;
using Styra.Opa.OpenApi.Models.Requests;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ This SDK supports the following security scheme globally:
| ------------ | ------------ | ------------ |
| `BearerAuth` | http | HTTP Bearer |

To authenticate with the API the `Null` parameter must be set when initializing the SDK client instance. For example:
To authenticate with the API the `BearerAuth` parameter must be set when initializing the SDK client instance. For example:
```csharp
using Styra.Opa.OpenApi;
using Styra.Opa.OpenApi.Models.Requests;
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,14 @@ Based on:
### Generated
- [csharp v1.2.0] .
### Releases
- [NuGet v1.2.0] https://www.nuget.org/packages/Styra.Opa.OpenApi/1.2.0 - .
- [NuGet v1.2.0] https://www.nuget.org/packages/Styra.Opa.OpenApi/1.2.0 - .

## 2024-08-19 16:29:28
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.376.0 (2.402.5) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v1.3.0] .
### Releases
- [NuGet v1.3.0] https://www.nuget.org/packages/Styra.Opa.OpenApi/1.3.0 - .
10 changes: 10 additions & 0 deletions Styra/Opa/OpenApi/Models/Components/Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,20 @@ public class Input {
public Input(InputType type) {
Type = type;
}

[SpeakeasyMetadata("form:explode=true")]
public bool? Boolean { get; set; }

[SpeakeasyMetadata("form:explode=true")]
public string? Str { get; set; }

[SpeakeasyMetadata("form:explode=true")]
public double? Number { get; set; }

[SpeakeasyMetadata("form:explode=true")]
public List<object>? ArrayOfAny { get; set; }

[SpeakeasyMetadata("form:explode=true")]
public Dictionary<string, object>? MapOfAny { get; set; }

public InputType Type { get; set; }
Expand Down
4 changes: 4 additions & 0 deletions Styra/Opa/OpenApi/Models/Components/Responses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ public class Responses {
public Responses(ResponsesType type) {
Type = type;
}

[SpeakeasyMetadata("form:explode=true")]
public ResponsesSuccessfulPolicyResponse? ResponsesSuccessfulPolicyResponse { get; set; }

[SpeakeasyMetadata("form:explode=true")]
public Models.Components.ServerError? ServerError { get; set; }

public ResponsesType Type { get; set; }
Expand Down
10 changes: 10 additions & 0 deletions Styra/Opa/OpenApi/Models/Components/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,20 @@ public class Result {
public Result(ResultType type) {
Type = type;
}

[SpeakeasyMetadata("form:explode=true")]
public bool? Boolean { get; set; }

[SpeakeasyMetadata("form:explode=true")]
public string? Str { get; set; }

[SpeakeasyMetadata("form:explode=true")]
public double? Number { get; set; }

[SpeakeasyMetadata("form:explode=true")]
public List<object>? ArrayOfAny { get; set; }

[SpeakeasyMetadata("form:explode=true")]
public Dictionary<string, object>? MapOfAny { get; set; }

public ResultType Type { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions Styra/Opa/OpenApi/OpaApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ public class OpaApiClient: IOpaApiClient
public SDKConfig SDKConfiguration { get; private set; }

private const string _language = "csharp";
private const string _sdkVersion = "1.2.0";
private const string _sdkGenVersion = "2.385.2";
private const string _sdkVersion = "1.3.0";
private const string _sdkGenVersion = "2.402.5";
private const string _openapiDocVersion = "0.2.0";
private const string _userAgent = "speakeasy-sdk/csharp 1.2.0 2.385.2 0.2.0 Styra.Opa.OpenApi";
private const string _userAgent = "speakeasy-sdk/csharp 1.3.0 2.402.5 0.2.0 Styra.Opa.OpenApi";
private string _serverUrl = "";
private int _serverIndex = 0;
private ISpeakeasyHttpClient _client;
Expand Down
3 changes: 2 additions & 1 deletion Styra/Opa/OpenApi/Utils/EnumConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ JsonSerializer serializer
var extensionType = System.Type.GetType(objectType.FullName + "Extension");

if (Nullable.GetUnderlyingType(objectType) != null) {
extensionType = System.Type.GetType(Nullable.GetUnderlyingType(objectType)!.FullName + "Extension");
objectType = Nullable.GetUnderlyingType(objectType)!;
extensionType = System.Type.GetType(objectType!.FullName + "Extension");
}

if (extensionType == null)
Expand Down
24 changes: 22 additions & 2 deletions Styra/Opa/OpenApi/Utils/RequestBodySerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,31 @@ ref Dictionary<string, List<string>> form
form[metadata.Name] = new List<string>();
}

form[metadata.Name].Add(Utilities.ValueToString(val));
if (Utilities.IsList(val))
{
foreach(var item in (IEnumerable)val)
{
form[metadata.Name].Add(Utilities.ValueToString(item));
}
}
else
{
form[metadata.Name].Add(Utilities.ValueToString(val));
}
}
else
{
items.Add($"{metadata.Name},{Utilities.ValueToString(val)}");
if (Utilities.IsList(val))
{
foreach(var item in (IEnumerable)val)
{
items.Add($"{metadata.Name},{Utilities.ValueToString(item)}");
}
}
else
{
items.Add($"{metadata.Name},{Utilities.ValueToString(val)}");
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions Styra/Opa/OpenApi/Utils/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ public static string ValueToString(object? value)
}
return (string)(method.Invoke(null, new[] { value }) ?? "");
}
else if (IsDictionary(value))
{
return JsonConvert.SerializeObject(value, GetDefaultJsonSerializerSettings());
}

return value.ToString() ?? "";
}
Expand Down
2 changes: 1 addition & 1 deletion Styra/Opa/Styra.Opa.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>Styra.Opa</PackageId>
<Version>1.2.0</Version>
<Version>1.3.0</Version>
<Authors>Styra</Authors>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
Expand Down

0 comments on commit cc66a14

Please sign in to comment.