Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 🐝 Update SDK - Generate #8

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ id: f1a8c321-72a7-41c5-8f5e-3d925aeafa1a
management:
docChecksum: 2401c7030f847f72ab31c8f75de58a66
docVersion: 0.2.0
speakeasyVersion: 1.228.1
generationVersion: 2.292.0
releaseVersion: 0.2.0
configChecksum: 0533e466bb5ff158a6d254f0b245f86d
speakeasyVersion: 1.231.1
generationVersion: 2.295.1
releaseVersion: 0.3.0
configChecksum: 63ca38beda4ee137c4037339b326841e
repoURL: https://github.com/StyraInc/opa-csharp.git
features:
csharp:
core: 3.5.0
core: 3.6.0
examples: 2.81.3
flattening: 2.81.1
globalServerURLs: 2.82.3
Expand All @@ -27,25 +27,21 @@ generatedFiles:
- Api/Utils/HeaderSerializer.cs
- Api/Utils/IsoDateTimeSerializer.cs
- Api/Utils/RequestBodySerializer.cs
- Api/Utils/ResponseBodyDeserializer.cs
- Api/Utils/SecuritySerializer.cs
- Api/Utils/SpeakeasyHttpClient.cs
- Api/Utils/SpeakeasyMetadata.cs
- Api/Utils/URLBuilder.cs
- Api/Utils/Utilities.cs
- Api/Api.csproj
- Api/Models/Errors/SDKException.cs
- Api/Models/Requests/ExecutePolicyRequest.cs
- Api/Models/Requests/ExecutePolicyResponse.cs
- Api/Models/Requests/ExecutePolicyWithInputRequestBody.cs
- Api/Models/Requests/ExecutePolicyWithInputRequest.cs
- Api/Models/Requests/ExecutePolicyWithInputResponse.cs
- Api/Models/Requests/HealthRequest.cs
- Api/Models/Requests/HealthResponse.cs
- Api/Models/Components/ServerErrorLocation.cs
- Api/Models/Components/ServerErrorErrors.cs
- Api/Models/Components/ServerError.cs
- Api/Models/Components/Location.cs
- Api/Models/Components/Errors.cs
- Api/Models/Components/ClientError.cs
- Api/Models/Components/SuccessfulPolicyEvaluation.cs
- Api/Models/Components/Revision.cs
- Api/Models/Components/Provenance.cs
Expand All @@ -54,21 +50,21 @@ generatedFiles:
- Api/Models/Components/GzipAcceptEncoding.cs
- Api/Models/Components/Input.cs
- Api/Models/Components/GzipContentEncoding.cs
- Api/Models/Components/UnhealthyServer.cs
- Api/Models/Components/HealthyServer.cs
- Api/Models/Errors/Location.cs
- Api/Models/Errors/Errors.cs
- Api/Models/Errors/ClientError.cs
- Api/Models/Errors/ServerErrorLocation.cs
- Api/Models/Errors/ServerErrorErrors.cs
- Api/Models/Errors/ServerError.cs
- Api/Models/Errors/UnhealthyServer.cs
- docs/Models/Requests/ExecutePolicyRequest.md
- docs/Models/Requests/ExecutePolicyResponse.md
- docs/Models/Requests/ExecutePolicyWithInputRequestBody.md
- docs/Models/Requests/ExecutePolicyWithInputRequest.md
- docs/Models/Requests/ExecutePolicyWithInputResponse.md
- docs/Models/Requests/HealthRequest.md
- docs/Models/Requests/HealthResponse.md
- docs/Models/Components/ServerErrorLocation.md
- docs/Models/Components/ServerErrorErrors.md
- docs/Models/Components/ServerError.md
- docs/Models/Components/Location.md
- docs/Models/Components/Errors.md
- docs/Models/Components/ClientError.md
- docs/Models/Components/SuccessfulPolicyEvaluation.md
- docs/Models/Components/Revision.md
- docs/Models/Components/Provenance.md
Expand All @@ -77,8 +73,14 @@ generatedFiles:
- docs/Models/Components/GzipAcceptEncoding.md
- docs/Models/Components/Input.md
- docs/Models/Components/GzipContentEncoding.md
- docs/Models/Components/UnhealthyServer.md
- docs/Models/Components/HealthyServer.md
- docs/Models/Errors/Location.md
- docs/Models/Errors/Errors.md
- docs/Models/Errors/ClientError.md
- docs/Models/Errors/ServerErrorLocation.md
- docs/Models/Errors/ServerErrorErrors.md
- docs/Models/Errors/ServerError.md
- docs/Models/Errors/UnhealthyServer.md
- docs/sdks/opa/README.md
- USAGE.md
- .gitattributes
3 changes: 2 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
csharp:
version: 0.2.0
version: 0.3.0
author: Styra
clientServerStatusCodesAsErrors: true
company: ""
dotnetVersion: net6.0
flattenGlobalSecurity: true
Expand Down
2 changes: 1 addition & 1 deletion Api/Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>Api</PackageId>
<Version>0.2.0</Version>
<Version>0.3.0</Version>
<Authors>Styra</Authors>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
Expand Down
4 changes: 2 additions & 2 deletions Api/Models/Components/Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public class InputConverter : JsonConverter
}
try
{
Dictionary<string, object>? mapOfany = JsonConvert.DeserializeObject<Dictionary<string, object>>(json, new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, MissingMemberHandling = MissingMemberHandling.Error, Converters = Utilities.GetJsonConverters(typeof(Dictionary<string, object>))});
Dictionary<string, object>? mapOfany = ResponseBodyDeserializer.Deserialize<Dictionary<string, object>>(json, missingMemberHandling: MissingMemberHandling.Error);
return new Input(InputType.MapOfany) {
MapOfany = mapOfany
};
Expand All @@ -167,7 +167,7 @@ public class InputConverter : JsonConverter
}
try
{
List<object>? arrayOfany = JsonConvert.DeserializeObject<List<object>>(json, new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, MissingMemberHandling = MissingMemberHandling.Error, Converters = Utilities.GetJsonConverters(typeof(List<object>))});
List<object>? arrayOfany = ResponseBodyDeserializer.Deserialize<List<object>>(json, missingMemberHandling: MissingMemberHandling.Error);
return new Input(InputType.ArrayOfany) {
ArrayOfany = arrayOfany
};
Expand Down
4 changes: 2 additions & 2 deletions Api/Models/Components/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public class ResultConverter : JsonConverter
}
try
{
Dictionary<string, object>? mapOfany = JsonConvert.DeserializeObject<Dictionary<string, object>>(json, new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, MissingMemberHandling = MissingMemberHandling.Error, Converters = Utilities.GetJsonConverters(typeof(Dictionary<string, object>))});
Dictionary<string, object>? mapOfany = ResponseBodyDeserializer.Deserialize<Dictionary<string, object>>(json, missingMemberHandling: MissingMemberHandling.Error);
return new Result(ResultType.MapOfany) {
MapOfany = mapOfany
};
Expand All @@ -167,7 +167,7 @@ public class ResultConverter : JsonConverter
}
try
{
List<object>? arrayOfany = JsonConvert.DeserializeObject<List<object>>(json, new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, MissingMemberHandling = MissingMemberHandling.Error, Converters = Utilities.GetJsonConverters(typeof(List<object>))});
List<object>? arrayOfany = ResponseBodyDeserializer.Deserialize<List<object>>(json, missingMemberHandling: MissingMemberHandling.Error);
return new Result(ResultType.ArrayOfany) {
ArrayOfany = arrayOfany
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,25 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace Api.Models.Components
namespace Api.Models.Errors
{
using Api.Models.Components;
using Api.Models.Errors;
using Newtonsoft.Json;
using System.Collections.Generic;
using System;

public class ClientError
/// <summary>
/// Bad Request
/// </summary>
public class ClientError : Exception
{

[JsonProperty("code")]
public string Code { get; set; } = default!;

[JsonProperty("message")]
public string Message { get; set; } = default!;
private string? _message { get; set; }
public override string Message { get {return _message ?? "";} }

[JsonProperty("errors")]
public List<Errors>? Errors { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace Api.Models.Components
namespace Api.Models.Errors
{
using Api.Models.Components;
using Api.Models.Errors;
using Newtonsoft.Json;

public class Errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace Api.Models.Components
namespace Api.Models.Errors
{
using Newtonsoft.Json;

Expand Down
44 changes: 44 additions & 0 deletions Api/Models/Errors/SDKException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

//------------------------------------------------------------------------------
// <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 Api.Models.Errors
{
using System;
using System.Net.Http;

public class SDKException : Exception
{
public int StatusCode { get; set; }

public override string Message { get; }
public string Body { get; set; }

public HttpResponseMessage RawResponse { get; set; } = default!;

public SDKException(string message, int statusCode, string body, HttpResponseMessage rawResponse)
{
Message = message;
StatusCode = statusCode;
Body = body;
RawResponse = rawResponse;
}

public override string ToString(){
var body = "";
if (Body.Length > 0)
{
body += $"\n{Body}";
}

return Message + ": Status " + StatusCode + body;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,25 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace Api.Models.Components
namespace Api.Models.Errors
{
using Api.Models.Components;
using Api.Models.Errors;
using Newtonsoft.Json;
using System.Collections.Generic;
using System;

public class ServerError
/// <summary>
/// Server Error
/// </summary>
public class ServerError : Exception
{

[JsonProperty("code")]
public string Code { get; set; } = default!;

[JsonProperty("message")]
public string Message { get; set; } = default!;
private string? _message { get; set; }
public override string Message { get {return _message ?? "";} }

[JsonProperty("errors")]
public List<ServerErrorErrors>? Errors { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace Api.Models.Components
namespace Api.Models.Errors
{
using Api.Models.Components;
using Api.Models.Errors;
using Newtonsoft.Json;

public class ServerErrorErrors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace Api.Models.Components
namespace Api.Models.Errors
{
using Newtonsoft.Json;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace Api.Models.Components
namespace Api.Models.Errors
{
using Newtonsoft.Json;
using System;

public class UnhealthyServer
public class UnhealthyServer : Exception
{

[JsonProperty("code")]
Expand Down
10 changes: 0 additions & 10 deletions Api/Models/Requests/ExecutePolicyResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@ public class ExecutePolicyResponse
/// </summary>
public SuccessfulPolicyEvaluation? SuccessfulPolicyEvaluation { get; set; }

/// <summary>
/// Bad Request
/// </summary>
public ClientError? ClientError { get; set; }

/// <summary>
/// Server Error
/// </summary>
public ServerError? ServerError { get; set; }

public Dictionary<string, List<string>> Headers { get; set; } = default!;
}
}
10 changes: 0 additions & 10 deletions Api/Models/Requests/ExecutePolicyWithInputResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@ public class ExecutePolicyWithInputResponse
/// </summary>
public SuccessfulPolicyEvaluation? SuccessfulPolicyEvaluation { get; set; }

/// <summary>
/// Bad Request
/// </summary>
public ClientError? ClientError { get; set; }

/// <summary>
/// Server Error
/// </summary>
public ServerError? ServerError { get; set; }

public Dictionary<string, List<string>> Headers { get; set; } = default!;
}
}
5 changes: 0 additions & 5 deletions Api/Models/Requests/HealthResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,5 @@ public class HealthResponse
/// OPA service is healthy. If the bundles option is specified then all configured bundles have been activated. If the plugins option is specified then all plugins are in an OK state.
/// </summary>
public HealthyServer? HealthyServer { get; set; }

/// <summary>
/// OPA service is not healthy. If the bundles option is specified this can mean any of the configured bundles have not yet been activated. If the plugins option is specified then at least one plugin is in a non-OK state.
/// </summary>
public UnhealthyServer? UnhealthyServer { get; set; }
}
}
Loading
Loading