-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: 🐝 Update SDK - 1 - Generate (#52)
* ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.310.0 * Update project file to version 1.0.1 * Manual fixups for the breaking renames. Signed-off-by: Philip Conrad <[email protected]> --------- Signed-off-by: Philip Conrad <[email protected]> Co-authored-by: speakeasybot <[email protected]> Co-authored-by: GitHub Actions <[email protected]> Co-authored-by: Philip Conrad <[email protected]>
- Loading branch information
1 parent
7432f58
commit dc8a3f8
Showing
29 changed files
with
952 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
# Styra.Opa.OpenApi | ||
|
||
<div align="left"> | ||
<a href="https://speakeasyapi.dev/"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a> | ||
<a href="https://opensource.org/licenses/MIT"> | ||
<img src="https://img.shields.io/badge/License-MIT-blue.svg" style="width: 100px; height: 28px;" /> | ||
</a> | ||
</div> | ||
|
||
|
||
<!-- Start Installation [installation] --> | ||
## Installation | ||
|
||
```bash | ||
dotnet add package Styra.Opa.OpenApi | ||
``` | ||
<!-- End Installation [installation] --> | ||
|
||
<!-- Start SDK Example Usage [usage] --> | ||
## SDK Example Usage | ||
|
||
### Example 1 | ||
|
||
```csharp | ||
using Styra.Opa.OpenApi; | ||
using Styra.Opa.OpenApi.Models.Requests; | ||
using Styra.Opa.OpenApi.Models.Components; | ||
|
||
var sdk = new OpaApiClient(); | ||
|
||
var res = await sdk.ExecuteDefaultPolicyWithInputAsync( | ||
input: Input.CreateInputNumber( | ||
8203.11D, | ||
), | ||
pretty: false, | ||
acceptEncoding: GzipAcceptEncoding.Gzip); | ||
|
||
// handle response | ||
``` | ||
|
||
### Example 2 | ||
|
||
```csharp | ||
using Styra.Opa.OpenApi; | ||
using Styra.Opa.OpenApi.Models.Requests; | ||
using Styra.Opa.OpenApi.Models.Components; | ||
|
||
var sdk = new OpaApiClient(); | ||
|
||
ExecutePolicyWithInputRequest req = new ExecutePolicyWithInputRequest() { | ||
Path = "app/rbac", | ||
RequestBody = new ExecutePolicyWithInputRequestBody() { | ||
Input = Input.CreateInputBoolean( | ||
false, | ||
), | ||
}, | ||
}; | ||
|
||
var res = await sdk.ExecutePolicyWithInputAsync(req); | ||
|
||
// handle response | ||
``` | ||
|
||
### Example 3 | ||
|
||
```csharp | ||
using Styra.Opa.OpenApi; | ||
using Styra.Opa.OpenApi.Models.Requests; | ||
using System.Collections.Generic; | ||
using Styra.Opa.OpenApi.Models.Components; | ||
|
||
var sdk = new OpaApiClient(); | ||
|
||
ExecuteBatchPolicyWithInputRequest req = new ExecuteBatchPolicyWithInputRequest() { | ||
Path = "app/rbac", | ||
RequestBody = new ExecuteBatchPolicyWithInputRequestBody() { | ||
Inputs = new Dictionary<string, Input>() { | ||
{ "key", Input.CreateInputStr( | ||
"<value>", | ||
) }, | ||
}, | ||
}, | ||
}; | ||
|
||
var res = await sdk.ExecuteBatchPolicyWithInputAsync(req); | ||
|
||
// handle response | ||
``` | ||
<!-- End SDK Example Usage [usage] --> | ||
|
||
<!-- Start Available Resources and Operations [operations] --> | ||
## Available Resources and Operations | ||
|
||
- [OpaApiClient SDK](https:/github.com/StyraInc/opa-csharp/blob/main/Styra/Opa/OpenApi/github/workspace/repo/docs/sdks/opaapiclient/README.md#available-operations) | ||
<!-- End Available Resources and Operations [operations] --> | ||
|
||
<!-- Start Error Handling [errors] --> | ||
## Error Handling | ||
|
||
Handling errors in this SDK should largely match your expectations. All operations return a response object or thow an exception. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate type. | ||
|
||
| Error Object | Status Code | Content Type | | ||
| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | | ||
| Styra.Opa.OpenApi.Models.Errors.ClientError | 400,404 | application/json | | ||
| Styra.Opa.OpenApi.Models.Errors.ServerError | 500 | application/json | | ||
| Styra.Opa.OpenApi.Models.Errors.SDKException | 4xx-5xx | */* | | ||
|
||
### Example | ||
|
||
```csharp | ||
using Styra.Opa.OpenApi; | ||
using System; | ||
using Styra.Opa.OpenApi.Models.Errors; | ||
using Styra.Opa.OpenApi.Models.Requests; | ||
using Styra.Opa.OpenApi.Models.Components; | ||
|
||
var sdk = new OpaApiClient(); | ||
|
||
try | ||
{ | ||
var res = await sdk.ExecuteDefaultPolicyWithInputAsync( | ||
input: Input.CreateInputNumber( | ||
8203.11D, | ||
), | ||
pretty: false, | ||
acceptEncoding: GzipAcceptEncoding.Gzip); | ||
// handle response | ||
} | ||
catch (Exception ex) | ||
{ | ||
if (ex is ClientError) | ||
{ | ||
// handle exception | ||
} | ||
else if (ex is Models.Errors.ServerError) | ||
{ | ||
// handle exception | ||
} | ||
else if (ex is Styra.Opa.OpenApi.Models.Errors.SDKException) | ||
{ | ||
// handle exception | ||
} | ||
} | ||
|
||
``` | ||
<!-- End Error Handling [errors] --> | ||
|
||
<!-- Start Server Selection [server] --> | ||
## Server Selection | ||
|
||
### Select Server by Index | ||
|
||
You can override the default server globally by passing a server index to the `serverIndex: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: | ||
|
||
| # | Server | Variables | | ||
| - | ------ | --------- | | ||
| 0 | `http://localhost:8181` | None | | ||
|
||
|
||
|
||
|
||
### Override Server URL Per-Client | ||
|
||
The default server can also be overridden globally by passing a URL to the `serverUrl: str` optional parameter when initializing the SDK client instance. For example: | ||
<!-- End Server Selection [server] --> | ||
|
||
<!-- Placeholder for Future Speakeasy SDK Sections --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost when | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
#nullable enable | ||
namespace Styra.Opa.OpenApi.Models.Components | ||
{ | ||
using Newtonsoft.Json; | ||
using Styra.Opa.OpenApi.Models.Components; | ||
using Styra.Opa.OpenApi.Utils; | ||
using System.Collections.Generic; | ||
|
||
public class BatchMixedResults | ||
{ | ||
|
||
[JsonProperty("batch_decision_id")] | ||
public string? BatchDecisionId { get; set; } | ||
|
||
/// <summary> | ||
/// If query metrics are enabled, this field contains query performance metrics collected during the parse, compile, and evaluation steps. | ||
/// </summary> | ||
[JsonProperty("metrics")] | ||
public Dictionary<string, object>? Metrics { get; set; } | ||
|
||
[JsonProperty("responses")] | ||
public Dictionary<string, Responses>? Responses { get; set; } | ||
} | ||
} |
Oops, something went wrong.