From 4b889d922577159fed261767ea87bdd17ab5f07a Mon Sep 17 00:00:00 2001 From: Tom Schindl Date: Thu, 25 Jun 2026 01:42:02 +0200 Subject: [PATCH 1/4] 25 - reworked client lib to use Result-Pattern instead of exceptions --- dsl/java-test/java-client/pom.xml | 4 +- .../sample/client/BinaryTypesService.java | 98 +- .../client/BodyParameterTypesService.java | 244 +- .../client/HeaderParameterTypesService.java | 210 +- .../client/ListBodyParameterTypesService.java | 212 +- .../ListHeaderParameterTypesService.java | 212 +- .../ListQueryParameterTypesService.java | 34 +- .../client/ListSampleServiceService.java | 32 +- .../PathParameterTypeServiceService.java | 30 +- .../client/QueryParameterTypesService.java | 98 +- .../dev/rsdlang/sample/client/RSDError.java | 50 + .../rsdlang/sample/client/RSDException.java | 36 - .../dev/rsdlang/sample/client/Result.java | 98 + .../rsdlang/sample/client/SampleError.java | 9 + .../rsdlang/sample/client/SampleError2.java | 9 + .../sample/client/SampleError2Exception.java | 8 - .../sample/client/SampleErrorBoolean.java | 9 + .../client/SampleErrorBooleanException.java | 14 - .../sample/client/SampleErrorEnum.java | 11 + .../client/SampleErrorEnumException.java | 16 - .../sample/client/SampleErrorException.java | 8 - .../rsdlang/sample/client/SampleErrorInt.java | 9 + .../client/SampleErrorIntException.java | 14 - .../sample/client/SampleErrorScalar.java | 11 + .../client/SampleErrorScalarException.java | 16 - .../sample/client/SampleErrorScalarSub.java | 9 + .../client/SampleErrorScalarSubException.java | 14 - .../sample/client/SampleErrorUnion.java | 11 + .../client/SampleErrorUnionException.java | 16 - .../sample/client/SampleErrorWithValue.java | 11 + .../client/SampleErrorWithValueException.java | 16 - .../sample/client/SampleServiceService.java | 50 +- .../ScalarSubstition_ServiceService.java | 78 +- .../sample/client/SpecSamplesClient.java | 4 +- .../client/jdkhttp/JDKSpecSamplesClient.java | 6 +- .../jdkhttp/impl/BinaryTypesServiceImpl.java | 950 +++---- .../impl/BodyParameterTypesServiceImpl.java | 2321 +++++++---------- .../impl/HeaderParameterTypesServiceImpl.java | 1998 ++++++-------- .../ListBodyParameterTypesServiceImpl.java | 2017 ++++++-------- .../ListHeaderParameterTypesServiceImpl.java | 2017 ++++++-------- .../ListQueryParameterTypesServiceImpl.java | 326 +-- .../impl/ListSampleServiceServiceImpl.java | 316 +-- .../PathParameterTypeServiceServiceImpl.java | 288 +- .../impl/QueryParameterTypesServiceImpl.java | 934 +++---- .../impl/SampleServiceServiceImpl.java | 564 ++-- .../ScalarSubstition_ServiceServiceImpl.java | 753 +++--- .../sample/client/BinaryTypesServiceTest.java | 87 +- .../client/BodyParameterTypesServiceTest.java | 314 +-- .../HeaderParameterTypesServiceTest.java | 290 +- .../ListBodyParameterTypesServiceTest.java | 292 ++- .../ListHeaderParameterTypesServiceTest.java | 300 ++- .../ListQueryParameterTypesServiceTest.java | 37 +- .../client/ListSampleServiceServiceTest.java | 40 +- .../PathParameterTypeServiceServiceTest.java | 36 +- .../QueryParameterTypesServiceTest.java | 110 +- .../client/SampleServiceServiceTest.java | 147 +- .../ScalarSubstition_ServiceServiceTest.java | 106 +- .../cli/src/java-client-api/client.ts | 4 +- dsl/packages/cli/src/java-client-api/error.ts | 67 +- .../cli/src/java-client-api/generator.ts | 12 +- .../cli/src/java-client-api/result.ts | 116 + .../cli/src/java-client-api/service-errors.ts | 91 + .../cli/src/java-client-api/service.ts | 60 +- .../cli/src/java-rest-client-jdk/client.ts | 6 +- .../cli/src/java-rest-client-jdk/generator.ts | 2 +- .../cli/src/java-rest-client-jdk/service.ts | 151 +- dsl/packages/cli/src/java-server/error.ts | 83 + dsl/packages/cli/src/java-server/generator.ts | 4 +- .../rsd-exception.ts | 9 +- 69 files changed, 7557 insertions(+), 8998 deletions(-) create mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/RSDError.java delete mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/RSDException.java create mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/Result.java create mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleError.java create mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleError2.java delete mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleError2Exception.java create mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorBoolean.java delete mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorBooleanException.java create mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorEnum.java delete mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorEnumException.java delete mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorException.java create mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorInt.java delete mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorIntException.java create mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalar.java delete mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalarException.java create mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalarSub.java delete mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalarSubException.java create mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorUnion.java delete mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorUnionException.java create mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorWithValue.java delete mode 100644 dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorWithValueException.java create mode 100644 dsl/packages/cli/src/java-client-api/result.ts create mode 100644 dsl/packages/cli/src/java-client-api/service-errors.ts create mode 100644 dsl/packages/cli/src/java-server/error.ts rename dsl/packages/cli/src/{java-client-api => java-server}/rsd-exception.ts (93%) diff --git a/dsl/java-test/java-client/pom.xml b/dsl/java-test/java-client/pom.xml index f598643b..b005200e 100644 --- a/dsl/java-test/java-client/pom.xml +++ b/dsl/java-test/java-client/pom.xml @@ -9,8 +9,8 @@ 1.0-SNAPSHOT - 17 - 17 + 21 + 21 diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/BinaryTypesService.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/BinaryTypesService.java index 6e5ce0ba..63c31249 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/BinaryTypesService.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/BinaryTypesService.java @@ -10,55 +10,55 @@ import dev.rsdlang.sample.client.model.UploadMixedResult; public interface BinaryTypesService extends BaseService { - public int uploadFile(RSDFile data); + public Result uploadFile(RSDFile data); - public int uploadFileOpt(); + public Result uploadFileOpt(); - public int uploadFileOpt(RSDFile data); + public Result uploadFileOpt(RSDFile data); - public int uploadFileNil(RSDFile data); + public Result uploadFileNil(RSDFile data); - public int uploadFileOptNil(); + public Result uploadFileOptNil(); - public int uploadFileOptNil(RSDFile data); + public Result uploadFileOptNil(RSDFile data); - public int uploadBlob(RSDBlob data); + public Result uploadBlob(RSDBlob data); - public int uploadBlobOpt(); + public Result uploadBlobOpt(); - public int uploadBlobOpt(RSDBlob data); + public Result uploadBlobOpt(RSDBlob data); - public int uploadBlobNil(RSDBlob data); + public Result uploadBlobNil(RSDBlob data); - public int uploadBlobOptNil(); + public Result uploadBlobOptNil(); - public int uploadBlobOptNil(RSDBlob data); + public Result uploadBlobOptNil(RSDBlob data); - public int uploadFileList(List data); + public Result uploadFileList(List data); - public int uploadFileListOpt(); + public Result uploadFileListOpt(); - public int uploadFileListOpt(List data); + public Result uploadFileListOpt(List data); - public int uploadFileListNil(List data); + public Result uploadFileListNil(List data); - public int uploadFileListOptNil(); + public Result uploadFileListOptNil(); - public int uploadFileListOptNil(List data); + public Result uploadFileListOptNil(List data); - public int uploadBlobList(List data); + public Result uploadBlobList(List data); - public int uploadBlobListOpt(); + public Result uploadBlobListOpt(); - public int uploadBlobListOpt(List data); + public Result uploadBlobListOpt(List data); - public int uploadBlobListNil(List data); + public Result uploadBlobListNil(List data); - public int uploadBlobListOptNil(); + public Result uploadBlobListOptNil(); - public int uploadBlobListOptNil(List data); + public Result uploadBlobListOptNil(List data); - public UploadMixedResult.Data uploadMixed( + public Result uploadMixed( String text, int number, SimpleRecord.Data rec, @@ -68,33 +68,33 @@ public UploadMixedResult.Data uploadMixed( RSDFile dataFile, RSDBlob dataBlob); - public UploadMixedResult.Data uploadMixedOpt(); + public Result uploadMixedOpt(); - public UploadMixedResult.Data uploadMixedOpt(String text); + public Result uploadMixedOpt(String text); - public UploadMixedResult.Data uploadMixedOpt( + public Result uploadMixedOpt( String text, Integer number); - public UploadMixedResult.Data uploadMixedOpt( + public Result uploadMixedOpt( String text, Integer number, SimpleRecord.Data rec); - public UploadMixedResult.Data uploadMixedOpt( + public Result uploadMixedOpt( String text, Integer number, SimpleRecord.Data rec, List textList); - public UploadMixedResult.Data uploadMixedOpt( + public Result uploadMixedOpt( String text, Integer number, SimpleRecord.Data rec, List textList, List numberList); - public UploadMixedResult.Data uploadMixedOpt( + public Result uploadMixedOpt( String text, Integer number, SimpleRecord.Data rec, @@ -102,7 +102,7 @@ public UploadMixedResult.Data uploadMixedOpt( List numberList, List recList); - public UploadMixedResult.Data uploadMixedOpt( + public Result uploadMixedOpt( String text, Integer number, SimpleRecord.Data rec, @@ -111,7 +111,7 @@ public UploadMixedResult.Data uploadMixedOpt( List recList, RSDFile dataFile); - public UploadMixedResult.Data uploadMixedOpt( + public Result uploadMixedOpt( String text, Integer number, SimpleRecord.Data rec, @@ -121,7 +121,7 @@ public UploadMixedResult.Data uploadMixedOpt( RSDFile dataFile, RSDBlob dataBlob); - public UploadMixedResult.Data uploadMixedNil( + public Result uploadMixedNil( String text, Integer number, SimpleRecord.Data rec, @@ -131,33 +131,33 @@ public UploadMixedResult.Data uploadMixedNil( RSDFile dataFile, RSDBlob dataBlob); - public UploadMixedResult.Data uploadMixedOptNil(); + public Result uploadMixedOptNil(); - public UploadMixedResult.Data uploadMixedOptNil(String text); + public Result uploadMixedOptNil(String text); - public UploadMixedResult.Data uploadMixedOptNil( + public Result uploadMixedOptNil( String text, Integer number); - public UploadMixedResult.Data uploadMixedOptNil( + public Result uploadMixedOptNil( String text, Integer number, SimpleRecord.Data rec); - public UploadMixedResult.Data uploadMixedOptNil( + public Result uploadMixedOptNil( String text, Integer number, SimpleRecord.Data rec, List textList); - public UploadMixedResult.Data uploadMixedOptNil( + public Result uploadMixedOptNil( String text, Integer number, SimpleRecord.Data rec, List textList, List numberList); - public UploadMixedResult.Data uploadMixedOptNil( + public Result uploadMixedOptNil( String text, Integer number, SimpleRecord.Data rec, @@ -165,7 +165,7 @@ public UploadMixedResult.Data uploadMixedOptNil( List numberList, List recList); - public UploadMixedResult.Data uploadMixedOptNil( + public Result uploadMixedOptNil( String text, Integer number, SimpleRecord.Data rec, @@ -174,7 +174,7 @@ public UploadMixedResult.Data uploadMixedOptNil( List recList, RSDFile dataFile); - public UploadMixedResult.Data uploadMixedOptNil( + public Result uploadMixedOptNil( String text, Integer number, SimpleRecord.Data rec, @@ -184,7 +184,7 @@ public UploadMixedResult.Data uploadMixedOptNil( RSDFile dataFile, RSDBlob dataBlob); - public MixedResult.Data mixed( + public Result mixed( String pathString, int pathNumber, String headerString, @@ -195,16 +195,16 @@ public MixedResult.Data mixed( SimpleRecord.Data queryRecord, RSDBlob dataBlob); - public String singleBodyAddition( + public Result singleBodyAddition( String name, RSDBlob dataBlob); - public List twoBinariesAddition( + public Result, RSDError.$GenericError> twoBinariesAddition( RSDBlob dataBlob, RSDFile dataFile); - public RSDFile downloadFile() throws SampleErrorWithValueException; + public Result downloadFile(); - public RSDBlob downloadBlob() throws SampleErrorWithValueException; + public Result downloadBlob(); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/BodyParameterTypesService.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/BodyParameterTypesService.java index 0d452aaf..48f5b5c7 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/BodyParameterTypesService.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/BodyParameterTypesService.java @@ -35,269 +35,269 @@ public enum SimpleInlineEnumBodyParamOptNil_BodyEnum_Param$ { C, D, } - public boolean simpleBooleanBodyParam(boolean bodyBoolean); + public Result simpleBooleanBodyParam(boolean bodyBoolean); - public NilResult simpleBooleanBodyParamOpt(); + public Result simpleBooleanBodyParamOpt(); - public NilResult simpleBooleanBodyParamOpt(Boolean bodyBoolean); + public Result simpleBooleanBodyParamOpt(Boolean bodyBoolean); - public NilResult simpleBooleanBodyParamNil(Boolean bodyBoolean); + public Result simpleBooleanBodyParamNil(Boolean bodyBoolean); - public NilResult simpleBooleanBodyParamOptNil(); + public Result simpleBooleanBodyParamOptNil(); - public NilResult simpleBooleanBodyParamOptNil(Boolean bodyBoolean); + public Result simpleBooleanBodyParamOptNil(Boolean bodyBoolean); - public short simpleShortBodyParam(short bodyShort); + public Result simpleShortBodyParam(short bodyShort); - public NilResult simpleShortBodyParamOpt(); + public Result simpleShortBodyParamOpt(); - public NilResult simpleShortBodyParamOpt(Short bodyShort); + public Result simpleShortBodyParamOpt(Short bodyShort); - public NilResult simpleShortBodyParamNil(Short bodyShort); + public Result simpleShortBodyParamNil(Short bodyShort); - public NilResult simpleShortBodyParamOptNil(); + public Result simpleShortBodyParamOptNil(); - public NilResult simpleShortBodyParamOptNil(Short bodyShort); + public Result simpleShortBodyParamOptNil(Short bodyShort); - public int simpleIntBodyParam(int bodyInt); + public Result simpleIntBodyParam(int bodyInt); - public NilResult simpleIntBodyParamOpt(); + public Result simpleIntBodyParamOpt(); - public NilResult simpleIntBodyParamOpt(Integer bodyInt); + public Result simpleIntBodyParamOpt(Integer bodyInt); - public NilResult simpleIntBodyParamNil(Integer bodyInt); + public Result simpleIntBodyParamNil(Integer bodyInt); - public NilResult simpleIntBodyParamOptNil(); + public Result simpleIntBodyParamOptNil(); - public NilResult simpleIntBodyParamOptNil(Integer bodyInt); + public Result simpleIntBodyParamOptNil(Integer bodyInt); - public long simpleLongBodyParam(long bodyLong); + public Result simpleLongBodyParam(long bodyLong); - public NilResult simpleLongBodyParamOpt(); + public Result simpleLongBodyParamOpt(); - public NilResult simpleLongBodyParamOpt(Long bodyLong); + public Result simpleLongBodyParamOpt(Long bodyLong); - public NilResult simpleLongBodyParamNil(Long bodyLong); + public Result simpleLongBodyParamNil(Long bodyLong); - public NilResult simpleLongBodyParamOptNil(); + public Result simpleLongBodyParamOptNil(); - public NilResult simpleLongBodyParamOptNil(Long bodyLong); + public Result simpleLongBodyParamOptNil(Long bodyLong); - public float simpleFloatBodyParam(float bodyFloat); + public Result simpleFloatBodyParam(float bodyFloat); - public NilResult simpleFloatBodyParamOpt(); + public Result simpleFloatBodyParamOpt(); - public NilResult simpleFloatBodyParamOpt(Float bodyFloat); + public Result simpleFloatBodyParamOpt(Float bodyFloat); - public NilResult simpleFloatBodyParamNil(Float bodyFloat); + public Result simpleFloatBodyParamNil(Float bodyFloat); - public NilResult simpleFloatBodyParamOptNil(); + public Result simpleFloatBodyParamOptNil(); - public NilResult simpleFloatBodyParamOptNil(Float bodyFloat); + public Result simpleFloatBodyParamOptNil(Float bodyFloat); - public double simpleDoubleBodyParam(double bodyDouble); + public Result simpleDoubleBodyParam(double bodyDouble); - public NilResult simpleDoubleBodyParamOpt(); + public Result simpleDoubleBodyParamOpt(); - public NilResult simpleDoubleBodyParamOpt(Double bodyDouble); + public Result simpleDoubleBodyParamOpt(Double bodyDouble); - public NilResult simpleDoubleBodyParamNil(Double bodyDouble); + public Result simpleDoubleBodyParamNil(Double bodyDouble); - public NilResult simpleDoubleBodyParamOptNil(); + public Result simpleDoubleBodyParamOptNil(); - public NilResult simpleDoubleBodyParamOptNil(Double bodyDouble); + public Result simpleDoubleBodyParamOptNil(Double bodyDouble); - public String simpleStringBodyParam(String bodyString); + public Result simpleStringBodyParam(String bodyString); - public NilResult simpleStringBodyParamOpt(); + public Result simpleStringBodyParamOpt(); - public NilResult simpleStringBodyParamOpt(String bodyString); + public Result simpleStringBodyParamOpt(String bodyString); - public NilResult simpleStringBodyParamNil(String bodyString); + public Result simpleStringBodyParamNil(String bodyString); - public NilResult simpleStringBodyParamOptNil(); + public Result simpleStringBodyParamOptNil(); - public NilResult simpleStringBodyParamOptNil(String bodyString); + public Result simpleStringBodyParamOptNil(String bodyString); - public LocalDate simpleLocalDateBodyParam(LocalDate bodyLocalDate); + public Result simpleLocalDateBodyParam(LocalDate bodyLocalDate); - public NilResult simpleLocalDateBodyParamOpt(); + public Result simpleLocalDateBodyParamOpt(); - public NilResult simpleLocalDateBodyParamOpt(LocalDate bodyLocalDate); + public Result simpleLocalDateBodyParamOpt(LocalDate bodyLocalDate); - public NilResult simpleLocalDateBodyParamNil(LocalDate bodyLocalDate); + public Result simpleLocalDateBodyParamNil(LocalDate bodyLocalDate); - public NilResult simpleLocalDateBodyParamOptNil(); + public Result simpleLocalDateBodyParamOptNil(); - public NilResult simpleLocalDateBodyParamOptNil(LocalDate bodyLocalDate); + public Result simpleLocalDateBodyParamOptNil(LocalDate bodyLocalDate); - public LocalDateTime simpleLocalDateTimeBodyParam(LocalDateTime bodyLocalDateTime); + public Result simpleLocalDateTimeBodyParam(LocalDateTime bodyLocalDateTime); - public NilResult simpleLocalDateTimeBodyParamOpt(); + public Result simpleLocalDateTimeBodyParamOpt(); - public NilResult simpleLocalDateTimeBodyParamOpt(LocalDateTime bodyLocalDateTime); + public Result simpleLocalDateTimeBodyParamOpt(LocalDateTime bodyLocalDateTime); - public NilResult simpleLocalDateTimeBodyParamNil(LocalDateTime bodyLocalDateTime); + public Result simpleLocalDateTimeBodyParamNil(LocalDateTime bodyLocalDateTime); - public NilResult simpleLocalDateTimeBodyParamOptNil(); + public Result simpleLocalDateTimeBodyParamOptNil(); - public NilResult simpleLocalDateTimeBodyParamOptNil(LocalDateTime bodyLocalDateTime); + public Result simpleLocalDateTimeBodyParamOptNil(LocalDateTime bodyLocalDateTime); - public LocalTime simpleLocalTimeBodyParam(LocalTime bodyLocalTime); + public Result simpleLocalTimeBodyParam(LocalTime bodyLocalTime); - public NilResult simpleLocalTimeBodyParamOpt(); + public Result simpleLocalTimeBodyParamOpt(); - public NilResult simpleLocalTimeBodyParamOpt(LocalTime bodyLocalTime); + public Result simpleLocalTimeBodyParamOpt(LocalTime bodyLocalTime); - public NilResult simpleLocalTimeBodyParamNil(LocalTime bodyLocalTime); + public Result simpleLocalTimeBodyParamNil(LocalTime bodyLocalTime); - public NilResult simpleLocalTimeBodyParamOptNil(); + public Result simpleLocalTimeBodyParamOptNil(); - public NilResult simpleLocalTimeBodyParamOptNil(LocalTime bodyLocalTime); + public Result simpleLocalTimeBodyParamOptNil(LocalTime bodyLocalTime); - public OffsetDateTime simpleOffsetDateTimeBodyParam(OffsetDateTime bodyOffsetDateTime); + public Result simpleOffsetDateTimeBodyParam(OffsetDateTime bodyOffsetDateTime); - public NilResult simpleOffsetDateTimeBodyParamOpt(); + public Result simpleOffsetDateTimeBodyParamOpt(); - public NilResult simpleOffsetDateTimeBodyParamOpt(OffsetDateTime bodyOffsetDateTime); + public Result simpleOffsetDateTimeBodyParamOpt(OffsetDateTime bodyOffsetDateTime); - public NilResult simpleOffsetDateTimeBodyParamNil(OffsetDateTime bodyOffsetDateTime); + public Result simpleOffsetDateTimeBodyParamNil(OffsetDateTime bodyOffsetDateTime); - public NilResult simpleOffsetDateTimeBodyParamOptNil(); + public Result simpleOffsetDateTimeBodyParamOptNil(); - public NilResult simpleOffsetDateTimeBodyParamOptNil(OffsetDateTime bodyOffsetDateTime); + public Result simpleOffsetDateTimeBodyParamOptNil(OffsetDateTime bodyOffsetDateTime); - public ZonedDateTime simpleZonedDateTimeBodyParam(ZonedDateTime bodyZonedDateTime); + public Result simpleZonedDateTimeBodyParam(ZonedDateTime bodyZonedDateTime); - public NilResult simpleZonedDateTimeBodyParamOpt(); + public Result simpleZonedDateTimeBodyParamOpt(); - public NilResult simpleZonedDateTimeBodyParamOpt(ZonedDateTime bodyZonedDateTime); + public Result simpleZonedDateTimeBodyParamOpt(ZonedDateTime bodyZonedDateTime); - public NilResult simpleZonedDateTimeBodyParamNil(ZonedDateTime bodyZonedDateTime); + public Result simpleZonedDateTimeBodyParamNil(ZonedDateTime bodyZonedDateTime); - public NilResult simpleZonedDateTimeBodyParamOptNil(); + public Result simpleZonedDateTimeBodyParamOptNil(); - public NilResult simpleZonedDateTimeBodyParamOptNil(ZonedDateTime bodyZonedDateTime); + public Result simpleZonedDateTimeBodyParamOptNil(ZonedDateTime bodyZonedDateTime); - public ZoneId simpleScalarBodyParam(ZoneId bodyScalar); + public Result simpleScalarBodyParam(ZoneId bodyScalar); - public NilResult simpleScalarBodyParamOpt(); + public Result simpleScalarBodyParamOpt(); - public NilResult simpleScalarBodyParamOpt(ZoneId bodyScalar); + public Result simpleScalarBodyParamOpt(ZoneId bodyScalar); - public NilResult simpleScalarBodyParamNil(ZoneId bodyScalar); + public Result simpleScalarBodyParamNil(ZoneId bodyScalar); - public NilResult simpleScalarBodyParamOptNil(); + public Result simpleScalarBodyParamOptNil(); - public NilResult simpleScalarBodyParamOptNil(ZoneId bodyScalar); + public Result simpleScalarBodyParamOptNil(ZoneId bodyScalar); - public SampleEnum simpleEnumBodyParam(SampleEnum bodyEnum); + public Result simpleEnumBodyParam(SampleEnum bodyEnum); - public NilResult simpleEnumBodyParamOpt(); + public Result simpleEnumBodyParamOpt(); - public NilResult simpleEnumBodyParamOpt(SampleEnum bodyEnum); + public Result simpleEnumBodyParamOpt(SampleEnum bodyEnum); - public NilResult simpleEnumBodyParamNil(SampleEnum bodyEnum); + public Result simpleEnumBodyParamNil(SampleEnum bodyEnum); - public NilResult simpleEnumBodyParamOptNil(); + public Result simpleEnumBodyParamOptNil(); - public NilResult simpleEnumBodyParamOptNil(SampleEnum bodyEnum); + public Result simpleEnumBodyParamOptNil(SampleEnum bodyEnum); - public SimpleInlineEnumBodyParam_Result$ simpleInlineEnumBodyParam(SimpleInlineEnumBodyParam_BodyEnum_Param$ bodyEnum); + public Result simpleInlineEnumBodyParam(SimpleInlineEnumBodyParam_BodyEnum_Param$ bodyEnum); - public NilResult simpleInlineEnumBodyParamOpt(); + public Result simpleInlineEnumBodyParamOpt(); - public NilResult simpleInlineEnumBodyParamOpt(SimpleInlineEnumBodyParamOpt_BodyEnum_Param$ bodyEnum); + public Result simpleInlineEnumBodyParamOpt(SimpleInlineEnumBodyParamOpt_BodyEnum_Param$ bodyEnum); - public NilResult simpleInlineEnumBodyParamNil(SimpleInlineEnumBodyParamNil_BodyEnum_Param$ bodyEnum); + public Result simpleInlineEnumBodyParamNil(SimpleInlineEnumBodyParamNil_BodyEnum_Param$ bodyEnum); - public NilResult simpleInlineEnumBodyParamOptNil(); + public Result simpleInlineEnumBodyParamOptNil(); - public NilResult simpleInlineEnumBodyParamOptNil(SimpleInlineEnumBodyParamOptNil_BodyEnum_Param$ bodyEnum); + public Result simpleInlineEnumBodyParamOptNil(SimpleInlineEnumBodyParamOptNil_BodyEnum_Param$ bodyEnum); - public String multiBodyParam( + public Result multiBodyParam( String valueA, int valueB, SimpleRecord.Data valueC); - public String multiBodyParamOpt(); + public Result multiBodyParamOpt(); - public String multiBodyParamOpt(String valueA); + public Result multiBodyParamOpt(String valueA); - public String multiBodyParamOpt( + public Result multiBodyParamOpt( String valueA, Integer valueB); - public String multiBodyParamOpt( + public Result multiBodyParamOpt( String valueA, Integer valueB, SimpleRecord.Data valueC); - public String multiBodyParamNil( + public Result multiBodyParamNil( String valueA, Integer valueB, SimpleRecord.Data valueC); - public String multiBodyParamOptNil(); + public Result multiBodyParamOptNil(); - public String multiBodyParamOptNil(String valueA); + public Result multiBodyParamOptNil(String valueA); - public String multiBodyParamOptNil( + public Result multiBodyParamOptNil( String valueA, Integer valueB); - public String multiBodyParamOptNil( + public Result multiBodyParamOptNil( String valueA, Integer valueB, SimpleRecord.Data valueC); - public String multiBodyParamFirst(); + public Result multiBodyParamFirst(); - public String multiBodyParamFirst(String valueA); + public Result multiBodyParamFirst(String valueA); - public String multiBodyParamFirst( + public Result multiBodyParamFirst( String valueA, int valueB); - public String multiBodyParamFirst( + public Result multiBodyParamFirst( String valueA, int valueB, SimpleRecord.Data valueC); - public SimpleRecord.Data recordBodyParam(SimpleRecord.Data bodyRecord); + public Result recordBodyParam(SimpleRecord.Data bodyRecord); - public NilResult recordBodyParamOpt(); + public Result recordBodyParamOpt(); - public NilResult recordBodyParamOpt(SimpleRecord.Data bodyRecord); + public Result recordBodyParamOpt(SimpleRecord.Data bodyRecord); - public NilResult recordBodyParamNil(SimpleRecord.Data bodyRecord); + public Result recordBodyParamNil(SimpleRecord.Data bodyRecord); - public NilResult recordBodyParamOptNil(); + public Result recordBodyParamOptNil(); - public NilResult recordBodyParamOptNil(SimpleRecord.Data bodyRecord); + public Result recordBodyParamOptNil(SimpleRecord.Data bodyRecord); - public Union.Data unionBodyParam(Union.Data bodyUnion); + public Result unionBodyParam(Union.Data bodyUnion); - public NilResult unionBodyParamOpt(); + public Result unionBodyParamOpt(); - public NilResult unionBodyParamOpt(Union.Data bodyUnion); + public Result unionBodyParamOpt(Union.Data bodyUnion); - public NilResult unionBodyParamNil(Union.Data bodyUnion); + public Result unionBodyParamNil(Union.Data bodyUnion); - public NilResult unionBodyParamOptNil(); + public Result unionBodyParamOptNil(); - public NilResult unionBodyParamOptNil(Union.Data bodyUnion); + public Result unionBodyParamOptNil(Union.Data bodyUnion); - public PatchableRecord.Data patchableRecordBodyParam(PatchableRecord.Patch bodyRecord); + public Result patchableRecordBodyParam(PatchableRecord.Patch bodyRecord); - public PatchableRecord.Data patchableRecordBodyParamOpt(); + public Result patchableRecordBodyParamOpt(); - public PatchableRecord.Data patchableRecordBodyParamOpt(PatchableRecord.Patch bodyRecord); + public Result patchableRecordBodyParamOpt(PatchableRecord.Patch bodyRecord); - public PatchableRecord.Data patchableRecordBodyParamNil(PatchableRecord.Patch bodyRecord); + public Result patchableRecordBodyParamNil(PatchableRecord.Patch bodyRecord); - public PatchableRecord.Data patchableRecordBodyParamOptNil(); + public Result patchableRecordBodyParamOptNil(); - public PatchableRecord.Data patchableRecordBodyParamOptNil(PatchableRecord.Patch bodyRecord); + public Result patchableRecordBodyParamOptNil(PatchableRecord.Patch bodyRecord); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/HeaderParameterTypesService.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/HeaderParameterTypesService.java index b57aafc9..e25fe9f1 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/HeaderParameterTypesService.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/HeaderParameterTypesService.java @@ -34,223 +34,223 @@ public enum SimpleInlineEnumHeaderParamOptNil_HeaderValue_Param$ { C, D, } - public boolean simpleBooleanHeaderParam(boolean headerValue); + public Result simpleBooleanHeaderParam(boolean headerValue); - public NilResult simpleBooleanHeaderParamOpt(); + public Result simpleBooleanHeaderParamOpt(); - public NilResult simpleBooleanHeaderParamOpt(Boolean headerValue); + public Result simpleBooleanHeaderParamOpt(Boolean headerValue); - public NilResult simpleBooleanHeaderParamNil(Boolean headerValue); + public Result simpleBooleanHeaderParamNil(Boolean headerValue); - public NilResult simpleBooleanHeaderParamOptNil(); + public Result simpleBooleanHeaderParamOptNil(); - public NilResult simpleBooleanHeaderParamOptNil(Boolean headerValue); + public Result simpleBooleanHeaderParamOptNil(Boolean headerValue); - public short simpleShortHeaderParam(short headerValue); + public Result simpleShortHeaderParam(short headerValue); - public NilResult simpleShortHeaderParamOpt(); + public Result simpleShortHeaderParamOpt(); - public NilResult simpleShortHeaderParamOpt(Short headerValue); + public Result simpleShortHeaderParamOpt(Short headerValue); - public NilResult simpleShortHeaderParamNil(Short headerValue); + public Result simpleShortHeaderParamNil(Short headerValue); - public NilResult simpleShortHeaderParamOptNil(); + public Result simpleShortHeaderParamOptNil(); - public NilResult simpleShortHeaderParamOptNil(Short headerValue); + public Result simpleShortHeaderParamOptNil(Short headerValue); - public int simpleIntHeaderParam(int headerValue); + public Result simpleIntHeaderParam(int headerValue); - public NilResult simpleIntHeaderParamOpt(); + public Result simpleIntHeaderParamOpt(); - public NilResult simpleIntHeaderParamOpt(Integer headerValue); + public Result simpleIntHeaderParamOpt(Integer headerValue); - public NilResult simpleIntHeaderParamNil(Integer headerValue); + public Result simpleIntHeaderParamNil(Integer headerValue); - public NilResult simpleIntHeaderParamOptNil(); + public Result simpleIntHeaderParamOptNil(); - public NilResult simpleIntHeaderParamOptNil(Integer headerValue); + public Result simpleIntHeaderParamOptNil(Integer headerValue); - public long simpleLongHeaderParam(long headerValue); + public Result simpleLongHeaderParam(long headerValue); - public NilResult simpleLongHeaderParamOpt(); + public Result simpleLongHeaderParamOpt(); - public NilResult simpleLongHeaderParamOpt(Long headerValue); + public Result simpleLongHeaderParamOpt(Long headerValue); - public NilResult simpleLongHeaderParamNil(Long headerValue); + public Result simpleLongHeaderParamNil(Long headerValue); - public NilResult simpleLongHeaderParamOptNil(); + public Result simpleLongHeaderParamOptNil(); - public NilResult simpleLongHeaderParamOptNil(Long headerValue); + public Result simpleLongHeaderParamOptNil(Long headerValue); - public float simpleFloatHeaderParam(float headerValue); + public Result simpleFloatHeaderParam(float headerValue); - public NilResult simpleFloatHeaderParamOpt(); + public Result simpleFloatHeaderParamOpt(); - public NilResult simpleFloatHeaderParamOpt(Float headerValue); + public Result simpleFloatHeaderParamOpt(Float headerValue); - public NilResult simpleFloatHeaderParamNil(Float headerValue); + public Result simpleFloatHeaderParamNil(Float headerValue); - public NilResult simpleFloatHeaderParamOptNil(); + public Result simpleFloatHeaderParamOptNil(); - public NilResult simpleFloatHeaderParamOptNil(Float headerValue); + public Result simpleFloatHeaderParamOptNil(Float headerValue); - public double simpleDoubleHeaderParam(double headerValue); + public Result simpleDoubleHeaderParam(double headerValue); - public NilResult simpleDoubleHeaderParamOpt(); + public Result simpleDoubleHeaderParamOpt(); - public NilResult simpleDoubleHeaderParamOpt(Double headerValue); + public Result simpleDoubleHeaderParamOpt(Double headerValue); - public NilResult simpleDoubleHeaderParamNil(Double headerValue); + public Result simpleDoubleHeaderParamNil(Double headerValue); - public NilResult simpleDoubleHeaderParamOptNil(); + public Result simpleDoubleHeaderParamOptNil(); - public NilResult simpleDoubleHeaderParamOptNil(Double headerValue); + public Result simpleDoubleHeaderParamOptNil(Double headerValue); - public String simpleStringHeaderParam(String headerValue); + public Result simpleStringHeaderParam(String headerValue); - public NilResult simpleStringHeaderParamOpt(); + public Result simpleStringHeaderParamOpt(); - public NilResult simpleStringHeaderParamOpt(String headerValue); + public Result simpleStringHeaderParamOpt(String headerValue); - public NilResult simpleStringHeaderParamNil(String headerValue); + public Result simpleStringHeaderParamNil(String headerValue); - public NilResult simpleStringHeaderParamOptNil(); + public Result simpleStringHeaderParamOptNil(); - public NilResult simpleStringHeaderParamOptNil(String headerValue); + public Result simpleStringHeaderParamOptNil(String headerValue); - public LocalDate simpleLocalDateHeaderParam(LocalDate headerValue); + public Result simpleLocalDateHeaderParam(LocalDate headerValue); - public NilResult simpleLocalDateHeaderParamOpt(); + public Result simpleLocalDateHeaderParamOpt(); - public NilResult simpleLocalDateHeaderParamOpt(LocalDate headerValue); + public Result simpleLocalDateHeaderParamOpt(LocalDate headerValue); - public NilResult simpleLocalDateHeaderParamNil(LocalDate headerValue); + public Result simpleLocalDateHeaderParamNil(LocalDate headerValue); - public NilResult simpleLocalDateHeaderParamOptNil(); + public Result simpleLocalDateHeaderParamOptNil(); - public NilResult simpleLocalDateHeaderParamOptNil(LocalDate headerValue); + public Result simpleLocalDateHeaderParamOptNil(LocalDate headerValue); - public LocalDateTime simpleLocalDateTimeHeaderParam(LocalDateTime headerValue); + public Result simpleLocalDateTimeHeaderParam(LocalDateTime headerValue); - public NilResult simpleLocalDateTimeHeaderParamOpt(); + public Result simpleLocalDateTimeHeaderParamOpt(); - public NilResult simpleLocalDateTimeHeaderParamOpt(LocalDateTime headerValue); + public Result simpleLocalDateTimeHeaderParamOpt(LocalDateTime headerValue); - public NilResult simpleLocalDateTimeHeaderParamNil(LocalDateTime headerValue); + public Result simpleLocalDateTimeHeaderParamNil(LocalDateTime headerValue); - public NilResult simpleLocalDateTimeHeaderParamOptNil(); + public Result simpleLocalDateTimeHeaderParamOptNil(); - public NilResult simpleLocalDateTimeHeaderParamOptNil(LocalDateTime headerValue); + public Result simpleLocalDateTimeHeaderParamOptNil(LocalDateTime headerValue); - public LocalTime simpleLocalTimeHeaderParam(LocalTime headerValue); + public Result simpleLocalTimeHeaderParam(LocalTime headerValue); - public NilResult simpleLocalTimeHeaderParamOpt(); + public Result simpleLocalTimeHeaderParamOpt(); - public NilResult simpleLocalTimeHeaderParamOpt(LocalTime headerValue); + public Result simpleLocalTimeHeaderParamOpt(LocalTime headerValue); - public NilResult simpleLocalTimeHeaderParamNil(LocalTime headerValue); + public Result simpleLocalTimeHeaderParamNil(LocalTime headerValue); - public NilResult simpleLocalTimeHeaderParamOptNil(); + public Result simpleLocalTimeHeaderParamOptNil(); - public NilResult simpleLocalTimeHeaderParamOptNil(LocalTime headerValue); + public Result simpleLocalTimeHeaderParamOptNil(LocalTime headerValue); - public OffsetDateTime simpleOffsetDateTimeHeaderParam(OffsetDateTime headerValue); + public Result simpleOffsetDateTimeHeaderParam(OffsetDateTime headerValue); - public NilResult simpleOffsetDateTimeHeaderParamOpt(); + public Result simpleOffsetDateTimeHeaderParamOpt(); - public NilResult simpleOffsetDateTimeHeaderParamOpt(OffsetDateTime headerValue); + public Result simpleOffsetDateTimeHeaderParamOpt(OffsetDateTime headerValue); - public NilResult simpleOffsetDateTimeHeaderParamNil(OffsetDateTime headerValue); + public Result simpleOffsetDateTimeHeaderParamNil(OffsetDateTime headerValue); - public NilResult simpleOffsetDateTimeHeaderParamOptNil(); + public Result simpleOffsetDateTimeHeaderParamOptNil(); - public NilResult simpleOffsetDateTimeHeaderParamOptNil(OffsetDateTime headerValue); + public Result simpleOffsetDateTimeHeaderParamOptNil(OffsetDateTime headerValue); - public ZonedDateTime simpleZonedDateTimeHeaderParam(ZonedDateTime headerValue); + public Result simpleZonedDateTimeHeaderParam(ZonedDateTime headerValue); - public NilResult simpleZonedDateTimeHeaderParamOpt(); + public Result simpleZonedDateTimeHeaderParamOpt(); - public NilResult simpleZonedDateTimeHeaderParamOpt(ZonedDateTime headerValue); + public Result simpleZonedDateTimeHeaderParamOpt(ZonedDateTime headerValue); - public NilResult simpleZonedDateTimeHeaderParamNil(ZonedDateTime headerValue); + public Result simpleZonedDateTimeHeaderParamNil(ZonedDateTime headerValue); - public NilResult simpleZonedDateTimeHeaderParamOptNil(); + public Result simpleZonedDateTimeHeaderParamOptNil(); - public NilResult simpleZonedDateTimeHeaderParamOptNil(ZonedDateTime headerValue); + public Result simpleZonedDateTimeHeaderParamOptNil(ZonedDateTime headerValue); - public ZoneId simpleScalarHeaderParam(ZoneId headerValue); + public Result simpleScalarHeaderParam(ZoneId headerValue); - public NilResult simpleScalarHeaderParamOpt(); + public Result simpleScalarHeaderParamOpt(); - public NilResult simpleScalarHeaderParamOpt(ZoneId headerValue); + public Result simpleScalarHeaderParamOpt(ZoneId headerValue); - public NilResult simpleScalarHeaderParamNil(ZoneId headerValue); + public Result simpleScalarHeaderParamNil(ZoneId headerValue); - public NilResult simpleScalarHeaderParamOptNil(); + public Result simpleScalarHeaderParamOptNil(); - public NilResult simpleScalarHeaderParamOptNil(ZoneId headerValue); + public Result simpleScalarHeaderParamOptNil(ZoneId headerValue); - public SampleEnum simpleEnumHeaderParam(SampleEnum headerValue); + public Result simpleEnumHeaderParam(SampleEnum headerValue); - public NilResult simpleEnumHeaderParamOpt(); + public Result simpleEnumHeaderParamOpt(); - public NilResult simpleEnumHeaderParamOpt(SampleEnum headerValue); + public Result simpleEnumHeaderParamOpt(SampleEnum headerValue); - public NilResult simpleEnumHeaderParamNil(SampleEnum headerValue); + public Result simpleEnumHeaderParamNil(SampleEnum headerValue); - public NilResult simpleEnumHeaderParamOptNil(); + public Result simpleEnumHeaderParamOptNil(); - public NilResult simpleEnumHeaderParamOptNil(SampleEnum headerValue); + public Result simpleEnumHeaderParamOptNil(SampleEnum headerValue); - public SimpleInlineEnumHeaderParam_Result$ simpleInlineEnumHeaderParam(SimpleInlineEnumHeaderParam_HeaderValue_Param$ headerValue); + public Result simpleInlineEnumHeaderParam(SimpleInlineEnumHeaderParam_HeaderValue_Param$ headerValue); - public NilResult simpleInlineEnumHeaderParamOpt(); + public Result simpleInlineEnumHeaderParamOpt(); - public NilResult simpleInlineEnumHeaderParamOpt(SimpleInlineEnumHeaderParamOpt_HeaderValue_Param$ headerValue); + public Result simpleInlineEnumHeaderParamOpt(SimpleInlineEnumHeaderParamOpt_HeaderValue_Param$ headerValue); - public NilResult simpleInlineEnumHeaderParamNil(SimpleInlineEnumHeaderParamNil_HeaderValue_Param$ headerValue); + public Result simpleInlineEnumHeaderParamNil(SimpleInlineEnumHeaderParamNil_HeaderValue_Param$ headerValue); - public NilResult simpleInlineEnumHeaderParamOptNil(); + public Result simpleInlineEnumHeaderParamOptNil(); - public NilResult simpleInlineEnumHeaderParamOptNil(SimpleInlineEnumHeaderParamOptNil_HeaderValue_Param$ headerValue); + public Result simpleInlineEnumHeaderParamOptNil(SimpleInlineEnumHeaderParamOptNil_HeaderValue_Param$ headerValue); - public String multiHeaderParam( + public Result multiHeaderParam( String valueA, int valueB); - public List multiHeaderParamOpt(); + public Result, RSDError.$GenericError> multiHeaderParamOpt(); - public List multiHeaderParamOpt(String valueA); + public Result, RSDError.$GenericError> multiHeaderParamOpt(String valueA); - public List multiHeaderParamOpt( + public Result, RSDError.$GenericError> multiHeaderParamOpt( String valueA, Integer valueB); - public List multiHeaderParamNil( + public Result, RSDError.$GenericError> multiHeaderParamNil( String valueA, Integer valueB); - public List multiHeaderParamOptNil(); + public Result, RSDError.$GenericError> multiHeaderParamOptNil(); - public List multiHeaderParamOptNil(String valueA); + public Result, RSDError.$GenericError> multiHeaderParamOptNil(String valueA); - public List multiHeaderParamOptNil( + public Result, RSDError.$GenericError> multiHeaderParamOptNil( String valueA, Integer valueB); - public SimpleRecord.Data recordHeaderParam(SimpleRecord.Data headerValue); + public Result recordHeaderParam(SimpleRecord.Data headerValue); - public NilResult recordHeaderParamOpt(); + public Result recordHeaderParamOpt(); - public NilResult recordHeaderParamOpt(SimpleRecord.Data headerValue); + public Result recordHeaderParamOpt(SimpleRecord.Data headerValue); - public NilResult recordHeaderParamNil(SimpleRecord.Data headerValue); + public Result recordHeaderParamNil(SimpleRecord.Data headerValue); - public NilResult recordHeaderParamOptNil(); + public Result recordHeaderParamOptNil(); - public NilResult recordHeaderParamOptNil(SimpleRecord.Data headerValue); + public Result recordHeaderParamOptNil(SimpleRecord.Data headerValue); - public void mixed( + public Result mixed( String pathString, int pathNumber, String headerString, diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListBodyParameterTypesService.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListBodyParameterTypesService.java index 74f40b6a..ffbd74c6 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListBodyParameterTypesService.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListBodyParameterTypesService.java @@ -34,232 +34,232 @@ public enum ListInlineEnumBodyParamOptNil_BodyEnum_Param$ { C, D, } - public List listBooleanBodyParam(List bodyBoolean); + public Result, RSDError.$GenericError> listBooleanBodyParam(List bodyBoolean); - public NilResult listBooleanBodyParamOpt(); + public Result listBooleanBodyParamOpt(); - public NilResult listBooleanBodyParamOpt(List bodyBoolean); + public Result listBooleanBodyParamOpt(List bodyBoolean); - public NilResult listBooleanBodyParamNil(List bodyBoolean); + public Result listBooleanBodyParamNil(List bodyBoolean); - public NilResult listBooleanBodyParamOptNil(); + public Result listBooleanBodyParamOptNil(); - public NilResult listBooleanBodyParamOptNil(List bodyBoolean); + public Result listBooleanBodyParamOptNil(List bodyBoolean); - public List listShortBodyParam(List bodyShort); + public Result, RSDError.$GenericError> listShortBodyParam(List bodyShort); - public NilResult listShortBodyParamOpt(); + public Result listShortBodyParamOpt(); - public NilResult listShortBodyParamOpt(List bodyShort); + public Result listShortBodyParamOpt(List bodyShort); - public NilResult listShortBodyParamNil(List bodyShort); + public Result listShortBodyParamNil(List bodyShort); - public NilResult listShortBodyParamOptNil(); + public Result listShortBodyParamOptNil(); - public NilResult listShortBodyParamOptNil(List bodyShort); + public Result listShortBodyParamOptNil(List bodyShort); - public List listIntBodyParam(List bodyInt); + public Result, RSDError.$GenericError> listIntBodyParam(List bodyInt); - public NilResult listIntBodyParamOpt(); + public Result listIntBodyParamOpt(); - public NilResult listIntBodyParamOpt(List bodyInt); + public Result listIntBodyParamOpt(List bodyInt); - public NilResult listIntBodyParamNil(List bodyInt); + public Result listIntBodyParamNil(List bodyInt); - public NilResult listIntBodyParamOptNil(); + public Result listIntBodyParamOptNil(); - public NilResult listIntBodyParamOptNil(List bodyInt); + public Result listIntBodyParamOptNil(List bodyInt); - public List listLongBodyParam(List bodyLong); + public Result, RSDError.$GenericError> listLongBodyParam(List bodyLong); - public NilResult listLongBodyParamOpt(); + public Result listLongBodyParamOpt(); - public NilResult listLongBodyParamOpt(List bodyLong); + public Result listLongBodyParamOpt(List bodyLong); - public NilResult listLongBodyParamNil(List bodyLong); + public Result listLongBodyParamNil(List bodyLong); - public NilResult listLongBodyParamOptNil(); + public Result listLongBodyParamOptNil(); - public NilResult listLongBodyParamOptNil(List bodyLong); + public Result listLongBodyParamOptNil(List bodyLong); - public List listFloatBodyParam(List bodyFloat); + public Result, RSDError.$GenericError> listFloatBodyParam(List bodyFloat); - public NilResult listFloatBodyParamOpt(); + public Result listFloatBodyParamOpt(); - public NilResult listFloatBodyParamOpt(List bodyFloat); + public Result listFloatBodyParamOpt(List bodyFloat); - public NilResult listFloatBodyParamNil(List bodyFloat); + public Result listFloatBodyParamNil(List bodyFloat); - public NilResult listFloatBodyParamOptNil(); + public Result listFloatBodyParamOptNil(); - public NilResult listFloatBodyParamOptNil(List bodyFloat); + public Result listFloatBodyParamOptNil(List bodyFloat); - public List listDoubleBodyParam(List bodyDouble); + public Result, RSDError.$GenericError> listDoubleBodyParam(List bodyDouble); - public NilResult listDoubleBodyParamOpt(); + public Result listDoubleBodyParamOpt(); - public NilResult listDoubleBodyParamOpt(List bodyDouble); + public Result listDoubleBodyParamOpt(List bodyDouble); - public NilResult listDoubleBodyParamNil(List bodyDouble); + public Result listDoubleBodyParamNil(List bodyDouble); - public NilResult listDoubleBodyParamOptNil(); + public Result listDoubleBodyParamOptNil(); - public NilResult listDoubleBodyParamOptNil(List bodyDouble); + public Result listDoubleBodyParamOptNil(List bodyDouble); - public List listStringBodyParam(List bodyString); + public Result, RSDError.$GenericError> listStringBodyParam(List bodyString); - public NilResult listStringBodyParamOpt(); + public Result listStringBodyParamOpt(); - public NilResult listStringBodyParamOpt(List bodyString); + public Result listStringBodyParamOpt(List bodyString); - public NilResult listStringBodyParamNil(List bodyString); + public Result listStringBodyParamNil(List bodyString); - public NilResult listStringBodyParamOptNil(); + public Result listStringBodyParamOptNil(); - public NilResult listStringBodyParamOptNil(List bodyString); + public Result listStringBodyParamOptNil(List bodyString); - public List listLocalDateBodyParam(List bodyLocalDate); + public Result, RSDError.$GenericError> listLocalDateBodyParam(List bodyLocalDate); - public NilResult listLocalDateBodyParamOpt(); + public Result listLocalDateBodyParamOpt(); - public NilResult listLocalDateBodyParamOpt(List bodyLocalDate); + public Result listLocalDateBodyParamOpt(List bodyLocalDate); - public NilResult listLocalDateBodyParamNil(List bodyLocalDate); + public Result listLocalDateBodyParamNil(List bodyLocalDate); - public NilResult listLocalDateBodyParamOptNil(); + public Result listLocalDateBodyParamOptNil(); - public NilResult listLocalDateBodyParamOptNil(List bodyLocalDate); + public Result listLocalDateBodyParamOptNil(List bodyLocalDate); - public List listLocalDateTimeBodyParam(List bodyLocalDateTime); + public Result, RSDError.$GenericError> listLocalDateTimeBodyParam(List bodyLocalDateTime); - public NilResult listLocalDateTimeBodyParamOpt(); + public Result listLocalDateTimeBodyParamOpt(); - public NilResult listLocalDateTimeBodyParamOpt(List bodyLocalDateTime); + public Result listLocalDateTimeBodyParamOpt(List bodyLocalDateTime); - public NilResult listLocalDateTimeBodyParamNil(List bodyLocalDateTime); + public Result listLocalDateTimeBodyParamNil(List bodyLocalDateTime); - public NilResult listLocalDateTimeBodyParamOptNil(); + public Result listLocalDateTimeBodyParamOptNil(); - public NilResult listLocalDateTimeBodyParamOptNil(List bodyLocalDateTime); + public Result listLocalDateTimeBodyParamOptNil(List bodyLocalDateTime); - public List listLocalTimeBodyParam(List bodyLocalTime); + public Result, RSDError.$GenericError> listLocalTimeBodyParam(List bodyLocalTime); - public NilResult listLocalTimeBodyParamOpt(); + public Result listLocalTimeBodyParamOpt(); - public NilResult listLocalTimeBodyParamOpt(List bodyLocalTime); + public Result listLocalTimeBodyParamOpt(List bodyLocalTime); - public NilResult listLocalTimeBodyParamNil(List bodyLocalTime); + public Result listLocalTimeBodyParamNil(List bodyLocalTime); - public NilResult listLocalTimeBodyParamOptNil(); + public Result listLocalTimeBodyParamOptNil(); - public NilResult listLocalTimeBodyParamOptNil(List bodyLocalTime); + public Result listLocalTimeBodyParamOptNil(List bodyLocalTime); - public List listOffsetDateTimeBodyParam(List bodyOffsetDateTime); + public Result, RSDError.$GenericError> listOffsetDateTimeBodyParam(List bodyOffsetDateTime); - public NilResult listOffsetDateTimeBodyParamOpt(); + public Result listOffsetDateTimeBodyParamOpt(); - public NilResult listOffsetDateTimeBodyParamOpt(List bodyOffsetDateTime); + public Result listOffsetDateTimeBodyParamOpt(List bodyOffsetDateTime); - public NilResult listOffsetDateTimeBodyParamNil(List bodyOffsetDateTime); + public Result listOffsetDateTimeBodyParamNil(List bodyOffsetDateTime); - public NilResult listOffsetDateTimeBodyParamOptNil(); + public Result listOffsetDateTimeBodyParamOptNil(); - public NilResult listOffsetDateTimeBodyParamOptNil(List bodyOffsetDateTime); + public Result listOffsetDateTimeBodyParamOptNil(List bodyOffsetDateTime); - public List listZonedDateTimeBodyParam(List bodyZonedDateTime); + public Result, RSDError.$GenericError> listZonedDateTimeBodyParam(List bodyZonedDateTime); - public NilResult listZonedDateTimeBodyParamOpt(); + public Result listZonedDateTimeBodyParamOpt(); - public NilResult listZonedDateTimeBodyParamOpt(List bodyZonedDateTime); + public Result listZonedDateTimeBodyParamOpt(List bodyZonedDateTime); - public NilResult listZonedDateTimeBodyParamNil(List bodyZonedDateTime); + public Result listZonedDateTimeBodyParamNil(List bodyZonedDateTime); - public NilResult listZonedDateTimeBodyParamOptNil(); + public Result listZonedDateTimeBodyParamOptNil(); - public NilResult listZonedDateTimeBodyParamOptNil(List bodyZonedDateTime); + public Result listZonedDateTimeBodyParamOptNil(List bodyZonedDateTime); - public List listScalarBodyParam(List bodyScalar); + public Result, RSDError.$GenericError> listScalarBodyParam(List bodyScalar); - public NilResult listScalarBodyParamOpt(); + public Result listScalarBodyParamOpt(); - public NilResult listScalarBodyParamOpt(List bodyScalar); + public Result listScalarBodyParamOpt(List bodyScalar); - public NilResult listScalarBodyParamNil(List bodyScalar); + public Result listScalarBodyParamNil(List bodyScalar); - public NilResult listScalarBodyParamOptNil(); + public Result listScalarBodyParamOptNil(); - public NilResult listScalarBodyParamOptNil(List bodyScalar); + public Result listScalarBodyParamOptNil(List bodyScalar); - public List listEnumBodyParam(List bodyEnum); + public Result, RSDError.$GenericError> listEnumBodyParam(List bodyEnum); - public NilResult listEnumBodyParamOpt(); + public Result listEnumBodyParamOpt(); - public NilResult listEnumBodyParamOpt(List bodyEnum); + public Result listEnumBodyParamOpt(List bodyEnum); - public NilResult listEnumBodyParamNil(List bodyEnum); + public Result listEnumBodyParamNil(List bodyEnum); - public NilResult listEnumBodyParamOptNil(); + public Result listEnumBodyParamOptNil(); - public NilResult listEnumBodyParamOptNil(List bodyEnum); + public Result listEnumBodyParamOptNil(List bodyEnum); - public List listInlineEnumBodyParam(List bodyEnum); + public Result, RSDError.$GenericError> listInlineEnumBodyParam(List bodyEnum); - public NilResult listInlineEnumBodyParamOpt(); + public Result listInlineEnumBodyParamOpt(); - public NilResult listInlineEnumBodyParamOpt(List bodyEnum); + public Result listInlineEnumBodyParamOpt(List bodyEnum); - public NilResult listInlineEnumBodyParamNil(List bodyEnum); + public Result listInlineEnumBodyParamNil(List bodyEnum); - public NilResult listInlineEnumBodyParamOptNil(); + public Result listInlineEnumBodyParamOptNil(); - public NilResult listInlineEnumBodyParamOptNil(List bodyEnum); + public Result listInlineEnumBodyParamOptNil(List bodyEnum); - public String listMultiBodyParam( + public Result listMultiBodyParam( List valueA, List valueB, List valueC); - public List listMultiBodyParamOpt(); + public Result, RSDError.$GenericError> listMultiBodyParamOpt(); - public List listMultiBodyParamOpt(List valueA); + public Result, RSDError.$GenericError> listMultiBodyParamOpt(List valueA); - public List listMultiBodyParamOpt( + public Result, RSDError.$GenericError> listMultiBodyParamOpt( List valueA, List valueB); - public List listMultiBodyParamOpt( + public Result, RSDError.$GenericError> listMultiBodyParamOpt( List valueA, List valueB, List valueC); - public List listMultiBodyParamNil( + public Result, RSDError.$GenericError> listMultiBodyParamNil( List valueA, List valueB, List valueC); - public List listMultiBodyParamOptNil(); + public Result, RSDError.$GenericError> listMultiBodyParamOptNil(); - public List listMultiBodyParamOptNil(List valueA); + public Result, RSDError.$GenericError> listMultiBodyParamOptNil(List valueA); - public List listMultiBodyParamOptNil( + public Result, RSDError.$GenericError> listMultiBodyParamOptNil( List valueA, List valueB); - public List listMultiBodyParamOptNil( + public Result, RSDError.$GenericError> listMultiBodyParamOptNil( List valueA, List valueB, List valueC); - public List listRecordBodyParam(List bodyRecord); + public Result, RSDError.$GenericError> listRecordBodyParam(List bodyRecord); - public NilResult listRecordBodyParamOpt(); + public Result listRecordBodyParamOpt(); - public NilResult listRecordBodyParamOpt(List bodyRecord); + public Result listRecordBodyParamOpt(List bodyRecord); - public NilResult listRecordBodyParamNil(List bodyRecord); + public Result listRecordBodyParamNil(List bodyRecord); - public NilResult listRecordBodyParamOptNil(); + public Result listRecordBodyParamOptNil(); - public NilResult listRecordBodyParamOptNil(List bodyRecord); + public Result listRecordBodyParamOptNil(List bodyRecord); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListHeaderParameterTypesService.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListHeaderParameterTypesService.java index e97f989b..609344ee 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListHeaderParameterTypesService.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListHeaderParameterTypesService.java @@ -34,232 +34,232 @@ public enum ListInlineEnumHeaderParamOptNil_HeaderValue_Param$ { C, D, } - public List listBooleanHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listBooleanHeaderParam(List headerValue); - public NilResult listBooleanHeaderParamOpt(); + public Result listBooleanHeaderParamOpt(); - public NilResult listBooleanHeaderParamOpt(List headerValue); + public Result listBooleanHeaderParamOpt(List headerValue); - public NilResult listBooleanHeaderParamNil(List headerValue); + public Result listBooleanHeaderParamNil(List headerValue); - public NilResult listBooleanHeaderParamOptNil(); + public Result listBooleanHeaderParamOptNil(); - public NilResult listBooleanHeaderParamOptNil(List headerValue); + public Result listBooleanHeaderParamOptNil(List headerValue); - public List listShortHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listShortHeaderParam(List headerValue); - public NilResult listShortHeaderParamOpt(); + public Result listShortHeaderParamOpt(); - public NilResult listShortHeaderParamOpt(List headerValue); + public Result listShortHeaderParamOpt(List headerValue); - public NilResult listShortHeaderParamNil(List headerValue); + public Result listShortHeaderParamNil(List headerValue); - public NilResult listShortHeaderParamOptNil(); + public Result listShortHeaderParamOptNil(); - public NilResult listShortHeaderParamOptNil(List headerValue); + public Result listShortHeaderParamOptNil(List headerValue); - public List listIntHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listIntHeaderParam(List headerValue); - public NilResult listIntHeaderParamOpt(); + public Result listIntHeaderParamOpt(); - public NilResult listIntHeaderParamOpt(List headerValue); + public Result listIntHeaderParamOpt(List headerValue); - public NilResult listIntHeaderParamNil(List headerValue); + public Result listIntHeaderParamNil(List headerValue); - public NilResult listIntHeaderParamOptNil(); + public Result listIntHeaderParamOptNil(); - public NilResult listIntHeaderParamOptNil(List headerValue); + public Result listIntHeaderParamOptNil(List headerValue); - public List listLongHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listLongHeaderParam(List headerValue); - public NilResult listLongHeaderParamOpt(); + public Result listLongHeaderParamOpt(); - public NilResult listLongHeaderParamOpt(List headerValue); + public Result listLongHeaderParamOpt(List headerValue); - public NilResult listLongHeaderParamNil(List headerValue); + public Result listLongHeaderParamNil(List headerValue); - public NilResult listLongHeaderParamOptNil(); + public Result listLongHeaderParamOptNil(); - public NilResult listLongHeaderParamOptNil(List headerValue); + public Result listLongHeaderParamOptNil(List headerValue); - public List listFloatHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listFloatHeaderParam(List headerValue); - public NilResult listFloatHeaderParamOpt(); + public Result listFloatHeaderParamOpt(); - public NilResult listFloatHeaderParamOpt(List headerValue); + public Result listFloatHeaderParamOpt(List headerValue); - public NilResult listFloatHeaderParamNil(List headerValue); + public Result listFloatHeaderParamNil(List headerValue); - public NilResult listFloatHeaderParamOptNil(); + public Result listFloatHeaderParamOptNil(); - public NilResult listFloatHeaderParamOptNil(List headerValue); + public Result listFloatHeaderParamOptNil(List headerValue); - public List listDoubleHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listDoubleHeaderParam(List headerValue); - public NilResult listDoubleHeaderParamOpt(); + public Result listDoubleHeaderParamOpt(); - public NilResult listDoubleHeaderParamOpt(List headerValue); + public Result listDoubleHeaderParamOpt(List headerValue); - public NilResult listDoubleHeaderParamNil(List headerValue); + public Result listDoubleHeaderParamNil(List headerValue); - public NilResult listDoubleHeaderParamOptNil(); + public Result listDoubleHeaderParamOptNil(); - public NilResult listDoubleHeaderParamOptNil(List headerValue); + public Result listDoubleHeaderParamOptNil(List headerValue); - public List listStringHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listStringHeaderParam(List headerValue); - public NilResult listStringHeaderParamOpt(); + public Result listStringHeaderParamOpt(); - public NilResult listStringHeaderParamOpt(List headerValue); + public Result listStringHeaderParamOpt(List headerValue); - public NilResult listStringHeaderParamNil(List headerValue); + public Result listStringHeaderParamNil(List headerValue); - public NilResult listStringHeaderParamOptNil(); + public Result listStringHeaderParamOptNil(); - public NilResult listStringHeaderParamOptNil(List headerValue); + public Result listStringHeaderParamOptNil(List headerValue); - public List listLocalDateHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listLocalDateHeaderParam(List headerValue); - public NilResult listLocalDateHeaderParamOpt(); + public Result listLocalDateHeaderParamOpt(); - public NilResult listLocalDateHeaderParamOpt(List headerValue); + public Result listLocalDateHeaderParamOpt(List headerValue); - public NilResult listLocalDateHeaderParamNil(List headerValue); + public Result listLocalDateHeaderParamNil(List headerValue); - public NilResult listLocalDateHeaderParamOptNil(); + public Result listLocalDateHeaderParamOptNil(); - public NilResult listLocalDateHeaderParamOptNil(List headerValue); + public Result listLocalDateHeaderParamOptNil(List headerValue); - public List listLocalDateTimeHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listLocalDateTimeHeaderParam(List headerValue); - public NilResult listLocalDateTimeHeaderParamOpt(); + public Result listLocalDateTimeHeaderParamOpt(); - public NilResult listLocalDateTimeHeaderParamOpt(List headerValue); + public Result listLocalDateTimeHeaderParamOpt(List headerValue); - public NilResult listLocalDateTimeHeaderParamNil(List headerValue); + public Result listLocalDateTimeHeaderParamNil(List headerValue); - public NilResult listLocalDateTimeHeaderParamOptNil(); + public Result listLocalDateTimeHeaderParamOptNil(); - public NilResult listLocalDateTimeHeaderParamOptNil(List headerValue); + public Result listLocalDateTimeHeaderParamOptNil(List headerValue); - public List listLocalTimeHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listLocalTimeHeaderParam(List headerValue); - public NilResult listLocalTimeHeaderParamOpt(); + public Result listLocalTimeHeaderParamOpt(); - public NilResult listLocalTimeHeaderParamOpt(List headerValue); + public Result listLocalTimeHeaderParamOpt(List headerValue); - public NilResult listLocalTimeHeaderParamNil(List headerValue); + public Result listLocalTimeHeaderParamNil(List headerValue); - public NilResult listLocalTimeHeaderParamOptNil(); + public Result listLocalTimeHeaderParamOptNil(); - public NilResult listLocalTimeHeaderParamOptNil(List headerValue); + public Result listLocalTimeHeaderParamOptNil(List headerValue); - public List listOffsetDateTimeHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listOffsetDateTimeHeaderParam(List headerValue); - public NilResult listOffsetDateTimeHeaderParamOpt(); + public Result listOffsetDateTimeHeaderParamOpt(); - public NilResult listOffsetDateTimeHeaderParamOpt(List headerValue); + public Result listOffsetDateTimeHeaderParamOpt(List headerValue); - public NilResult listOffsetDateTimeHeaderParamNil(List headerValue); + public Result listOffsetDateTimeHeaderParamNil(List headerValue); - public NilResult listOffsetDateTimeHeaderParamOptNil(); + public Result listOffsetDateTimeHeaderParamOptNil(); - public NilResult listOffsetDateTimeHeaderParamOptNil(List headerValue); + public Result listOffsetDateTimeHeaderParamOptNil(List headerValue); - public List listZonedDateTimeHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listZonedDateTimeHeaderParam(List headerValue); - public NilResult listZonedDateTimeHeaderParamOpt(); + public Result listZonedDateTimeHeaderParamOpt(); - public NilResult listZonedDateTimeHeaderParamOpt(List headerValue); + public Result listZonedDateTimeHeaderParamOpt(List headerValue); - public NilResult listZonedDateTimeHeaderParamNil(List headerValue); + public Result listZonedDateTimeHeaderParamNil(List headerValue); - public NilResult listZonedDateTimeHeaderParamOptNil(); + public Result listZonedDateTimeHeaderParamOptNil(); - public NilResult listZonedDateTimeHeaderParamOptNil(List headerValue); + public Result listZonedDateTimeHeaderParamOptNil(List headerValue); - public List listScalarHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listScalarHeaderParam(List headerValue); - public NilResult listScalarHeaderParamOpt(); + public Result listScalarHeaderParamOpt(); - public NilResult listScalarHeaderParamOpt(List headerValue); + public Result listScalarHeaderParamOpt(List headerValue); - public NilResult listScalarHeaderParamNil(List headerValue); + public Result listScalarHeaderParamNil(List headerValue); - public NilResult listScalarHeaderParamOptNil(); + public Result listScalarHeaderParamOptNil(); - public NilResult listScalarHeaderParamOptNil(List headerValue); + public Result listScalarHeaderParamOptNil(List headerValue); - public List listEnumHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listEnumHeaderParam(List headerValue); - public NilResult listEnumHeaderParamOpt(); + public Result listEnumHeaderParamOpt(); - public NilResult listEnumHeaderParamOpt(List headerValue); + public Result listEnumHeaderParamOpt(List headerValue); - public NilResult listEnumHeaderParamNil(List headerValue); + public Result listEnumHeaderParamNil(List headerValue); - public NilResult listEnumHeaderParamOptNil(); + public Result listEnumHeaderParamOptNil(); - public NilResult listEnumHeaderParamOptNil(List headerValue); + public Result listEnumHeaderParamOptNil(List headerValue); - public List listInlineEnumHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listInlineEnumHeaderParam(List headerValue); - public NilResult listInlineEnumHeaderParamOpt(); + public Result listInlineEnumHeaderParamOpt(); - public NilResult listInlineEnumHeaderParamOpt(List headerValue); + public Result listInlineEnumHeaderParamOpt(List headerValue); - public NilResult listInlineEnumHeaderParamNil(List headerValue); + public Result listInlineEnumHeaderParamNil(List headerValue); - public NilResult listInlineEnumHeaderParamOptNil(); + public Result listInlineEnumHeaderParamOptNil(); - public NilResult listInlineEnumHeaderParamOptNil(List headerValue); + public Result listInlineEnumHeaderParamOptNil(List headerValue); - public String listMultiHeaderParam( + public Result listMultiHeaderParam( List valueA, List valueB, List valueC); - public List listMultiHeaderParamOpt(); + public Result, RSDError.$GenericError> listMultiHeaderParamOpt(); - public List listMultiHeaderParamOpt(List valueA); + public Result, RSDError.$GenericError> listMultiHeaderParamOpt(List valueA); - public List listMultiHeaderParamOpt( + public Result, RSDError.$GenericError> listMultiHeaderParamOpt( List valueA, List valueB); - public List listMultiHeaderParamOpt( + public Result, RSDError.$GenericError> listMultiHeaderParamOpt( List valueA, List valueB, List valueC); - public List listMultiHeaderParamNil( + public Result, RSDError.$GenericError> listMultiHeaderParamNil( List valueA, List valueB, List valueC); - public List listMultiHeaderParamOptNil(); + public Result, RSDError.$GenericError> listMultiHeaderParamOptNil(); - public List listMultiHeaderParamOptNil(List valueA); + public Result, RSDError.$GenericError> listMultiHeaderParamOptNil(List valueA); - public List listMultiHeaderParamOptNil( + public Result, RSDError.$GenericError> listMultiHeaderParamOptNil( List valueA, List valueB); - public List listMultiHeaderParamOptNil( + public Result, RSDError.$GenericError> listMultiHeaderParamOptNil( List valueA, List valueB, List valueC); - public List listRecordHeaderParam(List headerValue); + public Result, RSDError.$GenericError> listRecordHeaderParam(List headerValue); - public NilResult listRecordHeaderParamOpt(); + public Result listRecordHeaderParamOpt(); - public NilResult listRecordHeaderParamOpt(List headerValue); + public Result listRecordHeaderParamOpt(List headerValue); - public NilResult listRecordHeaderParamNil(List headerValue); + public Result listRecordHeaderParamNil(List headerValue); - public NilResult listRecordHeaderParamOptNil(); + public Result listRecordHeaderParamOptNil(); - public NilResult listRecordHeaderParamOptNil(List headerValue); + public Result listRecordHeaderParamOptNil(List headerValue); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListQueryParameterTypesService.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListQueryParameterTypesService.java index d436b5f1..42a45443 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListQueryParameterTypesService.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListQueryParameterTypesService.java @@ -21,41 +21,41 @@ public enum ListInlineEnumQueryParam_QueryValue_Param$ { A, B, } - public List listBooleanQueryParam(List queryValue); + public Result, RSDError.$GenericError> listBooleanQueryParam(List queryValue); - public List listShortQueryParam(List queryValue); + public Result, RSDError.$GenericError> listShortQueryParam(List queryValue); - public List listIntQueryParam(List queryValue); + public Result, RSDError.$GenericError> listIntQueryParam(List queryValue); - public List listLongQueryParam(List queryValue); + public Result, RSDError.$GenericError> listLongQueryParam(List queryValue); - public List listFloatQueryParam(List queryValue); + public Result, RSDError.$GenericError> listFloatQueryParam(List queryValue); - public List listDoubleQueryParam(List queryValue); + public Result, RSDError.$GenericError> listDoubleQueryParam(List queryValue); - public List listStringQueryParam(List queryValue); + public Result, RSDError.$GenericError> listStringQueryParam(List queryValue); - public List listLocalDateQueryParam(List queryValue); + public Result, RSDError.$GenericError> listLocalDateQueryParam(List queryValue); - public List listLocalDateTimeQueryParam(List queryValue); + public Result, RSDError.$GenericError> listLocalDateTimeQueryParam(List queryValue); - public List listLocalTimeQueryParam(List queryValue); + public Result, RSDError.$GenericError> listLocalTimeQueryParam(List queryValue); - public List listOffsetDateTimeQueryParam(List queryValue); + public Result, RSDError.$GenericError> listOffsetDateTimeQueryParam(List queryValue); - public List listZonedDateTimeQueryParam(List queryValue); + public Result, RSDError.$GenericError> listZonedDateTimeQueryParam(List queryValue); - public List listScalarQueryParam(List queryValue); + public Result, RSDError.$GenericError> listScalarQueryParam(List queryValue); - public List listEnumQueryParam(List queryValue); + public Result, RSDError.$GenericError> listEnumQueryParam(List queryValue); - public List listInlineEnumQueryParam(List queryValue); + public Result, RSDError.$GenericError> listInlineEnumQueryParam(List queryValue); - public String listMultiQueryParam( + public Result listMultiQueryParam( List valueA, List valueB, List valueC); - public List listRecordQueryParam(List queryValue); + public Result, RSDError.$GenericError> listRecordQueryParam(List queryValue); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListSampleServiceService.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListSampleServiceService.java index 31aca2fe..8fac96c9 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListSampleServiceService.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ListSampleServiceService.java @@ -13,36 +13,36 @@ import dev.rsdlang.sample.client.model.ZoneId; public interface ListSampleServiceService extends BaseService { - public List listBoolean(); + public Result, RSDError.$GenericError> listBoolean(); - public List listShort(); + public Result, RSDError.$GenericError> listShort(); - public List listInt(); + public Result, RSDError.$GenericError> listInt(); - public List listLong(); + public Result, RSDError.$GenericError> listLong(); - public List listFloat(); + public Result, RSDError.$GenericError> listFloat(); - public List listDouble(); + public Result, RSDError.$GenericError> listDouble(); - public List listString(); + public Result, RSDError.$GenericError> listString(); - public List listLocalDate(); + public Result, RSDError.$GenericError> listLocalDate(); - public List listLocalDateTime(); + public Result, RSDError.$GenericError> listLocalDateTime(); - public List listLocalTime(); + public Result, RSDError.$GenericError> listLocalTime(); - public List listOffsetDateTime(); + public Result, RSDError.$GenericError> listOffsetDateTime(); - public List listZonedDateTime(); + public Result, RSDError.$GenericError> listZonedDateTime(); - public List listScalar(); + public Result, RSDError.$GenericError> listScalar(); - public List listEnum(); + public Result, RSDError.$GenericError> listEnum(); - public List listSimpleRecord(); + public Result, RSDError.$GenericError> listSimpleRecord(); - public List listSimpleRecordWithError() throws SampleErrorException; + public Result, RSDError.E1> listSimpleRecordWithError(); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/PathParameterTypeServiceService.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/PathParameterTypeServiceService.java index f039f020..dd69834c 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/PathParameterTypeServiceService.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/PathParameterTypeServiceService.java @@ -11,35 +11,35 @@ import dev.rsdlang.sample.client.model.ZoneId; public interface PathParameterTypeServiceService extends BaseService { - public boolean simpleBooleanPathParam(boolean pathBoolean); + public Result simpleBooleanPathParam(boolean pathBoolean); - public short simpleShortPathParam(short pathShort); + public Result simpleShortPathParam(short pathShort); - public int simpleIntPathParam(int pathInt); + public Result simpleIntPathParam(int pathInt); - public long simpleLongPathParam(long pathLong); + public Result simpleLongPathParam(long pathLong); - public float simpleFloatPathParam(float pathFloat); + public Result simpleFloatPathParam(float pathFloat); - public double simpleDoublePathParam(double pathDouble); + public Result simpleDoublePathParam(double pathDouble); - public String simpleStringPathParam(String pathString); + public Result simpleStringPathParam(String pathString); - public LocalDate simpleLocalDatePathParam(LocalDate pathLocalDate); + public Result simpleLocalDatePathParam(LocalDate pathLocalDate); - public LocalDateTime simpleLocalDateTimePathParam(LocalDateTime pathLocalDateTime); + public Result simpleLocalDateTimePathParam(LocalDateTime pathLocalDateTime); - public LocalTime simpleLocalTimePathParam(LocalTime pathLocalTime); + public Result simpleLocalTimePathParam(LocalTime pathLocalTime); - public OffsetDateTime simpleOffsetDateTimePathParam(OffsetDateTime pathOffsetDateTime); + public Result simpleOffsetDateTimePathParam(OffsetDateTime pathOffsetDateTime); - public ZonedDateTime simpleZonedDateTimePathParam(ZonedDateTime pathZonedDateTime); + public Result simpleZonedDateTimePathParam(ZonedDateTime pathZonedDateTime); - public ZoneId simpleScalarPathParam(ZoneId pathScalar); + public Result simpleScalarPathParam(ZoneId pathScalar); - public SampleEnum simpleEnumPathParam(SampleEnum pathEnum); + public Result simpleEnumPathParam(SampleEnum pathEnum); - public String multiPathParam( + public Result multiPathParam( String valueA, int valueB); diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/QueryParameterTypesService.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/QueryParameterTypesService.java index 373fcbac..39c00d60 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/QueryParameterTypesService.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/QueryParameterTypesService.java @@ -13,106 +13,106 @@ import dev.rsdlang.sample.client.model.ZoneId; public interface QueryParameterTypesService extends BaseService { - public boolean simpleBooleanQueryParam(boolean queryValue); + public Result simpleBooleanQueryParam(boolean queryValue); - public NilResult simpleBooleanQueryParamOpt(); + public Result simpleBooleanQueryParamOpt(); - public NilResult simpleBooleanQueryParamOpt(Boolean queryValue); + public Result simpleBooleanQueryParamOpt(Boolean queryValue); - public short simpleShortQueryParam(short queryValue); + public Result simpleShortQueryParam(short queryValue); - public NilResult simpleShortQueryParamOpt(); + public Result simpleShortQueryParamOpt(); - public NilResult simpleShortQueryParamOpt(Short queryValue); + public Result simpleShortQueryParamOpt(Short queryValue); - public int simpleIntQueryParam(int queryValue); + public Result simpleIntQueryParam(int queryValue); - public NilResult simpleIntQueryParamOpt(); + public Result simpleIntQueryParamOpt(); - public NilResult simpleIntQueryParamOpt(Integer queryValue); + public Result simpleIntQueryParamOpt(Integer queryValue); - public long simpleLongQueryParam(long queryValue); + public Result simpleLongQueryParam(long queryValue); - public NilResult simpleLongQueryParamOpt(); + public Result simpleLongQueryParamOpt(); - public NilResult simpleLongQueryParamOpt(Long queryValue); + public Result simpleLongQueryParamOpt(Long queryValue); - public float simpleFloatQueryParam(float queryValue); + public Result simpleFloatQueryParam(float queryValue); - public NilResult simpleFloatQueryParamOpt(); + public Result simpleFloatQueryParamOpt(); - public NilResult simpleFloatQueryParamOpt(Float queryValue); + public Result simpleFloatQueryParamOpt(Float queryValue); - public double simpleDoubleQueryParam(double queryValue); + public Result simpleDoubleQueryParam(double queryValue); - public NilResult simpleDoubleQueryParamOpt(); + public Result simpleDoubleQueryParamOpt(); - public NilResult simpleDoubleQueryParamOpt(Double queryValue); + public Result simpleDoubleQueryParamOpt(Double queryValue); - public String simpleStringQueryParam(String queryValue); + public Result simpleStringQueryParam(String queryValue); - public NilResult simpleStringQueryParamOpt(); + public Result simpleStringQueryParamOpt(); - public NilResult simpleStringQueryParamOpt(String queryValue); + public Result simpleStringQueryParamOpt(String queryValue); - public LocalDate simpleLocalDateQueryParam(LocalDate queryValue); + public Result simpleLocalDateQueryParam(LocalDate queryValue); - public NilResult simpleLocalDateQueryParamOpt(); + public Result simpleLocalDateQueryParamOpt(); - public NilResult simpleLocalDateQueryParamOpt(LocalDate queryValue); + public Result simpleLocalDateQueryParamOpt(LocalDate queryValue); - public LocalDateTime simpleLocalDateTimeQueryParam(LocalDateTime queryValue); + public Result simpleLocalDateTimeQueryParam(LocalDateTime queryValue); - public NilResult simpleLocalDateTimeQueryParamOpt(); + public Result simpleLocalDateTimeQueryParamOpt(); - public NilResult simpleLocalDateTimeQueryParamOpt(LocalDateTime queryValue); + public Result simpleLocalDateTimeQueryParamOpt(LocalDateTime queryValue); - public LocalTime simpleLocalTimeQueryParam(LocalTime queryValue); + public Result simpleLocalTimeQueryParam(LocalTime queryValue); - public NilResult simpleLocalTimeQueryParamOpt(); + public Result simpleLocalTimeQueryParamOpt(); - public NilResult simpleLocalTimeQueryParamOpt(LocalTime queryValue); + public Result simpleLocalTimeQueryParamOpt(LocalTime queryValue); - public OffsetDateTime simpleOffsetDateTimeQueryParam(OffsetDateTime queryValue); + public Result simpleOffsetDateTimeQueryParam(OffsetDateTime queryValue); - public NilResult simpleOffsetDateTimeQueryParamOpt(); + public Result simpleOffsetDateTimeQueryParamOpt(); - public NilResult simpleOffsetDateTimeQueryParamOpt(OffsetDateTime queryValue); + public Result simpleOffsetDateTimeQueryParamOpt(OffsetDateTime queryValue); - public ZonedDateTime simpleZonedDateTimeQueryParam(ZonedDateTime queryValue); + public Result simpleZonedDateTimeQueryParam(ZonedDateTime queryValue); - public NilResult simpleZonedDateTimeQueryParamOpt(); + public Result simpleZonedDateTimeQueryParamOpt(); - public NilResult simpleZonedDateTimeQueryParamOpt(ZonedDateTime queryValue); + public Result simpleZonedDateTimeQueryParamOpt(ZonedDateTime queryValue); - public ZoneId simpleScalarQueryParam(ZoneId queryValue); + public Result simpleScalarQueryParam(ZoneId queryValue); - public NilResult simpleScalarQueryParamOpt(); + public Result simpleScalarQueryParamOpt(); - public NilResult simpleScalarQueryParamOpt(ZoneId queryValue); + public Result simpleScalarQueryParamOpt(ZoneId queryValue); - public SampleEnum simpleEnumQueryParam(SampleEnum queryValue); + public Result simpleEnumQueryParam(SampleEnum queryValue); - public NilResult simpleEnumQueryParamOpt(); + public Result simpleEnumQueryParamOpt(); - public NilResult simpleEnumQueryParamOpt(SampleEnum queryValue); + public Result simpleEnumQueryParamOpt(SampleEnum queryValue); - public String multiQueryParam( + public Result multiQueryParam( String valueA, int valueB); - public String multiQueryParamOpt(); + public Result multiQueryParamOpt(); - public String multiQueryParamOpt(String valueA); + public Result multiQueryParamOpt(String valueA); - public String multiQueryParamOpt( + public Result multiQueryParamOpt( String valueA, Integer valueB); - public SimpleRecord.Data recordQueryParam(SimpleRecord.Data queryValue); + public Result recordQueryParam(SimpleRecord.Data queryValue); - public NilResult recordQueryParamOpt(); + public Result recordQueryParamOpt(); - public NilResult recordQueryParamOpt(SimpleRecord.Data queryValue); + public Result recordQueryParamOpt(SimpleRecord.Data queryValue); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/RSDError.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/RSDError.java new file mode 100644 index 00000000..d7a66faf --- /dev/null +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/RSDError.java @@ -0,0 +1,50 @@ +// Generated by RSD - Do not modify +package dev.rsdlang.sample.client; + +public interface RSDError { + public enum Type { + _Native, + _UnknownResponse, + SampleError, + SampleError2, + SampleErrorBoolean, + SampleErrorEnum, + SampleErrorInt, + SampleErrorScalar, + SampleErrorScalarSub, + SampleErrorUnion, + SampleErrorWithValue; + } + + public Type type(); + + public sealed interface E1 permits $GenericError, SampleError { + } + + public sealed interface E2 permits $GenericError, SampleError, SampleError2 { + } + + public sealed interface E3 permits $GenericError, SampleErrorWithValue { + } + + public sealed interface E4 permits $GenericError, SampleErrorInt { + } + + public sealed interface E5 permits $GenericError, SampleErrorBoolean { + } + + public sealed interface E6 permits $GenericError, SampleErrorEnum { + } + + public sealed interface E7 permits $GenericError, SampleErrorScalar { + } + + public sealed interface E8 permits $GenericError, SampleErrorUnion { + } + + public sealed interface E9 permits $GenericError, SampleErrorScalarSub { + } + + public record $GenericError(Type type, String message, Throwable error) implements RSDError, E1, E2, E3, E4, E5, E6, E7, E8, E9 { + } +} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/RSDException.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/RSDException.java deleted file mode 100644 index e9b5a7db..00000000 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/RSDException.java +++ /dev/null @@ -1,36 +0,0 @@ -// Generated by RSD - Do not modify -package dev.rsdlang.sample.client; - -public class RSDException extends RuntimeException { - public enum Type { - _Native, - _UnknownResponse, - SampleError, - SampleError2, - SampleErrorWithValue, - SampleErrorInt, - SampleErrorBoolean, - SampleErrorEnum, - SampleErrorScalar, - SampleErrorUnion, - SampleErrorScalarSub; - } - - public final Type type; - - public RSDException(Type type, String message) { - super(message); - this.type = type; - } - - public RSDException(Type type, String message, Throwable cause) { - super(message, cause); - this.type = type; - } - public static abstract class RSDStructuredDataException extends RSDException { - public RSDStructuredDataException(Type type, String message) { - super(type, message); - } - public abstract Object data(); - } -} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/Result.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/Result.java new file mode 100644 index 00000000..3b5cb33a --- /dev/null +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/Result.java @@ -0,0 +1,98 @@ +// Generated by RSD - Do not modify +package dev.rsdlang.sample.client; + +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; + +public sealed interface Result { + public boolean isOk(); + + public boolean isErr(); + + public Result onOk(Consumer consumer); + + public Result onErr(Consumer consumer); + + public Result or(Supplier> supplier); + + public default T orThrow() throws IllegalStateException { + return orThrow(e -> new IllegalStateException(String.valueOf(e))); + } + + public T orThrow(Function exceptionProvider) throws X; + + public record OK(T value) implements Result { + @Override + public boolean isOk() { + return true; + } + + @Override + public boolean isErr() { + return false; + } + + @Override + public Result onOk(Consumer consumer) { + consumer.accept(value); + return this; + } + + @Override + public Result onErr(Consumer consumer) { + return this; + } + + @Override + public Result or(Supplier> supplier) { + return this; + } + + @Override + public T orThrow(Function exceptionProvider) { + return value; + } + } + + public record ERR(E error) implements Result { + @Override + public boolean isOk() { + return false; + } + + @Override + public boolean isErr() { + return true; + } + + @Override + public Result onOk(Consumer consumer) { + return this; + } + + @Override + public Result onErr(Consumer consumer) { + consumer.accept(error); + return this; + } + + @Override + public Result or(Supplier> supplier) { + return supplier.get(); + } + + @Override + public T orThrow(Function exceptionProvider) throws X { + throw exceptionProvider.apply(error); + } + } + + public static Result ok(T value) { + return new OK<>(value); + } + + public static Result err(E error) { + return new ERR<>(error); + } +} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleError.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleError.java new file mode 100644 index 00000000..dd734c91 --- /dev/null +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleError.java @@ -0,0 +1,9 @@ +// Generated by RSD - Do not modify +package dev.rsdlang.sample.client; + +public record SampleError(String message) implements RSDError, RSDError.E1, RSDError.E2 { + @Override + public Type type() { + return Type.SampleError; + } +} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleError2.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleError2.java new file mode 100644 index 00000000..dc091fba --- /dev/null +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleError2.java @@ -0,0 +1,9 @@ +// Generated by RSD - Do not modify +package dev.rsdlang.sample.client; + +public record SampleError2(String message) implements RSDError, RSDError.E2 { + @Override + public Type type() { + return Type.SampleError2; + } +} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleError2Exception.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleError2Exception.java deleted file mode 100644 index fcf35398..00000000 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleError2Exception.java +++ /dev/null @@ -1,8 +0,0 @@ -// Generated by RSD - Do not modify -package dev.rsdlang.sample.client; - -public class SampleError2Exception extends RSDException { - public SampleError2Exception(String message) { - super(Type.SampleError2, message); - } -} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorBoolean.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorBoolean.java new file mode 100644 index 00000000..5488c908 --- /dev/null +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorBoolean.java @@ -0,0 +1,9 @@ +// Generated by RSD - Do not modify +package dev.rsdlang.sample.client; + +public record SampleErrorBoolean(String message, boolean data) implements RSDError, RSDError.E5 { + @Override + public Type type() { + return Type.SampleErrorBoolean; + } +} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorBooleanException.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorBooleanException.java deleted file mode 100644 index 8e997682..00000000 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorBooleanException.java +++ /dev/null @@ -1,14 +0,0 @@ -// Generated by RSD - Do not modify -package dev.rsdlang.sample.client; - -public class SampleErrorBooleanException extends RSDException.RSDStructuredDataException { - private final boolean data; - - public SampleErrorBooleanException(String message, boolean data) { - super(Type.SampleErrorBoolean, message); - this.data = data; - } - public Boolean data() { - return this.data; - } -} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorEnum.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorEnum.java new file mode 100644 index 00000000..fa3cdff7 --- /dev/null +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorEnum.java @@ -0,0 +1,11 @@ +// Generated by RSD - Do not modify +package dev.rsdlang.sample.client; + +import dev.rsdlang.sample.client.model.SampleEnum; + +public record SampleErrorEnum(String message, SampleEnum data) implements RSDError, RSDError.E6 { + @Override + public Type type() { + return Type.SampleErrorEnum; + } +} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorEnumException.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorEnumException.java deleted file mode 100644 index f01dd644..00000000 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorEnumException.java +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by RSD - Do not modify -package dev.rsdlang.sample.client; - -import dev.rsdlang.sample.client.model.SampleEnum; - -public class SampleErrorEnumException extends RSDException.RSDStructuredDataException { - private final SampleEnum data; - - public SampleErrorEnumException(String message, SampleEnum data) { - super(Type.SampleErrorEnum, message); - this.data = data; - } - public SampleEnum data() { - return this.data; - } -} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorException.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorException.java deleted file mode 100644 index 244d9c13..00000000 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorException.java +++ /dev/null @@ -1,8 +0,0 @@ -// Generated by RSD - Do not modify -package dev.rsdlang.sample.client; - -public class SampleErrorException extends RSDException { - public SampleErrorException(String message) { - super(Type.SampleError, message); - } -} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorInt.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorInt.java new file mode 100644 index 00000000..1c8a5970 --- /dev/null +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorInt.java @@ -0,0 +1,9 @@ +// Generated by RSD - Do not modify +package dev.rsdlang.sample.client; + +public record SampleErrorInt(String message, int data) implements RSDError, RSDError.E4 { + @Override + public Type type() { + return Type.SampleErrorInt; + } +} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorIntException.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorIntException.java deleted file mode 100644 index 7857cad2..00000000 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorIntException.java +++ /dev/null @@ -1,14 +0,0 @@ -// Generated by RSD - Do not modify -package dev.rsdlang.sample.client; - -public class SampleErrorIntException extends RSDException.RSDStructuredDataException { - private final int data; - - public SampleErrorIntException(String message, int data) { - super(Type.SampleErrorInt, message); - this.data = data; - } - public Integer data() { - return this.data; - } -} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalar.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalar.java new file mode 100644 index 00000000..fce1df99 --- /dev/null +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalar.java @@ -0,0 +1,11 @@ +// Generated by RSD - Do not modify +package dev.rsdlang.sample.client; + +import dev.rsdlang.sample.client.model.ZoneId; + +public record SampleErrorScalar(String message, ZoneId data) implements RSDError, RSDError.E7 { + @Override + public Type type() { + return Type.SampleErrorScalar; + } +} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalarException.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalarException.java deleted file mode 100644 index cc35ba67..00000000 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalarException.java +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by RSD - Do not modify -package dev.rsdlang.sample.client; - -import dev.rsdlang.sample.client.model.ZoneId; - -public class SampleErrorScalarException extends RSDException.RSDStructuredDataException { - private final ZoneId data; - - public SampleErrorScalarException(String message, ZoneId data) { - super(Type.SampleErrorScalar, message); - this.data = data; - } - public ZoneId data() { - return this.data; - } -} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalarSub.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalarSub.java new file mode 100644 index 00000000..0009cfdb --- /dev/null +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalarSub.java @@ -0,0 +1,9 @@ +// Generated by RSD - Do not modify +package dev.rsdlang.sample.client; + +public record SampleErrorScalarSub(String message, MyRange data) implements RSDError, RSDError.E9 { + @Override + public Type type() { + return Type.SampleErrorScalarSub; + } +} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalarSubException.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalarSubException.java deleted file mode 100644 index 518ec4f1..00000000 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorScalarSubException.java +++ /dev/null @@ -1,14 +0,0 @@ -// Generated by RSD - Do not modify -package dev.rsdlang.sample.client; - -public class SampleErrorScalarSubException extends RSDException.RSDStructuredDataException { - private final MyRange data; - - public SampleErrorScalarSubException(String message, MyRange data) { - super(Type.SampleErrorScalarSub, message); - this.data = data; - } - public MyRange data() { - return this.data; - } -} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorUnion.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorUnion.java new file mode 100644 index 00000000..a5b08603 --- /dev/null +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorUnion.java @@ -0,0 +1,11 @@ +// Generated by RSD - Do not modify +package dev.rsdlang.sample.client; + +import dev.rsdlang.sample.client.model.Union; + +public record SampleErrorUnion(String message, Union.Data data) implements RSDError, RSDError.E8 { + @Override + public Type type() { + return Type.SampleErrorUnion; + } +} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorUnionException.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorUnionException.java deleted file mode 100644 index 313cb00e..00000000 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorUnionException.java +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by RSD - Do not modify -package dev.rsdlang.sample.client; - -import dev.rsdlang.sample.client.model.Union; - -public class SampleErrorUnionException extends RSDException.RSDStructuredDataException { - private final Union.Data data; - - public SampleErrorUnionException(String message, Union.Data data) { - super(Type.SampleErrorUnion, message); - this.data = data; - } - public Union.Data data() { - return this.data; - } -} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorWithValue.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorWithValue.java new file mode 100644 index 00000000..e59b5533 --- /dev/null +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorWithValue.java @@ -0,0 +1,11 @@ +// Generated by RSD - Do not modify +package dev.rsdlang.sample.client; + +import dev.rsdlang.sample.client.model.ErrorData; + +public record SampleErrorWithValue(String message, ErrorData.Data data) implements RSDError, RSDError.E3 { + @Override + public Type type() { + return Type.SampleErrorWithValue; + } +} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorWithValueException.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorWithValueException.java deleted file mode 100644 index b3422789..00000000 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleErrorWithValueException.java +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by RSD - Do not modify -package dev.rsdlang.sample.client; - -import dev.rsdlang.sample.client.model.ErrorData; - -public class SampleErrorWithValueException extends RSDException.RSDStructuredDataException { - private final ErrorData.Data data; - - public SampleErrorWithValueException(String message, ErrorData.Data data) { - super(Type.SampleErrorWithValue, message); - this.data = data; - } - public ErrorData.Data data() { - return this.data; - } -} diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleServiceService.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleServiceService.java index 05b8fb49..847e5bc9 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleServiceService.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SampleServiceService.java @@ -12,54 +12,54 @@ import dev.rsdlang.sample.client.model.ZoneId; public interface SampleServiceService extends BaseService { - public boolean getBoolean(); + public Result getBoolean(); - public short getShort(); + public Result getShort(); - public int getInt(); + public Result getInt(); - public long getLong(); + public Result getLong(); - public float getFloat(); + public Result getFloat(); - public double getDouble(); + public Result getDouble(); - public String getString(); + public Result getString(); - public LocalDate getLocalDate(); + public Result getLocalDate(); - public LocalDateTime getLocalDateTime(); + public Result getLocalDateTime(); - public LocalTime getLocalTime(); + public Result getLocalTime(); - public OffsetDateTime getOffsetDateTime(); + public Result getOffsetDateTime(); - public ZonedDateTime getZonedDateTime(); + public Result getZonedDateTime(); - public ZoneId getScalar(); + public Result getScalar(); - public SampleEnum getEnum(); + public Result getEnum(); - public void voidOperation(); + public Result voidOperation(); - public void errorOperation() throws SampleErrorException; + public Result errorOperation(); - public void multiErrorOperation() throws SampleErrorException, SampleError2Exception; + public Result multiErrorOperation(); - public SimpleRecord.Data getSimpleRecord(String key); + public Result getSimpleRecord(String key); - public SimpleRecord.Data getSimpleRecordWithError(String key) throws SampleErrorException; + public Result getSimpleRecordWithError(String key); - public void getSimpleErrorWithValue() throws SampleErrorWithValueException; + public Result getSimpleErrorWithValue(); - public void getSimpleErrorInt() throws SampleErrorIntException; + public Result getSimpleErrorInt(); - public void getSimpleErrorBoolean() throws SampleErrorBooleanException; + public Result getSimpleErrorBoolean(); - public void getSimpleErrorEnum() throws SampleErrorEnumException; + public Result getSimpleErrorEnum(); - public void getSimpleErrorScalar() throws SampleErrorScalarException; + public Result getSimpleErrorScalar(); - public void getSimpleErrorUnion() throws SampleErrorUnionException; + public Result getSimpleErrorUnion(); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ScalarSubstition_ServiceService.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ScalarSubstition_ServiceService.java index 0c8a42b9..37d77123 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ScalarSubstition_ServiceService.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/ScalarSubstition_ServiceService.java @@ -6,82 +6,82 @@ import dev.rsdlang.sample.client.model.NilResult; public interface ScalarSubstition_ServiceService extends BaseService { - public MyRange get(); + public Result get(); - public List list(); + public Result, RSDError.$GenericError> list(); - public MyRange post(MyRange range); + public Result post(MyRange range); - public NilResult postOpt(); + public Result postOpt(); - public NilResult postOpt(MyRange range); + public Result postOpt(MyRange range); - public NilResult postNull(MyRange range); + public Result postNull(MyRange range); - public NilResult postOptNull(); + public Result postOptNull(); - public NilResult postOptNull(MyRange range); + public Result postOptNull(MyRange range); - public List postList(List range); + public Result, RSDError.$GenericError> postList(List range); - public NilResult postListOpt(); + public Result postListOpt(); - public NilResult postListOpt(List range); + public Result postListOpt(List range); - public NilResult postListNull(List range); + public Result postListNull(List range); - public NilResult postListOptNull(); + public Result postListOptNull(); - public NilResult postListOptNull(List range); + public Result postListOptNull(List range); - public MyRange query(MyRange range); + public Result query(MyRange range); - public NilResult queryOpt(); + public Result queryOpt(); - public NilResult queryOpt(MyRange range); + public Result queryOpt(MyRange range); - public NilResult queryNull(MyRange range); + public Result queryNull(MyRange range); - public NilResult queryOptNull(); + public Result queryOptNull(); - public NilResult queryOptNull(MyRange range); + public Result queryOptNull(MyRange range); - public List queryList(List range); + public Result, RSDError.$GenericError> queryList(List range); - public NilResult queryListOpt(); + public Result queryListOpt(); - public NilResult queryListOpt(List range); + public Result queryListOpt(List range); - public NilResult queryListNull(List range); + public Result queryListNull(List range); - public NilResult queryListOptNull(); + public Result queryListOptNull(); - public NilResult queryListOptNull(List range); + public Result queryListOptNull(List range); - public MyRange header(MyRange range); + public Result header(MyRange range); - public NilResult headerOpt(); + public Result headerOpt(); - public NilResult headerOpt(MyRange range); + public Result headerOpt(MyRange range); - public NilResult headerNull(MyRange range); + public Result headerNull(MyRange range); - public NilResult headerOptNull(); + public Result headerOptNull(); - public NilResult headerOptNull(MyRange range); + public Result headerOptNull(MyRange range); - public List headerList(List range); + public Result, RSDError.$GenericError> headerList(List range); - public NilResult headerListOpt(); + public Result headerListOpt(); - public NilResult headerListOpt(List range); + public Result headerListOpt(List range); - public NilResult headerListNull(List range); + public Result headerListNull(List range); - public NilResult headerListOptNull(); + public Result headerListOptNull(); - public NilResult headerListOptNull(List range); + public Result headerListOptNull(List range); - public void fail() throws SampleErrorScalarSubException; + public Result fail(); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SpecSamplesClient.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SpecSamplesClient.java index f6921cf2..683e540d 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SpecSamplesClient.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/SpecSamplesClient.java @@ -205,7 +205,7 @@ public interface LifecycleHook { * eg. HttpResponse for JDK HttpClient, Response for * OkHttp, etc. */ - void onError(String method, RSDException error, Adaptable responseAdapter); + void onError(String method, RSDError error, Adaptable responseAdapter); /** * Called if an exception was thrown during the request (e.g. network error) @@ -214,7 +214,7 @@ public interface LifecycleHook { * (e.g. "getUser", "createUser", etc.) * @param error the exception that was thrown during the request */ - void onCatch(String method, RSDException error); + void onCatch(String method, RSDError error); /** * Called after the request was completed, regardless of the outcome. It can be diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/JDKSpecSamplesClient.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/JDKSpecSamplesClient.java index ca24d090..d572eff4 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/JDKSpecSamplesClient.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/JDKSpecSamplesClient.java @@ -141,7 +141,7 @@ import dev.rsdlang.sample.client.model.UploadMixedResult; import dev.rsdlang.sample.client.PathParameterTypeServiceService; import dev.rsdlang.sample.client.QueryParameterTypesService; -import dev.rsdlang.sample.client.RSDException; +import dev.rsdlang.sample.client.RSDError; import dev.rsdlang.sample.client.SampleServiceService; import dev.rsdlang.sample.client.ScalarSubstition_ServiceService; import dev.rsdlang.sample.client.SpecSamplesClient; @@ -216,12 +216,12 @@ public void onSuccess(String method, Object value, Adaptable responseAdapter) { } @Override - public void onError(String method, RSDException error, Adaptable responseAdapter) { + public void onError(String method, RSDError error, Adaptable responseAdapter) { // no-op } @Override - public void onCatch(String method, RSDException error) { + public void onCatch(String method, RSDError error) { // no-op } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/BinaryTypesServiceImpl.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/BinaryTypesServiceImpl.java index 41793dfa..162ed643 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/BinaryTypesServiceImpl.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/BinaryTypesServiceImpl.java @@ -29,8 +29,9 @@ import dev.rsdlang.sample.client.model.RSDFile; import dev.rsdlang.sample.client.model.SimpleRecord; import dev.rsdlang.sample.client.model.UploadMixedResult; -import dev.rsdlang.sample.client.RSDException; -import dev.rsdlang.sample.client.SampleErrorWithValueException; +import dev.rsdlang.sample.client.Result; +import dev.rsdlang.sample.client.RSDError; +import dev.rsdlang.sample.client.SampleErrorWithValue; import dev.rsdlang.sample.client.SpecSamplesClient; public class BinaryTypesServiceImpl implements BinaryTypesService { @@ -59,7 +60,7 @@ private String contentType() { return this.client.contentTypeEncoding().contentType; } - public int uploadFile(RSDFile data) { + public Result uploadFile(RSDFile data) { Objects.requireNonNull(data, "data must not be null"); var $path = "%s/api/binarytypes/uploadFile".formatted( @@ -85,28 +86,25 @@ public int uploadFile(RSDFile data) { if ($response.statusCode() == 201) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadFile", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadFile", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadFile", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadFile", e); - this.lifecycleHook.onCatch("uploadFile", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadFile", e); + this.lifecycleHook.onCatch("uploadFile", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadFile"); } } - public int uploadFileOpt() { + public Result uploadFileOpt() { var $path = "%s/api/binarytypes/uploadFileOpt".formatted( this.baseURI()); @@ -129,28 +127,25 @@ public int uploadFileOpt() { if ($response.statusCode() == 201) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadFileOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadFileOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadFileOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadFileOpt", e); - this.lifecycleHook.onCatch("uploadFileOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadFileOpt", e); + this.lifecycleHook.onCatch("uploadFileOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadFileOpt"); } } - public int uploadFileOpt(RSDFile data) { + public Result uploadFileOpt(RSDFile data) { var $path = "%s/api/binarytypes/uploadFileOpt".formatted( this.baseURI()); @@ -176,28 +171,25 @@ public int uploadFileOpt(RSDFile data) { if ($response.statusCode() == 201) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadFileOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadFileOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadFileOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadFileOpt", e); - this.lifecycleHook.onCatch("uploadFileOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadFileOpt", e); + this.lifecycleHook.onCatch("uploadFileOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadFileOpt"); } } - public int uploadFileNil(RSDFile data) { + public Result uploadFileNil(RSDFile data) { var $path = "%s/api/binarytypes/uploadFileNil".formatted( this.baseURI()); @@ -223,28 +215,25 @@ public int uploadFileNil(RSDFile data) { if ($response.statusCode() == 201) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadFileNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadFileNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadFileNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadFileNil", e); - this.lifecycleHook.onCatch("uploadFileNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadFileNil", e); + this.lifecycleHook.onCatch("uploadFileNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadFileNil"); } } - public int uploadFileOptNil() { + public Result uploadFileOptNil() { var $path = "%s/api/binarytypes/uploadFileOptNil".formatted( this.baseURI()); @@ -267,28 +256,25 @@ public int uploadFileOptNil() { if ($response.statusCode() == 201) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadFileOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadFileOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadFileOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadFileOptNil", e); - this.lifecycleHook.onCatch("uploadFileOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadFileOptNil", e); + this.lifecycleHook.onCatch("uploadFileOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadFileOptNil"); } } - public int uploadFileOptNil(RSDFile data) { + public Result uploadFileOptNil(RSDFile data) { var $path = "%s/api/binarytypes/uploadFileOptNil".formatted( this.baseURI()); @@ -317,28 +303,25 @@ public int uploadFileOptNil(RSDFile data) { if ($response.statusCode() == 201) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadFileOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadFileOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadFileOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadFileOptNil", e); - this.lifecycleHook.onCatch("uploadFileOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadFileOptNil", e); + this.lifecycleHook.onCatch("uploadFileOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadFileOptNil"); } } - public int uploadBlob(RSDBlob data) { + public Result uploadBlob(RSDBlob data) { Objects.requireNonNull(data, "data must not be null"); var $path = "%s/api/binarytypes/uploadBlob".formatted( @@ -364,28 +347,25 @@ public int uploadBlob(RSDBlob data) { if ($response.statusCode() == 201) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadBlob", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadBlob", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadBlob", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadBlob", e); - this.lifecycleHook.onCatch("uploadBlob", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadBlob", e); + this.lifecycleHook.onCatch("uploadBlob", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadBlob"); } } - public int uploadBlobOpt() { + public Result uploadBlobOpt() { var $path = "%s/api/binarytypes/uploadBlobOpt".formatted( this.baseURI()); @@ -408,28 +388,25 @@ public int uploadBlobOpt() { if ($response.statusCode() == 201) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadBlobOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadBlobOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadBlobOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadBlobOpt", e); - this.lifecycleHook.onCatch("uploadBlobOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadBlobOpt", e); + this.lifecycleHook.onCatch("uploadBlobOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadBlobOpt"); } } - public int uploadBlobOpt(RSDBlob data) { + public Result uploadBlobOpt(RSDBlob data) { var $path = "%s/api/binarytypes/uploadBlobOpt".formatted( this.baseURI()); @@ -455,28 +432,25 @@ public int uploadBlobOpt(RSDBlob data) { if ($response.statusCode() == 201) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadBlobOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadBlobOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadBlobOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadBlobOpt", e); - this.lifecycleHook.onCatch("uploadBlobOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadBlobOpt", e); + this.lifecycleHook.onCatch("uploadBlobOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadBlobOpt"); } } - public int uploadBlobNil(RSDBlob data) { + public Result uploadBlobNil(RSDBlob data) { var $path = "%s/api/binarytypes/uploadBlobNil".formatted( this.baseURI()); @@ -502,28 +476,25 @@ public int uploadBlobNil(RSDBlob data) { if ($response.statusCode() == 201) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadBlobNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadBlobNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadBlobNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadBlobNil", e); - this.lifecycleHook.onCatch("uploadBlobNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadBlobNil", e); + this.lifecycleHook.onCatch("uploadBlobNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadBlobNil"); } } - public int uploadBlobOptNil() { + public Result uploadBlobOptNil() { var $path = "%s/api/binarytypes/uploadBlobOptNil".formatted( this.baseURI()); @@ -546,28 +517,25 @@ public int uploadBlobOptNil() { if ($response.statusCode() == 201) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadBlobOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadBlobOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadBlobOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadBlobOptNil", e); - this.lifecycleHook.onCatch("uploadBlobOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadBlobOptNil", e); + this.lifecycleHook.onCatch("uploadBlobOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadBlobOptNil"); } } - public int uploadBlobOptNil(RSDBlob data) { + public Result uploadBlobOptNil(RSDBlob data) { var $path = "%s/api/binarytypes/uploadBlobOptNil".formatted( this.baseURI()); @@ -596,28 +564,25 @@ public int uploadBlobOptNil(RSDBlob data) { if ($response.statusCode() == 201) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadBlobOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadBlobOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadBlobOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadBlobOptNil", e); - this.lifecycleHook.onCatch("uploadBlobOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadBlobOptNil", e); + this.lifecycleHook.onCatch("uploadBlobOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadBlobOptNil"); } } - public int uploadFileList(List data) { + public Result uploadFileList(List data) { Objects.requireNonNull(data, "data must not be null"); var $path = "%s/api/binarytypes/uploadFileList".formatted( @@ -643,28 +608,25 @@ public int uploadFileList(List data) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadFileList", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadFileList", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadFileList", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadFileList", e); - this.lifecycleHook.onCatch("uploadFileList", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadFileList", e); + this.lifecycleHook.onCatch("uploadFileList", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadFileList"); } } - public int uploadFileListOpt() { + public Result uploadFileListOpt() { var $path = "%s/api/binarytypes/uploadFileListOpt".formatted( this.baseURI()); @@ -687,28 +649,25 @@ public int uploadFileListOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadFileListOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadFileListOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadFileListOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadFileListOpt", e); - this.lifecycleHook.onCatch("uploadFileListOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadFileListOpt", e); + this.lifecycleHook.onCatch("uploadFileListOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadFileListOpt"); } } - public int uploadFileListOpt(List data) { + public Result uploadFileListOpt(List data) { var $path = "%s/api/binarytypes/uploadFileListOpt".formatted( this.baseURI()); @@ -734,28 +693,25 @@ public int uploadFileListOpt(List data) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadFileListOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadFileListOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadFileListOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadFileListOpt", e); - this.lifecycleHook.onCatch("uploadFileListOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadFileListOpt", e); + this.lifecycleHook.onCatch("uploadFileListOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadFileListOpt"); } } - public int uploadFileListNil(List data) { + public Result uploadFileListNil(List data) { var $path = "%s/api/binarytypes/uploadFileListNil".formatted( this.baseURI()); @@ -781,28 +737,25 @@ public int uploadFileListNil(List data) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadFileListNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadFileListNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadFileListNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadFileListNil", e); - this.lifecycleHook.onCatch("uploadFileListNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadFileListNil", e); + this.lifecycleHook.onCatch("uploadFileListNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadFileListNil"); } } - public int uploadFileListOptNil() { + public Result uploadFileListOptNil() { var $path = "%s/api/binarytypes/uploadFileListOptNil".formatted( this.baseURI()); @@ -825,28 +778,25 @@ public int uploadFileListOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadFileListOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadFileListOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadFileListOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadFileListOptNil", e); - this.lifecycleHook.onCatch("uploadFileListOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadFileListOptNil", e); + this.lifecycleHook.onCatch("uploadFileListOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadFileListOptNil"); } } - public int uploadFileListOptNil(List data) { + public Result uploadFileListOptNil(List data) { var $path = "%s/api/binarytypes/uploadFileListOptNil".formatted( this.baseURI()); @@ -875,28 +825,25 @@ public int uploadFileListOptNil(List data) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadFileListOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadFileListOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadFileListOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadFileListOptNil", e); - this.lifecycleHook.onCatch("uploadFileListOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadFileListOptNil", e); + this.lifecycleHook.onCatch("uploadFileListOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadFileListOptNil"); } } - public int uploadBlobList(List data) { + public Result uploadBlobList(List data) { Objects.requireNonNull(data, "data must not be null"); var $path = "%s/api/binarytypes/uploadBlobList".formatted( @@ -922,28 +869,25 @@ public int uploadBlobList(List data) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadBlobList", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadBlobList", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadBlobList", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadBlobList", e); - this.lifecycleHook.onCatch("uploadBlobList", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadBlobList", e); + this.lifecycleHook.onCatch("uploadBlobList", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadBlobList"); } } - public int uploadBlobListOpt() { + public Result uploadBlobListOpt() { var $path = "%s/api/binarytypes/uploadBlobListOpt".formatted( this.baseURI()); @@ -966,28 +910,25 @@ public int uploadBlobListOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadBlobListOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadBlobListOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadBlobListOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadBlobListOpt", e); - this.lifecycleHook.onCatch("uploadBlobListOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadBlobListOpt", e); + this.lifecycleHook.onCatch("uploadBlobListOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadBlobListOpt"); } } - public int uploadBlobListOpt(List data) { + public Result uploadBlobListOpt(List data) { var $path = "%s/api/binarytypes/uploadBlobListOpt".formatted( this.baseURI()); @@ -1013,28 +954,25 @@ public int uploadBlobListOpt(List data) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadBlobListOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadBlobListOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadBlobListOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadBlobListOpt", e); - this.lifecycleHook.onCatch("uploadBlobListOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadBlobListOpt", e); + this.lifecycleHook.onCatch("uploadBlobListOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadBlobListOpt"); } } - public int uploadBlobListNil(List data) { + public Result uploadBlobListNil(List data) { var $path = "%s/api/binarytypes/uploadBlobListNil".formatted( this.baseURI()); @@ -1060,28 +998,25 @@ public int uploadBlobListNil(List data) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadBlobListNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadBlobListNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadBlobListNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadBlobListNil", e); - this.lifecycleHook.onCatch("uploadBlobListNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadBlobListNil", e); + this.lifecycleHook.onCatch("uploadBlobListNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadBlobListNil"); } } - public int uploadBlobListOptNil() { + public Result uploadBlobListOptNil() { var $path = "%s/api/binarytypes/uploadBlobListOptNil".formatted( this.baseURI()); @@ -1104,28 +1039,25 @@ public int uploadBlobListOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadBlobListOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadBlobListOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadBlobListOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadBlobListOptNil", e); - this.lifecycleHook.onCatch("uploadBlobListOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadBlobListOptNil", e); + this.lifecycleHook.onCatch("uploadBlobListOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadBlobListOptNil"); } } - public int uploadBlobListOptNil(List data) { + public Result uploadBlobListOptNil(List data) { var $path = "%s/api/binarytypes/uploadBlobListOptNil".formatted( this.baseURI()); @@ -1154,28 +1086,25 @@ public int uploadBlobListOptNil(List data) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("uploadBlobListOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadBlobListOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadBlobListOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadBlobListOptNil", e); - this.lifecycleHook.onCatch("uploadBlobListOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadBlobListOptNil", e); + this.lifecycleHook.onCatch("uploadBlobListOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadBlobListOptNil"); } } - public UploadMixedResult.Data uploadMixed(String text, int number, SimpleRecord.Data rec, List textList, List numberList, List recList, RSDFile dataFile, RSDBlob dataBlob) { + public Result uploadMixed(String text, int number, SimpleRecord.Data rec, List textList, List numberList, List recList, RSDFile dataFile, RSDBlob dataBlob) { Objects.requireNonNull(text, "text must not be null"); Objects.requireNonNull(rec, "rec must not be null"); Objects.requireNonNull(textList, "textList must not be null"); @@ -1215,28 +1144,25 @@ public UploadMixedResult.Data uploadMixed(String text, int number, SimpleRecord. if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixed", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixed", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixed", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixed", e); - this.lifecycleHook.onCatch("uploadMixed", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixed", e); + this.lifecycleHook.onCatch("uploadMixed", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixed"); } } - public UploadMixedResult.Data uploadMixedOpt() { + public Result uploadMixedOpt() { var $path = "%s/api/binarytypes/uploadMixedOpt".formatted( this.baseURI()); @@ -1261,28 +1187,25 @@ public UploadMixedResult.Data uploadMixedOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); - this.lifecycleHook.onCatch("uploadMixedOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); + this.lifecycleHook.onCatch("uploadMixedOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOpt"); } } - public UploadMixedResult.Data uploadMixedOpt(String text) { + public Result uploadMixedOpt(String text) { var $path = "%s/api/binarytypes/uploadMixedOpt".formatted( this.baseURI()); @@ -1310,28 +1233,25 @@ public UploadMixedResult.Data uploadMixedOpt(String text) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); - this.lifecycleHook.onCatch("uploadMixedOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); + this.lifecycleHook.onCatch("uploadMixedOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOpt"); } } - public UploadMixedResult.Data uploadMixedOpt(String text, Integer number) { + public Result uploadMixedOpt(String text, Integer number) { var $path = "%s/api/binarytypes/uploadMixedOpt".formatted( this.baseURI()); @@ -1362,28 +1282,25 @@ public UploadMixedResult.Data uploadMixedOpt(String text, Integer number) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); - this.lifecycleHook.onCatch("uploadMixedOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); + this.lifecycleHook.onCatch("uploadMixedOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOpt"); } } - public UploadMixedResult.Data uploadMixedOpt(String text, Integer number, SimpleRecord.Data rec) { + public Result uploadMixedOpt(String text, Integer number, SimpleRecord.Data rec) { var $path = "%s/api/binarytypes/uploadMixedOpt".formatted( this.baseURI()); @@ -1417,28 +1334,25 @@ public UploadMixedResult.Data uploadMixedOpt(String text, Integer number, Simple if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); - this.lifecycleHook.onCatch("uploadMixedOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); + this.lifecycleHook.onCatch("uploadMixedOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOpt"); } } - public UploadMixedResult.Data uploadMixedOpt(String text, Integer number, SimpleRecord.Data rec, List textList) { + public Result uploadMixedOpt(String text, Integer number, SimpleRecord.Data rec, List textList) { var $path = "%s/api/binarytypes/uploadMixedOpt".formatted( this.baseURI()); @@ -1475,28 +1389,25 @@ public UploadMixedResult.Data uploadMixedOpt(String text, Integer number, Simple if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); - this.lifecycleHook.onCatch("uploadMixedOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); + this.lifecycleHook.onCatch("uploadMixedOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOpt"); } } - public UploadMixedResult.Data uploadMixedOpt(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList) { + public Result uploadMixedOpt(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList) { var $path = "%s/api/binarytypes/uploadMixedOpt".formatted( this.baseURI()); @@ -1536,28 +1447,25 @@ public UploadMixedResult.Data uploadMixedOpt(String text, Integer number, Simple if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); - this.lifecycleHook.onCatch("uploadMixedOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); + this.lifecycleHook.onCatch("uploadMixedOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOpt"); } } - public UploadMixedResult.Data uploadMixedOpt(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList) { + public Result uploadMixedOpt(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList) { var $path = "%s/api/binarytypes/uploadMixedOpt".formatted( this.baseURI()); @@ -1600,28 +1508,25 @@ public UploadMixedResult.Data uploadMixedOpt(String text, Integer number, Simple if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); - this.lifecycleHook.onCatch("uploadMixedOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); + this.lifecycleHook.onCatch("uploadMixedOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOpt"); } } - public UploadMixedResult.Data uploadMixedOpt(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList, RSDFile dataFile) { + public Result uploadMixedOpt(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList, RSDFile dataFile) { var $path = "%s/api/binarytypes/uploadMixedOpt".formatted( this.baseURI()); @@ -1667,28 +1572,25 @@ public UploadMixedResult.Data uploadMixedOpt(String text, Integer number, Simple if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); - this.lifecycleHook.onCatch("uploadMixedOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); + this.lifecycleHook.onCatch("uploadMixedOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOpt"); } } - public UploadMixedResult.Data uploadMixedOpt(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList, RSDFile dataFile, RSDBlob dataBlob) { + public Result uploadMixedOpt(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList, RSDFile dataFile, RSDBlob dataBlob) { var $path = "%s/api/binarytypes/uploadMixedOpt".formatted( this.baseURI()); @@ -1737,28 +1639,25 @@ public UploadMixedResult.Data uploadMixedOpt(String text, Integer number, Simple if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); - this.lifecycleHook.onCatch("uploadMixedOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOpt", e); + this.lifecycleHook.onCatch("uploadMixedOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOpt"); } } - public UploadMixedResult.Data uploadMixedNil(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList, RSDFile dataFile, RSDBlob dataBlob) { + public Result uploadMixedNil(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList, RSDFile dataFile, RSDBlob dataBlob) { var $path = "%s/api/binarytypes/uploadMixedNil".formatted( this.baseURI()); @@ -1819,28 +1718,25 @@ public UploadMixedResult.Data uploadMixedNil(String text, Integer number, Simple if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedNil", e); - this.lifecycleHook.onCatch("uploadMixedNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedNil", e); + this.lifecycleHook.onCatch("uploadMixedNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedNil"); } } - public UploadMixedResult.Data uploadMixedOptNil() { + public Result uploadMixedOptNil() { var $path = "%s/api/binarytypes/uploadMixedOptNil".formatted( this.baseURI()); @@ -1865,28 +1761,25 @@ public UploadMixedResult.Data uploadMixedOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); - this.lifecycleHook.onCatch("uploadMixedOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); + this.lifecycleHook.onCatch("uploadMixedOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOptNil"); } } - public UploadMixedResult.Data uploadMixedOptNil(String text) { + public Result uploadMixedOptNil(String text) { var $path = "%s/api/binarytypes/uploadMixedOptNil".formatted( this.baseURI()); @@ -1916,28 +1809,25 @@ public UploadMixedResult.Data uploadMixedOptNil(String text) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); - this.lifecycleHook.onCatch("uploadMixedOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); + this.lifecycleHook.onCatch("uploadMixedOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOptNil"); } } - public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number) { + public Result uploadMixedOptNil(String text, Integer number) { var $path = "%s/api/binarytypes/uploadMixedOptNil".formatted( this.baseURI()); @@ -1972,28 +1862,25 @@ public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); - this.lifecycleHook.onCatch("uploadMixedOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); + this.lifecycleHook.onCatch("uploadMixedOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOptNil"); } } - public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number, SimpleRecord.Data rec) { + public Result uploadMixedOptNil(String text, Integer number, SimpleRecord.Data rec) { var $path = "%s/api/binarytypes/uploadMixedOptNil".formatted( this.baseURI()); @@ -2033,28 +1920,25 @@ public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number, Sim if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); - this.lifecycleHook.onCatch("uploadMixedOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); + this.lifecycleHook.onCatch("uploadMixedOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOptNil"); } } - public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number, SimpleRecord.Data rec, List textList) { + public Result uploadMixedOptNil(String text, Integer number, SimpleRecord.Data rec, List textList) { var $path = "%s/api/binarytypes/uploadMixedOptNil".formatted( this.baseURI()); @@ -2099,28 +1983,25 @@ public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number, Sim if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); - this.lifecycleHook.onCatch("uploadMixedOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); + this.lifecycleHook.onCatch("uploadMixedOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOptNil"); } } - public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList) { + public Result uploadMixedOptNil(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList) { var $path = "%s/api/binarytypes/uploadMixedOptNil".formatted( this.baseURI()); @@ -2170,28 +2051,25 @@ public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number, Sim if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); - this.lifecycleHook.onCatch("uploadMixedOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); + this.lifecycleHook.onCatch("uploadMixedOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOptNil"); } } - public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList) { + public Result uploadMixedOptNil(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList) { var $path = "%s/api/binarytypes/uploadMixedOptNil".formatted( this.baseURI()); @@ -2246,28 +2124,25 @@ public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number, Sim if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); - this.lifecycleHook.onCatch("uploadMixedOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); + this.lifecycleHook.onCatch("uploadMixedOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOptNil"); } } - public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList, RSDFile dataFile) { + public Result uploadMixedOptNil(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList, RSDFile dataFile) { var $path = "%s/api/binarytypes/uploadMixedOptNil".formatted( this.baseURI()); @@ -2328,28 +2203,25 @@ public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number, Sim if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); - this.lifecycleHook.onCatch("uploadMixedOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); + this.lifecycleHook.onCatch("uploadMixedOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOptNil"); } } - public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList, RSDFile dataFile, RSDBlob dataBlob) { + public Result uploadMixedOptNil(String text, Integer number, SimpleRecord.Data rec, List textList, List numberList, List recList, RSDFile dataFile, RSDBlob dataBlob) { var $path = "%s/api/binarytypes/uploadMixedOptNil".formatted( this.baseURI()); @@ -2416,28 +2288,25 @@ public UploadMixedResult.Data uploadMixedOptNil(String text, Integer number, Sim if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UploadMixedResultDataImpl::of, UploadMixedResult.Data.class); this.lifecycleHook.onSuccess("uploadMixedOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("uploadMixedOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("uploadMixedOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); - this.lifecycleHook.onCatch("uploadMixedOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation uploadMixedOptNil", e); + this.lifecycleHook.onCatch("uploadMixedOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("uploadMixedOptNil"); } } - public MixedResult.Data mixed(String pathString, int pathNumber, String headerString, int headerNumber, SimpleRecord.Data headerRecord, String queryString, int queryNumber, SimpleRecord.Data queryRecord, RSDBlob dataBlob) { + public Result mixed(String pathString, int pathNumber, String headerString, int headerNumber, SimpleRecord.Data headerRecord, String queryString, int queryNumber, SimpleRecord.Data queryRecord, RSDBlob dataBlob) { Objects.requireNonNull(pathString, "pathString must not be null"); Objects.requireNonNull(headerString, "headerString must not be null"); Objects.requireNonNull(headerRecord, "headerRecord must not be null"); @@ -2485,28 +2354,25 @@ public MixedResult.Data mixed(String pathString, int pathNumber, String headerSt if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, MixedResultDataImpl::of, MixedResult.Data.class); this.lifecycleHook.onSuccess("mixed", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("mixed", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("mixed", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation mixed", e); - this.lifecycleHook.onCatch("mixed", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation mixed", e); + this.lifecycleHook.onCatch("mixed", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("mixed"); } } - public String singleBodyAddition(String name, RSDBlob dataBlob) { + public Result singleBodyAddition(String name, RSDBlob dataBlob) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(dataBlob, "dataBlob must not be null"); @@ -2536,28 +2402,25 @@ public String singleBodyAddition(String name, RSDBlob dataBlob) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("singleBodyAddition", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("singleBodyAddition", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("singleBodyAddition", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation singleBodyAddition", e); - this.lifecycleHook.onCatch("singleBodyAddition", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation singleBodyAddition", e); + this.lifecycleHook.onCatch("singleBodyAddition", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("singleBodyAddition"); } } - public List twoBinariesAddition(RSDBlob dataBlob, RSDFile dataFile) { + public Result, RSDError.$GenericError> twoBinariesAddition(RSDBlob dataBlob, RSDFile dataFile) { Objects.requireNonNull(dataBlob, "dataBlob must not be null"); Objects.requireNonNull(dataFile, "dataFile must not be null"); @@ -2585,29 +2448,25 @@ public List twoBinariesAddition(RSDBlob dataBlob, RSDFile dataFile) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInts($response); this.lifecycleHook.onSuccess("twoBinariesAddition", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("twoBinariesAddition", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("twoBinariesAddition", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation twoBinariesAddition", e); - this.lifecycleHook.onCatch("twoBinariesAddition", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation twoBinariesAddition", e); + this.lifecycleHook.onCatch("twoBinariesAddition", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("twoBinariesAddition"); } } - public RSDFile downloadFile() - throws SampleErrorWithValueException { + public Result downloadFile() { var $path = "%s/api/binarytypes/downloadFile".formatted( this.baseURI()); @@ -2624,35 +2483,31 @@ public RSDFile downloadFile() if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapFile($response); this.lifecycleHook.onSuccess("downloadFile", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } else if ($response.statusCode() == 400) { var $errorData = JDKHttpClientResponseUtils.mapObject($response, ErrorDataDataImpl::of, ErrorData.Data.class); var $message = $response.headers().firstValue("X-RSD-Error-Message").orElse("Invocation of downloadFile failed"); - var exception = new SampleErrorWithValueException($message, $errorData); - this.lifecycleHook.onError("downloadFile", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleErrorWithValue($message, $errorData); + this.lifecycleHook.onError("downloadFile", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("downloadFile", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("downloadFile", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation downloadFile", e); - this.lifecycleHook.onCatch("downloadFile", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation downloadFile", e); + this.lifecycleHook.onCatch("downloadFile", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("downloadFile"); } } - public RSDBlob downloadBlob() - throws SampleErrorWithValueException { + public Result downloadBlob() { var $path = "%s/api/binarytypes/downloadBlob".formatted( this.baseURI()); @@ -2669,28 +2524,25 @@ public RSDBlob downloadBlob() if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapBlob($response); this.lifecycleHook.onSuccess("downloadBlob", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } else if ($response.statusCode() == 400) { var $errorData = JDKHttpClientResponseUtils.mapObject($response, ErrorDataDataImpl::of, ErrorData.Data.class); var $message = $response.headers().firstValue("X-RSD-Error-Message").orElse("Invocation of downloadBlob failed"); - var exception = new SampleErrorWithValueException($message, $errorData); - this.lifecycleHook.onError("downloadBlob", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleErrorWithValue($message, $errorData); + this.lifecycleHook.onError("downloadBlob", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("downloadBlob", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("downloadBlob", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation downloadBlob", e); - this.lifecycleHook.onCatch("downloadBlob", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation downloadBlob", e); + this.lifecycleHook.onCatch("downloadBlob", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("downloadBlob"); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/BodyParameterTypesServiceImpl.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/BodyParameterTypesServiceImpl.java index 6c88ac90..9c40f833 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/BodyParameterTypesServiceImpl.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/BodyParameterTypesServiceImpl.java @@ -33,7 +33,8 @@ import dev.rsdlang.sample.client.model.SimpleRecord; import dev.rsdlang.sample.client.model.Union; import dev.rsdlang.sample.client.model.ZoneId; -import dev.rsdlang.sample.client.RSDException; +import dev.rsdlang.sample.client.Result; +import dev.rsdlang.sample.client.RSDError; import dev.rsdlang.sample.client.SpecSamplesClient; public class BodyParameterTypesServiceImpl implements BodyParameterTypesService { @@ -62,7 +63,7 @@ private String contentType() { return this.client.contentTypeEncoding().contentType; } - public boolean simpleBooleanBodyParam(boolean bodyBoolean) { + public Result simpleBooleanBodyParam(boolean bodyBoolean) { var $path = "%s/api/bodyparametertypes/simpleBooleanBodyParam".formatted( this.baseURI()); @@ -83,28 +84,25 @@ public boolean simpleBooleanBodyParam(boolean bodyBoolean) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapBoolean($response); this.lifecycleHook.onSuccess("simpleBooleanBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanBodyParam", e); - this.lifecycleHook.onCatch("simpleBooleanBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanBodyParam", e); + this.lifecycleHook.onCatch("simpleBooleanBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanBodyParam"); } } - public NilResult simpleBooleanBodyParamOpt() { + public Result simpleBooleanBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleBooleanBodyParamOpt".formatted( this.baseURI()); @@ -125,28 +123,25 @@ public NilResult simpleBooleanBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleBooleanBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleBooleanBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleBooleanBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanBodyParamOpt"); } } - public NilResult simpleBooleanBodyParamOpt(Boolean bodyBoolean) { + public Result simpleBooleanBodyParamOpt(Boolean bodyBoolean) { var $path = "%s/api/bodyparametertypes/simpleBooleanBodyParamOpt".formatted( this.baseURI()); @@ -167,28 +162,25 @@ public NilResult simpleBooleanBodyParamOpt(Boolean bodyBoolean) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleBooleanBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleBooleanBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleBooleanBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanBodyParamOpt"); } } - public NilResult simpleBooleanBodyParamNil(Boolean bodyBoolean) { + public Result simpleBooleanBodyParamNil(Boolean bodyBoolean) { var $path = "%s/api/bodyparametertypes/simpleBooleanBodyParamNil".formatted( this.baseURI()); @@ -209,28 +201,25 @@ public NilResult simpleBooleanBodyParamNil(Boolean bodyBoolean) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleBooleanBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanBodyParamNil", e); - this.lifecycleHook.onCatch("simpleBooleanBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanBodyParamNil", e); + this.lifecycleHook.onCatch("simpleBooleanBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanBodyParamNil"); } } - public NilResult simpleBooleanBodyParamOptNil() { + public Result simpleBooleanBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleBooleanBodyParamOptNil".formatted( this.baseURI()); @@ -251,28 +240,25 @@ public NilResult simpleBooleanBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleBooleanBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleBooleanBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleBooleanBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanBodyParamOptNil"); } } - public NilResult simpleBooleanBodyParamOptNil(Boolean bodyBoolean) { + public Result simpleBooleanBodyParamOptNil(Boolean bodyBoolean) { var $path = "%s/api/bodyparametertypes/simpleBooleanBodyParamOptNil".formatted( this.baseURI()); @@ -293,28 +279,25 @@ public NilResult simpleBooleanBodyParamOptNil(Boolean bodyBoolean) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleBooleanBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleBooleanBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleBooleanBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanBodyParamOptNil"); } } - public short simpleShortBodyParam(short bodyShort) { + public Result simpleShortBodyParam(short bodyShort) { var $path = "%s/api/bodyparametertypes/simpleShortBodyParam".formatted( this.baseURI()); @@ -335,28 +318,25 @@ public short simpleShortBodyParam(short bodyShort) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapShort($response); this.lifecycleHook.onSuccess("simpleShortBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortBodyParam", e); - this.lifecycleHook.onCatch("simpleShortBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortBodyParam", e); + this.lifecycleHook.onCatch("simpleShortBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortBodyParam"); } } - public NilResult simpleShortBodyParamOpt() { + public Result simpleShortBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleShortBodyParamOpt".formatted( this.baseURI()); @@ -377,28 +357,25 @@ public NilResult simpleShortBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleShortBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleShortBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleShortBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortBodyParamOpt"); } } - public NilResult simpleShortBodyParamOpt(Short bodyShort) { + public Result simpleShortBodyParamOpt(Short bodyShort) { var $path = "%s/api/bodyparametertypes/simpleShortBodyParamOpt".formatted( this.baseURI()); @@ -419,28 +396,25 @@ public NilResult simpleShortBodyParamOpt(Short bodyShort) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleShortBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleShortBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleShortBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortBodyParamOpt"); } } - public NilResult simpleShortBodyParamNil(Short bodyShort) { + public Result simpleShortBodyParamNil(Short bodyShort) { var $path = "%s/api/bodyparametertypes/simpleShortBodyParamNil".formatted( this.baseURI()); @@ -461,28 +435,25 @@ public NilResult simpleShortBodyParamNil(Short bodyShort) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleShortBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortBodyParamNil", e); - this.lifecycleHook.onCatch("simpleShortBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortBodyParamNil", e); + this.lifecycleHook.onCatch("simpleShortBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortBodyParamNil"); } } - public NilResult simpleShortBodyParamOptNil() { + public Result simpleShortBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleShortBodyParamOptNil".formatted( this.baseURI()); @@ -503,28 +474,25 @@ public NilResult simpleShortBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleShortBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleShortBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleShortBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortBodyParamOptNil"); } } - public NilResult simpleShortBodyParamOptNil(Short bodyShort) { + public Result simpleShortBodyParamOptNil(Short bodyShort) { var $path = "%s/api/bodyparametertypes/simpleShortBodyParamOptNil".formatted( this.baseURI()); @@ -545,28 +513,25 @@ public NilResult simpleShortBodyParamOptNil(Short bodyShort) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleShortBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleShortBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleShortBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortBodyParamOptNil"); } } - public int simpleIntBodyParam(int bodyInt) { + public Result simpleIntBodyParam(int bodyInt) { var $path = "%s/api/bodyparametertypes/simpleIntBodyParam".formatted( this.baseURI()); @@ -587,28 +552,25 @@ public int simpleIntBodyParam(int bodyInt) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("simpleIntBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntBodyParam", e); - this.lifecycleHook.onCatch("simpleIntBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntBodyParam", e); + this.lifecycleHook.onCatch("simpleIntBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntBodyParam"); } } - public NilResult simpleIntBodyParamOpt() { + public Result simpleIntBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleIntBodyParamOpt".formatted( this.baseURI()); @@ -629,28 +591,25 @@ public NilResult simpleIntBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleIntBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleIntBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleIntBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntBodyParamOpt"); } } - public NilResult simpleIntBodyParamOpt(Integer bodyInt) { + public Result simpleIntBodyParamOpt(Integer bodyInt) { var $path = "%s/api/bodyparametertypes/simpleIntBodyParamOpt".formatted( this.baseURI()); @@ -671,28 +630,25 @@ public NilResult simpleIntBodyParamOpt(Integer bodyInt) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleIntBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleIntBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleIntBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntBodyParamOpt"); } } - public NilResult simpleIntBodyParamNil(Integer bodyInt) { + public Result simpleIntBodyParamNil(Integer bodyInt) { var $path = "%s/api/bodyparametertypes/simpleIntBodyParamNil".formatted( this.baseURI()); @@ -713,28 +669,25 @@ public NilResult simpleIntBodyParamNil(Integer bodyInt) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleIntBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntBodyParamNil", e); - this.lifecycleHook.onCatch("simpleIntBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntBodyParamNil", e); + this.lifecycleHook.onCatch("simpleIntBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntBodyParamNil"); } } - public NilResult simpleIntBodyParamOptNil() { + public Result simpleIntBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleIntBodyParamOptNil".formatted( this.baseURI()); @@ -755,28 +708,25 @@ public NilResult simpleIntBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleIntBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleIntBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleIntBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntBodyParamOptNil"); } } - public NilResult simpleIntBodyParamOptNil(Integer bodyInt) { + public Result simpleIntBodyParamOptNil(Integer bodyInt) { var $path = "%s/api/bodyparametertypes/simpleIntBodyParamOptNil".formatted( this.baseURI()); @@ -797,28 +747,25 @@ public NilResult simpleIntBodyParamOptNil(Integer bodyInt) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleIntBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleIntBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleIntBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntBodyParamOptNil"); } } - public long simpleLongBodyParam(long bodyLong) { + public Result simpleLongBodyParam(long bodyLong) { var $path = "%s/api/bodyparametertypes/simpleLongBodyParam".formatted( this.baseURI()); @@ -839,28 +786,25 @@ public long simpleLongBodyParam(long bodyLong) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLong($response); this.lifecycleHook.onSuccess("simpleLongBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongBodyParam", e); - this.lifecycleHook.onCatch("simpleLongBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongBodyParam", e); + this.lifecycleHook.onCatch("simpleLongBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongBodyParam"); } } - public NilResult simpleLongBodyParamOpt() { + public Result simpleLongBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleLongBodyParamOpt".formatted( this.baseURI()); @@ -881,28 +825,25 @@ public NilResult simpleLongBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLongBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleLongBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleLongBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongBodyParamOpt"); } } - public NilResult simpleLongBodyParamOpt(Long bodyLong) { + public Result simpleLongBodyParamOpt(Long bodyLong) { var $path = "%s/api/bodyparametertypes/simpleLongBodyParamOpt".formatted( this.baseURI()); @@ -923,28 +864,25 @@ public NilResult simpleLongBodyParamOpt(Long bodyLong) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLongBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleLongBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleLongBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongBodyParamOpt"); } } - public NilResult simpleLongBodyParamNil(Long bodyLong) { + public Result simpleLongBodyParamNil(Long bodyLong) { var $path = "%s/api/bodyparametertypes/simpleLongBodyParamNil".formatted( this.baseURI()); @@ -965,28 +903,25 @@ public NilResult simpleLongBodyParamNil(Long bodyLong) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLongBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongBodyParamNil", e); - this.lifecycleHook.onCatch("simpleLongBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongBodyParamNil", e); + this.lifecycleHook.onCatch("simpleLongBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongBodyParamNil"); } } - public NilResult simpleLongBodyParamOptNil() { + public Result simpleLongBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleLongBodyParamOptNil".formatted( this.baseURI()); @@ -1007,28 +942,25 @@ public NilResult simpleLongBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLongBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleLongBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleLongBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongBodyParamOptNil"); } } - public NilResult simpleLongBodyParamOptNil(Long bodyLong) { + public Result simpleLongBodyParamOptNil(Long bodyLong) { var $path = "%s/api/bodyparametertypes/simpleLongBodyParamOptNil".formatted( this.baseURI()); @@ -1049,28 +981,25 @@ public NilResult simpleLongBodyParamOptNil(Long bodyLong) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLongBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleLongBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleLongBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongBodyParamOptNil"); } } - public float simpleFloatBodyParam(float bodyFloat) { + public Result simpleFloatBodyParam(float bodyFloat) { var $path = "%s/api/bodyparametertypes/simpleFloatBodyParam".formatted( this.baseURI()); @@ -1091,28 +1020,25 @@ public float simpleFloatBodyParam(float bodyFloat) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapFloat($response); this.lifecycleHook.onSuccess("simpleFloatBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatBodyParam", e); - this.lifecycleHook.onCatch("simpleFloatBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatBodyParam", e); + this.lifecycleHook.onCatch("simpleFloatBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatBodyParam"); } } - public NilResult simpleFloatBodyParamOpt() { + public Result simpleFloatBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleFloatBodyParamOpt".formatted( this.baseURI()); @@ -1133,28 +1059,25 @@ public NilResult simpleFloatBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleFloatBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleFloatBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleFloatBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatBodyParamOpt"); } } - public NilResult simpleFloatBodyParamOpt(Float bodyFloat) { + public Result simpleFloatBodyParamOpt(Float bodyFloat) { var $path = "%s/api/bodyparametertypes/simpleFloatBodyParamOpt".formatted( this.baseURI()); @@ -1175,28 +1098,25 @@ public NilResult simpleFloatBodyParamOpt(Float bodyFloat) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleFloatBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleFloatBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleFloatBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatBodyParamOpt"); } } - public NilResult simpleFloatBodyParamNil(Float bodyFloat) { + public Result simpleFloatBodyParamNil(Float bodyFloat) { var $path = "%s/api/bodyparametertypes/simpleFloatBodyParamNil".formatted( this.baseURI()); @@ -1217,28 +1137,25 @@ public NilResult simpleFloatBodyParamNil(Float bodyFloat) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleFloatBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatBodyParamNil", e); - this.lifecycleHook.onCatch("simpleFloatBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatBodyParamNil", e); + this.lifecycleHook.onCatch("simpleFloatBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatBodyParamNil"); } } - public NilResult simpleFloatBodyParamOptNil() { + public Result simpleFloatBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleFloatBodyParamOptNil".formatted( this.baseURI()); @@ -1259,28 +1176,25 @@ public NilResult simpleFloatBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleFloatBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleFloatBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleFloatBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatBodyParamOptNil"); } } - public NilResult simpleFloatBodyParamOptNil(Float bodyFloat) { + public Result simpleFloatBodyParamOptNil(Float bodyFloat) { var $path = "%s/api/bodyparametertypes/simpleFloatBodyParamOptNil".formatted( this.baseURI()); @@ -1301,28 +1215,25 @@ public NilResult simpleFloatBodyParamOptNil(Float bodyFloat) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleFloatBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleFloatBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleFloatBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatBodyParamOptNil"); } } - public double simpleDoubleBodyParam(double bodyDouble) { + public Result simpleDoubleBodyParam(double bodyDouble) { var $path = "%s/api/bodyparametertypes/simpleDoubleBodyParam".formatted( this.baseURI()); @@ -1343,28 +1254,25 @@ public double simpleDoubleBodyParam(double bodyDouble) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapDouble($response); this.lifecycleHook.onSuccess("simpleDoubleBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleBodyParam", e); - this.lifecycleHook.onCatch("simpleDoubleBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleBodyParam", e); + this.lifecycleHook.onCatch("simpleDoubleBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleBodyParam"); } } - public NilResult simpleDoubleBodyParamOpt() { + public Result simpleDoubleBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleDoubleBodyParamOpt".formatted( this.baseURI()); @@ -1385,28 +1293,25 @@ public NilResult simpleDoubleBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleDoubleBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleDoubleBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleDoubleBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleBodyParamOpt"); } } - public NilResult simpleDoubleBodyParamOpt(Double bodyDouble) { + public Result simpleDoubleBodyParamOpt(Double bodyDouble) { var $path = "%s/api/bodyparametertypes/simpleDoubleBodyParamOpt".formatted( this.baseURI()); @@ -1427,28 +1332,25 @@ public NilResult simpleDoubleBodyParamOpt(Double bodyDouble) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleDoubleBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleDoubleBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleDoubleBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleBodyParamOpt"); } } - public NilResult simpleDoubleBodyParamNil(Double bodyDouble) { + public Result simpleDoubleBodyParamNil(Double bodyDouble) { var $path = "%s/api/bodyparametertypes/simpleDoubleBodyParamNil".formatted( this.baseURI()); @@ -1469,28 +1371,25 @@ public NilResult simpleDoubleBodyParamNil(Double bodyDouble) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleDoubleBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleBodyParamNil", e); - this.lifecycleHook.onCatch("simpleDoubleBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleBodyParamNil", e); + this.lifecycleHook.onCatch("simpleDoubleBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleBodyParamNil"); } } - public NilResult simpleDoubleBodyParamOptNil() { + public Result simpleDoubleBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleDoubleBodyParamOptNil".formatted( this.baseURI()); @@ -1511,28 +1410,25 @@ public NilResult simpleDoubleBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleDoubleBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleDoubleBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleDoubleBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleBodyParamOptNil"); } } - public NilResult simpleDoubleBodyParamOptNil(Double bodyDouble) { + public Result simpleDoubleBodyParamOptNil(Double bodyDouble) { var $path = "%s/api/bodyparametertypes/simpleDoubleBodyParamOptNil".formatted( this.baseURI()); @@ -1553,28 +1449,25 @@ public NilResult simpleDoubleBodyParamOptNil(Double bodyDouble) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleDoubleBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleDoubleBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleDoubleBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleBodyParamOptNil"); } } - public String simpleStringBodyParam(String bodyString) { + public Result simpleStringBodyParam(String bodyString) { Objects.requireNonNull(bodyString, "bodyString must not be null"); var $path = "%s/api/bodyparametertypes/simpleStringBodyParam".formatted( @@ -1597,28 +1490,25 @@ public String simpleStringBodyParam(String bodyString) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("simpleStringBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringBodyParam", e); - this.lifecycleHook.onCatch("simpleStringBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringBodyParam", e); + this.lifecycleHook.onCatch("simpleStringBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringBodyParam"); } } - public NilResult simpleStringBodyParamOpt() { + public Result simpleStringBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleStringBodyParamOpt".formatted( this.baseURI()); @@ -1639,28 +1529,25 @@ public NilResult simpleStringBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleStringBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleStringBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleStringBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringBodyParamOpt"); } } - public NilResult simpleStringBodyParamOpt(String bodyString) { + public Result simpleStringBodyParamOpt(String bodyString) { var $path = "%s/api/bodyparametertypes/simpleStringBodyParamOpt".formatted( this.baseURI()); @@ -1681,28 +1568,25 @@ public NilResult simpleStringBodyParamOpt(String bodyString) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleStringBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleStringBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleStringBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringBodyParamOpt"); } } - public NilResult simpleStringBodyParamNil(String bodyString) { + public Result simpleStringBodyParamNil(String bodyString) { var $path = "%s/api/bodyparametertypes/simpleStringBodyParamNil".formatted( this.baseURI()); @@ -1723,28 +1607,25 @@ public NilResult simpleStringBodyParamNil(String bodyString) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleStringBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringBodyParamNil", e); - this.lifecycleHook.onCatch("simpleStringBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringBodyParamNil", e); + this.lifecycleHook.onCatch("simpleStringBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringBodyParamNil"); } } - public NilResult simpleStringBodyParamOptNil() { + public Result simpleStringBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleStringBodyParamOptNil".formatted( this.baseURI()); @@ -1765,28 +1646,25 @@ public NilResult simpleStringBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleStringBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleStringBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleStringBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringBodyParamOptNil"); } } - public NilResult simpleStringBodyParamOptNil(String bodyString) { + public Result simpleStringBodyParamOptNil(String bodyString) { var $path = "%s/api/bodyparametertypes/simpleStringBodyParamOptNil".formatted( this.baseURI()); @@ -1807,28 +1685,25 @@ public NilResult simpleStringBodyParamOptNil(String bodyString) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleStringBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleStringBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleStringBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringBodyParamOptNil"); } } - public LocalDate simpleLocalDateBodyParam(LocalDate bodyLocalDate) { + public Result simpleLocalDateBodyParam(LocalDate bodyLocalDate) { Objects.requireNonNull(bodyLocalDate, "bodyLocalDate must not be null"); var $path = "%s/api/bodyparametertypes/simpleLocalDateBodyParam".formatted( @@ -1851,28 +1726,25 @@ public LocalDate simpleLocalDateBodyParam(LocalDate bodyLocalDate) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDate($response); this.lifecycleHook.onSuccess("simpleLocalDateBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateBodyParam", e); - this.lifecycleHook.onCatch("simpleLocalDateBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateBodyParam", e); + this.lifecycleHook.onCatch("simpleLocalDateBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateBodyParam"); } } - public NilResult simpleLocalDateBodyParamOpt() { + public Result simpleLocalDateBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleLocalDateBodyParamOpt".formatted( this.baseURI()); @@ -1893,28 +1765,25 @@ public NilResult simpleLocalDateBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalDateBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalDateBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateBodyParamOpt"); } } - public NilResult simpleLocalDateBodyParamOpt(LocalDate bodyLocalDate) { + public Result simpleLocalDateBodyParamOpt(LocalDate bodyLocalDate) { var $path = "%s/api/bodyparametertypes/simpleLocalDateBodyParamOpt".formatted( this.baseURI()); @@ -1935,28 +1804,25 @@ public NilResult simpleLocalDateBodyParamOpt(LocalDate bodyLocalDate) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalDateBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalDateBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateBodyParamOpt"); } } - public NilResult simpleLocalDateBodyParamNil(LocalDate bodyLocalDate) { + public Result simpleLocalDateBodyParamNil(LocalDate bodyLocalDate) { var $path = "%s/api/bodyparametertypes/simpleLocalDateBodyParamNil".formatted( this.baseURI()); @@ -1977,28 +1843,25 @@ public NilResult simpleLocalDateBodyParamNil(LocalDate bodyLocalDate) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateBodyParamNil", e); - this.lifecycleHook.onCatch("simpleLocalDateBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateBodyParamNil", e); + this.lifecycleHook.onCatch("simpleLocalDateBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateBodyParamNil"); } } - public NilResult simpleLocalDateBodyParamOptNil() { + public Result simpleLocalDateBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleLocalDateBodyParamOptNil".formatted( this.baseURI()); @@ -2019,28 +1882,25 @@ public NilResult simpleLocalDateBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleLocalDateBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleLocalDateBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateBodyParamOptNil"); } } - public NilResult simpleLocalDateBodyParamOptNil(LocalDate bodyLocalDate) { + public Result simpleLocalDateBodyParamOptNil(LocalDate bodyLocalDate) { var $path = "%s/api/bodyparametertypes/simpleLocalDateBodyParamOptNil".formatted( this.baseURI()); @@ -2061,28 +1921,25 @@ public NilResult simpleLocalDateBodyParamOptNil(LocalDate bodyLocalDate) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleLocalDateBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleLocalDateBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateBodyParamOptNil"); } } - public LocalDateTime simpleLocalDateTimeBodyParam(LocalDateTime bodyLocalDateTime) { + public Result simpleLocalDateTimeBodyParam(LocalDateTime bodyLocalDateTime) { Objects.requireNonNull(bodyLocalDateTime, "bodyLocalDateTime must not be null"); var $path = "%s/api/bodyparametertypes/simpleLocalDateTimeBodyParam".formatted( @@ -2105,28 +1962,25 @@ public LocalDateTime simpleLocalDateTimeBodyParam(LocalDateTime bodyLocalDateTim if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDateTime($response); this.lifecycleHook.onSuccess("simpleLocalDateTimeBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeBodyParam", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeBodyParam", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeBodyParam"); } } - public NilResult simpleLocalDateTimeBodyParamOpt() { + public Result simpleLocalDateTimeBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleLocalDateTimeBodyParamOpt".formatted( this.baseURI()); @@ -2147,28 +2001,25 @@ public NilResult simpleLocalDateTimeBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeBodyParamOpt"); } } - public NilResult simpleLocalDateTimeBodyParamOpt(LocalDateTime bodyLocalDateTime) { + public Result simpleLocalDateTimeBodyParamOpt(LocalDateTime bodyLocalDateTime) { var $path = "%s/api/bodyparametertypes/simpleLocalDateTimeBodyParamOpt".formatted( this.baseURI()); @@ -2189,28 +2040,25 @@ public NilResult simpleLocalDateTimeBodyParamOpt(LocalDateTime bodyLocalDateTime if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeBodyParamOpt"); } } - public NilResult simpleLocalDateTimeBodyParamNil(LocalDateTime bodyLocalDateTime) { + public Result simpleLocalDateTimeBodyParamNil(LocalDateTime bodyLocalDateTime) { var $path = "%s/api/bodyparametertypes/simpleLocalDateTimeBodyParamNil".formatted( this.baseURI()); @@ -2231,28 +2079,25 @@ public NilResult simpleLocalDateTimeBodyParamNil(LocalDateTime bodyLocalDateTime if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateTimeBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeBodyParamNil", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeBodyParamNil", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeBodyParamNil"); } } - public NilResult simpleLocalDateTimeBodyParamOptNil() { + public Result simpleLocalDateTimeBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleLocalDateTimeBodyParamOptNil".formatted( this.baseURI()); @@ -2273,28 +2118,25 @@ public NilResult simpleLocalDateTimeBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeBodyParamOptNil"); } } - public NilResult simpleLocalDateTimeBodyParamOptNil(LocalDateTime bodyLocalDateTime) { + public Result simpleLocalDateTimeBodyParamOptNil(LocalDateTime bodyLocalDateTime) { var $path = "%s/api/bodyparametertypes/simpleLocalDateTimeBodyParamOptNil".formatted( this.baseURI()); @@ -2315,28 +2157,25 @@ public NilResult simpleLocalDateTimeBodyParamOptNil(LocalDateTime bodyLocalDateT if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeBodyParamOptNil"); } } - public LocalTime simpleLocalTimeBodyParam(LocalTime bodyLocalTime) { + public Result simpleLocalTimeBodyParam(LocalTime bodyLocalTime) { Objects.requireNonNull(bodyLocalTime, "bodyLocalTime must not be null"); var $path = "%s/api/bodyparametertypes/simpleLocalTimeBodyParam".formatted( @@ -2359,28 +2198,25 @@ public LocalTime simpleLocalTimeBodyParam(LocalTime bodyLocalTime) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalTime($response); this.lifecycleHook.onSuccess("simpleLocalTimeBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeBodyParam", e); - this.lifecycleHook.onCatch("simpleLocalTimeBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeBodyParam", e); + this.lifecycleHook.onCatch("simpleLocalTimeBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeBodyParam"); } } - public NilResult simpleLocalTimeBodyParamOpt() { + public Result simpleLocalTimeBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleLocalTimeBodyParamOpt".formatted( this.baseURI()); @@ -2401,28 +2237,25 @@ public NilResult simpleLocalTimeBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeBodyParamOpt"); } } - public NilResult simpleLocalTimeBodyParamOpt(LocalTime bodyLocalTime) { + public Result simpleLocalTimeBodyParamOpt(LocalTime bodyLocalTime) { var $path = "%s/api/bodyparametertypes/simpleLocalTimeBodyParamOpt".formatted( this.baseURI()); @@ -2443,28 +2276,25 @@ public NilResult simpleLocalTimeBodyParamOpt(LocalTime bodyLocalTime) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeBodyParamOpt"); } } - public NilResult simpleLocalTimeBodyParamNil(LocalTime bodyLocalTime) { + public Result simpleLocalTimeBodyParamNil(LocalTime bodyLocalTime) { var $path = "%s/api/bodyparametertypes/simpleLocalTimeBodyParamNil".formatted( this.baseURI()); @@ -2485,28 +2315,25 @@ public NilResult simpleLocalTimeBodyParamNil(LocalTime bodyLocalTime) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalTimeBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeBodyParamNil", e); - this.lifecycleHook.onCatch("simpleLocalTimeBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeBodyParamNil", e); + this.lifecycleHook.onCatch("simpleLocalTimeBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeBodyParamNil"); } } - public NilResult simpleLocalTimeBodyParamOptNil() { + public Result simpleLocalTimeBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleLocalTimeBodyParamOptNil".formatted( this.baseURI()); @@ -2527,28 +2354,25 @@ public NilResult simpleLocalTimeBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleLocalTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleLocalTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeBodyParamOptNil"); } } - public NilResult simpleLocalTimeBodyParamOptNil(LocalTime bodyLocalTime) { + public Result simpleLocalTimeBodyParamOptNil(LocalTime bodyLocalTime) { var $path = "%s/api/bodyparametertypes/simpleLocalTimeBodyParamOptNil".formatted( this.baseURI()); @@ -2569,28 +2393,25 @@ public NilResult simpleLocalTimeBodyParamOptNil(LocalTime bodyLocalTime) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleLocalTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleLocalTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeBodyParamOptNil"); } } - public OffsetDateTime simpleOffsetDateTimeBodyParam(OffsetDateTime bodyOffsetDateTime) { + public Result simpleOffsetDateTimeBodyParam(OffsetDateTime bodyOffsetDateTime) { Objects.requireNonNull(bodyOffsetDateTime, "bodyOffsetDateTime must not be null"); var $path = "%s/api/bodyparametertypes/simpleOffsetDateTimeBodyParam".formatted( @@ -2613,28 +2434,25 @@ public OffsetDateTime simpleOffsetDateTimeBodyParam(OffsetDateTime bodyOffsetDat if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapOffsetDateTime($response); this.lifecycleHook.onSuccess("simpleOffsetDateTimeBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeBodyParam", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeBodyParam", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeBodyParam"); } } - public NilResult simpleOffsetDateTimeBodyParamOpt() { + public Result simpleOffsetDateTimeBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleOffsetDateTimeBodyParamOpt".formatted( this.baseURI()); @@ -2655,28 +2473,25 @@ public NilResult simpleOffsetDateTimeBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleOffsetDateTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeBodyParamOpt"); } } - public NilResult simpleOffsetDateTimeBodyParamOpt(OffsetDateTime bodyOffsetDateTime) { + public Result simpleOffsetDateTimeBodyParamOpt(OffsetDateTime bodyOffsetDateTime) { var $path = "%s/api/bodyparametertypes/simpleOffsetDateTimeBodyParamOpt".formatted( this.baseURI()); @@ -2697,28 +2512,25 @@ public NilResult simpleOffsetDateTimeBodyParamOpt(OffsetDateTime bodyOffsetDateT if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleOffsetDateTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeBodyParamOpt"); } } - public NilResult simpleOffsetDateTimeBodyParamNil(OffsetDateTime bodyOffsetDateTime) { + public Result simpleOffsetDateTimeBodyParamNil(OffsetDateTime bodyOffsetDateTime) { var $path = "%s/api/bodyparametertypes/simpleOffsetDateTimeBodyParamNil".formatted( this.baseURI()); @@ -2739,28 +2551,25 @@ public NilResult simpleOffsetDateTimeBodyParamNil(OffsetDateTime bodyOffsetDateT if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleOffsetDateTimeBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeBodyParamNil", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeBodyParamNil", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeBodyParamNil"); } } - public NilResult simpleOffsetDateTimeBodyParamOptNil() { + public Result simpleOffsetDateTimeBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleOffsetDateTimeBodyParamOptNil".formatted( this.baseURI()); @@ -2781,28 +2590,25 @@ public NilResult simpleOffsetDateTimeBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleOffsetDateTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeBodyParamOptNil"); } } - public NilResult simpleOffsetDateTimeBodyParamOptNil(OffsetDateTime bodyOffsetDateTime) { + public Result simpleOffsetDateTimeBodyParamOptNil(OffsetDateTime bodyOffsetDateTime) { var $path = "%s/api/bodyparametertypes/simpleOffsetDateTimeBodyParamOptNil".formatted( this.baseURI()); @@ -2823,28 +2629,25 @@ public NilResult simpleOffsetDateTimeBodyParamOptNil(OffsetDateTime bodyOffsetDa if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleOffsetDateTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeBodyParamOptNil"); } } - public ZonedDateTime simpleZonedDateTimeBodyParam(ZonedDateTime bodyZonedDateTime) { + public Result simpleZonedDateTimeBodyParam(ZonedDateTime bodyZonedDateTime) { Objects.requireNonNull(bodyZonedDateTime, "bodyZonedDateTime must not be null"); var $path = "%s/api/bodyparametertypes/simpleZonedDateTimeBodyParam".formatted( @@ -2867,28 +2670,25 @@ public ZonedDateTime simpleZonedDateTimeBodyParam(ZonedDateTime bodyZonedDateTim if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapZonedDateTime($response); this.lifecycleHook.onSuccess("simpleZonedDateTimeBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeBodyParam", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeBodyParam", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeBodyParam"); } } - public NilResult simpleZonedDateTimeBodyParamOpt() { + public Result simpleZonedDateTimeBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleZonedDateTimeBodyParamOpt".formatted( this.baseURI()); @@ -2909,28 +2709,25 @@ public NilResult simpleZonedDateTimeBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleZonedDateTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeBodyParamOpt"); } } - public NilResult simpleZonedDateTimeBodyParamOpt(ZonedDateTime bodyZonedDateTime) { + public Result simpleZonedDateTimeBodyParamOpt(ZonedDateTime bodyZonedDateTime) { var $path = "%s/api/bodyparametertypes/simpleZonedDateTimeBodyParamOpt".formatted( this.baseURI()); @@ -2951,28 +2748,25 @@ public NilResult simpleZonedDateTimeBodyParamOpt(ZonedDateTime bodyZonedDateTime if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleZonedDateTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeBodyParamOpt"); } } - public NilResult simpleZonedDateTimeBodyParamNil(ZonedDateTime bodyZonedDateTime) { + public Result simpleZonedDateTimeBodyParamNil(ZonedDateTime bodyZonedDateTime) { var $path = "%s/api/bodyparametertypes/simpleZonedDateTimeBodyParamNil".formatted( this.baseURI()); @@ -2993,28 +2787,25 @@ public NilResult simpleZonedDateTimeBodyParamNil(ZonedDateTime bodyZonedDateTime if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleZonedDateTimeBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeBodyParamNil", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeBodyParamNil", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeBodyParamNil"); } } - public NilResult simpleZonedDateTimeBodyParamOptNil() { + public Result simpleZonedDateTimeBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleZonedDateTimeBodyParamOptNil".formatted( this.baseURI()); @@ -3035,28 +2826,25 @@ public NilResult simpleZonedDateTimeBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleZonedDateTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeBodyParamOptNil"); } } - public NilResult simpleZonedDateTimeBodyParamOptNil(ZonedDateTime bodyZonedDateTime) { + public Result simpleZonedDateTimeBodyParamOptNil(ZonedDateTime bodyZonedDateTime) { var $path = "%s/api/bodyparametertypes/simpleZonedDateTimeBodyParamOptNil".formatted( this.baseURI()); @@ -3077,28 +2865,25 @@ public NilResult simpleZonedDateTimeBodyParamOptNil(ZonedDateTime bodyZonedDateT if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleZonedDateTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeBodyParamOptNil"); } } - public ZoneId simpleScalarBodyParam(ZoneId bodyScalar) { + public Result simpleScalarBodyParam(ZoneId bodyScalar) { Objects.requireNonNull(bodyScalar, "bodyScalar must not be null"); var $path = "%s/api/bodyparametertypes/simpleScalarBodyParam".formatted( @@ -3121,28 +2906,25 @@ public ZoneId simpleScalarBodyParam(ZoneId bodyScalar) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, ZoneId::of); this.lifecycleHook.onSuccess("simpleScalarBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarBodyParam", e); - this.lifecycleHook.onCatch("simpleScalarBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarBodyParam", e); + this.lifecycleHook.onCatch("simpleScalarBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarBodyParam"); } } - public NilResult simpleScalarBodyParamOpt() { + public Result simpleScalarBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleScalarBodyParamOpt".formatted( this.baseURI()); @@ -3163,28 +2945,25 @@ public NilResult simpleScalarBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleScalarBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleScalarBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleScalarBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarBodyParamOpt"); } } - public NilResult simpleScalarBodyParamOpt(ZoneId bodyScalar) { + public Result simpleScalarBodyParamOpt(ZoneId bodyScalar) { var $path = "%s/api/bodyparametertypes/simpleScalarBodyParamOpt".formatted( this.baseURI()); @@ -3205,28 +2984,25 @@ public NilResult simpleScalarBodyParamOpt(ZoneId bodyScalar) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleScalarBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleScalarBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleScalarBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarBodyParamOpt"); } } - public NilResult simpleScalarBodyParamNil(ZoneId bodyScalar) { + public Result simpleScalarBodyParamNil(ZoneId bodyScalar) { var $path = "%s/api/bodyparametertypes/simpleScalarBodyParamNil".formatted( this.baseURI()); @@ -3247,28 +3023,25 @@ public NilResult simpleScalarBodyParamNil(ZoneId bodyScalar) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleScalarBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarBodyParamNil", e); - this.lifecycleHook.onCatch("simpleScalarBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarBodyParamNil", e); + this.lifecycleHook.onCatch("simpleScalarBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarBodyParamNil"); } } - public NilResult simpleScalarBodyParamOptNil() { + public Result simpleScalarBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleScalarBodyParamOptNil".formatted( this.baseURI()); @@ -3289,28 +3062,25 @@ public NilResult simpleScalarBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleScalarBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleScalarBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleScalarBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarBodyParamOptNil"); } } - public NilResult simpleScalarBodyParamOptNil(ZoneId bodyScalar) { + public Result simpleScalarBodyParamOptNil(ZoneId bodyScalar) { var $path = "%s/api/bodyparametertypes/simpleScalarBodyParamOptNil".formatted( this.baseURI()); @@ -3331,28 +3101,25 @@ public NilResult simpleScalarBodyParamOptNil(ZoneId bodyScalar) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleScalarBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleScalarBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleScalarBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarBodyParamOptNil"); } } - public SampleEnum simpleEnumBodyParam(SampleEnum bodyEnum) { + public Result simpleEnumBodyParam(SampleEnum bodyEnum) { Objects.requireNonNull(bodyEnum, "bodyEnum must not be null"); var $path = "%s/api/bodyparametertypes/simpleEnumBodyParam".formatted( @@ -3375,28 +3142,25 @@ public SampleEnum simpleEnumBodyParam(SampleEnum bodyEnum) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, SampleEnum::valueOf); this.lifecycleHook.onSuccess("simpleEnumBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumBodyParam", e); - this.lifecycleHook.onCatch("simpleEnumBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumBodyParam", e); + this.lifecycleHook.onCatch("simpleEnumBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumBodyParam"); } } - public NilResult simpleEnumBodyParamOpt() { + public Result simpleEnumBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleEnumBodyParamOpt".formatted( this.baseURI()); @@ -3417,28 +3181,25 @@ public NilResult simpleEnumBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleEnumBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleEnumBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleEnumBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumBodyParamOpt"); } } - public NilResult simpleEnumBodyParamOpt(SampleEnum bodyEnum) { + public Result simpleEnumBodyParamOpt(SampleEnum bodyEnum) { var $path = "%s/api/bodyparametertypes/simpleEnumBodyParamOpt".formatted( this.baseURI()); @@ -3459,28 +3220,25 @@ public NilResult simpleEnumBodyParamOpt(SampleEnum bodyEnum) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleEnumBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleEnumBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleEnumBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumBodyParamOpt"); } } - public NilResult simpleEnumBodyParamNil(SampleEnum bodyEnum) { + public Result simpleEnumBodyParamNil(SampleEnum bodyEnum) { var $path = "%s/api/bodyparametertypes/simpleEnumBodyParamNil".formatted( this.baseURI()); @@ -3501,28 +3259,25 @@ public NilResult simpleEnumBodyParamNil(SampleEnum bodyEnum) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleEnumBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumBodyParamNil", e); - this.lifecycleHook.onCatch("simpleEnumBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumBodyParamNil", e); + this.lifecycleHook.onCatch("simpleEnumBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumBodyParamNil"); } } - public NilResult simpleEnumBodyParamOptNil() { + public Result simpleEnumBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleEnumBodyParamOptNil".formatted( this.baseURI()); @@ -3543,28 +3298,25 @@ public NilResult simpleEnumBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleEnumBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleEnumBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleEnumBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumBodyParamOptNil"); } } - public NilResult simpleEnumBodyParamOptNil(SampleEnum bodyEnum) { + public Result simpleEnumBodyParamOptNil(SampleEnum bodyEnum) { var $path = "%s/api/bodyparametertypes/simpleEnumBodyParamOptNil".formatted( this.baseURI()); @@ -3585,28 +3337,25 @@ public NilResult simpleEnumBodyParamOptNil(SampleEnum bodyEnum) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleEnumBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleEnumBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleEnumBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumBodyParamOptNil"); } } - public SimpleInlineEnumBodyParam_Result$ simpleInlineEnumBodyParam(SimpleInlineEnumBodyParam_BodyEnum_Param$ bodyEnum) { + public Result simpleInlineEnumBodyParam(SimpleInlineEnumBodyParam_BodyEnum_Param$ bodyEnum) { Objects.requireNonNull(bodyEnum, "bodyEnum must not be null"); var $path = "%s/api/bodyparametertypes/simpleInlineEnumBodyParam".formatted( @@ -3629,28 +3378,25 @@ public NilResult simpleEnumBodyParamOptNil(SampleEnum bodyEnum) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, SimpleInlineEnumBodyParam_Result$::valueOf); this.lifecycleHook.onSuccess("simpleInlineEnumBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleInlineEnumBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleInlineEnumBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleInlineEnumBodyParam", e); - this.lifecycleHook.onCatch("simpleInlineEnumBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleInlineEnumBodyParam", e); + this.lifecycleHook.onCatch("simpleInlineEnumBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleInlineEnumBodyParam"); } } - public NilResult simpleInlineEnumBodyParamOpt() { + public Result simpleInlineEnumBodyParamOpt() { var $path = "%s/api/bodyparametertypes/simpleInlineEnumBodyParamOpt".formatted( this.baseURI()); @@ -3671,28 +3417,25 @@ public NilResult simpleInlineEnumBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleInlineEnumBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleInlineEnumBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleInlineEnumBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleInlineEnumBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleInlineEnumBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleInlineEnumBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleInlineEnumBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleInlineEnumBodyParamOpt"); } } - public NilResult simpleInlineEnumBodyParamOpt(SimpleInlineEnumBodyParamOpt_BodyEnum_Param$ bodyEnum) { + public Result simpleInlineEnumBodyParamOpt(SimpleInlineEnumBodyParamOpt_BodyEnum_Param$ bodyEnum) { var $path = "%s/api/bodyparametertypes/simpleInlineEnumBodyParamOpt".formatted( this.baseURI()); @@ -3713,28 +3456,25 @@ public NilResult simpleInlineEnumBodyParamOpt(SimpleInlineEnumBodyParamOpt_BodyE if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleInlineEnumBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleInlineEnumBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleInlineEnumBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleInlineEnumBodyParamOpt", e); - this.lifecycleHook.onCatch("simpleInlineEnumBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleInlineEnumBodyParamOpt", e); + this.lifecycleHook.onCatch("simpleInlineEnumBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleInlineEnumBodyParamOpt"); } } - public NilResult simpleInlineEnumBodyParamNil(SimpleInlineEnumBodyParamNil_BodyEnum_Param$ bodyEnum) { + public Result simpleInlineEnumBodyParamNil(SimpleInlineEnumBodyParamNil_BodyEnum_Param$ bodyEnum) { var $path = "%s/api/bodyparametertypes/simpleInlineEnumBodyParamNil".formatted( this.baseURI()); @@ -3755,28 +3495,25 @@ public NilResult simpleInlineEnumBodyParamNil(SimpleInlineEnumBodyParamNil_BodyE if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleInlineEnumBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleInlineEnumBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleInlineEnumBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleInlineEnumBodyParamNil", e); - this.lifecycleHook.onCatch("simpleInlineEnumBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleInlineEnumBodyParamNil", e); + this.lifecycleHook.onCatch("simpleInlineEnumBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleInlineEnumBodyParamNil"); } } - public NilResult simpleInlineEnumBodyParamOptNil() { + public Result simpleInlineEnumBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/simpleInlineEnumBodyParamOptNil".formatted( this.baseURI()); @@ -3797,28 +3534,25 @@ public NilResult simpleInlineEnumBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleInlineEnumBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleInlineEnumBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleInlineEnumBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleInlineEnumBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleInlineEnumBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleInlineEnumBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleInlineEnumBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleInlineEnumBodyParamOptNil"); } } - public NilResult simpleInlineEnumBodyParamOptNil(SimpleInlineEnumBodyParamOptNil_BodyEnum_Param$ bodyEnum) { + public Result simpleInlineEnumBodyParamOptNil(SimpleInlineEnumBodyParamOptNil_BodyEnum_Param$ bodyEnum) { var $path = "%s/api/bodyparametertypes/simpleInlineEnumBodyParamOptNil".formatted( this.baseURI()); @@ -3839,28 +3573,25 @@ public NilResult simpleInlineEnumBodyParamOptNil(SimpleInlineEnumBodyParamOptNil if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleInlineEnumBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleInlineEnumBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleInlineEnumBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleInlineEnumBodyParamOptNil", e); - this.lifecycleHook.onCatch("simpleInlineEnumBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleInlineEnumBodyParamOptNil", e); + this.lifecycleHook.onCatch("simpleInlineEnumBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleInlineEnumBodyParamOptNil"); } } - public String multiBodyParam(String valueA, int valueB, SimpleRecord.Data valueC) { + public Result multiBodyParam(String valueA, int valueB, SimpleRecord.Data valueC) { Objects.requireNonNull(valueA, "valueA must not be null"); Objects.requireNonNull(valueC, "valueC must not be null"); @@ -3888,28 +3619,25 @@ public String multiBodyParam(String valueA, int valueB, SimpleRecord.Data valueC if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParam", e); - this.lifecycleHook.onCatch("multiBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParam", e); + this.lifecycleHook.onCatch("multiBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParam"); } } - public String multiBodyParamOpt() { + public Result multiBodyParamOpt() { var $path = "%s/api/bodyparametertypes/multiBodyParamOpt".formatted( this.baseURI()); @@ -3930,28 +3658,25 @@ public String multiBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamOpt", e); - this.lifecycleHook.onCatch("multiBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamOpt", e); + this.lifecycleHook.onCatch("multiBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamOpt"); } } - public String multiBodyParamOpt(String valueA) { + public Result multiBodyParamOpt(String valueA) { var $path = "%s/api/bodyparametertypes/multiBodyParamOpt".formatted( this.baseURI()); @@ -3976,28 +3701,25 @@ public String multiBodyParamOpt(String valueA) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamOpt", e); - this.lifecycleHook.onCatch("multiBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamOpt", e); + this.lifecycleHook.onCatch("multiBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamOpt"); } } - public String multiBodyParamOpt(String valueA, Integer valueB) { + public Result multiBodyParamOpt(String valueA, Integer valueB) { var $path = "%s/api/bodyparametertypes/multiBodyParamOpt".formatted( this.baseURI()); @@ -4025,28 +3747,25 @@ public String multiBodyParamOpt(String valueA, Integer valueB) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamOpt", e); - this.lifecycleHook.onCatch("multiBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamOpt", e); + this.lifecycleHook.onCatch("multiBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamOpt"); } } - public String multiBodyParamOpt(String valueA, Integer valueB, SimpleRecord.Data valueC) { + public Result multiBodyParamOpt(String valueA, Integer valueB, SimpleRecord.Data valueC) { var $path = "%s/api/bodyparametertypes/multiBodyParamOpt".formatted( this.baseURI()); @@ -4077,28 +3796,25 @@ public String multiBodyParamOpt(String valueA, Integer valueB, SimpleRecord.Data if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamOpt", e); - this.lifecycleHook.onCatch("multiBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamOpt", e); + this.lifecycleHook.onCatch("multiBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamOpt"); } } - public String multiBodyParamNil(String valueA, Integer valueB, SimpleRecord.Data valueC) { + public Result multiBodyParamNil(String valueA, Integer valueB, SimpleRecord.Data valueC) { var $path = "%s/api/bodyparametertypes/multiBodyParamNil".formatted( this.baseURI()); @@ -4123,28 +3839,25 @@ public String multiBodyParamNil(String valueA, Integer valueB, SimpleRecord.Data if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamNil", e); - this.lifecycleHook.onCatch("multiBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamNil", e); + this.lifecycleHook.onCatch("multiBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamNil"); } } - public String multiBodyParamOptNil() { + public Result multiBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/multiBodyParamOptNil".formatted( this.baseURI()); @@ -4165,28 +3878,25 @@ public String multiBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamOptNil", e); - this.lifecycleHook.onCatch("multiBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamOptNil", e); + this.lifecycleHook.onCatch("multiBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamOptNil"); } } - public String multiBodyParamOptNil(String valueA) { + public Result multiBodyParamOptNil(String valueA) { var $path = "%s/api/bodyparametertypes/multiBodyParamOptNil".formatted( this.baseURI()); @@ -4209,28 +3919,25 @@ public String multiBodyParamOptNil(String valueA) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamOptNil", e); - this.lifecycleHook.onCatch("multiBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamOptNil", e); + this.lifecycleHook.onCatch("multiBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamOptNil"); } } - public String multiBodyParamOptNil(String valueA, Integer valueB) { + public Result multiBodyParamOptNil(String valueA, Integer valueB) { var $path = "%s/api/bodyparametertypes/multiBodyParamOptNil".formatted( this.baseURI()); @@ -4254,28 +3961,25 @@ public String multiBodyParamOptNil(String valueA, Integer valueB) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamOptNil", e); - this.lifecycleHook.onCatch("multiBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamOptNil", e); + this.lifecycleHook.onCatch("multiBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamOptNil"); } } - public String multiBodyParamOptNil(String valueA, Integer valueB, SimpleRecord.Data valueC) { + public Result multiBodyParamOptNil(String valueA, Integer valueB, SimpleRecord.Data valueC) { var $path = "%s/api/bodyparametertypes/multiBodyParamOptNil".formatted( this.baseURI()); @@ -4300,28 +4004,25 @@ public String multiBodyParamOptNil(String valueA, Integer valueB, SimpleRecord.D if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamOptNil", e); - this.lifecycleHook.onCatch("multiBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamOptNil", e); + this.lifecycleHook.onCatch("multiBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamOptNil"); } } - public String multiBodyParamFirst() { + public Result multiBodyParamFirst() { var $path = "%s/api/bodyparametertypes/multiBodyParamFirst".formatted( this.baseURI()); @@ -4342,28 +4043,25 @@ public String multiBodyParamFirst() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamFirst", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamFirst", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamFirst", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamFirst", e); - this.lifecycleHook.onCatch("multiBodyParamFirst", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamFirst", e); + this.lifecycleHook.onCatch("multiBodyParamFirst", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamFirst"); } } - public String multiBodyParamFirst(String valueA) { + public Result multiBodyParamFirst(String valueA) { var $path = "%s/api/bodyparametertypes/multiBodyParamFirst".formatted( this.baseURI()); @@ -4388,28 +4086,25 @@ public String multiBodyParamFirst(String valueA) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamFirst", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamFirst", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamFirst", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamFirst", e); - this.lifecycleHook.onCatch("multiBodyParamFirst", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamFirst", e); + this.lifecycleHook.onCatch("multiBodyParamFirst", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamFirst"); } } - public String multiBodyParamFirst(String valueA, int valueB) { + public Result multiBodyParamFirst(String valueA, int valueB) { var $path = "%s/api/bodyparametertypes/multiBodyParamFirst".formatted( this.baseURI()); @@ -4435,28 +4130,25 @@ public String multiBodyParamFirst(String valueA, int valueB) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamFirst", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamFirst", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamFirst", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamFirst", e); - this.lifecycleHook.onCatch("multiBodyParamFirst", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamFirst", e); + this.lifecycleHook.onCatch("multiBodyParamFirst", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamFirst"); } } - public String multiBodyParamFirst(String valueA, int valueB, SimpleRecord.Data valueC) { + public Result multiBodyParamFirst(String valueA, int valueB, SimpleRecord.Data valueC) { Objects.requireNonNull(valueC, "valueC must not be null"); var $path = "%s/api/bodyparametertypes/multiBodyParamFirst".formatted( @@ -4485,28 +4177,25 @@ public String multiBodyParamFirst(String valueA, int valueB, SimpleRecord.Data v if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiBodyParamFirst", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiBodyParamFirst", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiBodyParamFirst", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiBodyParamFirst", e); - this.lifecycleHook.onCatch("multiBodyParamFirst", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiBodyParamFirst", e); + this.lifecycleHook.onCatch("multiBodyParamFirst", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiBodyParamFirst"); } } - public SimpleRecord.Data recordBodyParam(SimpleRecord.Data bodyRecord) { + public Result recordBodyParam(SimpleRecord.Data bodyRecord) { Objects.requireNonNull(bodyRecord, "bodyRecord must not be null"); var $path = "%s/api/bodyparametertypes/recordBodyParam".formatted( @@ -4529,28 +4218,25 @@ public SimpleRecord.Data recordBodyParam(SimpleRecord.Data bodyRecord) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, SimpleRecordDataImpl::of, SimpleRecord.Data.class); this.lifecycleHook.onSuccess("recordBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordBodyParam", e); - this.lifecycleHook.onCatch("recordBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordBodyParam", e); + this.lifecycleHook.onCatch("recordBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordBodyParam"); } } - public NilResult recordBodyParamOpt() { + public Result recordBodyParamOpt() { var $path = "%s/api/bodyparametertypes/recordBodyParamOpt".formatted( this.baseURI()); @@ -4571,28 +4257,25 @@ public NilResult recordBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("recordBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordBodyParamOpt", e); - this.lifecycleHook.onCatch("recordBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordBodyParamOpt", e); + this.lifecycleHook.onCatch("recordBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordBodyParamOpt"); } } - public NilResult recordBodyParamOpt(SimpleRecord.Data bodyRecord) { + public Result recordBodyParamOpt(SimpleRecord.Data bodyRecord) { var $path = "%s/api/bodyparametertypes/recordBodyParamOpt".formatted( this.baseURI()); @@ -4613,28 +4296,25 @@ public NilResult recordBodyParamOpt(SimpleRecord.Data bodyRecord) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("recordBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordBodyParamOpt", e); - this.lifecycleHook.onCatch("recordBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordBodyParamOpt", e); + this.lifecycleHook.onCatch("recordBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordBodyParamOpt"); } } - public NilResult recordBodyParamNil(SimpleRecord.Data bodyRecord) { + public Result recordBodyParamNil(SimpleRecord.Data bodyRecord) { var $path = "%s/api/bodyparametertypes/recordBodyParamNil".formatted( this.baseURI()); @@ -4655,28 +4335,25 @@ public NilResult recordBodyParamNil(SimpleRecord.Data bodyRecord) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("recordBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordBodyParamNil", e); - this.lifecycleHook.onCatch("recordBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordBodyParamNil", e); + this.lifecycleHook.onCatch("recordBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordBodyParamNil"); } } - public NilResult recordBodyParamOptNil() { + public Result recordBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/recordBodyParamOptNil".formatted( this.baseURI()); @@ -4697,28 +4374,25 @@ public NilResult recordBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("recordBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordBodyParamOptNil", e); - this.lifecycleHook.onCatch("recordBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordBodyParamOptNil", e); + this.lifecycleHook.onCatch("recordBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordBodyParamOptNil"); } } - public NilResult recordBodyParamOptNil(SimpleRecord.Data bodyRecord) { + public Result recordBodyParamOptNil(SimpleRecord.Data bodyRecord) { var $path = "%s/api/bodyparametertypes/recordBodyParamOptNil".formatted( this.baseURI()); @@ -4739,28 +4413,25 @@ public NilResult recordBodyParamOptNil(SimpleRecord.Data bodyRecord) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("recordBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordBodyParamOptNil", e); - this.lifecycleHook.onCatch("recordBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordBodyParamOptNil", e); + this.lifecycleHook.onCatch("recordBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordBodyParamOptNil"); } } - public Union.Data unionBodyParam(Union.Data bodyUnion) { + public Result unionBodyParam(Union.Data bodyUnion) { Objects.requireNonNull(bodyUnion, "bodyUnion must not be null"); var $path = "%s/api/bodyparametertypes/unionBodyParam".formatted( @@ -4783,28 +4454,25 @@ public Union.Data unionBodyParam(Union.Data bodyUnion) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, UnionDataImpl::of, Union.Data.class); this.lifecycleHook.onSuccess("unionBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("unionBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("unionBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation unionBodyParam", e); - this.lifecycleHook.onCatch("unionBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation unionBodyParam", e); + this.lifecycleHook.onCatch("unionBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("unionBodyParam"); } } - public NilResult unionBodyParamOpt() { + public Result unionBodyParamOpt() { var $path = "%s/api/bodyparametertypes/unionBodyParamOpt".formatted( this.baseURI()); @@ -4825,28 +4493,25 @@ public NilResult unionBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("unionBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("unionBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("unionBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation unionBodyParamOpt", e); - this.lifecycleHook.onCatch("unionBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation unionBodyParamOpt", e); + this.lifecycleHook.onCatch("unionBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("unionBodyParamOpt"); } } - public NilResult unionBodyParamOpt(Union.Data bodyUnion) { + public Result unionBodyParamOpt(Union.Data bodyUnion) { var $path = "%s/api/bodyparametertypes/unionBodyParamOpt".formatted( this.baseURI()); @@ -4867,28 +4532,25 @@ public NilResult unionBodyParamOpt(Union.Data bodyUnion) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("unionBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("unionBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("unionBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation unionBodyParamOpt", e); - this.lifecycleHook.onCatch("unionBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation unionBodyParamOpt", e); + this.lifecycleHook.onCatch("unionBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("unionBodyParamOpt"); } } - public NilResult unionBodyParamNil(Union.Data bodyUnion) { + public Result unionBodyParamNil(Union.Data bodyUnion) { var $path = "%s/api/bodyparametertypes/unionBodyParamNil".formatted( this.baseURI()); @@ -4909,28 +4571,25 @@ public NilResult unionBodyParamNil(Union.Data bodyUnion) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("unionBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("unionBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("unionBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation unionBodyParamNil", e); - this.lifecycleHook.onCatch("unionBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation unionBodyParamNil", e); + this.lifecycleHook.onCatch("unionBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("unionBodyParamNil"); } } - public NilResult unionBodyParamOptNil() { + public Result unionBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/unionBodyParamOptNil".formatted( this.baseURI()); @@ -4951,28 +4610,25 @@ public NilResult unionBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("unionBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("unionBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("unionBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation unionBodyParamOptNil", e); - this.lifecycleHook.onCatch("unionBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation unionBodyParamOptNil", e); + this.lifecycleHook.onCatch("unionBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("unionBodyParamOptNil"); } } - public NilResult unionBodyParamOptNil(Union.Data bodyUnion) { + public Result unionBodyParamOptNil(Union.Data bodyUnion) { var $path = "%s/api/bodyparametertypes/unionBodyParamOptNil".formatted( this.baseURI()); @@ -4993,28 +4649,25 @@ public NilResult unionBodyParamOptNil(Union.Data bodyUnion) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("unionBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("unionBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("unionBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation unionBodyParamOptNil", e); - this.lifecycleHook.onCatch("unionBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation unionBodyParamOptNil", e); + this.lifecycleHook.onCatch("unionBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("unionBodyParamOptNil"); } } - public PatchableRecord.Data patchableRecordBodyParam(PatchableRecord.Patch bodyRecord) { + public Result patchableRecordBodyParam(PatchableRecord.Patch bodyRecord) { Objects.requireNonNull(bodyRecord, "bodyRecord must not be null"); var $path = "%s/api/bodyparametertypes/patchableRecordBodyParam".formatted( @@ -5037,28 +4690,25 @@ public PatchableRecord.Data patchableRecordBodyParam(PatchableRecord.Patch bodyR if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, PatchableRecordDataImpl::of, PatchableRecord.Data.class); this.lifecycleHook.onSuccess("patchableRecordBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("patchableRecordBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("patchableRecordBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation patchableRecordBodyParam", e); - this.lifecycleHook.onCatch("patchableRecordBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation patchableRecordBodyParam", e); + this.lifecycleHook.onCatch("patchableRecordBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("patchableRecordBodyParam"); } } - public PatchableRecord.Data patchableRecordBodyParamOpt() { + public Result patchableRecordBodyParamOpt() { var $path = "%s/api/bodyparametertypes/patchableRecordBodyParamOpt".formatted( this.baseURI()); @@ -5079,28 +4729,25 @@ public PatchableRecord.Data patchableRecordBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, PatchableRecordDataImpl::of, PatchableRecord.Data.class); this.lifecycleHook.onSuccess("patchableRecordBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("patchableRecordBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("patchableRecordBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation patchableRecordBodyParamOpt", e); - this.lifecycleHook.onCatch("patchableRecordBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation patchableRecordBodyParamOpt", e); + this.lifecycleHook.onCatch("patchableRecordBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("patchableRecordBodyParamOpt"); } } - public PatchableRecord.Data patchableRecordBodyParamOpt(PatchableRecord.Patch bodyRecord) { + public Result patchableRecordBodyParamOpt(PatchableRecord.Patch bodyRecord) { var $path = "%s/api/bodyparametertypes/patchableRecordBodyParamOpt".formatted( this.baseURI()); @@ -5121,28 +4768,25 @@ public PatchableRecord.Data patchableRecordBodyParamOpt(PatchableRecord.Patch bo if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, PatchableRecordDataImpl::of, PatchableRecord.Data.class); this.lifecycleHook.onSuccess("patchableRecordBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("patchableRecordBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("patchableRecordBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation patchableRecordBodyParamOpt", e); - this.lifecycleHook.onCatch("patchableRecordBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation patchableRecordBodyParamOpt", e); + this.lifecycleHook.onCatch("patchableRecordBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("patchableRecordBodyParamOpt"); } } - public PatchableRecord.Data patchableRecordBodyParamNil(PatchableRecord.Patch bodyRecord) { + public Result patchableRecordBodyParamNil(PatchableRecord.Patch bodyRecord) { var $path = "%s/api/bodyparametertypes/patchableRecordBodyParamNil".formatted( this.baseURI()); @@ -5163,28 +4807,25 @@ public PatchableRecord.Data patchableRecordBodyParamNil(PatchableRecord.Patch bo if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, PatchableRecordDataImpl::of, PatchableRecord.Data.class); this.lifecycleHook.onSuccess("patchableRecordBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("patchableRecordBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("patchableRecordBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation patchableRecordBodyParamNil", e); - this.lifecycleHook.onCatch("patchableRecordBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation patchableRecordBodyParamNil", e); + this.lifecycleHook.onCatch("patchableRecordBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("patchableRecordBodyParamNil"); } } - public PatchableRecord.Data patchableRecordBodyParamOptNil() { + public Result patchableRecordBodyParamOptNil() { var $path = "%s/api/bodyparametertypes/patchableRecordBodyParamOptNil".formatted( this.baseURI()); @@ -5205,28 +4846,25 @@ public PatchableRecord.Data patchableRecordBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, PatchableRecordDataImpl::of, PatchableRecord.Data.class); this.lifecycleHook.onSuccess("patchableRecordBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("patchableRecordBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("patchableRecordBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation patchableRecordBodyParamOptNil", e); - this.lifecycleHook.onCatch("patchableRecordBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation patchableRecordBodyParamOptNil", e); + this.lifecycleHook.onCatch("patchableRecordBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("patchableRecordBodyParamOptNil"); } } - public PatchableRecord.Data patchableRecordBodyParamOptNil(PatchableRecord.Patch bodyRecord) { + public Result patchableRecordBodyParamOptNil(PatchableRecord.Patch bodyRecord) { var $path = "%s/api/bodyparametertypes/patchableRecordBodyParamOptNil".formatted( this.baseURI()); @@ -5247,22 +4885,19 @@ public PatchableRecord.Data patchableRecordBodyParamOptNil(PatchableRecord.Patch if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, PatchableRecordDataImpl::of, PatchableRecord.Data.class); this.lifecycleHook.onSuccess("patchableRecordBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("patchableRecordBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("patchableRecordBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation patchableRecordBodyParamOptNil", e); - this.lifecycleHook.onCatch("patchableRecordBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation patchableRecordBodyParamOptNil", e); + this.lifecycleHook.onCatch("patchableRecordBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("patchableRecordBodyParamOptNil"); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/HeaderParameterTypesServiceImpl.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/HeaderParameterTypesServiceImpl.java index ce7627b6..f7c3c0d7 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/HeaderParameterTypesServiceImpl.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/HeaderParameterTypesServiceImpl.java @@ -22,7 +22,8 @@ import dev.rsdlang.sample.client.model.SampleEnum; import dev.rsdlang.sample.client.model.SimpleRecord; import dev.rsdlang.sample.client.model.ZoneId; -import dev.rsdlang.sample.client.RSDException; +import dev.rsdlang.sample.client.Result; +import dev.rsdlang.sample.client.RSDError; import dev.rsdlang.sample.client.SpecSamplesClient; public class HeaderParameterTypesServiceImpl implements HeaderParameterTypesService { @@ -51,7 +52,7 @@ private String contentType() { return this.client.contentTypeEncoding().contentType; } - public boolean simpleBooleanHeaderParam(boolean headerValue) { + public Result simpleBooleanHeaderParam(boolean headerValue) { var $path = "%s/api/headerparametertypes/simpleBooleanHeaderParam".formatted( this.baseURI()); @@ -75,28 +76,25 @@ public boolean simpleBooleanHeaderParam(boolean headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapBoolean($response); this.lifecycleHook.onSuccess("simpleBooleanHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanHeaderParam", e); - this.lifecycleHook.onCatch("simpleBooleanHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanHeaderParam", e); + this.lifecycleHook.onCatch("simpleBooleanHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanHeaderParam"); } } - public NilResult simpleBooleanHeaderParamOpt() { + public Result simpleBooleanHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleBooleanHeaderParamOpt".formatted( this.baseURI()); @@ -113,28 +111,25 @@ public NilResult simpleBooleanHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleBooleanHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleBooleanHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleBooleanHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanHeaderParamOpt"); } } - public NilResult simpleBooleanHeaderParamOpt(Boolean headerValue) { + public Result simpleBooleanHeaderParamOpt(Boolean headerValue) { var $path = "%s/api/headerparametertypes/simpleBooleanHeaderParamOpt".formatted( this.baseURI()); @@ -158,28 +153,25 @@ public NilResult simpleBooleanHeaderParamOpt(Boolean headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleBooleanHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleBooleanHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleBooleanHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanHeaderParamOpt"); } } - public NilResult simpleBooleanHeaderParamNil(Boolean headerValue) { + public Result simpleBooleanHeaderParamNil(Boolean headerValue) { var $path = "%s/api/headerparametertypes/simpleBooleanHeaderParamNil".formatted( this.baseURI()); @@ -203,28 +195,25 @@ public NilResult simpleBooleanHeaderParamNil(Boolean headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleBooleanHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleBooleanHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleBooleanHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanHeaderParamNil"); } } - public NilResult simpleBooleanHeaderParamOptNil() { + public Result simpleBooleanHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleBooleanHeaderParamOptNil".formatted( this.baseURI()); @@ -241,28 +230,25 @@ public NilResult simpleBooleanHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleBooleanHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleBooleanHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleBooleanHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanHeaderParamOptNil"); } } - public NilResult simpleBooleanHeaderParamOptNil(Boolean headerValue) { + public Result simpleBooleanHeaderParamOptNil(Boolean headerValue) { var $path = "%s/api/headerparametertypes/simpleBooleanHeaderParamOptNil".formatted( this.baseURI()); @@ -286,28 +272,25 @@ public NilResult simpleBooleanHeaderParamOptNil(Boolean headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleBooleanHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleBooleanHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleBooleanHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanHeaderParamOptNil"); } } - public short simpleShortHeaderParam(short headerValue) { + public Result simpleShortHeaderParam(short headerValue) { var $path = "%s/api/headerparametertypes/simpleShortHeaderParam".formatted( this.baseURI()); @@ -331,28 +314,25 @@ public short simpleShortHeaderParam(short headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapShort($response); this.lifecycleHook.onSuccess("simpleShortHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortHeaderParam", e); - this.lifecycleHook.onCatch("simpleShortHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortHeaderParam", e); + this.lifecycleHook.onCatch("simpleShortHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortHeaderParam"); } } - public NilResult simpleShortHeaderParamOpt() { + public Result simpleShortHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleShortHeaderParamOpt".formatted( this.baseURI()); @@ -369,28 +349,25 @@ public NilResult simpleShortHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleShortHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleShortHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleShortHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortHeaderParamOpt"); } } - public NilResult simpleShortHeaderParamOpt(Short headerValue) { + public Result simpleShortHeaderParamOpt(Short headerValue) { var $path = "%s/api/headerparametertypes/simpleShortHeaderParamOpt".formatted( this.baseURI()); @@ -414,28 +391,25 @@ public NilResult simpleShortHeaderParamOpt(Short headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleShortHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleShortHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleShortHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortHeaderParamOpt"); } } - public NilResult simpleShortHeaderParamNil(Short headerValue) { + public Result simpleShortHeaderParamNil(Short headerValue) { var $path = "%s/api/headerparametertypes/simpleShortHeaderParamNil".formatted( this.baseURI()); @@ -459,28 +433,25 @@ public NilResult simpleShortHeaderParamNil(Short headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleShortHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleShortHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleShortHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortHeaderParamNil"); } } - public NilResult simpleShortHeaderParamOptNil() { + public Result simpleShortHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleShortHeaderParamOptNil".formatted( this.baseURI()); @@ -497,28 +468,25 @@ public NilResult simpleShortHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleShortHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleShortHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleShortHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortHeaderParamOptNil"); } } - public NilResult simpleShortHeaderParamOptNil(Short headerValue) { + public Result simpleShortHeaderParamOptNil(Short headerValue) { var $path = "%s/api/headerparametertypes/simpleShortHeaderParamOptNil".formatted( this.baseURI()); @@ -542,28 +510,25 @@ public NilResult simpleShortHeaderParamOptNil(Short headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleShortHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleShortHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleShortHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortHeaderParamOptNil"); } } - public int simpleIntHeaderParam(int headerValue) { + public Result simpleIntHeaderParam(int headerValue) { var $path = "%s/api/headerparametertypes/simpleIntHeaderParam".formatted( this.baseURI()); @@ -587,28 +552,25 @@ public int simpleIntHeaderParam(int headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("simpleIntHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntHeaderParam", e); - this.lifecycleHook.onCatch("simpleIntHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntHeaderParam", e); + this.lifecycleHook.onCatch("simpleIntHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntHeaderParam"); } } - public NilResult simpleIntHeaderParamOpt() { + public Result simpleIntHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleIntHeaderParamOpt".formatted( this.baseURI()); @@ -625,28 +587,25 @@ public NilResult simpleIntHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleIntHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleIntHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleIntHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntHeaderParamOpt"); } } - public NilResult simpleIntHeaderParamOpt(Integer headerValue) { + public Result simpleIntHeaderParamOpt(Integer headerValue) { var $path = "%s/api/headerparametertypes/simpleIntHeaderParamOpt".formatted( this.baseURI()); @@ -670,28 +629,25 @@ public NilResult simpleIntHeaderParamOpt(Integer headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleIntHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleIntHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleIntHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntHeaderParamOpt"); } } - public NilResult simpleIntHeaderParamNil(Integer headerValue) { + public Result simpleIntHeaderParamNil(Integer headerValue) { var $path = "%s/api/headerparametertypes/simpleIntHeaderParamNil".formatted( this.baseURI()); @@ -715,28 +671,25 @@ public NilResult simpleIntHeaderParamNil(Integer headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleIntHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleIntHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleIntHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntHeaderParamNil"); } } - public NilResult simpleIntHeaderParamOptNil() { + public Result simpleIntHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleIntHeaderParamOptNil".formatted( this.baseURI()); @@ -753,28 +706,25 @@ public NilResult simpleIntHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleIntHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleIntHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleIntHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntHeaderParamOptNil"); } } - public NilResult simpleIntHeaderParamOptNil(Integer headerValue) { + public Result simpleIntHeaderParamOptNil(Integer headerValue) { var $path = "%s/api/headerparametertypes/simpleIntHeaderParamOptNil".formatted( this.baseURI()); @@ -798,28 +748,25 @@ public NilResult simpleIntHeaderParamOptNil(Integer headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleIntHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleIntHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleIntHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntHeaderParamOptNil"); } } - public long simpleLongHeaderParam(long headerValue) { + public Result simpleLongHeaderParam(long headerValue) { var $path = "%s/api/headerparametertypes/simpleLongHeaderParam".formatted( this.baseURI()); @@ -843,28 +790,25 @@ public long simpleLongHeaderParam(long headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLong($response); this.lifecycleHook.onSuccess("simpleLongHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongHeaderParam", e); - this.lifecycleHook.onCatch("simpleLongHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongHeaderParam", e); + this.lifecycleHook.onCatch("simpleLongHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongHeaderParam"); } } - public NilResult simpleLongHeaderParamOpt() { + public Result simpleLongHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleLongHeaderParamOpt".formatted( this.baseURI()); @@ -881,28 +825,25 @@ public NilResult simpleLongHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLongHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleLongHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleLongHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongHeaderParamOpt"); } } - public NilResult simpleLongHeaderParamOpt(Long headerValue) { + public Result simpleLongHeaderParamOpt(Long headerValue) { var $path = "%s/api/headerparametertypes/simpleLongHeaderParamOpt".formatted( this.baseURI()); @@ -926,28 +867,25 @@ public NilResult simpleLongHeaderParamOpt(Long headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLongHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleLongHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleLongHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongHeaderParamOpt"); } } - public NilResult simpleLongHeaderParamNil(Long headerValue) { + public Result simpleLongHeaderParamNil(Long headerValue) { var $path = "%s/api/headerparametertypes/simpleLongHeaderParamNil".formatted( this.baseURI()); @@ -971,28 +909,25 @@ public NilResult simpleLongHeaderParamNil(Long headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLongHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleLongHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleLongHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongHeaderParamNil"); } } - public NilResult simpleLongHeaderParamOptNil() { + public Result simpleLongHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleLongHeaderParamOptNil".formatted( this.baseURI()); @@ -1009,28 +944,25 @@ public NilResult simpleLongHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLongHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleLongHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleLongHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongHeaderParamOptNil"); } } - public NilResult simpleLongHeaderParamOptNil(Long headerValue) { + public Result simpleLongHeaderParamOptNil(Long headerValue) { var $path = "%s/api/headerparametertypes/simpleLongHeaderParamOptNil".formatted( this.baseURI()); @@ -1054,28 +986,25 @@ public NilResult simpleLongHeaderParamOptNil(Long headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLongHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleLongHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleLongHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongHeaderParamOptNil"); } } - public float simpleFloatHeaderParam(float headerValue) { + public Result simpleFloatHeaderParam(float headerValue) { var $path = "%s/api/headerparametertypes/simpleFloatHeaderParam".formatted( this.baseURI()); @@ -1099,28 +1028,25 @@ public float simpleFloatHeaderParam(float headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapFloat($response); this.lifecycleHook.onSuccess("simpleFloatHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatHeaderParam", e); - this.lifecycleHook.onCatch("simpleFloatHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatHeaderParam", e); + this.lifecycleHook.onCatch("simpleFloatHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatHeaderParam"); } } - public NilResult simpleFloatHeaderParamOpt() { + public Result simpleFloatHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleFloatHeaderParamOpt".formatted( this.baseURI()); @@ -1137,28 +1063,25 @@ public NilResult simpleFloatHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleFloatHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleFloatHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleFloatHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatHeaderParamOpt"); } } - public NilResult simpleFloatHeaderParamOpt(Float headerValue) { + public Result simpleFloatHeaderParamOpt(Float headerValue) { var $path = "%s/api/headerparametertypes/simpleFloatHeaderParamOpt".formatted( this.baseURI()); @@ -1182,28 +1105,25 @@ public NilResult simpleFloatHeaderParamOpt(Float headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleFloatHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleFloatHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleFloatHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatHeaderParamOpt"); } } - public NilResult simpleFloatHeaderParamNil(Float headerValue) { + public Result simpleFloatHeaderParamNil(Float headerValue) { var $path = "%s/api/headerparametertypes/simpleFloatHeaderParamNil".formatted( this.baseURI()); @@ -1227,28 +1147,25 @@ public NilResult simpleFloatHeaderParamNil(Float headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleFloatHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleFloatHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleFloatHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatHeaderParamNil"); } } - public NilResult simpleFloatHeaderParamOptNil() { + public Result simpleFloatHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleFloatHeaderParamOptNil".formatted( this.baseURI()); @@ -1265,28 +1182,25 @@ public NilResult simpleFloatHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleFloatHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleFloatHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleFloatHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatHeaderParamOptNil"); } } - public NilResult simpleFloatHeaderParamOptNil(Float headerValue) { + public Result simpleFloatHeaderParamOptNil(Float headerValue) { var $path = "%s/api/headerparametertypes/simpleFloatHeaderParamOptNil".formatted( this.baseURI()); @@ -1310,28 +1224,25 @@ public NilResult simpleFloatHeaderParamOptNil(Float headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleFloatHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleFloatHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleFloatHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatHeaderParamOptNil"); } } - public double simpleDoubleHeaderParam(double headerValue) { + public Result simpleDoubleHeaderParam(double headerValue) { var $path = "%s/api/headerparametertypes/simpleDoubleHeaderParam".formatted( this.baseURI()); @@ -1355,28 +1266,25 @@ public double simpleDoubleHeaderParam(double headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapDouble($response); this.lifecycleHook.onSuccess("simpleDoubleHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleHeaderParam", e); - this.lifecycleHook.onCatch("simpleDoubleHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleHeaderParam", e); + this.lifecycleHook.onCatch("simpleDoubleHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleHeaderParam"); } } - public NilResult simpleDoubleHeaderParamOpt() { + public Result simpleDoubleHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleDoubleHeaderParamOpt".formatted( this.baseURI()); @@ -1393,28 +1301,25 @@ public NilResult simpleDoubleHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleDoubleHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleDoubleHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleDoubleHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleHeaderParamOpt"); } } - public NilResult simpleDoubleHeaderParamOpt(Double headerValue) { + public Result simpleDoubleHeaderParamOpt(Double headerValue) { var $path = "%s/api/headerparametertypes/simpleDoubleHeaderParamOpt".formatted( this.baseURI()); @@ -1438,28 +1343,25 @@ public NilResult simpleDoubleHeaderParamOpt(Double headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleDoubleHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleDoubleHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleDoubleHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleHeaderParamOpt"); } } - public NilResult simpleDoubleHeaderParamNil(Double headerValue) { + public Result simpleDoubleHeaderParamNil(Double headerValue) { var $path = "%s/api/headerparametertypes/simpleDoubleHeaderParamNil".formatted( this.baseURI()); @@ -1483,28 +1385,25 @@ public NilResult simpleDoubleHeaderParamNil(Double headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleDoubleHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleDoubleHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleDoubleHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleHeaderParamNil"); } } - public NilResult simpleDoubleHeaderParamOptNil() { + public Result simpleDoubleHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleDoubleHeaderParamOptNil".formatted( this.baseURI()); @@ -1521,28 +1420,25 @@ public NilResult simpleDoubleHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleDoubleHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleDoubleHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleDoubleHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleHeaderParamOptNil"); } } - public NilResult simpleDoubleHeaderParamOptNil(Double headerValue) { + public Result simpleDoubleHeaderParamOptNil(Double headerValue) { var $path = "%s/api/headerparametertypes/simpleDoubleHeaderParamOptNil".formatted( this.baseURI()); @@ -1566,28 +1462,25 @@ public NilResult simpleDoubleHeaderParamOptNil(Double headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleDoubleHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleDoubleHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleDoubleHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleHeaderParamOptNil"); } } - public String simpleStringHeaderParam(String headerValue) { + public Result simpleStringHeaderParam(String headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/headerparametertypes/simpleStringHeaderParam".formatted( @@ -1613,28 +1506,25 @@ public String simpleStringHeaderParam(String headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("simpleStringHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringHeaderParam", e); - this.lifecycleHook.onCatch("simpleStringHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringHeaderParam", e); + this.lifecycleHook.onCatch("simpleStringHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringHeaderParam"); } } - public NilResult simpleStringHeaderParamOpt() { + public Result simpleStringHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleStringHeaderParamOpt".formatted( this.baseURI()); @@ -1651,28 +1541,25 @@ public NilResult simpleStringHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleStringHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleStringHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleStringHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringHeaderParamOpt"); } } - public NilResult simpleStringHeaderParamOpt(String headerValue) { + public Result simpleStringHeaderParamOpt(String headerValue) { var $path = "%s/api/headerparametertypes/simpleStringHeaderParamOpt".formatted( this.baseURI()); @@ -1698,28 +1585,25 @@ public NilResult simpleStringHeaderParamOpt(String headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleStringHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleStringHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleStringHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringHeaderParamOpt"); } } - public NilResult simpleStringHeaderParamNil(String headerValue) { + public Result simpleStringHeaderParamNil(String headerValue) { var $path = "%s/api/headerparametertypes/simpleStringHeaderParamNil".formatted( this.baseURI()); @@ -1747,28 +1631,25 @@ public NilResult simpleStringHeaderParamNil(String headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleStringHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleStringHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleStringHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringHeaderParamNil"); } } - public NilResult simpleStringHeaderParamOptNil() { + public Result simpleStringHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleStringHeaderParamOptNil".formatted( this.baseURI()); @@ -1785,28 +1666,25 @@ public NilResult simpleStringHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleStringHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleStringHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleStringHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringHeaderParamOptNil"); } } - public NilResult simpleStringHeaderParamOptNil(String headerValue) { + public Result simpleStringHeaderParamOptNil(String headerValue) { var $path = "%s/api/headerparametertypes/simpleStringHeaderParamOptNil".formatted( this.baseURI()); @@ -1834,28 +1712,25 @@ public NilResult simpleStringHeaderParamOptNil(String headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleStringHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleStringHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleStringHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringHeaderParamOptNil"); } } - public LocalDate simpleLocalDateHeaderParam(LocalDate headerValue) { + public Result simpleLocalDateHeaderParam(LocalDate headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/headerparametertypes/simpleLocalDateHeaderParam".formatted( @@ -1881,28 +1756,25 @@ public LocalDate simpleLocalDateHeaderParam(LocalDate headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDate($response); this.lifecycleHook.onSuccess("simpleLocalDateHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateHeaderParam", e); - this.lifecycleHook.onCatch("simpleLocalDateHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateHeaderParam", e); + this.lifecycleHook.onCatch("simpleLocalDateHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateHeaderParam"); } } - public NilResult simpleLocalDateHeaderParamOpt() { + public Result simpleLocalDateHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleLocalDateHeaderParamOpt".formatted( this.baseURI()); @@ -1919,28 +1791,25 @@ public NilResult simpleLocalDateHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalDateHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalDateHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateHeaderParamOpt"); } } - public NilResult simpleLocalDateHeaderParamOpt(LocalDate headerValue) { + public Result simpleLocalDateHeaderParamOpt(LocalDate headerValue) { var $path = "%s/api/headerparametertypes/simpleLocalDateHeaderParamOpt".formatted( this.baseURI()); @@ -1964,28 +1833,25 @@ public NilResult simpleLocalDateHeaderParamOpt(LocalDate headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalDateHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalDateHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateHeaderParamOpt"); } } - public NilResult simpleLocalDateHeaderParamNil(LocalDate headerValue) { + public Result simpleLocalDateHeaderParamNil(LocalDate headerValue) { var $path = "%s/api/headerparametertypes/simpleLocalDateHeaderParamNil".formatted( this.baseURI()); @@ -2009,28 +1875,25 @@ public NilResult simpleLocalDateHeaderParamNil(LocalDate headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleLocalDateHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleLocalDateHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateHeaderParamNil"); } } - public NilResult simpleLocalDateHeaderParamOptNil() { + public Result simpleLocalDateHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleLocalDateHeaderParamOptNil".formatted( this.baseURI()); @@ -2047,28 +1910,25 @@ public NilResult simpleLocalDateHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleLocalDateHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleLocalDateHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateHeaderParamOptNil"); } } - public NilResult simpleLocalDateHeaderParamOptNil(LocalDate headerValue) { + public Result simpleLocalDateHeaderParamOptNil(LocalDate headerValue) { var $path = "%s/api/headerparametertypes/simpleLocalDateHeaderParamOptNil".formatted( this.baseURI()); @@ -2092,28 +1952,25 @@ public NilResult simpleLocalDateHeaderParamOptNil(LocalDate headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleLocalDateHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleLocalDateHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateHeaderParamOptNil"); } } - public LocalDateTime simpleLocalDateTimeHeaderParam(LocalDateTime headerValue) { + public Result simpleLocalDateTimeHeaderParam(LocalDateTime headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/headerparametertypes/simpleLocalDateTimeHeaderParam".formatted( @@ -2139,28 +1996,25 @@ public LocalDateTime simpleLocalDateTimeHeaderParam(LocalDateTime headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDateTime($response); this.lifecycleHook.onSuccess("simpleLocalDateTimeHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeHeaderParam", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeHeaderParam", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeHeaderParam"); } } - public NilResult simpleLocalDateTimeHeaderParamOpt() { + public Result simpleLocalDateTimeHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleLocalDateTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2177,28 +2031,25 @@ public NilResult simpleLocalDateTimeHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeHeaderParamOpt"); } } - public NilResult simpleLocalDateTimeHeaderParamOpt(LocalDateTime headerValue) { + public Result simpleLocalDateTimeHeaderParamOpt(LocalDateTime headerValue) { var $path = "%s/api/headerparametertypes/simpleLocalDateTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2222,28 +2073,25 @@ public NilResult simpleLocalDateTimeHeaderParamOpt(LocalDateTime headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeHeaderParamOpt"); } } - public NilResult simpleLocalDateTimeHeaderParamNil(LocalDateTime headerValue) { + public Result simpleLocalDateTimeHeaderParamNil(LocalDateTime headerValue) { var $path = "%s/api/headerparametertypes/simpleLocalDateTimeHeaderParamNil".formatted( this.baseURI()); @@ -2267,28 +2115,25 @@ public NilResult simpleLocalDateTimeHeaderParamNil(LocalDateTime headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateTimeHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeHeaderParamNil"); } } - public NilResult simpleLocalDateTimeHeaderParamOptNil() { + public Result simpleLocalDateTimeHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleLocalDateTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -2305,28 +2150,25 @@ public NilResult simpleLocalDateTimeHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeHeaderParamOptNil"); } } - public NilResult simpleLocalDateTimeHeaderParamOptNil(LocalDateTime headerValue) { + public Result simpleLocalDateTimeHeaderParamOptNil(LocalDateTime headerValue) { var $path = "%s/api/headerparametertypes/simpleLocalDateTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -2350,28 +2192,25 @@ public NilResult simpleLocalDateTimeHeaderParamOptNil(LocalDateTime headerValue) if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeHeaderParamOptNil"); } } - public LocalTime simpleLocalTimeHeaderParam(LocalTime headerValue) { + public Result simpleLocalTimeHeaderParam(LocalTime headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/headerparametertypes/simpleLocalTimeHeaderParam".formatted( @@ -2397,28 +2236,25 @@ public LocalTime simpleLocalTimeHeaderParam(LocalTime headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalTime($response); this.lifecycleHook.onSuccess("simpleLocalTimeHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeHeaderParam", e); - this.lifecycleHook.onCatch("simpleLocalTimeHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeHeaderParam", e); + this.lifecycleHook.onCatch("simpleLocalTimeHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeHeaderParam"); } } - public NilResult simpleLocalTimeHeaderParamOpt() { + public Result simpleLocalTimeHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleLocalTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2435,28 +2271,25 @@ public NilResult simpleLocalTimeHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeHeaderParamOpt"); } } - public NilResult simpleLocalTimeHeaderParamOpt(LocalTime headerValue) { + public Result simpleLocalTimeHeaderParamOpt(LocalTime headerValue) { var $path = "%s/api/headerparametertypes/simpleLocalTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2480,28 +2313,25 @@ public NilResult simpleLocalTimeHeaderParamOpt(LocalTime headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeHeaderParamOpt"); } } - public NilResult simpleLocalTimeHeaderParamNil(LocalTime headerValue) { + public Result simpleLocalTimeHeaderParamNil(LocalTime headerValue) { var $path = "%s/api/headerparametertypes/simpleLocalTimeHeaderParamNil".formatted( this.baseURI()); @@ -2525,28 +2355,25 @@ public NilResult simpleLocalTimeHeaderParamNil(LocalTime headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalTimeHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleLocalTimeHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleLocalTimeHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeHeaderParamNil"); } } - public NilResult simpleLocalTimeHeaderParamOptNil() { + public Result simpleLocalTimeHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleLocalTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -2563,28 +2390,25 @@ public NilResult simpleLocalTimeHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleLocalTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleLocalTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeHeaderParamOptNil"); } } - public NilResult simpleLocalTimeHeaderParamOptNil(LocalTime headerValue) { + public Result simpleLocalTimeHeaderParamOptNil(LocalTime headerValue) { var $path = "%s/api/headerparametertypes/simpleLocalTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -2608,28 +2432,25 @@ public NilResult simpleLocalTimeHeaderParamOptNil(LocalTime headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleLocalTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleLocalTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeHeaderParamOptNil"); } } - public OffsetDateTime simpleOffsetDateTimeHeaderParam(OffsetDateTime headerValue) { + public Result simpleOffsetDateTimeHeaderParam(OffsetDateTime headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/headerparametertypes/simpleOffsetDateTimeHeaderParam".formatted( @@ -2655,28 +2476,25 @@ public OffsetDateTime simpleOffsetDateTimeHeaderParam(OffsetDateTime headerValue if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapOffsetDateTime($response); this.lifecycleHook.onSuccess("simpleOffsetDateTimeHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeHeaderParam", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeHeaderParam", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeHeaderParam"); } } - public NilResult simpleOffsetDateTimeHeaderParamOpt() { + public Result simpleOffsetDateTimeHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleOffsetDateTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2693,28 +2511,25 @@ public NilResult simpleOffsetDateTimeHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleOffsetDateTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeHeaderParamOpt"); } } - public NilResult simpleOffsetDateTimeHeaderParamOpt(OffsetDateTime headerValue) { + public Result simpleOffsetDateTimeHeaderParamOpt(OffsetDateTime headerValue) { var $path = "%s/api/headerparametertypes/simpleOffsetDateTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2738,28 +2553,25 @@ public NilResult simpleOffsetDateTimeHeaderParamOpt(OffsetDateTime headerValue) if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleOffsetDateTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeHeaderParamOpt"); } } - public NilResult simpleOffsetDateTimeHeaderParamNil(OffsetDateTime headerValue) { + public Result simpleOffsetDateTimeHeaderParamNil(OffsetDateTime headerValue) { var $path = "%s/api/headerparametertypes/simpleOffsetDateTimeHeaderParamNil".formatted( this.baseURI()); @@ -2783,28 +2595,25 @@ public NilResult simpleOffsetDateTimeHeaderParamNil(OffsetDateTime headerValue) if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleOffsetDateTimeHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeHeaderParamNil"); } } - public NilResult simpleOffsetDateTimeHeaderParamOptNil() { + public Result simpleOffsetDateTimeHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleOffsetDateTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -2821,28 +2630,25 @@ public NilResult simpleOffsetDateTimeHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleOffsetDateTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeHeaderParamOptNil"); } } - public NilResult simpleOffsetDateTimeHeaderParamOptNil(OffsetDateTime headerValue) { + public Result simpleOffsetDateTimeHeaderParamOptNil(OffsetDateTime headerValue) { var $path = "%s/api/headerparametertypes/simpleOffsetDateTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -2866,28 +2672,25 @@ public NilResult simpleOffsetDateTimeHeaderParamOptNil(OffsetDateTime headerValu if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleOffsetDateTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeHeaderParamOptNil"); } } - public ZonedDateTime simpleZonedDateTimeHeaderParam(ZonedDateTime headerValue) { + public Result simpleZonedDateTimeHeaderParam(ZonedDateTime headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/headerparametertypes/simpleZonedDateTimeHeaderParam".formatted( @@ -2913,28 +2716,25 @@ public ZonedDateTime simpleZonedDateTimeHeaderParam(ZonedDateTime headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapZonedDateTime($response); this.lifecycleHook.onSuccess("simpleZonedDateTimeHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeHeaderParam", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeHeaderParam", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeHeaderParam"); } } - public NilResult simpleZonedDateTimeHeaderParamOpt() { + public Result simpleZonedDateTimeHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleZonedDateTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2951,28 +2751,25 @@ public NilResult simpleZonedDateTimeHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleZonedDateTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeHeaderParamOpt"); } } - public NilResult simpleZonedDateTimeHeaderParamOpt(ZonedDateTime headerValue) { + public Result simpleZonedDateTimeHeaderParamOpt(ZonedDateTime headerValue) { var $path = "%s/api/headerparametertypes/simpleZonedDateTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2996,28 +2793,25 @@ public NilResult simpleZonedDateTimeHeaderParamOpt(ZonedDateTime headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleZonedDateTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeHeaderParamOpt"); } } - public NilResult simpleZonedDateTimeHeaderParamNil(ZonedDateTime headerValue) { + public Result simpleZonedDateTimeHeaderParamNil(ZonedDateTime headerValue) { var $path = "%s/api/headerparametertypes/simpleZonedDateTimeHeaderParamNil".formatted( this.baseURI()); @@ -3041,28 +2835,25 @@ public NilResult simpleZonedDateTimeHeaderParamNil(ZonedDateTime headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleZonedDateTimeHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeHeaderParamNil"); } } - public NilResult simpleZonedDateTimeHeaderParamOptNil() { + public Result simpleZonedDateTimeHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleZonedDateTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -3079,28 +2870,25 @@ public NilResult simpleZonedDateTimeHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleZonedDateTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeHeaderParamOptNil"); } } - public NilResult simpleZonedDateTimeHeaderParamOptNil(ZonedDateTime headerValue) { + public Result simpleZonedDateTimeHeaderParamOptNil(ZonedDateTime headerValue) { var $path = "%s/api/headerparametertypes/simpleZonedDateTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -3124,28 +2912,25 @@ public NilResult simpleZonedDateTimeHeaderParamOptNil(ZonedDateTime headerValue) if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleZonedDateTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeHeaderParamOptNil"); } } - public ZoneId simpleScalarHeaderParam(ZoneId headerValue) { + public Result simpleScalarHeaderParam(ZoneId headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/headerparametertypes/simpleScalarHeaderParam".formatted( @@ -3171,28 +2956,25 @@ public ZoneId simpleScalarHeaderParam(ZoneId headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, ZoneId::of); this.lifecycleHook.onSuccess("simpleScalarHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarHeaderParam", e); - this.lifecycleHook.onCatch("simpleScalarHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarHeaderParam", e); + this.lifecycleHook.onCatch("simpleScalarHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarHeaderParam"); } } - public NilResult simpleScalarHeaderParamOpt() { + public Result simpleScalarHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleScalarHeaderParamOpt".formatted( this.baseURI()); @@ -3209,28 +2991,25 @@ public NilResult simpleScalarHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleScalarHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleScalarHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleScalarHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarHeaderParamOpt"); } } - public NilResult simpleScalarHeaderParamOpt(ZoneId headerValue) { + public Result simpleScalarHeaderParamOpt(ZoneId headerValue) { var $path = "%s/api/headerparametertypes/simpleScalarHeaderParamOpt".formatted( this.baseURI()); @@ -3254,28 +3033,25 @@ public NilResult simpleScalarHeaderParamOpt(ZoneId headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleScalarHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleScalarHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleScalarHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarHeaderParamOpt"); } } - public NilResult simpleScalarHeaderParamNil(ZoneId headerValue) { + public Result simpleScalarHeaderParamNil(ZoneId headerValue) { var $path = "%s/api/headerparametertypes/simpleScalarHeaderParamNil".formatted( this.baseURI()); @@ -3299,28 +3075,25 @@ public NilResult simpleScalarHeaderParamNil(ZoneId headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleScalarHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleScalarHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleScalarHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarHeaderParamNil"); } } - public NilResult simpleScalarHeaderParamOptNil() { + public Result simpleScalarHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleScalarHeaderParamOptNil".formatted( this.baseURI()); @@ -3337,28 +3110,25 @@ public NilResult simpleScalarHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleScalarHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleScalarHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleScalarHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarHeaderParamOptNil"); } } - public NilResult simpleScalarHeaderParamOptNil(ZoneId headerValue) { + public Result simpleScalarHeaderParamOptNil(ZoneId headerValue) { var $path = "%s/api/headerparametertypes/simpleScalarHeaderParamOptNil".formatted( this.baseURI()); @@ -3382,28 +3152,25 @@ public NilResult simpleScalarHeaderParamOptNil(ZoneId headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleScalarHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleScalarHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleScalarHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarHeaderParamOptNil"); } } - public SampleEnum simpleEnumHeaderParam(SampleEnum headerValue) { + public Result simpleEnumHeaderParam(SampleEnum headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/headerparametertypes/simpleEnumHeaderParam".formatted( @@ -3429,28 +3196,25 @@ public SampleEnum simpleEnumHeaderParam(SampleEnum headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, SampleEnum::valueOf); this.lifecycleHook.onSuccess("simpleEnumHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumHeaderParam", e); - this.lifecycleHook.onCatch("simpleEnumHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumHeaderParam", e); + this.lifecycleHook.onCatch("simpleEnumHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumHeaderParam"); } } - public NilResult simpleEnumHeaderParamOpt() { + public Result simpleEnumHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleEnumHeaderParamOpt".formatted( this.baseURI()); @@ -3467,28 +3231,25 @@ public NilResult simpleEnumHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleEnumHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleEnumHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleEnumHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumHeaderParamOpt"); } } - public NilResult simpleEnumHeaderParamOpt(SampleEnum headerValue) { + public Result simpleEnumHeaderParamOpt(SampleEnum headerValue) { var $path = "%s/api/headerparametertypes/simpleEnumHeaderParamOpt".formatted( this.baseURI()); @@ -3512,28 +3273,25 @@ public NilResult simpleEnumHeaderParamOpt(SampleEnum headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleEnumHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleEnumHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleEnumHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumHeaderParamOpt"); } } - public NilResult simpleEnumHeaderParamNil(SampleEnum headerValue) { + public Result simpleEnumHeaderParamNil(SampleEnum headerValue) { var $path = "%s/api/headerparametertypes/simpleEnumHeaderParamNil".formatted( this.baseURI()); @@ -3557,28 +3315,25 @@ public NilResult simpleEnumHeaderParamNil(SampleEnum headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleEnumHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleEnumHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleEnumHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumHeaderParamNil"); } } - public NilResult simpleEnumHeaderParamOptNil() { + public Result simpleEnumHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleEnumHeaderParamOptNil".formatted( this.baseURI()); @@ -3595,28 +3350,25 @@ public NilResult simpleEnumHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleEnumHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleEnumHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleEnumHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumHeaderParamOptNil"); } } - public NilResult simpleEnumHeaderParamOptNil(SampleEnum headerValue) { + public Result simpleEnumHeaderParamOptNil(SampleEnum headerValue) { var $path = "%s/api/headerparametertypes/simpleEnumHeaderParamOptNil".formatted( this.baseURI()); @@ -3640,28 +3392,25 @@ public NilResult simpleEnumHeaderParamOptNil(SampleEnum headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleEnumHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleEnumHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleEnumHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumHeaderParamOptNil"); } } - public SimpleInlineEnumHeaderParam_Result$ simpleInlineEnumHeaderParam(SimpleInlineEnumHeaderParam_HeaderValue_Param$ headerValue) { + public Result simpleInlineEnumHeaderParam(SimpleInlineEnumHeaderParam_HeaderValue_Param$ headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/headerparametertypes/simpleInlineEnumHeaderParam".formatted( @@ -3687,28 +3436,25 @@ public NilResult simpleEnumHeaderParamOptNil(SampleEnum headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, SimpleInlineEnumHeaderParam_Result$::valueOf); this.lifecycleHook.onSuccess("simpleInlineEnumHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleInlineEnumHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleInlineEnumHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleInlineEnumHeaderParam", e); - this.lifecycleHook.onCatch("simpleInlineEnumHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleInlineEnumHeaderParam", e); + this.lifecycleHook.onCatch("simpleInlineEnumHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleInlineEnumHeaderParam"); } } - public NilResult simpleInlineEnumHeaderParamOpt() { + public Result simpleInlineEnumHeaderParamOpt() { var $path = "%s/api/headerparametertypes/simpleInlineEnumHeaderParamOpt".formatted( this.baseURI()); @@ -3725,28 +3471,25 @@ public NilResult simpleInlineEnumHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleInlineEnumHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleInlineEnumHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleInlineEnumHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleInlineEnumHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleInlineEnumHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleInlineEnumHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleInlineEnumHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleInlineEnumHeaderParamOpt"); } } - public NilResult simpleInlineEnumHeaderParamOpt(SimpleInlineEnumHeaderParamOpt_HeaderValue_Param$ headerValue) { + public Result simpleInlineEnumHeaderParamOpt(SimpleInlineEnumHeaderParamOpt_HeaderValue_Param$ headerValue) { var $path = "%s/api/headerparametertypes/simpleInlineEnumHeaderParamOpt".formatted( this.baseURI()); @@ -3770,28 +3513,25 @@ public NilResult simpleInlineEnumHeaderParamOpt(SimpleInlineEnumHeaderParamOpt_H if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleInlineEnumHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleInlineEnumHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleInlineEnumHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleInlineEnumHeaderParamOpt", e); - this.lifecycleHook.onCatch("simpleInlineEnumHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleInlineEnumHeaderParamOpt", e); + this.lifecycleHook.onCatch("simpleInlineEnumHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleInlineEnumHeaderParamOpt"); } } - public NilResult simpleInlineEnumHeaderParamNil(SimpleInlineEnumHeaderParamNil_HeaderValue_Param$ headerValue) { + public Result simpleInlineEnumHeaderParamNil(SimpleInlineEnumHeaderParamNil_HeaderValue_Param$ headerValue) { var $path = "%s/api/headerparametertypes/simpleInlineEnumHeaderParamNil".formatted( this.baseURI()); @@ -3815,28 +3555,25 @@ public NilResult simpleInlineEnumHeaderParamNil(SimpleInlineEnumHeaderParamNil_H if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleInlineEnumHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleInlineEnumHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleInlineEnumHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleInlineEnumHeaderParamNil", e); - this.lifecycleHook.onCatch("simpleInlineEnumHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleInlineEnumHeaderParamNil", e); + this.lifecycleHook.onCatch("simpleInlineEnumHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleInlineEnumHeaderParamNil"); } } - public NilResult simpleInlineEnumHeaderParamOptNil() { + public Result simpleInlineEnumHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/simpleInlineEnumHeaderParamOptNil".formatted( this.baseURI()); @@ -3853,28 +3590,25 @@ public NilResult simpleInlineEnumHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleInlineEnumHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleInlineEnumHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleInlineEnumHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleInlineEnumHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleInlineEnumHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleInlineEnumHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleInlineEnumHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleInlineEnumHeaderParamOptNil"); } } - public NilResult simpleInlineEnumHeaderParamOptNil(SimpleInlineEnumHeaderParamOptNil_HeaderValue_Param$ headerValue) { + public Result simpleInlineEnumHeaderParamOptNil(SimpleInlineEnumHeaderParamOptNil_HeaderValue_Param$ headerValue) { var $path = "%s/api/headerparametertypes/simpleInlineEnumHeaderParamOptNil".formatted( this.baseURI()); @@ -3898,28 +3632,25 @@ public NilResult simpleInlineEnumHeaderParamOptNil(SimpleInlineEnumHeaderParamOp if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleInlineEnumHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleInlineEnumHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleInlineEnumHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleInlineEnumHeaderParamOptNil", e); - this.lifecycleHook.onCatch("simpleInlineEnumHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleInlineEnumHeaderParamOptNil", e); + this.lifecycleHook.onCatch("simpleInlineEnumHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleInlineEnumHeaderParamOptNil"); } } - public String multiHeaderParam(String valueA, int valueB) { + public Result multiHeaderParam(String valueA, int valueB) { Objects.requireNonNull(valueA, "valueA must not be null"); var $path = "%s/api/headerparametertypes/multiHeaderParam".formatted( @@ -3946,28 +3677,25 @@ public String multiHeaderParam(String valueA, int valueB) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiHeaderParam", e); - this.lifecycleHook.onCatch("multiHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiHeaderParam", e); + this.lifecycleHook.onCatch("multiHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiHeaderParam"); } } - public List multiHeaderParamOpt() { + public Result, RSDError.$GenericError> multiHeaderParamOpt() { var $path = "%s/api/headerparametertypes/multiHeaderParamOpt".formatted( this.baseURI()); @@ -3984,28 +3712,25 @@ public List multiHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("multiHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiHeaderParamOpt", e); - this.lifecycleHook.onCatch("multiHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiHeaderParamOpt", e); + this.lifecycleHook.onCatch("multiHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiHeaderParamOpt"); } } - public List multiHeaderParamOpt(String valueA) { + public Result, RSDError.$GenericError> multiHeaderParamOpt(String valueA) { var $path = "%s/api/headerparametertypes/multiHeaderParamOpt".formatted( this.baseURI()); @@ -4031,28 +3756,25 @@ public List multiHeaderParamOpt(String valueA) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("multiHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiHeaderParamOpt", e); - this.lifecycleHook.onCatch("multiHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiHeaderParamOpt", e); + this.lifecycleHook.onCatch("multiHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiHeaderParamOpt"); } } - public List multiHeaderParamOpt(String valueA, Integer valueB) { + public Result, RSDError.$GenericError> multiHeaderParamOpt(String valueA, Integer valueB) { var $path = "%s/api/headerparametertypes/multiHeaderParamOpt".formatted( this.baseURI()); @@ -4079,28 +3801,25 @@ public List multiHeaderParamOpt(String valueA, Integer valueB) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("multiHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiHeaderParamOpt", e); - this.lifecycleHook.onCatch("multiHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiHeaderParamOpt", e); + this.lifecycleHook.onCatch("multiHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiHeaderParamOpt"); } } - public List multiHeaderParamNil(String valueA, Integer valueB) { + public Result, RSDError.$GenericError> multiHeaderParamNil(String valueA, Integer valueB) { var $path = "%s/api/headerparametertypes/multiHeaderParamNil".formatted( this.baseURI()); @@ -4129,28 +3848,25 @@ public List multiHeaderParamNil(String valueA, Integer valueB) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("multiHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiHeaderParamNil", e); - this.lifecycleHook.onCatch("multiHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiHeaderParamNil", e); + this.lifecycleHook.onCatch("multiHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiHeaderParamNil"); } } - public List multiHeaderParamOptNil() { + public Result, RSDError.$GenericError> multiHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/multiHeaderParamOptNil".formatted( this.baseURI()); @@ -4167,28 +3883,25 @@ public List multiHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("multiHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiHeaderParamOptNil", e); - this.lifecycleHook.onCatch("multiHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiHeaderParamOptNil", e); + this.lifecycleHook.onCatch("multiHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiHeaderParamOptNil"); } } - public List multiHeaderParamOptNil(String valueA) { + public Result, RSDError.$GenericError> multiHeaderParamOptNil(String valueA) { var $path = "%s/api/headerparametertypes/multiHeaderParamOptNil".formatted( this.baseURI()); @@ -4216,28 +3929,25 @@ public List multiHeaderParamOptNil(String valueA) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("multiHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiHeaderParamOptNil", e); - this.lifecycleHook.onCatch("multiHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiHeaderParamOptNil", e); + this.lifecycleHook.onCatch("multiHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiHeaderParamOptNil"); } } - public List multiHeaderParamOptNil(String valueA, Integer valueB) { + public Result, RSDError.$GenericError> multiHeaderParamOptNil(String valueA, Integer valueB) { var $path = "%s/api/headerparametertypes/multiHeaderParamOptNil".formatted( this.baseURI()); @@ -4266,28 +3976,25 @@ public List multiHeaderParamOptNil(String valueA, Integer valueB) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("multiHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiHeaderParamOptNil", e); - this.lifecycleHook.onCatch("multiHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiHeaderParamOptNil", e); + this.lifecycleHook.onCatch("multiHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiHeaderParamOptNil"); } } - public SimpleRecord.Data recordHeaderParam(SimpleRecord.Data headerValue) { + public Result recordHeaderParam(SimpleRecord.Data headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/headerparametertypes/recordHeaderParam".formatted( @@ -4314,28 +4021,25 @@ public SimpleRecord.Data recordHeaderParam(SimpleRecord.Data headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, SimpleRecordDataImpl::of, SimpleRecord.Data.class); this.lifecycleHook.onSuccess("recordHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordHeaderParam", e); - this.lifecycleHook.onCatch("recordHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordHeaderParam", e); + this.lifecycleHook.onCatch("recordHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordHeaderParam"); } } - public NilResult recordHeaderParamOpt() { + public Result recordHeaderParamOpt() { var $path = "%s/api/headerparametertypes/recordHeaderParamOpt".formatted( this.baseURI()); @@ -4352,28 +4056,25 @@ public NilResult recordHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("recordHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordHeaderParamOpt", e); - this.lifecycleHook.onCatch("recordHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordHeaderParamOpt", e); + this.lifecycleHook.onCatch("recordHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordHeaderParamOpt"); } } - public NilResult recordHeaderParamOpt(SimpleRecord.Data headerValue) { + public Result recordHeaderParamOpt(SimpleRecord.Data headerValue) { var $path = "%s/api/headerparametertypes/recordHeaderParamOpt".formatted( this.baseURI()); @@ -4400,28 +4101,25 @@ public NilResult recordHeaderParamOpt(SimpleRecord.Data headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("recordHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordHeaderParamOpt", e); - this.lifecycleHook.onCatch("recordHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordHeaderParamOpt", e); + this.lifecycleHook.onCatch("recordHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordHeaderParamOpt"); } } - public NilResult recordHeaderParamNil(SimpleRecord.Data headerValue) { + public Result recordHeaderParamNil(SimpleRecord.Data headerValue) { var $path = "%s/api/headerparametertypes/recordHeaderParamNil".formatted( this.baseURI()); @@ -4450,28 +4148,25 @@ public NilResult recordHeaderParamNil(SimpleRecord.Data headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("recordHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordHeaderParamNil", e); - this.lifecycleHook.onCatch("recordHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordHeaderParamNil", e); + this.lifecycleHook.onCatch("recordHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordHeaderParamNil"); } } - public NilResult recordHeaderParamOptNil() { + public Result recordHeaderParamOptNil() { var $path = "%s/api/headerparametertypes/recordHeaderParamOptNil".formatted( this.baseURI()); @@ -4488,28 +4183,25 @@ public NilResult recordHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("recordHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordHeaderParamOptNil", e); - this.lifecycleHook.onCatch("recordHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordHeaderParamOptNil", e); + this.lifecycleHook.onCatch("recordHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordHeaderParamOptNil"); } } - public NilResult recordHeaderParamOptNil(SimpleRecord.Data headerValue) { + public Result recordHeaderParamOptNil(SimpleRecord.Data headerValue) { var $path = "%s/api/headerparametertypes/recordHeaderParamOptNil".formatted( this.baseURI()); @@ -4538,28 +4230,25 @@ public NilResult recordHeaderParamOptNil(SimpleRecord.Data headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("recordHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordHeaderParamOptNil", e); - this.lifecycleHook.onCatch("recordHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordHeaderParamOptNil", e); + this.lifecycleHook.onCatch("recordHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordHeaderParamOptNil"); } } - public void mixed(String pathString, int pathNumber, String headerString, int headerNumber, SimpleRecord.Data headerRecord, SimpleRecord.Data body, String queryString, double queryNumber, SimpleRecord.Data queryRecord) { + public Result mixed(String pathString, int pathNumber, String headerString, int headerNumber, SimpleRecord.Data headerRecord, SimpleRecord.Data body, String queryString, double queryNumber, SimpleRecord.Data queryRecord) { Objects.requireNonNull(pathString, "pathString must not be null"); Objects.requireNonNull(headerString, "headerString must not be null"); Objects.requireNonNull(headerRecord, "headerRecord must not be null"); @@ -4603,22 +4292,19 @@ public void mixed(String pathString, int pathNumber, String headerString, int he var $response = this.httpClient().send($request, BodyHandlers.ofInputStream()); if ($response.statusCode() == 204) { this.lifecycleHook.onSuccess("mixed", null, this.client.createResponseAdaptable($response)); - return; + return Result.ok(null); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("mixed", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("mixed", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation mixed", e); - this.lifecycleHook.onCatch("mixed", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation mixed", e); + this.lifecycleHook.onCatch("mixed", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("mixed"); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListBodyParameterTypesServiceImpl.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListBodyParameterTypesServiceImpl.java index b28bd3b8..77ea0d18 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListBodyParameterTypesServiceImpl.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListBodyParameterTypesServiceImpl.java @@ -29,7 +29,8 @@ import dev.rsdlang.sample.client.model.SampleEnum; import dev.rsdlang.sample.client.model.SimpleRecord; import dev.rsdlang.sample.client.model.ZoneId; -import dev.rsdlang.sample.client.RSDException; +import dev.rsdlang.sample.client.Result; +import dev.rsdlang.sample.client.RSDError; import dev.rsdlang.sample.client.SpecSamplesClient; public class ListBodyParameterTypesServiceImpl implements ListBodyParameterTypesService { @@ -58,7 +59,7 @@ private String contentType() { return this.client.contentTypeEncoding().contentType; } - public List listBooleanBodyParam(List bodyBoolean) { + public Result, RSDError.$GenericError> listBooleanBodyParam(List bodyBoolean) { var $path = "%s/api/listbodyparametertypes/listBooleanBodyParam".formatted( this.baseURI()); @@ -79,28 +80,25 @@ public List listBooleanBodyParam(List bodyBoolean) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapBooleans($response); this.lifecycleHook.onSuccess("listBooleanBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanBodyParam", e); - this.lifecycleHook.onCatch("listBooleanBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanBodyParam", e); + this.lifecycleHook.onCatch("listBooleanBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanBodyParam"); } } - public NilResult listBooleanBodyParamOpt() { + public Result listBooleanBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listBooleanBodyParamOpt".formatted( this.baseURI()); @@ -121,28 +119,25 @@ public NilResult listBooleanBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listBooleanBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanBodyParamOpt", e); - this.lifecycleHook.onCatch("listBooleanBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanBodyParamOpt", e); + this.lifecycleHook.onCatch("listBooleanBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanBodyParamOpt"); } } - public NilResult listBooleanBodyParamOpt(List bodyBoolean) { + public Result listBooleanBodyParamOpt(List bodyBoolean) { var $path = "%s/api/listbodyparametertypes/listBooleanBodyParamOpt".formatted( this.baseURI()); @@ -163,28 +158,25 @@ public NilResult listBooleanBodyParamOpt(List bodyBoolean) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listBooleanBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanBodyParamOpt", e); - this.lifecycleHook.onCatch("listBooleanBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanBodyParamOpt", e); + this.lifecycleHook.onCatch("listBooleanBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanBodyParamOpt"); } } - public NilResult listBooleanBodyParamNil(List bodyBoolean) { + public Result listBooleanBodyParamNil(List bodyBoolean) { var $path = "%s/api/listbodyparametertypes/listBooleanBodyParamNil".formatted( this.baseURI()); @@ -205,28 +197,25 @@ public NilResult listBooleanBodyParamNil(List bodyBoolean) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listBooleanBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanBodyParamNil", e); - this.lifecycleHook.onCatch("listBooleanBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanBodyParamNil", e); + this.lifecycleHook.onCatch("listBooleanBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanBodyParamNil"); } } - public NilResult listBooleanBodyParamOptNil() { + public Result listBooleanBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listBooleanBodyParamOptNil".formatted( this.baseURI()); @@ -247,28 +236,25 @@ public NilResult listBooleanBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listBooleanBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanBodyParamOptNil", e); - this.lifecycleHook.onCatch("listBooleanBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanBodyParamOptNil", e); + this.lifecycleHook.onCatch("listBooleanBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanBodyParamOptNil"); } } - public NilResult listBooleanBodyParamOptNil(List bodyBoolean) { + public Result listBooleanBodyParamOptNil(List bodyBoolean) { var $path = "%s/api/listbodyparametertypes/listBooleanBodyParamOptNil".formatted( this.baseURI()); @@ -289,28 +275,25 @@ public NilResult listBooleanBodyParamOptNil(List bodyBoolean) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listBooleanBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanBodyParamOptNil", e); - this.lifecycleHook.onCatch("listBooleanBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanBodyParamOptNil", e); + this.lifecycleHook.onCatch("listBooleanBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanBodyParamOptNil"); } } - public List listShortBodyParam(List bodyShort) { + public Result, RSDError.$GenericError> listShortBodyParam(List bodyShort) { var $path = "%s/api/listbodyparametertypes/listShortBodyParam".formatted( this.baseURI()); @@ -331,28 +314,25 @@ public List listShortBodyParam(List bodyShort) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapShorts($response); this.lifecycleHook.onSuccess("listShortBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortBodyParam", e); - this.lifecycleHook.onCatch("listShortBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortBodyParam", e); + this.lifecycleHook.onCatch("listShortBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortBodyParam"); } } - public NilResult listShortBodyParamOpt() { + public Result listShortBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listShortBodyParamOpt".formatted( this.baseURI()); @@ -373,28 +353,25 @@ public NilResult listShortBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listShortBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortBodyParamOpt", e); - this.lifecycleHook.onCatch("listShortBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortBodyParamOpt", e); + this.lifecycleHook.onCatch("listShortBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortBodyParamOpt"); } } - public NilResult listShortBodyParamOpt(List bodyShort) { + public Result listShortBodyParamOpt(List bodyShort) { var $path = "%s/api/listbodyparametertypes/listShortBodyParamOpt".formatted( this.baseURI()); @@ -415,28 +392,25 @@ public NilResult listShortBodyParamOpt(List bodyShort) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listShortBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortBodyParamOpt", e); - this.lifecycleHook.onCatch("listShortBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortBodyParamOpt", e); + this.lifecycleHook.onCatch("listShortBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortBodyParamOpt"); } } - public NilResult listShortBodyParamNil(List bodyShort) { + public Result listShortBodyParamNil(List bodyShort) { var $path = "%s/api/listbodyparametertypes/listShortBodyParamNil".formatted( this.baseURI()); @@ -457,28 +431,25 @@ public NilResult listShortBodyParamNil(List bodyShort) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listShortBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortBodyParamNil", e); - this.lifecycleHook.onCatch("listShortBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortBodyParamNil", e); + this.lifecycleHook.onCatch("listShortBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortBodyParamNil"); } } - public NilResult listShortBodyParamOptNil() { + public Result listShortBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listShortBodyParamOptNil".formatted( this.baseURI()); @@ -499,28 +470,25 @@ public NilResult listShortBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listShortBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortBodyParamOptNil", e); - this.lifecycleHook.onCatch("listShortBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortBodyParamOptNil", e); + this.lifecycleHook.onCatch("listShortBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortBodyParamOptNil"); } } - public NilResult listShortBodyParamOptNil(List bodyShort) { + public Result listShortBodyParamOptNil(List bodyShort) { var $path = "%s/api/listbodyparametertypes/listShortBodyParamOptNil".formatted( this.baseURI()); @@ -541,28 +509,25 @@ public NilResult listShortBodyParamOptNil(List bodyShort) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listShortBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortBodyParamOptNil", e); - this.lifecycleHook.onCatch("listShortBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortBodyParamOptNil", e); + this.lifecycleHook.onCatch("listShortBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortBodyParamOptNil"); } } - public List listIntBodyParam(List bodyInt) { + public Result, RSDError.$GenericError> listIntBodyParam(List bodyInt) { var $path = "%s/api/listbodyparametertypes/listIntBodyParam".formatted( this.baseURI()); @@ -583,28 +548,25 @@ public List listIntBodyParam(List bodyInt) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInts($response); this.lifecycleHook.onSuccess("listIntBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntBodyParam", e); - this.lifecycleHook.onCatch("listIntBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntBodyParam", e); + this.lifecycleHook.onCatch("listIntBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntBodyParam"); } } - public NilResult listIntBodyParamOpt() { + public Result listIntBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listIntBodyParamOpt".formatted( this.baseURI()); @@ -625,28 +587,25 @@ public NilResult listIntBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listIntBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntBodyParamOpt", e); - this.lifecycleHook.onCatch("listIntBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntBodyParamOpt", e); + this.lifecycleHook.onCatch("listIntBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntBodyParamOpt"); } } - public NilResult listIntBodyParamOpt(List bodyInt) { + public Result listIntBodyParamOpt(List bodyInt) { var $path = "%s/api/listbodyparametertypes/listIntBodyParamOpt".formatted( this.baseURI()); @@ -667,28 +626,25 @@ public NilResult listIntBodyParamOpt(List bodyInt) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listIntBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntBodyParamOpt", e); - this.lifecycleHook.onCatch("listIntBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntBodyParamOpt", e); + this.lifecycleHook.onCatch("listIntBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntBodyParamOpt"); } } - public NilResult listIntBodyParamNil(List bodyInt) { + public Result listIntBodyParamNil(List bodyInt) { var $path = "%s/api/listbodyparametertypes/listIntBodyParamNil".formatted( this.baseURI()); @@ -709,28 +665,25 @@ public NilResult listIntBodyParamNil(List bodyInt) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listIntBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntBodyParamNil", e); - this.lifecycleHook.onCatch("listIntBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntBodyParamNil", e); + this.lifecycleHook.onCatch("listIntBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntBodyParamNil"); } } - public NilResult listIntBodyParamOptNil() { + public Result listIntBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listIntBodyParamOptNil".formatted( this.baseURI()); @@ -751,28 +704,25 @@ public NilResult listIntBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listIntBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntBodyParamOptNil", e); - this.lifecycleHook.onCatch("listIntBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntBodyParamOptNil", e); + this.lifecycleHook.onCatch("listIntBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntBodyParamOptNil"); } } - public NilResult listIntBodyParamOptNil(List bodyInt) { + public Result listIntBodyParamOptNil(List bodyInt) { var $path = "%s/api/listbodyparametertypes/listIntBodyParamOptNil".formatted( this.baseURI()); @@ -793,28 +743,25 @@ public NilResult listIntBodyParamOptNil(List bodyInt) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listIntBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntBodyParamOptNil", e); - this.lifecycleHook.onCatch("listIntBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntBodyParamOptNil", e); + this.lifecycleHook.onCatch("listIntBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntBodyParamOptNil"); } } - public List listLongBodyParam(List bodyLong) { + public Result, RSDError.$GenericError> listLongBodyParam(List bodyLong) { var $path = "%s/api/listbodyparametertypes/listLongBodyParam".formatted( this.baseURI()); @@ -835,28 +782,25 @@ public List listLongBodyParam(List bodyLong) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLongs($response); this.lifecycleHook.onSuccess("listLongBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongBodyParam", e); - this.lifecycleHook.onCatch("listLongBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongBodyParam", e); + this.lifecycleHook.onCatch("listLongBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongBodyParam"); } } - public NilResult listLongBodyParamOpt() { + public Result listLongBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listLongBodyParamOpt".formatted( this.baseURI()); @@ -877,28 +821,25 @@ public NilResult listLongBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLongBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongBodyParamOpt", e); - this.lifecycleHook.onCatch("listLongBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongBodyParamOpt", e); + this.lifecycleHook.onCatch("listLongBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongBodyParamOpt"); } } - public NilResult listLongBodyParamOpt(List bodyLong) { + public Result listLongBodyParamOpt(List bodyLong) { var $path = "%s/api/listbodyparametertypes/listLongBodyParamOpt".formatted( this.baseURI()); @@ -919,28 +860,25 @@ public NilResult listLongBodyParamOpt(List bodyLong) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLongBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongBodyParamOpt", e); - this.lifecycleHook.onCatch("listLongBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongBodyParamOpt", e); + this.lifecycleHook.onCatch("listLongBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongBodyParamOpt"); } } - public NilResult listLongBodyParamNil(List bodyLong) { + public Result listLongBodyParamNil(List bodyLong) { var $path = "%s/api/listbodyparametertypes/listLongBodyParamNil".formatted( this.baseURI()); @@ -961,28 +899,25 @@ public NilResult listLongBodyParamNil(List bodyLong) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLongBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongBodyParamNil", e); - this.lifecycleHook.onCatch("listLongBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongBodyParamNil", e); + this.lifecycleHook.onCatch("listLongBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongBodyParamNil"); } } - public NilResult listLongBodyParamOptNil() { + public Result listLongBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listLongBodyParamOptNil".formatted( this.baseURI()); @@ -1003,28 +938,25 @@ public NilResult listLongBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLongBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongBodyParamOptNil", e); - this.lifecycleHook.onCatch("listLongBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongBodyParamOptNil", e); + this.lifecycleHook.onCatch("listLongBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongBodyParamOptNil"); } } - public NilResult listLongBodyParamOptNil(List bodyLong) { + public Result listLongBodyParamOptNil(List bodyLong) { var $path = "%s/api/listbodyparametertypes/listLongBodyParamOptNil".formatted( this.baseURI()); @@ -1045,28 +977,25 @@ public NilResult listLongBodyParamOptNil(List bodyLong) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLongBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongBodyParamOptNil", e); - this.lifecycleHook.onCatch("listLongBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongBodyParamOptNil", e); + this.lifecycleHook.onCatch("listLongBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongBodyParamOptNil"); } } - public List listFloatBodyParam(List bodyFloat) { + public Result, RSDError.$GenericError> listFloatBodyParam(List bodyFloat) { var $path = "%s/api/listbodyparametertypes/listFloatBodyParam".formatted( this.baseURI()); @@ -1087,28 +1016,25 @@ public List listFloatBodyParam(List bodyFloat) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapFloats($response); this.lifecycleHook.onSuccess("listFloatBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatBodyParam", e); - this.lifecycleHook.onCatch("listFloatBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatBodyParam", e); + this.lifecycleHook.onCatch("listFloatBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatBodyParam"); } } - public NilResult listFloatBodyParamOpt() { + public Result listFloatBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listFloatBodyParamOpt".formatted( this.baseURI()); @@ -1129,28 +1055,25 @@ public NilResult listFloatBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listFloatBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatBodyParamOpt", e); - this.lifecycleHook.onCatch("listFloatBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatBodyParamOpt", e); + this.lifecycleHook.onCatch("listFloatBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatBodyParamOpt"); } } - public NilResult listFloatBodyParamOpt(List bodyFloat) { + public Result listFloatBodyParamOpt(List bodyFloat) { var $path = "%s/api/listbodyparametertypes/listFloatBodyParamOpt".formatted( this.baseURI()); @@ -1171,28 +1094,25 @@ public NilResult listFloatBodyParamOpt(List bodyFloat) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listFloatBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatBodyParamOpt", e); - this.lifecycleHook.onCatch("listFloatBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatBodyParamOpt", e); + this.lifecycleHook.onCatch("listFloatBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatBodyParamOpt"); } } - public NilResult listFloatBodyParamNil(List bodyFloat) { + public Result listFloatBodyParamNil(List bodyFloat) { var $path = "%s/api/listbodyparametertypes/listFloatBodyParamNil".formatted( this.baseURI()); @@ -1213,28 +1133,25 @@ public NilResult listFloatBodyParamNil(List bodyFloat) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listFloatBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatBodyParamNil", e); - this.lifecycleHook.onCatch("listFloatBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatBodyParamNil", e); + this.lifecycleHook.onCatch("listFloatBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatBodyParamNil"); } } - public NilResult listFloatBodyParamOptNil() { + public Result listFloatBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listFloatBodyParamOptNil".formatted( this.baseURI()); @@ -1255,28 +1172,25 @@ public NilResult listFloatBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listFloatBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatBodyParamOptNil", e); - this.lifecycleHook.onCatch("listFloatBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatBodyParamOptNil", e); + this.lifecycleHook.onCatch("listFloatBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatBodyParamOptNil"); } } - public NilResult listFloatBodyParamOptNil(List bodyFloat) { + public Result listFloatBodyParamOptNil(List bodyFloat) { var $path = "%s/api/listbodyparametertypes/listFloatBodyParamOptNil".formatted( this.baseURI()); @@ -1297,28 +1211,25 @@ public NilResult listFloatBodyParamOptNil(List bodyFloat) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listFloatBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatBodyParamOptNil", e); - this.lifecycleHook.onCatch("listFloatBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatBodyParamOptNil", e); + this.lifecycleHook.onCatch("listFloatBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatBodyParamOptNil"); } } - public List listDoubleBodyParam(List bodyDouble) { + public Result, RSDError.$GenericError> listDoubleBodyParam(List bodyDouble) { var $path = "%s/api/listbodyparametertypes/listDoubleBodyParam".formatted( this.baseURI()); @@ -1339,28 +1250,25 @@ public List listDoubleBodyParam(List bodyDouble) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapDoubles($response); this.lifecycleHook.onSuccess("listDoubleBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleBodyParam", e); - this.lifecycleHook.onCatch("listDoubleBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleBodyParam", e); + this.lifecycleHook.onCatch("listDoubleBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleBodyParam"); } } - public NilResult listDoubleBodyParamOpt() { + public Result listDoubleBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listDoubleBodyParamOpt".formatted( this.baseURI()); @@ -1381,28 +1289,25 @@ public NilResult listDoubleBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listDoubleBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleBodyParamOpt", e); - this.lifecycleHook.onCatch("listDoubleBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleBodyParamOpt", e); + this.lifecycleHook.onCatch("listDoubleBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleBodyParamOpt"); } } - public NilResult listDoubleBodyParamOpt(List bodyDouble) { + public Result listDoubleBodyParamOpt(List bodyDouble) { var $path = "%s/api/listbodyparametertypes/listDoubleBodyParamOpt".formatted( this.baseURI()); @@ -1423,28 +1328,25 @@ public NilResult listDoubleBodyParamOpt(List bodyDouble) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listDoubleBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleBodyParamOpt", e); - this.lifecycleHook.onCatch("listDoubleBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleBodyParamOpt", e); + this.lifecycleHook.onCatch("listDoubleBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleBodyParamOpt"); } } - public NilResult listDoubleBodyParamNil(List bodyDouble) { + public Result listDoubleBodyParamNil(List bodyDouble) { var $path = "%s/api/listbodyparametertypes/listDoubleBodyParamNil".formatted( this.baseURI()); @@ -1465,28 +1367,25 @@ public NilResult listDoubleBodyParamNil(List bodyDouble) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listDoubleBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleBodyParamNil", e); - this.lifecycleHook.onCatch("listDoubleBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleBodyParamNil", e); + this.lifecycleHook.onCatch("listDoubleBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleBodyParamNil"); } } - public NilResult listDoubleBodyParamOptNil() { + public Result listDoubleBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listDoubleBodyParamOptNil".formatted( this.baseURI()); @@ -1507,28 +1406,25 @@ public NilResult listDoubleBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listDoubleBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleBodyParamOptNil", e); - this.lifecycleHook.onCatch("listDoubleBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleBodyParamOptNil", e); + this.lifecycleHook.onCatch("listDoubleBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleBodyParamOptNil"); } } - public NilResult listDoubleBodyParamOptNil(List bodyDouble) { + public Result listDoubleBodyParamOptNil(List bodyDouble) { var $path = "%s/api/listbodyparametertypes/listDoubleBodyParamOptNil".formatted( this.baseURI()); @@ -1549,28 +1445,25 @@ public NilResult listDoubleBodyParamOptNil(List bodyDouble) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listDoubleBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleBodyParamOptNil", e); - this.lifecycleHook.onCatch("listDoubleBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleBodyParamOptNil", e); + this.lifecycleHook.onCatch("listDoubleBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleBodyParamOptNil"); } } - public List listStringBodyParam(List bodyString) { + public Result, RSDError.$GenericError> listStringBodyParam(List bodyString) { Objects.requireNonNull(bodyString, "bodyString must not be null"); var $path = "%s/api/listbodyparametertypes/listStringBodyParam".formatted( @@ -1593,28 +1486,25 @@ public List listStringBodyParam(List bodyString) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapStrings($response); this.lifecycleHook.onSuccess("listStringBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringBodyParam", e); - this.lifecycleHook.onCatch("listStringBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringBodyParam", e); + this.lifecycleHook.onCatch("listStringBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringBodyParam"); } } - public NilResult listStringBodyParamOpt() { + public Result listStringBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listStringBodyParamOpt".formatted( this.baseURI()); @@ -1635,28 +1525,25 @@ public NilResult listStringBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listStringBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringBodyParamOpt", e); - this.lifecycleHook.onCatch("listStringBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringBodyParamOpt", e); + this.lifecycleHook.onCatch("listStringBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringBodyParamOpt"); } } - public NilResult listStringBodyParamOpt(List bodyString) { + public Result listStringBodyParamOpt(List bodyString) { var $path = "%s/api/listbodyparametertypes/listStringBodyParamOpt".formatted( this.baseURI()); @@ -1677,28 +1564,25 @@ public NilResult listStringBodyParamOpt(List bodyString) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listStringBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringBodyParamOpt", e); - this.lifecycleHook.onCatch("listStringBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringBodyParamOpt", e); + this.lifecycleHook.onCatch("listStringBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringBodyParamOpt"); } } - public NilResult listStringBodyParamNil(List bodyString) { + public Result listStringBodyParamNil(List bodyString) { var $path = "%s/api/listbodyparametertypes/listStringBodyParamNil".formatted( this.baseURI()); @@ -1719,28 +1603,25 @@ public NilResult listStringBodyParamNil(List bodyString) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listStringBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringBodyParamNil", e); - this.lifecycleHook.onCatch("listStringBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringBodyParamNil", e); + this.lifecycleHook.onCatch("listStringBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringBodyParamNil"); } } - public NilResult listStringBodyParamOptNil() { + public Result listStringBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listStringBodyParamOptNil".formatted( this.baseURI()); @@ -1761,28 +1642,25 @@ public NilResult listStringBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listStringBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringBodyParamOptNil", e); - this.lifecycleHook.onCatch("listStringBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringBodyParamOptNil", e); + this.lifecycleHook.onCatch("listStringBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringBodyParamOptNil"); } } - public NilResult listStringBodyParamOptNil(List bodyString) { + public Result listStringBodyParamOptNil(List bodyString) { var $path = "%s/api/listbodyparametertypes/listStringBodyParamOptNil".formatted( this.baseURI()); @@ -1803,28 +1681,25 @@ public NilResult listStringBodyParamOptNil(List bodyString) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listStringBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringBodyParamOptNil", e); - this.lifecycleHook.onCatch("listStringBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringBodyParamOptNil", e); + this.lifecycleHook.onCatch("listStringBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringBodyParamOptNil"); } } - public List listLocalDateBodyParam(List bodyLocalDate) { + public Result, RSDError.$GenericError> listLocalDateBodyParam(List bodyLocalDate) { Objects.requireNonNull(bodyLocalDate, "bodyLocalDate must not be null"); var $path = "%s/api/listbodyparametertypes/listLocalDateBodyParam".formatted( @@ -1847,28 +1722,25 @@ public List listLocalDateBodyParam(List bodyLocalDate) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDates($response); this.lifecycleHook.onSuccess("listLocalDateBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateBodyParam", e); - this.lifecycleHook.onCatch("listLocalDateBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateBodyParam", e); + this.lifecycleHook.onCatch("listLocalDateBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateBodyParam"); } } - public NilResult listLocalDateBodyParamOpt() { + public Result listLocalDateBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listLocalDateBodyParamOpt".formatted( this.baseURI()); @@ -1889,28 +1761,25 @@ public NilResult listLocalDateBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateBodyParamOpt", e); - this.lifecycleHook.onCatch("listLocalDateBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateBodyParamOpt", e); + this.lifecycleHook.onCatch("listLocalDateBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateBodyParamOpt"); } } - public NilResult listLocalDateBodyParamOpt(List bodyLocalDate) { + public Result listLocalDateBodyParamOpt(List bodyLocalDate) { var $path = "%s/api/listbodyparametertypes/listLocalDateBodyParamOpt".formatted( this.baseURI()); @@ -1931,28 +1800,25 @@ public NilResult listLocalDateBodyParamOpt(List bodyLocalDate) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateBodyParamOpt", e); - this.lifecycleHook.onCatch("listLocalDateBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateBodyParamOpt", e); + this.lifecycleHook.onCatch("listLocalDateBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateBodyParamOpt"); } } - public NilResult listLocalDateBodyParamNil(List bodyLocalDate) { + public Result listLocalDateBodyParamNil(List bodyLocalDate) { var $path = "%s/api/listbodyparametertypes/listLocalDateBodyParamNil".formatted( this.baseURI()); @@ -1973,28 +1839,25 @@ public NilResult listLocalDateBodyParamNil(List bodyLocalDate) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateBodyParamNil", e); - this.lifecycleHook.onCatch("listLocalDateBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateBodyParamNil", e); + this.lifecycleHook.onCatch("listLocalDateBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateBodyParamNil"); } } - public NilResult listLocalDateBodyParamOptNil() { + public Result listLocalDateBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listLocalDateBodyParamOptNil".formatted( this.baseURI()); @@ -2015,28 +1878,25 @@ public NilResult listLocalDateBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateBodyParamOptNil", e); - this.lifecycleHook.onCatch("listLocalDateBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateBodyParamOptNil", e); + this.lifecycleHook.onCatch("listLocalDateBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateBodyParamOptNil"); } } - public NilResult listLocalDateBodyParamOptNil(List bodyLocalDate) { + public Result listLocalDateBodyParamOptNil(List bodyLocalDate) { var $path = "%s/api/listbodyparametertypes/listLocalDateBodyParamOptNil".formatted( this.baseURI()); @@ -2057,28 +1917,25 @@ public NilResult listLocalDateBodyParamOptNil(List bodyLocalDate) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateBodyParamOptNil", e); - this.lifecycleHook.onCatch("listLocalDateBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateBodyParamOptNil", e); + this.lifecycleHook.onCatch("listLocalDateBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateBodyParamOptNil"); } } - public List listLocalDateTimeBodyParam(List bodyLocalDateTime) { + public Result, RSDError.$GenericError> listLocalDateTimeBodyParam(List bodyLocalDateTime) { Objects.requireNonNull(bodyLocalDateTime, "bodyLocalDateTime must not be null"); var $path = "%s/api/listbodyparametertypes/listLocalDateTimeBodyParam".formatted( @@ -2101,28 +1958,25 @@ public List listLocalDateTimeBodyParam(List bodyLo if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDateTimes($response); this.lifecycleHook.onSuccess("listLocalDateTimeBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeBodyParam", e); - this.lifecycleHook.onCatch("listLocalDateTimeBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeBodyParam", e); + this.lifecycleHook.onCatch("listLocalDateTimeBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeBodyParam"); } } - public NilResult listLocalDateTimeBodyParamOpt() { + public Result listLocalDateTimeBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listLocalDateTimeBodyParamOpt".formatted( this.baseURI()); @@ -2143,28 +1997,25 @@ public NilResult listLocalDateTimeBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("listLocalDateTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("listLocalDateTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeBodyParamOpt"); } } - public NilResult listLocalDateTimeBodyParamOpt(List bodyLocalDateTime) { + public Result listLocalDateTimeBodyParamOpt(List bodyLocalDateTime) { var $path = "%s/api/listbodyparametertypes/listLocalDateTimeBodyParamOpt".formatted( this.baseURI()); @@ -2185,28 +2036,25 @@ public NilResult listLocalDateTimeBodyParamOpt(List bodyLocalDate if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("listLocalDateTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("listLocalDateTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeBodyParamOpt"); } } - public NilResult listLocalDateTimeBodyParamNil(List bodyLocalDateTime) { + public Result listLocalDateTimeBodyParamNil(List bodyLocalDateTime) { var $path = "%s/api/listbodyparametertypes/listLocalDateTimeBodyParamNil".formatted( this.baseURI()); @@ -2227,28 +2075,25 @@ public NilResult listLocalDateTimeBodyParamNil(List bodyLocalDate if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateTimeBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeBodyParamNil", e); - this.lifecycleHook.onCatch("listLocalDateTimeBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeBodyParamNil", e); + this.lifecycleHook.onCatch("listLocalDateTimeBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeBodyParamNil"); } } - public NilResult listLocalDateTimeBodyParamOptNil() { + public Result listLocalDateTimeBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listLocalDateTimeBodyParamOptNil".formatted( this.baseURI()); @@ -2269,28 +2114,25 @@ public NilResult listLocalDateTimeBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("listLocalDateTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("listLocalDateTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeBodyParamOptNil"); } } - public NilResult listLocalDateTimeBodyParamOptNil(List bodyLocalDateTime) { + public Result listLocalDateTimeBodyParamOptNil(List bodyLocalDateTime) { var $path = "%s/api/listbodyparametertypes/listLocalDateTimeBodyParamOptNil".formatted( this.baseURI()); @@ -2311,28 +2153,25 @@ public NilResult listLocalDateTimeBodyParamOptNil(List bodyLocalD if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("listLocalDateTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("listLocalDateTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeBodyParamOptNil"); } } - public List listLocalTimeBodyParam(List bodyLocalTime) { + public Result, RSDError.$GenericError> listLocalTimeBodyParam(List bodyLocalTime) { Objects.requireNonNull(bodyLocalTime, "bodyLocalTime must not be null"); var $path = "%s/api/listbodyparametertypes/listLocalTimeBodyParam".formatted( @@ -2355,28 +2194,25 @@ public List listLocalTimeBodyParam(List bodyLocalTime) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalTimes($response); this.lifecycleHook.onSuccess("listLocalTimeBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeBodyParam", e); - this.lifecycleHook.onCatch("listLocalTimeBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeBodyParam", e); + this.lifecycleHook.onCatch("listLocalTimeBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeBodyParam"); } } - public NilResult listLocalTimeBodyParamOpt() { + public Result listLocalTimeBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listLocalTimeBodyParamOpt".formatted( this.baseURI()); @@ -2397,28 +2233,25 @@ public NilResult listLocalTimeBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("listLocalTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("listLocalTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeBodyParamOpt"); } } - public NilResult listLocalTimeBodyParamOpt(List bodyLocalTime) { + public Result listLocalTimeBodyParamOpt(List bodyLocalTime) { var $path = "%s/api/listbodyparametertypes/listLocalTimeBodyParamOpt".formatted( this.baseURI()); @@ -2439,28 +2272,25 @@ public NilResult listLocalTimeBodyParamOpt(List bodyLocalTime) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("listLocalTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("listLocalTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeBodyParamOpt"); } } - public NilResult listLocalTimeBodyParamNil(List bodyLocalTime) { + public Result listLocalTimeBodyParamNil(List bodyLocalTime) { var $path = "%s/api/listbodyparametertypes/listLocalTimeBodyParamNil".formatted( this.baseURI()); @@ -2481,28 +2311,25 @@ public NilResult listLocalTimeBodyParamNil(List bodyLocalTime) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalTimeBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeBodyParamNil", e); - this.lifecycleHook.onCatch("listLocalTimeBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeBodyParamNil", e); + this.lifecycleHook.onCatch("listLocalTimeBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeBodyParamNil"); } } - public NilResult listLocalTimeBodyParamOptNil() { + public Result listLocalTimeBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listLocalTimeBodyParamOptNil".formatted( this.baseURI()); @@ -2523,28 +2350,25 @@ public NilResult listLocalTimeBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("listLocalTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("listLocalTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeBodyParamOptNil"); } } - public NilResult listLocalTimeBodyParamOptNil(List bodyLocalTime) { + public Result listLocalTimeBodyParamOptNil(List bodyLocalTime) { var $path = "%s/api/listbodyparametertypes/listLocalTimeBodyParamOptNil".formatted( this.baseURI()); @@ -2565,28 +2389,25 @@ public NilResult listLocalTimeBodyParamOptNil(List bodyLocalTime) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("listLocalTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("listLocalTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeBodyParamOptNil"); } } - public List listOffsetDateTimeBodyParam(List bodyOffsetDateTime) { + public Result, RSDError.$GenericError> listOffsetDateTimeBodyParam(List bodyOffsetDateTime) { Objects.requireNonNull(bodyOffsetDateTime, "bodyOffsetDateTime must not be null"); var $path = "%s/api/listbodyparametertypes/listOffsetDateTimeBodyParam".formatted( @@ -2609,28 +2430,25 @@ public List listOffsetDateTimeBodyParam(List bod if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapOffsetDateTimes($response); this.lifecycleHook.onSuccess("listOffsetDateTimeBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeBodyParam", e); - this.lifecycleHook.onCatch("listOffsetDateTimeBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeBodyParam", e); + this.lifecycleHook.onCatch("listOffsetDateTimeBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeBodyParam"); } } - public NilResult listOffsetDateTimeBodyParamOpt() { + public Result listOffsetDateTimeBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listOffsetDateTimeBodyParamOpt".formatted( this.baseURI()); @@ -2651,28 +2469,25 @@ public NilResult listOffsetDateTimeBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listOffsetDateTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("listOffsetDateTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("listOffsetDateTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeBodyParamOpt"); } } - public NilResult listOffsetDateTimeBodyParamOpt(List bodyOffsetDateTime) { + public Result listOffsetDateTimeBodyParamOpt(List bodyOffsetDateTime) { var $path = "%s/api/listbodyparametertypes/listOffsetDateTimeBodyParamOpt".formatted( this.baseURI()); @@ -2693,28 +2508,25 @@ public NilResult listOffsetDateTimeBodyParamOpt(List bodyOffsetD if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listOffsetDateTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("listOffsetDateTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("listOffsetDateTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeBodyParamOpt"); } } - public NilResult listOffsetDateTimeBodyParamNil(List bodyOffsetDateTime) { + public Result listOffsetDateTimeBodyParamNil(List bodyOffsetDateTime) { var $path = "%s/api/listbodyparametertypes/listOffsetDateTimeBodyParamNil".formatted( this.baseURI()); @@ -2735,28 +2547,25 @@ public NilResult listOffsetDateTimeBodyParamNil(List bodyOffsetD if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listOffsetDateTimeBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeBodyParamNil", e); - this.lifecycleHook.onCatch("listOffsetDateTimeBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeBodyParamNil", e); + this.lifecycleHook.onCatch("listOffsetDateTimeBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeBodyParamNil"); } } - public NilResult listOffsetDateTimeBodyParamOptNil() { + public Result listOffsetDateTimeBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listOffsetDateTimeBodyParamOptNil".formatted( this.baseURI()); @@ -2777,28 +2586,25 @@ public NilResult listOffsetDateTimeBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listOffsetDateTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("listOffsetDateTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("listOffsetDateTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeBodyParamOptNil"); } } - public NilResult listOffsetDateTimeBodyParamOptNil(List bodyOffsetDateTime) { + public Result listOffsetDateTimeBodyParamOptNil(List bodyOffsetDateTime) { var $path = "%s/api/listbodyparametertypes/listOffsetDateTimeBodyParamOptNil".formatted( this.baseURI()); @@ -2819,28 +2625,25 @@ public NilResult listOffsetDateTimeBodyParamOptNil(List bodyOffs if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listOffsetDateTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("listOffsetDateTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("listOffsetDateTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeBodyParamOptNil"); } } - public List listZonedDateTimeBodyParam(List bodyZonedDateTime) { + public Result, RSDError.$GenericError> listZonedDateTimeBodyParam(List bodyZonedDateTime) { Objects.requireNonNull(bodyZonedDateTime, "bodyZonedDateTime must not be null"); var $path = "%s/api/listbodyparametertypes/listZonedDateTimeBodyParam".formatted( @@ -2863,28 +2666,25 @@ public List listZonedDateTimeBodyParam(List bodyZo if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapZonedDateTimes($response); this.lifecycleHook.onSuccess("listZonedDateTimeBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeBodyParam", e); - this.lifecycleHook.onCatch("listZonedDateTimeBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeBodyParam", e); + this.lifecycleHook.onCatch("listZonedDateTimeBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeBodyParam"); } } - public NilResult listZonedDateTimeBodyParamOpt() { + public Result listZonedDateTimeBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listZonedDateTimeBodyParamOpt".formatted( this.baseURI()); @@ -2905,28 +2705,25 @@ public NilResult listZonedDateTimeBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listZonedDateTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("listZonedDateTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("listZonedDateTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeBodyParamOpt"); } } - public NilResult listZonedDateTimeBodyParamOpt(List bodyZonedDateTime) { + public Result listZonedDateTimeBodyParamOpt(List bodyZonedDateTime) { var $path = "%s/api/listbodyparametertypes/listZonedDateTimeBodyParamOpt".formatted( this.baseURI()); @@ -2947,28 +2744,25 @@ public NilResult listZonedDateTimeBodyParamOpt(List bodyZonedDate if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listZonedDateTimeBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeBodyParamOpt", e); - this.lifecycleHook.onCatch("listZonedDateTimeBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeBodyParamOpt", e); + this.lifecycleHook.onCatch("listZonedDateTimeBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeBodyParamOpt"); } } - public NilResult listZonedDateTimeBodyParamNil(List bodyZonedDateTime) { + public Result listZonedDateTimeBodyParamNil(List bodyZonedDateTime) { var $path = "%s/api/listbodyparametertypes/listZonedDateTimeBodyParamNil".formatted( this.baseURI()); @@ -2989,28 +2783,25 @@ public NilResult listZonedDateTimeBodyParamNil(List bodyZonedDate if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listZonedDateTimeBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeBodyParamNil", e); - this.lifecycleHook.onCatch("listZonedDateTimeBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeBodyParamNil", e); + this.lifecycleHook.onCatch("listZonedDateTimeBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeBodyParamNil"); } } - public NilResult listZonedDateTimeBodyParamOptNil() { + public Result listZonedDateTimeBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listZonedDateTimeBodyParamOptNil".formatted( this.baseURI()); @@ -3031,28 +2822,25 @@ public NilResult listZonedDateTimeBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listZonedDateTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("listZonedDateTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("listZonedDateTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeBodyParamOptNil"); } } - public NilResult listZonedDateTimeBodyParamOptNil(List bodyZonedDateTime) { + public Result listZonedDateTimeBodyParamOptNil(List bodyZonedDateTime) { var $path = "%s/api/listbodyparametertypes/listZonedDateTimeBodyParamOptNil".formatted( this.baseURI()); @@ -3073,28 +2861,25 @@ public NilResult listZonedDateTimeBodyParamOptNil(List bodyZonedD if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listZonedDateTimeBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeBodyParamOptNil", e); - this.lifecycleHook.onCatch("listZonedDateTimeBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeBodyParamOptNil", e); + this.lifecycleHook.onCatch("listZonedDateTimeBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeBodyParamOptNil"); } } - public List listScalarBodyParam(List bodyScalar) { + public Result, RSDError.$GenericError> listScalarBodyParam(List bodyScalar) { Objects.requireNonNull(bodyScalar, "bodyScalar must not be null"); var $path = "%s/api/listbodyparametertypes/listScalarBodyParam".formatted( @@ -3117,28 +2902,25 @@ public List listScalarBodyParam(List bodyScalar) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, ZoneId::of); this.lifecycleHook.onSuccess("listScalarBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarBodyParam", e); - this.lifecycleHook.onCatch("listScalarBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarBodyParam", e); + this.lifecycleHook.onCatch("listScalarBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarBodyParam"); } } - public NilResult listScalarBodyParamOpt() { + public Result listScalarBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listScalarBodyParamOpt".formatted( this.baseURI()); @@ -3159,28 +2941,25 @@ public NilResult listScalarBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listScalarBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarBodyParamOpt", e); - this.lifecycleHook.onCatch("listScalarBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarBodyParamOpt", e); + this.lifecycleHook.onCatch("listScalarBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarBodyParamOpt"); } } - public NilResult listScalarBodyParamOpt(List bodyScalar) { + public Result listScalarBodyParamOpt(List bodyScalar) { var $path = "%s/api/listbodyparametertypes/listScalarBodyParamOpt".formatted( this.baseURI()); @@ -3201,28 +2980,25 @@ public NilResult listScalarBodyParamOpt(List bodyScalar) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listScalarBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarBodyParamOpt", e); - this.lifecycleHook.onCatch("listScalarBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarBodyParamOpt", e); + this.lifecycleHook.onCatch("listScalarBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarBodyParamOpt"); } } - public NilResult listScalarBodyParamNil(List bodyScalar) { + public Result listScalarBodyParamNil(List bodyScalar) { var $path = "%s/api/listbodyparametertypes/listScalarBodyParamNil".formatted( this.baseURI()); @@ -3243,28 +3019,25 @@ public NilResult listScalarBodyParamNil(List bodyScalar) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listScalarBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarBodyParamNil", e); - this.lifecycleHook.onCatch("listScalarBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarBodyParamNil", e); + this.lifecycleHook.onCatch("listScalarBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarBodyParamNil"); } } - public NilResult listScalarBodyParamOptNil() { + public Result listScalarBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listScalarBodyParamOptNil".formatted( this.baseURI()); @@ -3285,28 +3058,25 @@ public NilResult listScalarBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listScalarBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarBodyParamOptNil", e); - this.lifecycleHook.onCatch("listScalarBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarBodyParamOptNil", e); + this.lifecycleHook.onCatch("listScalarBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarBodyParamOptNil"); } } - public NilResult listScalarBodyParamOptNil(List bodyScalar) { + public Result listScalarBodyParamOptNil(List bodyScalar) { var $path = "%s/api/listbodyparametertypes/listScalarBodyParamOptNil".formatted( this.baseURI()); @@ -3327,28 +3097,25 @@ public NilResult listScalarBodyParamOptNil(List bodyScalar) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listScalarBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarBodyParamOptNil", e); - this.lifecycleHook.onCatch("listScalarBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarBodyParamOptNil", e); + this.lifecycleHook.onCatch("listScalarBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarBodyParamOptNil"); } } - public List listEnumBodyParam(List bodyEnum) { + public Result, RSDError.$GenericError> listEnumBodyParam(List bodyEnum) { Objects.requireNonNull(bodyEnum, "bodyEnum must not be null"); var $path = "%s/api/listbodyparametertypes/listEnumBodyParam".formatted( @@ -3371,28 +3138,25 @@ public List listEnumBodyParam(List bodyEnum) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, SampleEnum::valueOf); this.lifecycleHook.onSuccess("listEnumBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumBodyParam", e); - this.lifecycleHook.onCatch("listEnumBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumBodyParam", e); + this.lifecycleHook.onCatch("listEnumBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumBodyParam"); } } - public NilResult listEnumBodyParamOpt() { + public Result listEnumBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listEnumBodyParamOpt".formatted( this.baseURI()); @@ -3413,28 +3177,25 @@ public NilResult listEnumBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listEnumBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumBodyParamOpt", e); - this.lifecycleHook.onCatch("listEnumBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumBodyParamOpt", e); + this.lifecycleHook.onCatch("listEnumBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumBodyParamOpt"); } } - public NilResult listEnumBodyParamOpt(List bodyEnum) { + public Result listEnumBodyParamOpt(List bodyEnum) { var $path = "%s/api/listbodyparametertypes/listEnumBodyParamOpt".formatted( this.baseURI()); @@ -3455,28 +3216,25 @@ public NilResult listEnumBodyParamOpt(List bodyEnum) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listEnumBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumBodyParamOpt", e); - this.lifecycleHook.onCatch("listEnumBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumBodyParamOpt", e); + this.lifecycleHook.onCatch("listEnumBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumBodyParamOpt"); } } - public NilResult listEnumBodyParamNil(List bodyEnum) { + public Result listEnumBodyParamNil(List bodyEnum) { var $path = "%s/api/listbodyparametertypes/listEnumBodyParamNil".formatted( this.baseURI()); @@ -3497,28 +3255,25 @@ public NilResult listEnumBodyParamNil(List bodyEnum) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listEnumBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumBodyParamNil", e); - this.lifecycleHook.onCatch("listEnumBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumBodyParamNil", e); + this.lifecycleHook.onCatch("listEnumBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumBodyParamNil"); } } - public NilResult listEnumBodyParamOptNil() { + public Result listEnumBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listEnumBodyParamOptNil".formatted( this.baseURI()); @@ -3539,28 +3294,25 @@ public NilResult listEnumBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listEnumBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumBodyParamOptNil", e); - this.lifecycleHook.onCatch("listEnumBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumBodyParamOptNil", e); + this.lifecycleHook.onCatch("listEnumBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumBodyParamOptNil"); } } - public NilResult listEnumBodyParamOptNil(List bodyEnum) { + public Result listEnumBodyParamOptNil(List bodyEnum) { var $path = "%s/api/listbodyparametertypes/listEnumBodyParamOptNil".formatted( this.baseURI()); @@ -3581,28 +3333,25 @@ public NilResult listEnumBodyParamOptNil(List bodyEnum) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listEnumBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumBodyParamOptNil", e); - this.lifecycleHook.onCatch("listEnumBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumBodyParamOptNil", e); + this.lifecycleHook.onCatch("listEnumBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumBodyParamOptNil"); } } - public List listInlineEnumBodyParam(List bodyEnum) { + public Result, RSDError.$GenericError> listInlineEnumBodyParam(List bodyEnum) { Objects.requireNonNull(bodyEnum, "bodyEnum must not be null"); var $path = "%s/api/listbodyparametertypes/listInlineEnumBodyParam".formatted( @@ -3625,28 +3374,25 @@ public NilResult listEnumBodyParamOptNil(List bodyEnum) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, ListInlineEnumBodyParam_Result$::valueOf); this.lifecycleHook.onSuccess("listInlineEnumBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listInlineEnumBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listInlineEnumBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listInlineEnumBodyParam", e); - this.lifecycleHook.onCatch("listInlineEnumBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listInlineEnumBodyParam", e); + this.lifecycleHook.onCatch("listInlineEnumBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listInlineEnumBodyParam"); } } - public NilResult listInlineEnumBodyParamOpt() { + public Result listInlineEnumBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listInlineEnumBodyParamOpt".formatted( this.baseURI()); @@ -3667,28 +3413,25 @@ public NilResult listInlineEnumBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listInlineEnumBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listInlineEnumBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listInlineEnumBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listInlineEnumBodyParamOpt", e); - this.lifecycleHook.onCatch("listInlineEnumBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listInlineEnumBodyParamOpt", e); + this.lifecycleHook.onCatch("listInlineEnumBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listInlineEnumBodyParamOpt"); } } - public NilResult listInlineEnumBodyParamOpt(List bodyEnum) { + public Result listInlineEnumBodyParamOpt(List bodyEnum) { var $path = "%s/api/listbodyparametertypes/listInlineEnumBodyParamOpt".formatted( this.baseURI()); @@ -3709,28 +3452,25 @@ public NilResult listInlineEnumBodyParamOpt(List bodyEnum) { + public Result listInlineEnumBodyParamNil(List bodyEnum) { var $path = "%s/api/listbodyparametertypes/listInlineEnumBodyParamNil".formatted( this.baseURI()); @@ -3751,28 +3491,25 @@ public NilResult listInlineEnumBodyParamNil(List listInlineEnumBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listInlineEnumBodyParamOptNil".formatted( this.baseURI()); @@ -3793,28 +3530,25 @@ public NilResult listInlineEnumBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listInlineEnumBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listInlineEnumBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listInlineEnumBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listInlineEnumBodyParamOptNil", e); - this.lifecycleHook.onCatch("listInlineEnumBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listInlineEnumBodyParamOptNil", e); + this.lifecycleHook.onCatch("listInlineEnumBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listInlineEnumBodyParamOptNil"); } } - public NilResult listInlineEnumBodyParamOptNil(List bodyEnum) { + public Result listInlineEnumBodyParamOptNil(List bodyEnum) { var $path = "%s/api/listbodyparametertypes/listInlineEnumBodyParamOptNil".formatted( this.baseURI()); @@ -3835,28 +3569,25 @@ public NilResult listInlineEnumBodyParamOptNil(List valueA, List valueB, List valueC) { + public Result listMultiBodyParam(List valueA, List valueB, List valueC) { Objects.requireNonNull(valueA, "valueA must not be null"); Objects.requireNonNull(valueC, "valueC must not be null"); @@ -3884,28 +3615,25 @@ public String listMultiBodyParam(List valueA, List valueB, List if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("listMultiBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiBodyParam", e); - this.lifecycleHook.onCatch("listMultiBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiBodyParam", e); + this.lifecycleHook.onCatch("listMultiBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiBodyParam"); } } - public List listMultiBodyParamOpt() { + public Result, RSDError.$GenericError> listMultiBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listMultiBodyParamOpt".formatted( this.baseURI()); @@ -3926,28 +3654,25 @@ public List listMultiBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listMultiBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiBodyParamOpt", e); - this.lifecycleHook.onCatch("listMultiBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiBodyParamOpt", e); + this.lifecycleHook.onCatch("listMultiBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiBodyParamOpt"); } } - public List listMultiBodyParamOpt(List valueA) { + public Result, RSDError.$GenericError> listMultiBodyParamOpt(List valueA) { var $path = "%s/api/listbodyparametertypes/listMultiBodyParamOpt".formatted( this.baseURI()); @@ -3972,28 +3697,25 @@ public List listMultiBodyParamOpt(List valueA) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listMultiBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiBodyParamOpt", e); - this.lifecycleHook.onCatch("listMultiBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiBodyParamOpt", e); + this.lifecycleHook.onCatch("listMultiBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiBodyParamOpt"); } } - public List listMultiBodyParamOpt(List valueA, List valueB) { + public Result, RSDError.$GenericError> listMultiBodyParamOpt(List valueA, List valueB) { var $path = "%s/api/listbodyparametertypes/listMultiBodyParamOpt".formatted( this.baseURI()); @@ -4021,28 +3743,25 @@ public List listMultiBodyParamOpt(List valueA, List if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listMultiBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiBodyParamOpt", e); - this.lifecycleHook.onCatch("listMultiBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiBodyParamOpt", e); + this.lifecycleHook.onCatch("listMultiBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiBodyParamOpt"); } } - public List listMultiBodyParamOpt(List valueA, List valueB, List valueC) { + public Result, RSDError.$GenericError> listMultiBodyParamOpt(List valueA, List valueB, List valueC) { var $path = "%s/api/listbodyparametertypes/listMultiBodyParamOpt".formatted( this.baseURI()); @@ -4073,28 +3792,25 @@ public List listMultiBodyParamOpt(List valueA, List if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listMultiBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiBodyParamOpt", e); - this.lifecycleHook.onCatch("listMultiBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiBodyParamOpt", e); + this.lifecycleHook.onCatch("listMultiBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiBodyParamOpt"); } } - public List listMultiBodyParamNil(List valueA, List valueB, List valueC) { + public Result, RSDError.$GenericError> listMultiBodyParamNil(List valueA, List valueB, List valueC) { var $path = "%s/api/listbodyparametertypes/listMultiBodyParamNil".formatted( this.baseURI()); @@ -4119,28 +3835,25 @@ public List listMultiBodyParamNil(List valueA, List if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listMultiBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiBodyParamNil", e); - this.lifecycleHook.onCatch("listMultiBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiBodyParamNil", e); + this.lifecycleHook.onCatch("listMultiBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiBodyParamNil"); } } - public List listMultiBodyParamOptNil() { + public Result, RSDError.$GenericError> listMultiBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listMultiBodyParamOptNil".formatted( this.baseURI()); @@ -4161,28 +3874,25 @@ public List listMultiBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listMultiBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiBodyParamOptNil", e); - this.lifecycleHook.onCatch("listMultiBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiBodyParamOptNil", e); + this.lifecycleHook.onCatch("listMultiBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiBodyParamOptNil"); } } - public List listMultiBodyParamOptNil(List valueA) { + public Result, RSDError.$GenericError> listMultiBodyParamOptNil(List valueA) { var $path = "%s/api/listbodyparametertypes/listMultiBodyParamOptNil".formatted( this.baseURI()); @@ -4205,28 +3915,25 @@ public List listMultiBodyParamOptNil(List valueA) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listMultiBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiBodyParamOptNil", e); - this.lifecycleHook.onCatch("listMultiBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiBodyParamOptNil", e); + this.lifecycleHook.onCatch("listMultiBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiBodyParamOptNil"); } } - public List listMultiBodyParamOptNil(List valueA, List valueB) { + public Result, RSDError.$GenericError> listMultiBodyParamOptNil(List valueA, List valueB) { var $path = "%s/api/listbodyparametertypes/listMultiBodyParamOptNil".formatted( this.baseURI()); @@ -4250,28 +3957,25 @@ public List listMultiBodyParamOptNil(List valueA, List listMultiBodyParamOptNil(List valueA, List valueB, List valueC) { + public Result, RSDError.$GenericError> listMultiBodyParamOptNil(List valueA, List valueB, List valueC) { var $path = "%s/api/listbodyparametertypes/listMultiBodyParamOptNil".formatted( this.baseURI()); @@ -4296,28 +4000,25 @@ public List listMultiBodyParamOptNil(List valueA, List listRecordBodyParam(List bodyRecord) { + public Result, RSDError.$GenericError> listRecordBodyParam(List bodyRecord) { Objects.requireNonNull(bodyRecord, "bodyRecord must not be null"); var $path = "%s/api/listbodyparametertypes/listRecordBodyParam".formatted( @@ -4340,28 +4041,25 @@ public List listRecordBodyParam(List bodyR if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObjects($response, SimpleRecordDataImpl::of, SimpleRecord.Data.class); this.lifecycleHook.onSuccess("listRecordBodyParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordBodyParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordBodyParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordBodyParam", e); - this.lifecycleHook.onCatch("listRecordBodyParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordBodyParam", e); + this.lifecycleHook.onCatch("listRecordBodyParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordBodyParam"); } } - public NilResult listRecordBodyParamOpt() { + public Result listRecordBodyParamOpt() { var $path = "%s/api/listbodyparametertypes/listRecordBodyParamOpt".formatted( this.baseURI()); @@ -4382,28 +4080,25 @@ public NilResult listRecordBodyParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listRecordBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordBodyParamOpt", e); - this.lifecycleHook.onCatch("listRecordBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordBodyParamOpt", e); + this.lifecycleHook.onCatch("listRecordBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordBodyParamOpt"); } } - public NilResult listRecordBodyParamOpt(List bodyRecord) { + public Result listRecordBodyParamOpt(List bodyRecord) { var $path = "%s/api/listbodyparametertypes/listRecordBodyParamOpt".formatted( this.baseURI()); @@ -4424,28 +4119,25 @@ public NilResult listRecordBodyParamOpt(List bodyRecord) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listRecordBodyParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordBodyParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordBodyParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordBodyParamOpt", e); - this.lifecycleHook.onCatch("listRecordBodyParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordBodyParamOpt", e); + this.lifecycleHook.onCatch("listRecordBodyParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordBodyParamOpt"); } } - public NilResult listRecordBodyParamNil(List bodyRecord) { + public Result listRecordBodyParamNil(List bodyRecord) { var $path = "%s/api/listbodyparametertypes/listRecordBodyParamNil".formatted( this.baseURI()); @@ -4466,28 +4158,25 @@ public NilResult listRecordBodyParamNil(List bodyRecord) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listRecordBodyParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordBodyParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordBodyParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordBodyParamNil", e); - this.lifecycleHook.onCatch("listRecordBodyParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordBodyParamNil", e); + this.lifecycleHook.onCatch("listRecordBodyParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordBodyParamNil"); } } - public NilResult listRecordBodyParamOptNil() { + public Result listRecordBodyParamOptNil() { var $path = "%s/api/listbodyparametertypes/listRecordBodyParamOptNil".formatted( this.baseURI()); @@ -4508,28 +4197,25 @@ public NilResult listRecordBodyParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listRecordBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordBodyParamOptNil", e); - this.lifecycleHook.onCatch("listRecordBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordBodyParamOptNil", e); + this.lifecycleHook.onCatch("listRecordBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordBodyParamOptNil"); } } - public NilResult listRecordBodyParamOptNil(List bodyRecord) { + public Result listRecordBodyParamOptNil(List bodyRecord) { var $path = "%s/api/listbodyparametertypes/listRecordBodyParamOptNil".formatted( this.baseURI()); @@ -4550,22 +4236,19 @@ public NilResult listRecordBodyParamOptNil(List bodyRecord) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listRecordBodyParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordBodyParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordBodyParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordBodyParamOptNil", e); - this.lifecycleHook.onCatch("listRecordBodyParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordBodyParamOptNil", e); + this.lifecycleHook.onCatch("listRecordBodyParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordBodyParamOptNil"); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListHeaderParameterTypesServiceImpl.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListHeaderParameterTypesServiceImpl.java index 69b2ba07..4d30ee27 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListHeaderParameterTypesServiceImpl.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListHeaderParameterTypesServiceImpl.java @@ -21,7 +21,8 @@ import dev.rsdlang.sample.client.model.SampleEnum; import dev.rsdlang.sample.client.model.SimpleRecord; import dev.rsdlang.sample.client.model.ZoneId; -import dev.rsdlang.sample.client.RSDException; +import dev.rsdlang.sample.client.Result; +import dev.rsdlang.sample.client.RSDError; import dev.rsdlang.sample.client.SpecSamplesClient; public class ListHeaderParameterTypesServiceImpl implements ListHeaderParameterTypesService { @@ -50,7 +51,7 @@ private String contentType() { return this.client.contentTypeEncoding().contentType; } - public List listBooleanHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listBooleanHeaderParam(List headerValue) { var $path = "%s/api/listheaderparametertypes/listBooleanHeaderParam".formatted( this.baseURI()); @@ -74,28 +75,25 @@ public List listBooleanHeaderParam(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapBooleans($response); this.lifecycleHook.onSuccess("listBooleanHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanHeaderParam", e); - this.lifecycleHook.onCatch("listBooleanHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanHeaderParam", e); + this.lifecycleHook.onCatch("listBooleanHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanHeaderParam"); } } - public NilResult listBooleanHeaderParamOpt() { + public Result listBooleanHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listBooleanHeaderParamOpt".formatted( this.baseURI()); @@ -112,28 +110,25 @@ public NilResult listBooleanHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listBooleanHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanHeaderParamOpt", e); - this.lifecycleHook.onCatch("listBooleanHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanHeaderParamOpt", e); + this.lifecycleHook.onCatch("listBooleanHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanHeaderParamOpt"); } } - public NilResult listBooleanHeaderParamOpt(List headerValue) { + public Result listBooleanHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listBooleanHeaderParamOpt".formatted( this.baseURI()); @@ -159,28 +154,25 @@ public NilResult listBooleanHeaderParamOpt(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listBooleanHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanHeaderParamOpt", e); - this.lifecycleHook.onCatch("listBooleanHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanHeaderParamOpt", e); + this.lifecycleHook.onCatch("listBooleanHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanHeaderParamOpt"); } } - public NilResult listBooleanHeaderParamNil(List headerValue) { + public Result listBooleanHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listBooleanHeaderParamNil".formatted( this.baseURI()); @@ -208,28 +200,25 @@ public NilResult listBooleanHeaderParamNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listBooleanHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanHeaderParamNil", e); - this.lifecycleHook.onCatch("listBooleanHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanHeaderParamNil", e); + this.lifecycleHook.onCatch("listBooleanHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanHeaderParamNil"); } } - public NilResult listBooleanHeaderParamOptNil() { + public Result listBooleanHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listBooleanHeaderParamOptNil".formatted( this.baseURI()); @@ -246,28 +235,25 @@ public NilResult listBooleanHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listBooleanHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listBooleanHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listBooleanHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanHeaderParamOptNil"); } } - public NilResult listBooleanHeaderParamOptNil(List headerValue) { + public Result listBooleanHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listBooleanHeaderParamOptNil".formatted( this.baseURI()); @@ -295,28 +281,25 @@ public NilResult listBooleanHeaderParamOptNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listBooleanHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listBooleanHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listBooleanHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanHeaderParamOptNil"); } } - public List listShortHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listShortHeaderParam(List headerValue) { var $path = "%s/api/listheaderparametertypes/listShortHeaderParam".formatted( this.baseURI()); @@ -340,28 +323,25 @@ public List listShortHeaderParam(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapShorts($response); this.lifecycleHook.onSuccess("listShortHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortHeaderParam", e); - this.lifecycleHook.onCatch("listShortHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortHeaderParam", e); + this.lifecycleHook.onCatch("listShortHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortHeaderParam"); } } - public NilResult listShortHeaderParamOpt() { + public Result listShortHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listShortHeaderParamOpt".formatted( this.baseURI()); @@ -378,28 +358,25 @@ public NilResult listShortHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listShortHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortHeaderParamOpt", e); - this.lifecycleHook.onCatch("listShortHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortHeaderParamOpt", e); + this.lifecycleHook.onCatch("listShortHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortHeaderParamOpt"); } } - public NilResult listShortHeaderParamOpt(List headerValue) { + public Result listShortHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listShortHeaderParamOpt".formatted( this.baseURI()); @@ -425,28 +402,25 @@ public NilResult listShortHeaderParamOpt(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listShortHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortHeaderParamOpt", e); - this.lifecycleHook.onCatch("listShortHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortHeaderParamOpt", e); + this.lifecycleHook.onCatch("listShortHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortHeaderParamOpt"); } } - public NilResult listShortHeaderParamNil(List headerValue) { + public Result listShortHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listShortHeaderParamNil".formatted( this.baseURI()); @@ -474,28 +448,25 @@ public NilResult listShortHeaderParamNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listShortHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortHeaderParamNil", e); - this.lifecycleHook.onCatch("listShortHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortHeaderParamNil", e); + this.lifecycleHook.onCatch("listShortHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortHeaderParamNil"); } } - public NilResult listShortHeaderParamOptNil() { + public Result listShortHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listShortHeaderParamOptNil".formatted( this.baseURI()); @@ -512,28 +483,25 @@ public NilResult listShortHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listShortHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listShortHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listShortHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortHeaderParamOptNil"); } } - public NilResult listShortHeaderParamOptNil(List headerValue) { + public Result listShortHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listShortHeaderParamOptNil".formatted( this.baseURI()); @@ -561,28 +529,25 @@ public NilResult listShortHeaderParamOptNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listShortHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listShortHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listShortHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortHeaderParamOptNil"); } } - public List listIntHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listIntHeaderParam(List headerValue) { var $path = "%s/api/listheaderparametertypes/listIntHeaderParam".formatted( this.baseURI()); @@ -606,28 +571,25 @@ public List listIntHeaderParam(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInts($response); this.lifecycleHook.onSuccess("listIntHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntHeaderParam", e); - this.lifecycleHook.onCatch("listIntHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntHeaderParam", e); + this.lifecycleHook.onCatch("listIntHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntHeaderParam"); } } - public NilResult listIntHeaderParamOpt() { + public Result listIntHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listIntHeaderParamOpt".formatted( this.baseURI()); @@ -644,28 +606,25 @@ public NilResult listIntHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listIntHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntHeaderParamOpt", e); - this.lifecycleHook.onCatch("listIntHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntHeaderParamOpt", e); + this.lifecycleHook.onCatch("listIntHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntHeaderParamOpt"); } } - public NilResult listIntHeaderParamOpt(List headerValue) { + public Result listIntHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listIntHeaderParamOpt".formatted( this.baseURI()); @@ -691,28 +650,25 @@ public NilResult listIntHeaderParamOpt(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listIntHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntHeaderParamOpt", e); - this.lifecycleHook.onCatch("listIntHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntHeaderParamOpt", e); + this.lifecycleHook.onCatch("listIntHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntHeaderParamOpt"); } } - public NilResult listIntHeaderParamNil(List headerValue) { + public Result listIntHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listIntHeaderParamNil".formatted( this.baseURI()); @@ -740,28 +696,25 @@ public NilResult listIntHeaderParamNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listIntHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntHeaderParamNil", e); - this.lifecycleHook.onCatch("listIntHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntHeaderParamNil", e); + this.lifecycleHook.onCatch("listIntHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntHeaderParamNil"); } } - public NilResult listIntHeaderParamOptNil() { + public Result listIntHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listIntHeaderParamOptNil".formatted( this.baseURI()); @@ -778,28 +731,25 @@ public NilResult listIntHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listIntHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listIntHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listIntHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntHeaderParamOptNil"); } } - public NilResult listIntHeaderParamOptNil(List headerValue) { + public Result listIntHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listIntHeaderParamOptNil".formatted( this.baseURI()); @@ -827,28 +777,25 @@ public NilResult listIntHeaderParamOptNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listIntHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listIntHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listIntHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntHeaderParamOptNil"); } } - public List listLongHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listLongHeaderParam(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLongHeaderParam".formatted( this.baseURI()); @@ -872,28 +819,25 @@ public List listLongHeaderParam(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLongs($response); this.lifecycleHook.onSuccess("listLongHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongHeaderParam", e); - this.lifecycleHook.onCatch("listLongHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongHeaderParam", e); + this.lifecycleHook.onCatch("listLongHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongHeaderParam"); } } - public NilResult listLongHeaderParamOpt() { + public Result listLongHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listLongHeaderParamOpt".formatted( this.baseURI()); @@ -910,28 +854,25 @@ public NilResult listLongHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLongHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongHeaderParamOpt", e); - this.lifecycleHook.onCatch("listLongHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongHeaderParamOpt", e); + this.lifecycleHook.onCatch("listLongHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongHeaderParamOpt"); } } - public NilResult listLongHeaderParamOpt(List headerValue) { + public Result listLongHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLongHeaderParamOpt".formatted( this.baseURI()); @@ -957,28 +898,25 @@ public NilResult listLongHeaderParamOpt(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLongHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongHeaderParamOpt", e); - this.lifecycleHook.onCatch("listLongHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongHeaderParamOpt", e); + this.lifecycleHook.onCatch("listLongHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongHeaderParamOpt"); } } - public NilResult listLongHeaderParamNil(List headerValue) { + public Result listLongHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLongHeaderParamNil".formatted( this.baseURI()); @@ -1006,28 +944,25 @@ public NilResult listLongHeaderParamNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLongHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongHeaderParamNil", e); - this.lifecycleHook.onCatch("listLongHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongHeaderParamNil", e); + this.lifecycleHook.onCatch("listLongHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongHeaderParamNil"); } } - public NilResult listLongHeaderParamOptNil() { + public Result listLongHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listLongHeaderParamOptNil".formatted( this.baseURI()); @@ -1044,28 +979,25 @@ public NilResult listLongHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLongHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listLongHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listLongHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongHeaderParamOptNil"); } } - public NilResult listLongHeaderParamOptNil(List headerValue) { + public Result listLongHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLongHeaderParamOptNil".formatted( this.baseURI()); @@ -1093,28 +1025,25 @@ public NilResult listLongHeaderParamOptNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLongHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listLongHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listLongHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongHeaderParamOptNil"); } } - public List listFloatHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listFloatHeaderParam(List headerValue) { var $path = "%s/api/listheaderparametertypes/listFloatHeaderParam".formatted( this.baseURI()); @@ -1138,28 +1067,25 @@ public List listFloatHeaderParam(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapFloats($response); this.lifecycleHook.onSuccess("listFloatHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatHeaderParam", e); - this.lifecycleHook.onCatch("listFloatHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatHeaderParam", e); + this.lifecycleHook.onCatch("listFloatHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatHeaderParam"); } } - public NilResult listFloatHeaderParamOpt() { + public Result listFloatHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listFloatHeaderParamOpt".formatted( this.baseURI()); @@ -1176,28 +1102,25 @@ public NilResult listFloatHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listFloatHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatHeaderParamOpt", e); - this.lifecycleHook.onCatch("listFloatHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatHeaderParamOpt", e); + this.lifecycleHook.onCatch("listFloatHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatHeaderParamOpt"); } } - public NilResult listFloatHeaderParamOpt(List headerValue) { + public Result listFloatHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listFloatHeaderParamOpt".formatted( this.baseURI()); @@ -1223,28 +1146,25 @@ public NilResult listFloatHeaderParamOpt(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listFloatHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatHeaderParamOpt", e); - this.lifecycleHook.onCatch("listFloatHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatHeaderParamOpt", e); + this.lifecycleHook.onCatch("listFloatHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatHeaderParamOpt"); } } - public NilResult listFloatHeaderParamNil(List headerValue) { + public Result listFloatHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listFloatHeaderParamNil".formatted( this.baseURI()); @@ -1272,28 +1192,25 @@ public NilResult listFloatHeaderParamNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listFloatHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatHeaderParamNil", e); - this.lifecycleHook.onCatch("listFloatHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatHeaderParamNil", e); + this.lifecycleHook.onCatch("listFloatHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatHeaderParamNil"); } } - public NilResult listFloatHeaderParamOptNil() { + public Result listFloatHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listFloatHeaderParamOptNil".formatted( this.baseURI()); @@ -1310,28 +1227,25 @@ public NilResult listFloatHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listFloatHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listFloatHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listFloatHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatHeaderParamOptNil"); } } - public NilResult listFloatHeaderParamOptNil(List headerValue) { + public Result listFloatHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listFloatHeaderParamOptNil".formatted( this.baseURI()); @@ -1359,28 +1273,25 @@ public NilResult listFloatHeaderParamOptNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listFloatHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listFloatHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listFloatHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatHeaderParamOptNil"); } } - public List listDoubleHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listDoubleHeaderParam(List headerValue) { var $path = "%s/api/listheaderparametertypes/listDoubleHeaderParam".formatted( this.baseURI()); @@ -1404,28 +1315,25 @@ public List listDoubleHeaderParam(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapDoubles($response); this.lifecycleHook.onSuccess("listDoubleHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleHeaderParam", e); - this.lifecycleHook.onCatch("listDoubleHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleHeaderParam", e); + this.lifecycleHook.onCatch("listDoubleHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleHeaderParam"); } } - public NilResult listDoubleHeaderParamOpt() { + public Result listDoubleHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listDoubleHeaderParamOpt".formatted( this.baseURI()); @@ -1442,28 +1350,25 @@ public NilResult listDoubleHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listDoubleHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleHeaderParamOpt", e); - this.lifecycleHook.onCatch("listDoubleHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleHeaderParamOpt", e); + this.lifecycleHook.onCatch("listDoubleHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleHeaderParamOpt"); } } - public NilResult listDoubleHeaderParamOpt(List headerValue) { + public Result listDoubleHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listDoubleHeaderParamOpt".formatted( this.baseURI()); @@ -1489,28 +1394,25 @@ public NilResult listDoubleHeaderParamOpt(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listDoubleHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleHeaderParamOpt", e); - this.lifecycleHook.onCatch("listDoubleHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleHeaderParamOpt", e); + this.lifecycleHook.onCatch("listDoubleHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleHeaderParamOpt"); } } - public NilResult listDoubleHeaderParamNil(List headerValue) { + public Result listDoubleHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listDoubleHeaderParamNil".formatted( this.baseURI()); @@ -1538,28 +1440,25 @@ public NilResult listDoubleHeaderParamNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listDoubleHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleHeaderParamNil", e); - this.lifecycleHook.onCatch("listDoubleHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleHeaderParamNil", e); + this.lifecycleHook.onCatch("listDoubleHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleHeaderParamNil"); } } - public NilResult listDoubleHeaderParamOptNil() { + public Result listDoubleHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listDoubleHeaderParamOptNil".formatted( this.baseURI()); @@ -1576,28 +1475,25 @@ public NilResult listDoubleHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listDoubleHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listDoubleHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listDoubleHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleHeaderParamOptNil"); } } - public NilResult listDoubleHeaderParamOptNil(List headerValue) { + public Result listDoubleHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listDoubleHeaderParamOptNil".formatted( this.baseURI()); @@ -1625,28 +1521,25 @@ public NilResult listDoubleHeaderParamOptNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listDoubleHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listDoubleHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listDoubleHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleHeaderParamOptNil"); } } - public List listStringHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listStringHeaderParam(List headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/listheaderparametertypes/listStringHeaderParam".formatted( @@ -1672,28 +1565,25 @@ public List listStringHeaderParam(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapStrings($response); this.lifecycleHook.onSuccess("listStringHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringHeaderParam", e); - this.lifecycleHook.onCatch("listStringHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringHeaderParam", e); + this.lifecycleHook.onCatch("listStringHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringHeaderParam"); } } - public NilResult listStringHeaderParamOpt() { + public Result listStringHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listStringHeaderParamOpt".formatted( this.baseURI()); @@ -1710,28 +1600,25 @@ public NilResult listStringHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listStringHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringHeaderParamOpt", e); - this.lifecycleHook.onCatch("listStringHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringHeaderParamOpt", e); + this.lifecycleHook.onCatch("listStringHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringHeaderParamOpt"); } } - public NilResult listStringHeaderParamOpt(List headerValue) { + public Result listStringHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listStringHeaderParamOpt".formatted( this.baseURI()); @@ -1757,28 +1644,25 @@ public NilResult listStringHeaderParamOpt(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listStringHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringHeaderParamOpt", e); - this.lifecycleHook.onCatch("listStringHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringHeaderParamOpt", e); + this.lifecycleHook.onCatch("listStringHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringHeaderParamOpt"); } } - public NilResult listStringHeaderParamNil(List headerValue) { + public Result listStringHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listStringHeaderParamNil".formatted( this.baseURI()); @@ -1806,28 +1690,25 @@ public NilResult listStringHeaderParamNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listStringHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringHeaderParamNil", e); - this.lifecycleHook.onCatch("listStringHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringHeaderParamNil", e); + this.lifecycleHook.onCatch("listStringHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringHeaderParamNil"); } } - public NilResult listStringHeaderParamOptNil() { + public Result listStringHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listStringHeaderParamOptNil".formatted( this.baseURI()); @@ -1844,28 +1725,25 @@ public NilResult listStringHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listStringHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listStringHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listStringHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringHeaderParamOptNil"); } } - public NilResult listStringHeaderParamOptNil(List headerValue) { + public Result listStringHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listStringHeaderParamOptNil".formatted( this.baseURI()); @@ -1893,28 +1771,25 @@ public NilResult listStringHeaderParamOptNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listStringHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listStringHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listStringHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringHeaderParamOptNil"); } } - public List listLocalDateHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listLocalDateHeaderParam(List headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/listheaderparametertypes/listLocalDateHeaderParam".formatted( @@ -1940,28 +1815,25 @@ public List listLocalDateHeaderParam(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDates($response); this.lifecycleHook.onSuccess("listLocalDateHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateHeaderParam", e); - this.lifecycleHook.onCatch("listLocalDateHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateHeaderParam", e); + this.lifecycleHook.onCatch("listLocalDateHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateHeaderParam"); } } - public NilResult listLocalDateHeaderParamOpt() { + public Result listLocalDateHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listLocalDateHeaderParamOpt".formatted( this.baseURI()); @@ -1978,28 +1850,25 @@ public NilResult listLocalDateHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateHeaderParamOpt", e); - this.lifecycleHook.onCatch("listLocalDateHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateHeaderParamOpt", e); + this.lifecycleHook.onCatch("listLocalDateHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateHeaderParamOpt"); } } - public NilResult listLocalDateHeaderParamOpt(List headerValue) { + public Result listLocalDateHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLocalDateHeaderParamOpt".formatted( this.baseURI()); @@ -2025,28 +1894,25 @@ public NilResult listLocalDateHeaderParamOpt(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateHeaderParamOpt", e); - this.lifecycleHook.onCatch("listLocalDateHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateHeaderParamOpt", e); + this.lifecycleHook.onCatch("listLocalDateHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateHeaderParamOpt"); } } - public NilResult listLocalDateHeaderParamNil(List headerValue) { + public Result listLocalDateHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLocalDateHeaderParamNil".formatted( this.baseURI()); @@ -2074,28 +1940,25 @@ public NilResult listLocalDateHeaderParamNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateHeaderParamNil", e); - this.lifecycleHook.onCatch("listLocalDateHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateHeaderParamNil", e); + this.lifecycleHook.onCatch("listLocalDateHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateHeaderParamNil"); } } - public NilResult listLocalDateHeaderParamOptNil() { + public Result listLocalDateHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listLocalDateHeaderParamOptNil".formatted( this.baseURI()); @@ -2112,28 +1975,25 @@ public NilResult listLocalDateHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listLocalDateHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listLocalDateHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateHeaderParamOptNil"); } } - public NilResult listLocalDateHeaderParamOptNil(List headerValue) { + public Result listLocalDateHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLocalDateHeaderParamOptNil".formatted( this.baseURI()); @@ -2161,28 +2021,25 @@ public NilResult listLocalDateHeaderParamOptNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listLocalDateHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listLocalDateHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateHeaderParamOptNil"); } } - public List listLocalDateTimeHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listLocalDateTimeHeaderParam(List headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/listheaderparametertypes/listLocalDateTimeHeaderParam".formatted( @@ -2208,28 +2065,25 @@ public List listLocalDateTimeHeaderParam(List head if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDateTimes($response); this.lifecycleHook.onSuccess("listLocalDateTimeHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeHeaderParam", e); - this.lifecycleHook.onCatch("listLocalDateTimeHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeHeaderParam", e); + this.lifecycleHook.onCatch("listLocalDateTimeHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeHeaderParam"); } } - public NilResult listLocalDateTimeHeaderParamOpt() { + public Result listLocalDateTimeHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listLocalDateTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2246,28 +2100,25 @@ public NilResult listLocalDateTimeHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("listLocalDateTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("listLocalDateTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeHeaderParamOpt"); } } - public NilResult listLocalDateTimeHeaderParamOpt(List headerValue) { + public Result listLocalDateTimeHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLocalDateTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2293,28 +2144,25 @@ public NilResult listLocalDateTimeHeaderParamOpt(List headerValue if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("listLocalDateTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("listLocalDateTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeHeaderParamOpt"); } } - public NilResult listLocalDateTimeHeaderParamNil(List headerValue) { + public Result listLocalDateTimeHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLocalDateTimeHeaderParamNil".formatted( this.baseURI()); @@ -2342,28 +2190,25 @@ public NilResult listLocalDateTimeHeaderParamNil(List headerValue if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateTimeHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeHeaderParamNil", e); - this.lifecycleHook.onCatch("listLocalDateTimeHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeHeaderParamNil", e); + this.lifecycleHook.onCatch("listLocalDateTimeHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeHeaderParamNil"); } } - public NilResult listLocalDateTimeHeaderParamOptNil() { + public Result listLocalDateTimeHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listLocalDateTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -2380,28 +2225,25 @@ public NilResult listLocalDateTimeHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listLocalDateTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listLocalDateTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeHeaderParamOptNil"); } } - public NilResult listLocalDateTimeHeaderParamOptNil(List headerValue) { + public Result listLocalDateTimeHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLocalDateTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -2429,28 +2271,25 @@ public NilResult listLocalDateTimeHeaderParamOptNil(List headerVa if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalDateTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listLocalDateTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listLocalDateTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeHeaderParamOptNil"); } } - public List listLocalTimeHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listLocalTimeHeaderParam(List headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/listheaderparametertypes/listLocalTimeHeaderParam".formatted( @@ -2476,28 +2315,25 @@ public List listLocalTimeHeaderParam(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalTimes($response); this.lifecycleHook.onSuccess("listLocalTimeHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeHeaderParam", e); - this.lifecycleHook.onCatch("listLocalTimeHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeHeaderParam", e); + this.lifecycleHook.onCatch("listLocalTimeHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeHeaderParam"); } } - public NilResult listLocalTimeHeaderParamOpt() { + public Result listLocalTimeHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listLocalTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2514,28 +2350,25 @@ public NilResult listLocalTimeHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("listLocalTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("listLocalTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeHeaderParamOpt"); } } - public NilResult listLocalTimeHeaderParamOpt(List headerValue) { + public Result listLocalTimeHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLocalTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2561,28 +2394,25 @@ public NilResult listLocalTimeHeaderParamOpt(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("listLocalTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("listLocalTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeHeaderParamOpt"); } } - public NilResult listLocalTimeHeaderParamNil(List headerValue) { + public Result listLocalTimeHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLocalTimeHeaderParamNil".formatted( this.baseURI()); @@ -2610,28 +2440,25 @@ public NilResult listLocalTimeHeaderParamNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalTimeHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeHeaderParamNil", e); - this.lifecycleHook.onCatch("listLocalTimeHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeHeaderParamNil", e); + this.lifecycleHook.onCatch("listLocalTimeHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeHeaderParamNil"); } } - public NilResult listLocalTimeHeaderParamOptNil() { + public Result listLocalTimeHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listLocalTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -2648,28 +2475,25 @@ public NilResult listLocalTimeHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listLocalTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listLocalTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeHeaderParamOptNil"); } } - public NilResult listLocalTimeHeaderParamOptNil(List headerValue) { + public Result listLocalTimeHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listLocalTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -2697,28 +2521,25 @@ public NilResult listLocalTimeHeaderParamOptNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listLocalTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listLocalTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listLocalTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeHeaderParamOptNil"); } } - public List listOffsetDateTimeHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listOffsetDateTimeHeaderParam(List headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/listheaderparametertypes/listOffsetDateTimeHeaderParam".formatted( @@ -2744,28 +2565,25 @@ public List listOffsetDateTimeHeaderParam(List h if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapOffsetDateTimes($response); this.lifecycleHook.onSuccess("listOffsetDateTimeHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeHeaderParam", e); - this.lifecycleHook.onCatch("listOffsetDateTimeHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeHeaderParam", e); + this.lifecycleHook.onCatch("listOffsetDateTimeHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeHeaderParam"); } } - public NilResult listOffsetDateTimeHeaderParamOpt() { + public Result listOffsetDateTimeHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listOffsetDateTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2782,28 +2600,25 @@ public NilResult listOffsetDateTimeHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listOffsetDateTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("listOffsetDateTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("listOffsetDateTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeHeaderParamOpt"); } } - public NilResult listOffsetDateTimeHeaderParamOpt(List headerValue) { + public Result listOffsetDateTimeHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listOffsetDateTimeHeaderParamOpt".formatted( this.baseURI()); @@ -2829,28 +2644,25 @@ public NilResult listOffsetDateTimeHeaderParamOpt(List headerVal if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listOffsetDateTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("listOffsetDateTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("listOffsetDateTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeHeaderParamOpt"); } } - public NilResult listOffsetDateTimeHeaderParamNil(List headerValue) { + public Result listOffsetDateTimeHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listOffsetDateTimeHeaderParamNil".formatted( this.baseURI()); @@ -2878,28 +2690,25 @@ public NilResult listOffsetDateTimeHeaderParamNil(List headerVal if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listOffsetDateTimeHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeHeaderParamNil", e); - this.lifecycleHook.onCatch("listOffsetDateTimeHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeHeaderParamNil", e); + this.lifecycleHook.onCatch("listOffsetDateTimeHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeHeaderParamNil"); } } - public NilResult listOffsetDateTimeHeaderParamOptNil() { + public Result listOffsetDateTimeHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listOffsetDateTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -2916,28 +2725,25 @@ public NilResult listOffsetDateTimeHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listOffsetDateTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listOffsetDateTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listOffsetDateTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeHeaderParamOptNil"); } } - public NilResult listOffsetDateTimeHeaderParamOptNil(List headerValue) { + public Result listOffsetDateTimeHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listOffsetDateTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -2965,28 +2771,25 @@ public NilResult listOffsetDateTimeHeaderParamOptNil(List header if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listOffsetDateTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listOffsetDateTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listOffsetDateTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeHeaderParamOptNil"); } } - public List listZonedDateTimeHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listZonedDateTimeHeaderParam(List headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/listheaderparametertypes/listZonedDateTimeHeaderParam".formatted( @@ -3012,28 +2815,25 @@ public List listZonedDateTimeHeaderParam(List head if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapZonedDateTimes($response); this.lifecycleHook.onSuccess("listZonedDateTimeHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeHeaderParam", e); - this.lifecycleHook.onCatch("listZonedDateTimeHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeHeaderParam", e); + this.lifecycleHook.onCatch("listZonedDateTimeHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeHeaderParam"); } } - public NilResult listZonedDateTimeHeaderParamOpt() { + public Result listZonedDateTimeHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listZonedDateTimeHeaderParamOpt".formatted( this.baseURI()); @@ -3050,28 +2850,25 @@ public NilResult listZonedDateTimeHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listZonedDateTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("listZonedDateTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("listZonedDateTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeHeaderParamOpt"); } } - public NilResult listZonedDateTimeHeaderParamOpt(List headerValue) { + public Result listZonedDateTimeHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listZonedDateTimeHeaderParamOpt".formatted( this.baseURI()); @@ -3097,28 +2894,25 @@ public NilResult listZonedDateTimeHeaderParamOpt(List headerValue if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listZonedDateTimeHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeHeaderParamOpt", e); - this.lifecycleHook.onCatch("listZonedDateTimeHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeHeaderParamOpt", e); + this.lifecycleHook.onCatch("listZonedDateTimeHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeHeaderParamOpt"); } } - public NilResult listZonedDateTimeHeaderParamNil(List headerValue) { + public Result listZonedDateTimeHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listZonedDateTimeHeaderParamNil".formatted( this.baseURI()); @@ -3146,28 +2940,25 @@ public NilResult listZonedDateTimeHeaderParamNil(List headerValue if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listZonedDateTimeHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeHeaderParamNil", e); - this.lifecycleHook.onCatch("listZonedDateTimeHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeHeaderParamNil", e); + this.lifecycleHook.onCatch("listZonedDateTimeHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeHeaderParamNil"); } } - public NilResult listZonedDateTimeHeaderParamOptNil() { + public Result listZonedDateTimeHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listZonedDateTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -3184,28 +2975,25 @@ public NilResult listZonedDateTimeHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listZonedDateTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listZonedDateTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listZonedDateTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeHeaderParamOptNil"); } } - public NilResult listZonedDateTimeHeaderParamOptNil(List headerValue) { + public Result listZonedDateTimeHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listZonedDateTimeHeaderParamOptNil".formatted( this.baseURI()); @@ -3233,28 +3021,25 @@ public NilResult listZonedDateTimeHeaderParamOptNil(List headerVa if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listZonedDateTimeHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listZonedDateTimeHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listZonedDateTimeHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeHeaderParamOptNil"); } } - public List listScalarHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listScalarHeaderParam(List headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/listheaderparametertypes/listScalarHeaderParam".formatted( @@ -3280,28 +3065,25 @@ public List listScalarHeaderParam(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, ZoneId::of); this.lifecycleHook.onSuccess("listScalarHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarHeaderParam", e); - this.lifecycleHook.onCatch("listScalarHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarHeaderParam", e); + this.lifecycleHook.onCatch("listScalarHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarHeaderParam"); } } - public NilResult listScalarHeaderParamOpt() { + public Result listScalarHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listScalarHeaderParamOpt".formatted( this.baseURI()); @@ -3318,28 +3100,25 @@ public NilResult listScalarHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listScalarHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarHeaderParamOpt", e); - this.lifecycleHook.onCatch("listScalarHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarHeaderParamOpt", e); + this.lifecycleHook.onCatch("listScalarHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarHeaderParamOpt"); } } - public NilResult listScalarHeaderParamOpt(List headerValue) { + public Result listScalarHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listScalarHeaderParamOpt".formatted( this.baseURI()); @@ -3365,28 +3144,25 @@ public NilResult listScalarHeaderParamOpt(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listScalarHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarHeaderParamOpt", e); - this.lifecycleHook.onCatch("listScalarHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarHeaderParamOpt", e); + this.lifecycleHook.onCatch("listScalarHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarHeaderParamOpt"); } } - public NilResult listScalarHeaderParamNil(List headerValue) { + public Result listScalarHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listScalarHeaderParamNil".formatted( this.baseURI()); @@ -3414,28 +3190,25 @@ public NilResult listScalarHeaderParamNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listScalarHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarHeaderParamNil", e); - this.lifecycleHook.onCatch("listScalarHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarHeaderParamNil", e); + this.lifecycleHook.onCatch("listScalarHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarHeaderParamNil"); } } - public NilResult listScalarHeaderParamOptNil() { + public Result listScalarHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listScalarHeaderParamOptNil".formatted( this.baseURI()); @@ -3452,28 +3225,25 @@ public NilResult listScalarHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listScalarHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listScalarHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listScalarHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarHeaderParamOptNil"); } } - public NilResult listScalarHeaderParamOptNil(List headerValue) { + public Result listScalarHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listScalarHeaderParamOptNil".formatted( this.baseURI()); @@ -3501,28 +3271,25 @@ public NilResult listScalarHeaderParamOptNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listScalarHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listScalarHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listScalarHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarHeaderParamOptNil"); } } - public List listEnumHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listEnumHeaderParam(List headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/listheaderparametertypes/listEnumHeaderParam".formatted( @@ -3548,28 +3315,25 @@ public List listEnumHeaderParam(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, SampleEnum::valueOf); this.lifecycleHook.onSuccess("listEnumHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumHeaderParam", e); - this.lifecycleHook.onCatch("listEnumHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumHeaderParam", e); + this.lifecycleHook.onCatch("listEnumHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumHeaderParam"); } } - public NilResult listEnumHeaderParamOpt() { + public Result listEnumHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listEnumHeaderParamOpt".formatted( this.baseURI()); @@ -3586,28 +3350,25 @@ public NilResult listEnumHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listEnumHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumHeaderParamOpt", e); - this.lifecycleHook.onCatch("listEnumHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumHeaderParamOpt", e); + this.lifecycleHook.onCatch("listEnumHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumHeaderParamOpt"); } } - public NilResult listEnumHeaderParamOpt(List headerValue) { + public Result listEnumHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listEnumHeaderParamOpt".formatted( this.baseURI()); @@ -3633,28 +3394,25 @@ public NilResult listEnumHeaderParamOpt(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listEnumHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumHeaderParamOpt", e); - this.lifecycleHook.onCatch("listEnumHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumHeaderParamOpt", e); + this.lifecycleHook.onCatch("listEnumHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumHeaderParamOpt"); } } - public NilResult listEnumHeaderParamNil(List headerValue) { + public Result listEnumHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listEnumHeaderParamNil".formatted( this.baseURI()); @@ -3682,28 +3440,25 @@ public NilResult listEnumHeaderParamNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listEnumHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumHeaderParamNil", e); - this.lifecycleHook.onCatch("listEnumHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumHeaderParamNil", e); + this.lifecycleHook.onCatch("listEnumHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumHeaderParamNil"); } } - public NilResult listEnumHeaderParamOptNil() { + public Result listEnumHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listEnumHeaderParamOptNil".formatted( this.baseURI()); @@ -3720,28 +3475,25 @@ public NilResult listEnumHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listEnumHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listEnumHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listEnumHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumHeaderParamOptNil"); } } - public NilResult listEnumHeaderParamOptNil(List headerValue) { + public Result listEnumHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listEnumHeaderParamOptNil".formatted( this.baseURI()); @@ -3769,28 +3521,25 @@ public NilResult listEnumHeaderParamOptNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listEnumHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listEnumHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listEnumHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumHeaderParamOptNil"); } } - public List listInlineEnumHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listInlineEnumHeaderParam(List headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/listheaderparametertypes/listInlineEnumHeaderParam".formatted( @@ -3816,28 +3565,25 @@ public NilResult listEnumHeaderParamOptNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, ListInlineEnumHeaderParam_Result$::valueOf); this.lifecycleHook.onSuccess("listInlineEnumHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listInlineEnumHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listInlineEnumHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listInlineEnumHeaderParam", e); - this.lifecycleHook.onCatch("listInlineEnumHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listInlineEnumHeaderParam", e); + this.lifecycleHook.onCatch("listInlineEnumHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listInlineEnumHeaderParam"); } } - public NilResult listInlineEnumHeaderParamOpt() { + public Result listInlineEnumHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listInlineEnumHeaderParamOpt".formatted( this.baseURI()); @@ -3854,28 +3600,25 @@ public NilResult listInlineEnumHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listInlineEnumHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listInlineEnumHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listInlineEnumHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listInlineEnumHeaderParamOpt", e); - this.lifecycleHook.onCatch("listInlineEnumHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listInlineEnumHeaderParamOpt", e); + this.lifecycleHook.onCatch("listInlineEnumHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listInlineEnumHeaderParamOpt"); } } - public NilResult listInlineEnumHeaderParamOpt(List headerValue) { + public Result listInlineEnumHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listInlineEnumHeaderParamOpt".formatted( this.baseURI()); @@ -3901,28 +3644,25 @@ public NilResult listInlineEnumHeaderParamOpt(List headerValue) { + public Result listInlineEnumHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listInlineEnumHeaderParamNil".formatted( this.baseURI()); @@ -3950,28 +3690,25 @@ public NilResult listInlineEnumHeaderParamNil(List listInlineEnumHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listInlineEnumHeaderParamOptNil".formatted( this.baseURI()); @@ -3988,28 +3725,25 @@ public NilResult listInlineEnumHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listInlineEnumHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listInlineEnumHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listInlineEnumHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listInlineEnumHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listInlineEnumHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listInlineEnumHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listInlineEnumHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listInlineEnumHeaderParamOptNil"); } } - public NilResult listInlineEnumHeaderParamOptNil(List headerValue) { + public Result listInlineEnumHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listInlineEnumHeaderParamOptNil".formatted( this.baseURI()); @@ -4037,28 +3771,25 @@ public NilResult listInlineEnumHeaderParamOptNil(List valueA, List valueB, List valueC) { + public Result listMultiHeaderParam(List valueA, List valueB, List valueC) { Objects.requireNonNull(valueA, "valueA must not be null"); Objects.requireNonNull(valueC, "valueC must not be null"); @@ -4088,28 +3819,25 @@ public String listMultiHeaderParam(List valueA, List valueB, Li if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("listMultiHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiHeaderParam", e); - this.lifecycleHook.onCatch("listMultiHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiHeaderParam", e); + this.lifecycleHook.onCatch("listMultiHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiHeaderParam"); } } - public List listMultiHeaderParamOpt() { + public Result, RSDError.$GenericError> listMultiHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listMultiHeaderParamOpt".formatted( this.baseURI()); @@ -4126,28 +3854,25 @@ public List listMultiHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listMultiHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiHeaderParamOpt", e); - this.lifecycleHook.onCatch("listMultiHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiHeaderParamOpt", e); + this.lifecycleHook.onCatch("listMultiHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiHeaderParamOpt"); } } - public List listMultiHeaderParamOpt(List valueA) { + public Result, RSDError.$GenericError> listMultiHeaderParamOpt(List valueA) { var $path = "%s/api/listheaderparametertypes/listMultiHeaderParamOpt".formatted( this.baseURI()); @@ -4173,28 +3898,25 @@ public List listMultiHeaderParamOpt(List valueA) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listMultiHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiHeaderParamOpt", e); - this.lifecycleHook.onCatch("listMultiHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiHeaderParamOpt", e); + this.lifecycleHook.onCatch("listMultiHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiHeaderParamOpt"); } } - public List listMultiHeaderParamOpt(List valueA, List valueB) { + public Result, RSDError.$GenericError> listMultiHeaderParamOpt(List valueA, List valueB) { var $path = "%s/api/listheaderparametertypes/listMultiHeaderParamOpt".formatted( this.baseURI()); @@ -4223,28 +3945,25 @@ public List listMultiHeaderParamOpt(List valueA, List listMultiHeaderParamOpt(List valueA, List valueB, List valueC) { + public Result, RSDError.$GenericError> listMultiHeaderParamOpt(List valueA, List valueB, List valueC) { var $path = "%s/api/listheaderparametertypes/listMultiHeaderParamOpt".formatted( this.baseURI()); @@ -4277,28 +3996,25 @@ public List listMultiHeaderParamOpt(List valueA, List listMultiHeaderParamNil(List valueA, List valueB, List valueC) { + public Result, RSDError.$GenericError> listMultiHeaderParamNil(List valueA, List valueB, List valueC) { var $path = "%s/api/listheaderparametertypes/listMultiHeaderParamNil".formatted( this.baseURI()); @@ -4337,28 +4053,25 @@ public List listMultiHeaderParamNil(List valueA, List listMultiHeaderParamOptNil() { + public Result, RSDError.$GenericError> listMultiHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listMultiHeaderParamOptNil".formatted( this.baseURI()); @@ -4375,28 +4088,25 @@ public List listMultiHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listMultiHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listMultiHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listMultiHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiHeaderParamOptNil"); } } - public List listMultiHeaderParamOptNil(List valueA) { + public Result, RSDError.$GenericError> listMultiHeaderParamOptNil(List valueA) { var $path = "%s/api/listheaderparametertypes/listMultiHeaderParamOptNil".formatted( this.baseURI()); @@ -4424,28 +4134,25 @@ public List listMultiHeaderParamOptNil(List valueA) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listMultiHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listMultiHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listMultiHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiHeaderParamOptNil"); } } - public List listMultiHeaderParamOptNil(List valueA, List valueB) { + public Result, RSDError.$GenericError> listMultiHeaderParamOptNil(List valueA, List valueB) { var $path = "%s/api/listheaderparametertypes/listMultiHeaderParamOptNil".formatted( this.baseURI()); @@ -4478,28 +4185,25 @@ public List listMultiHeaderParamOptNil(List valueA, List listMultiHeaderParamOptNil(List valueA, List valueB, List valueC) { + public Result, RSDError.$GenericError> listMultiHeaderParamOptNil(List valueA, List valueB, List valueC) { var $path = "%s/api/listheaderparametertypes/listMultiHeaderParamOptNil".formatted( this.baseURI()); @@ -4538,28 +4242,25 @@ public List listMultiHeaderParamOptNil(List valueA, List listRecordHeaderParam(List headerValue) { + public Result, RSDError.$GenericError> listRecordHeaderParam(List headerValue) { Objects.requireNonNull(headerValue, "headerValue must not be null"); var $path = "%s/api/listheaderparametertypes/listRecordHeaderParam".formatted( @@ -4586,28 +4287,25 @@ public List listRecordHeaderParam(List hea if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObjects($response, SimpleRecordDataImpl::of, SimpleRecord.Data.class); this.lifecycleHook.onSuccess("listRecordHeaderParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordHeaderParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordHeaderParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordHeaderParam", e); - this.lifecycleHook.onCatch("listRecordHeaderParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordHeaderParam", e); + this.lifecycleHook.onCatch("listRecordHeaderParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordHeaderParam"); } } - public NilResult listRecordHeaderParamOpt() { + public Result listRecordHeaderParamOpt() { var $path = "%s/api/listheaderparametertypes/listRecordHeaderParamOpt".formatted( this.baseURI()); @@ -4624,28 +4322,25 @@ public NilResult listRecordHeaderParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listRecordHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordHeaderParamOpt", e); - this.lifecycleHook.onCatch("listRecordHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordHeaderParamOpt", e); + this.lifecycleHook.onCatch("listRecordHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordHeaderParamOpt"); } } - public NilResult listRecordHeaderParamOpt(List headerValue) { + public Result listRecordHeaderParamOpt(List headerValue) { var $path = "%s/api/listheaderparametertypes/listRecordHeaderParamOpt".formatted( this.baseURI()); @@ -4672,28 +4367,25 @@ public NilResult listRecordHeaderParamOpt(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listRecordHeaderParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordHeaderParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordHeaderParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordHeaderParamOpt", e); - this.lifecycleHook.onCatch("listRecordHeaderParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordHeaderParamOpt", e); + this.lifecycleHook.onCatch("listRecordHeaderParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordHeaderParamOpt"); } } - public NilResult listRecordHeaderParamNil(List headerValue) { + public Result listRecordHeaderParamNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listRecordHeaderParamNil".formatted( this.baseURI()); @@ -4722,28 +4414,25 @@ public NilResult listRecordHeaderParamNil(List headerValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listRecordHeaderParamNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordHeaderParamNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordHeaderParamNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordHeaderParamNil", e); - this.lifecycleHook.onCatch("listRecordHeaderParamNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordHeaderParamNil", e); + this.lifecycleHook.onCatch("listRecordHeaderParamNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordHeaderParamNil"); } } - public NilResult listRecordHeaderParamOptNil() { + public Result listRecordHeaderParamOptNil() { var $path = "%s/api/listheaderparametertypes/listRecordHeaderParamOptNil".formatted( this.baseURI()); @@ -4760,28 +4449,25 @@ public NilResult listRecordHeaderParamOptNil() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listRecordHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listRecordHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listRecordHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordHeaderParamOptNil"); } } - public NilResult listRecordHeaderParamOptNil(List headerValue) { + public Result listRecordHeaderParamOptNil(List headerValue) { var $path = "%s/api/listheaderparametertypes/listRecordHeaderParamOptNil".formatted( this.baseURI()); @@ -4810,22 +4496,19 @@ public NilResult listRecordHeaderParamOptNil(List headerValue if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("listRecordHeaderParamOptNil", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordHeaderParamOptNil", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordHeaderParamOptNil", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordHeaderParamOptNil", e); - this.lifecycleHook.onCatch("listRecordHeaderParamOptNil", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordHeaderParamOptNil", e); + this.lifecycleHook.onCatch("listRecordHeaderParamOptNil", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordHeaderParamOptNil"); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListQueryParameterTypesServiceImpl.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListQueryParameterTypesServiceImpl.java index f334ac54..6f3010fb 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListQueryParameterTypesServiceImpl.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListQueryParameterTypesServiceImpl.java @@ -19,7 +19,8 @@ import dev.rsdlang.sample.client.model.SampleEnum; import dev.rsdlang.sample.client.model.SimpleRecord; import dev.rsdlang.sample.client.model.ZoneId; -import dev.rsdlang.sample.client.RSDException; +import dev.rsdlang.sample.client.Result; +import dev.rsdlang.sample.client.RSDError; import dev.rsdlang.sample.client.SpecSamplesClient; public class ListQueryParameterTypesServiceImpl implements ListQueryParameterTypesService { @@ -48,7 +49,7 @@ private String contentType() { return this.client.contentTypeEncoding().contentType; } - public List listBooleanQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listBooleanQueryParam(List queryValue) { var $path = "%s/api/listqueryparametertypes/listBooleanQueryParam".formatted( this.baseURI()); @@ -70,28 +71,25 @@ public List listBooleanQueryParam(List queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapBooleans($response); this.lifecycleHook.onSuccess("listBooleanQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBooleanQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBooleanQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBooleanQueryParam", e); - this.lifecycleHook.onCatch("listBooleanQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBooleanQueryParam", e); + this.lifecycleHook.onCatch("listBooleanQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBooleanQueryParam"); } } - public List listShortQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listShortQueryParam(List queryValue) { var $path = "%s/api/listqueryparametertypes/listShortQueryParam".formatted( this.baseURI()); @@ -113,28 +111,25 @@ public List listShortQueryParam(List queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapShorts($response); this.lifecycleHook.onSuccess("listShortQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShortQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShortQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShortQueryParam", e); - this.lifecycleHook.onCatch("listShortQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShortQueryParam", e); + this.lifecycleHook.onCatch("listShortQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShortQueryParam"); } } - public List listIntQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listIntQueryParam(List queryValue) { var $path = "%s/api/listqueryparametertypes/listIntQueryParam".formatted( this.baseURI()); @@ -156,28 +151,25 @@ public List listIntQueryParam(List queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInts($response); this.lifecycleHook.onSuccess("listIntQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listIntQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listIntQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listIntQueryParam", e); - this.lifecycleHook.onCatch("listIntQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listIntQueryParam", e); + this.lifecycleHook.onCatch("listIntQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listIntQueryParam"); } } - public List listLongQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listLongQueryParam(List queryValue) { var $path = "%s/api/listqueryparametertypes/listLongQueryParam".formatted( this.baseURI()); @@ -199,28 +191,25 @@ public List listLongQueryParam(List queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLongs($response); this.lifecycleHook.onSuccess("listLongQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLongQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLongQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLongQueryParam", e); - this.lifecycleHook.onCatch("listLongQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLongQueryParam", e); + this.lifecycleHook.onCatch("listLongQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLongQueryParam"); } } - public List listFloatQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listFloatQueryParam(List queryValue) { var $path = "%s/api/listqueryparametertypes/listFloatQueryParam".formatted( this.baseURI()); @@ -242,28 +231,25 @@ public List listFloatQueryParam(List queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapFloats($response); this.lifecycleHook.onSuccess("listFloatQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloatQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloatQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloatQueryParam", e); - this.lifecycleHook.onCatch("listFloatQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloatQueryParam", e); + this.lifecycleHook.onCatch("listFloatQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloatQueryParam"); } } - public List listDoubleQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listDoubleQueryParam(List queryValue) { var $path = "%s/api/listqueryparametertypes/listDoubleQueryParam".formatted( this.baseURI()); @@ -285,28 +271,25 @@ public List listDoubleQueryParam(List queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapDoubles($response); this.lifecycleHook.onSuccess("listDoubleQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDoubleQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDoubleQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDoubleQueryParam", e); - this.lifecycleHook.onCatch("listDoubleQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDoubleQueryParam", e); + this.lifecycleHook.onCatch("listDoubleQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDoubleQueryParam"); } } - public List listStringQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listStringQueryParam(List queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/listqueryparametertypes/listStringQueryParam".formatted( @@ -330,28 +313,25 @@ public List listStringQueryParam(List queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapStrings($response); this.lifecycleHook.onSuccess("listStringQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listStringQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listStringQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listStringQueryParam", e); - this.lifecycleHook.onCatch("listStringQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listStringQueryParam", e); + this.lifecycleHook.onCatch("listStringQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listStringQueryParam"); } } - public List listLocalDateQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listLocalDateQueryParam(List queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/listqueryparametertypes/listLocalDateQueryParam".formatted( @@ -375,28 +355,25 @@ public List listLocalDateQueryParam(List queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDates($response); this.lifecycleHook.onSuccess("listLocalDateQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateQueryParam", e); - this.lifecycleHook.onCatch("listLocalDateQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateQueryParam", e); + this.lifecycleHook.onCatch("listLocalDateQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateQueryParam"); } } - public List listLocalDateTimeQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listLocalDateTimeQueryParam(List queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/listqueryparametertypes/listLocalDateTimeQueryParam".formatted( @@ -420,28 +397,25 @@ public List listLocalDateTimeQueryParam(List query if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDateTimes($response); this.lifecycleHook.onSuccess("listLocalDateTimeQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTimeQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTimeQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTimeQueryParam", e); - this.lifecycleHook.onCatch("listLocalDateTimeQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTimeQueryParam", e); + this.lifecycleHook.onCatch("listLocalDateTimeQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTimeQueryParam"); } } - public List listLocalTimeQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listLocalTimeQueryParam(List queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/listqueryparametertypes/listLocalTimeQueryParam".formatted( @@ -465,28 +439,25 @@ public List listLocalTimeQueryParam(List queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalTimes($response); this.lifecycleHook.onSuccess("listLocalTimeQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTimeQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTimeQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTimeQueryParam", e); - this.lifecycleHook.onCatch("listLocalTimeQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTimeQueryParam", e); + this.lifecycleHook.onCatch("listLocalTimeQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTimeQueryParam"); } } - public List listOffsetDateTimeQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listOffsetDateTimeQueryParam(List queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/listqueryparametertypes/listOffsetDateTimeQueryParam".formatted( @@ -510,28 +481,25 @@ public List listOffsetDateTimeQueryParam(List qu if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapOffsetDateTimes($response); this.lifecycleHook.onSuccess("listOffsetDateTimeQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTimeQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTimeQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTimeQueryParam", e); - this.lifecycleHook.onCatch("listOffsetDateTimeQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTimeQueryParam", e); + this.lifecycleHook.onCatch("listOffsetDateTimeQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTimeQueryParam"); } } - public List listZonedDateTimeQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listZonedDateTimeQueryParam(List queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/listqueryparametertypes/listZonedDateTimeQueryParam".formatted( @@ -555,28 +523,25 @@ public List listZonedDateTimeQueryParam(List query if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapZonedDateTimes($response); this.lifecycleHook.onSuccess("listZonedDateTimeQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTimeQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTimeQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTimeQueryParam", e); - this.lifecycleHook.onCatch("listZonedDateTimeQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTimeQueryParam", e); + this.lifecycleHook.onCatch("listZonedDateTimeQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTimeQueryParam"); } } - public List listScalarQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listScalarQueryParam(List queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/listqueryparametertypes/listScalarQueryParam".formatted( @@ -600,28 +565,25 @@ public List listScalarQueryParam(List queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, ZoneId::of); this.lifecycleHook.onSuccess("listScalarQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalarQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalarQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalarQueryParam", e); - this.lifecycleHook.onCatch("listScalarQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalarQueryParam", e); + this.lifecycleHook.onCatch("listScalarQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalarQueryParam"); } } - public List listEnumQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listEnumQueryParam(List queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/listqueryparametertypes/listEnumQueryParam".formatted( @@ -645,28 +607,25 @@ public List listEnumQueryParam(List queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, SampleEnum::valueOf); this.lifecycleHook.onSuccess("listEnumQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnumQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnumQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnumQueryParam", e); - this.lifecycleHook.onCatch("listEnumQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnumQueryParam", e); + this.lifecycleHook.onCatch("listEnumQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnumQueryParam"); } } - public List listInlineEnumQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listInlineEnumQueryParam(List queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/listqueryparametertypes/listInlineEnumQueryParam".formatted( @@ -690,28 +649,25 @@ public List listEnumQueryParam(List queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, ListInlineEnumQueryParam_Result$::valueOf); this.lifecycleHook.onSuccess("listInlineEnumQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listInlineEnumQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listInlineEnumQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listInlineEnumQueryParam", e); - this.lifecycleHook.onCatch("listInlineEnumQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listInlineEnumQueryParam", e); + this.lifecycleHook.onCatch("listInlineEnumQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listInlineEnumQueryParam"); } } - public String listMultiQueryParam(List valueA, List valueB, List valueC) { + public Result listMultiQueryParam(List valueA, List valueB, List valueC) { Objects.requireNonNull(valueA, "valueA must not be null"); Objects.requireNonNull(valueC, "valueC must not be null"); @@ -743,28 +699,25 @@ public String listMultiQueryParam(List valueA, List valueB, Lis if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("listMultiQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listMultiQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listMultiQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listMultiQueryParam", e); - this.lifecycleHook.onCatch("listMultiQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listMultiQueryParam", e); + this.lifecycleHook.onCatch("listMultiQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listMultiQueryParam"); } } - public List listRecordQueryParam(List queryValue) { + public Result, RSDError.$GenericError> listRecordQueryParam(List queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/listqueryparametertypes/listRecordQueryParam".formatted( @@ -789,22 +742,19 @@ public List listRecordQueryParam(List quer if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObjects($response, SimpleRecordDataImpl::of, SimpleRecord.Data.class); this.lifecycleHook.onSuccess("listRecordQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listRecordQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listRecordQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listRecordQueryParam", e); - this.lifecycleHook.onCatch("listRecordQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listRecordQueryParam", e); + this.lifecycleHook.onCatch("listRecordQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listRecordQueryParam"); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListSampleServiceServiceImpl.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListSampleServiceServiceImpl.java index e709f22d..8ecb7468 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListSampleServiceServiceImpl.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ListSampleServiceServiceImpl.java @@ -18,8 +18,9 @@ import dev.rsdlang.sample.client.model.SampleEnum; import dev.rsdlang.sample.client.model.SimpleRecord; import dev.rsdlang.sample.client.model.ZoneId; -import dev.rsdlang.sample.client.RSDException; -import dev.rsdlang.sample.client.SampleErrorException; +import dev.rsdlang.sample.client.Result; +import dev.rsdlang.sample.client.RSDError; +import dev.rsdlang.sample.client.SampleError; import dev.rsdlang.sample.client.SpecSamplesClient; public class ListSampleServiceServiceImpl implements ListSampleServiceService { @@ -48,7 +49,7 @@ private String contentType() { return this.client.contentTypeEncoding().contentType; } - public List listBoolean() { + public Result, RSDError.$GenericError> listBoolean() { var $path = "%s/api/listsamplerecords/boolean".formatted( this.baseURI()); @@ -65,28 +66,25 @@ public List listBoolean() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapBooleans($response); this.lifecycleHook.onSuccess("listBoolean", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listBoolean", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listBoolean", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listBoolean", e); - this.lifecycleHook.onCatch("listBoolean", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listBoolean", e); + this.lifecycleHook.onCatch("listBoolean", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listBoolean"); } } - public List listShort() { + public Result, RSDError.$GenericError> listShort() { var $path = "%s/api/listsamplerecords/short".formatted( this.baseURI()); @@ -103,28 +101,25 @@ public List listShort() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapShorts($response); this.lifecycleHook.onSuccess("listShort", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listShort", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listShort", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listShort", e); - this.lifecycleHook.onCatch("listShort", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listShort", e); + this.lifecycleHook.onCatch("listShort", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listShort"); } } - public List listInt() { + public Result, RSDError.$GenericError> listInt() { var $path = "%s/api/listsamplerecords/int".formatted( this.baseURI()); @@ -141,28 +136,25 @@ public List listInt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInts($response); this.lifecycleHook.onSuccess("listInt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listInt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listInt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listInt", e); - this.lifecycleHook.onCatch("listInt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listInt", e); + this.lifecycleHook.onCatch("listInt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listInt"); } } - public List listLong() { + public Result, RSDError.$GenericError> listLong() { var $path = "%s/api/listsamplerecords/long".formatted( this.baseURI()); @@ -179,28 +171,25 @@ public List listLong() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLongs($response); this.lifecycleHook.onSuccess("listLong", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLong", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLong", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLong", e); - this.lifecycleHook.onCatch("listLong", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLong", e); + this.lifecycleHook.onCatch("listLong", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLong"); } } - public List listFloat() { + public Result, RSDError.$GenericError> listFloat() { var $path = "%s/api/listsamplerecords/float".formatted( this.baseURI()); @@ -217,28 +206,25 @@ public List listFloat() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapFloats($response); this.lifecycleHook.onSuccess("listFloat", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listFloat", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listFloat", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listFloat", e); - this.lifecycleHook.onCatch("listFloat", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listFloat", e); + this.lifecycleHook.onCatch("listFloat", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listFloat"); } } - public List listDouble() { + public Result, RSDError.$GenericError> listDouble() { var $path = "%s/api/listsamplerecords/double".formatted( this.baseURI()); @@ -255,28 +241,25 @@ public List listDouble() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapDoubles($response); this.lifecycleHook.onSuccess("listDouble", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listDouble", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listDouble", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listDouble", e); - this.lifecycleHook.onCatch("listDouble", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listDouble", e); + this.lifecycleHook.onCatch("listDouble", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listDouble"); } } - public List listString() { + public Result, RSDError.$GenericError> listString() { var $path = "%s/api/listsamplerecords/string".formatted( this.baseURI()); @@ -293,28 +276,25 @@ public List listString() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapStrings($response); this.lifecycleHook.onSuccess("listString", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listString", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listString", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listString", e); - this.lifecycleHook.onCatch("listString", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listString", e); + this.lifecycleHook.onCatch("listString", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listString"); } } - public List listLocalDate() { + public Result, RSDError.$GenericError> listLocalDate() { var $path = "%s/api/listsamplerecords/localdate".formatted( this.baseURI()); @@ -331,28 +311,25 @@ public List listLocalDate() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDates($response); this.lifecycleHook.onSuccess("listLocalDate", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDate", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDate", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDate", e); - this.lifecycleHook.onCatch("listLocalDate", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDate", e); + this.lifecycleHook.onCatch("listLocalDate", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDate"); } } - public List listLocalDateTime() { + public Result, RSDError.$GenericError> listLocalDateTime() { var $path = "%s/api/listsamplerecords/localdatetime".formatted( this.baseURI()); @@ -369,28 +346,25 @@ public List listLocalDateTime() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDateTimes($response); this.lifecycleHook.onSuccess("listLocalDateTime", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalDateTime", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalDateTime", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalDateTime", e); - this.lifecycleHook.onCatch("listLocalDateTime", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalDateTime", e); + this.lifecycleHook.onCatch("listLocalDateTime", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalDateTime"); } } - public List listLocalTime() { + public Result, RSDError.$GenericError> listLocalTime() { var $path = "%s/api/listsamplerecords/localtime".formatted( this.baseURI()); @@ -407,28 +381,25 @@ public List listLocalTime() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalTimes($response); this.lifecycleHook.onSuccess("listLocalTime", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listLocalTime", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listLocalTime", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listLocalTime", e); - this.lifecycleHook.onCatch("listLocalTime", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listLocalTime", e); + this.lifecycleHook.onCatch("listLocalTime", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listLocalTime"); } } - public List listOffsetDateTime() { + public Result, RSDError.$GenericError> listOffsetDateTime() { var $path = "%s/api/listsamplerecords/offsetdatetime".formatted( this.baseURI()); @@ -445,28 +416,25 @@ public List listOffsetDateTime() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapOffsetDateTimes($response); this.lifecycleHook.onSuccess("listOffsetDateTime", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listOffsetDateTime", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listOffsetDateTime", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listOffsetDateTime", e); - this.lifecycleHook.onCatch("listOffsetDateTime", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listOffsetDateTime", e); + this.lifecycleHook.onCatch("listOffsetDateTime", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listOffsetDateTime"); } } - public List listZonedDateTime() { + public Result, RSDError.$GenericError> listZonedDateTime() { var $path = "%s/api/listsamplerecords/zoneddatetime".formatted( this.baseURI()); @@ -483,28 +451,25 @@ public List listZonedDateTime() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapZonedDateTimes($response); this.lifecycleHook.onSuccess("listZonedDateTime", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listZonedDateTime", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listZonedDateTime", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listZonedDateTime", e); - this.lifecycleHook.onCatch("listZonedDateTime", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listZonedDateTime", e); + this.lifecycleHook.onCatch("listZonedDateTime", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listZonedDateTime"); } } - public List listScalar() { + public Result, RSDError.$GenericError> listScalar() { var $path = "%s/api/listsamplerecords/scalar".formatted( this.baseURI()); @@ -521,28 +486,25 @@ public List listScalar() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, ZoneId::of); this.lifecycleHook.onSuccess("listScalar", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listScalar", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listScalar", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listScalar", e); - this.lifecycleHook.onCatch("listScalar", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listScalar", e); + this.lifecycleHook.onCatch("listScalar", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listScalar"); } } - public List listEnum() { + public Result, RSDError.$GenericError> listEnum() { var $path = "%s/api/listsamplerecords/enum".formatted( this.baseURI()); @@ -559,28 +521,25 @@ public List listEnum() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, SampleEnum::valueOf); this.lifecycleHook.onSuccess("listEnum", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listEnum", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listEnum", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listEnum", e); - this.lifecycleHook.onCatch("listEnum", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listEnum", e); + this.lifecycleHook.onCatch("listEnum", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listEnum"); } } - public List listSimpleRecord() { + public Result, RSDError.$GenericError> listSimpleRecord() { var $path = "%s/api/listsamplerecords/simplerecord".formatted( this.baseURI()); @@ -597,29 +556,25 @@ public List listSimpleRecord() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObjects($response, SimpleRecordDataImpl::of, SimpleRecord.Data.class); this.lifecycleHook.onSuccess("listSimpleRecord", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listSimpleRecord", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listSimpleRecord", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listSimpleRecord", e); - this.lifecycleHook.onCatch("listSimpleRecord", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listSimpleRecord", e); + this.lifecycleHook.onCatch("listSimpleRecord", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listSimpleRecord"); } } - public List listSimpleRecordWithError() - throws SampleErrorException { + public Result, RSDError.E1> listSimpleRecordWithError() { var $path = "%s/api/listsamplerecords/simplerecordwitherror".formatted( this.baseURI()); @@ -636,26 +591,23 @@ public List listSimpleRecordWithError() if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObjects($response, SimpleRecordDataImpl::of, SimpleRecord.Data.class); this.lifecycleHook.onSuccess("listSimpleRecordWithError", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } else if ($response.statusCode() == 400) { - var exception = new SampleErrorException(JDKHttpClientResponseUtils.toString($response)); - this.lifecycleHook.onError("listSimpleRecordWithError", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleError(JDKHttpClientResponseUtils.toString($response)); + this.lifecycleHook.onError("listSimpleRecordWithError", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("listSimpleRecordWithError", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("listSimpleRecordWithError", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation listSimpleRecordWithError", e); - this.lifecycleHook.onCatch("listSimpleRecordWithError", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation listSimpleRecordWithError", e); + this.lifecycleHook.onCatch("listSimpleRecordWithError", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("listSimpleRecordWithError"); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/PathParameterTypeServiceServiceImpl.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/PathParameterTypeServiceServiceImpl.java index 315decf1..7551707d 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/PathParameterTypeServiceServiceImpl.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/PathParameterTypeServiceServiceImpl.java @@ -16,7 +16,8 @@ import dev.rsdlang.sample.client.model.SampleEnum; import dev.rsdlang.sample.client.model.ZoneId; import dev.rsdlang.sample.client.PathParameterTypeServiceService; -import dev.rsdlang.sample.client.RSDException; +import dev.rsdlang.sample.client.Result; +import dev.rsdlang.sample.client.RSDError; import dev.rsdlang.sample.client.SpecSamplesClient; public class PathParameterTypeServiceServiceImpl implements PathParameterTypeServiceService { @@ -45,7 +46,7 @@ private String contentType() { return this.client.contentTypeEncoding().contentType; } - public boolean simpleBooleanPathParam(boolean pathBoolean) { + public Result simpleBooleanPathParam(boolean pathBoolean) { var $path = "%s/api/pathparametertype/boolean/%s".formatted( this.baseURI(), BaseUtils.encodeURIComponent(Objects.toString(pathBoolean))); @@ -63,28 +64,25 @@ public boolean simpleBooleanPathParam(boolean pathBoolean) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapBoolean($response); this.lifecycleHook.onSuccess("simpleBooleanPathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanPathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanPathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanPathParam", e); - this.lifecycleHook.onCatch("simpleBooleanPathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanPathParam", e); + this.lifecycleHook.onCatch("simpleBooleanPathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanPathParam"); } } - public short simpleShortPathParam(short pathShort) { + public Result simpleShortPathParam(short pathShort) { var $path = "%s/api/pathparametertype/short/%s".formatted( this.baseURI(), BaseUtils.encodeURIComponent(Objects.toString(pathShort))); @@ -102,28 +100,25 @@ public short simpleShortPathParam(short pathShort) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapShort($response); this.lifecycleHook.onSuccess("simpleShortPathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortPathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortPathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortPathParam", e); - this.lifecycleHook.onCatch("simpleShortPathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortPathParam", e); + this.lifecycleHook.onCatch("simpleShortPathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortPathParam"); } } - public int simpleIntPathParam(int pathInt) { + public Result simpleIntPathParam(int pathInt) { var $path = "%s/api/pathparametertype/int/%s".formatted( this.baseURI(), BaseUtils.encodeURIComponent(Objects.toString(pathInt))); @@ -141,28 +136,25 @@ public int simpleIntPathParam(int pathInt) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("simpleIntPathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntPathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntPathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntPathParam", e); - this.lifecycleHook.onCatch("simpleIntPathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntPathParam", e); + this.lifecycleHook.onCatch("simpleIntPathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntPathParam"); } } - public long simpleLongPathParam(long pathLong) { + public Result simpleLongPathParam(long pathLong) { var $path = "%s/api/pathparametertype/long/%s".formatted( this.baseURI(), BaseUtils.encodeURIComponent(Objects.toString(pathLong))); @@ -180,28 +172,25 @@ public long simpleLongPathParam(long pathLong) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLong($response); this.lifecycleHook.onSuccess("simpleLongPathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongPathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongPathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongPathParam", e); - this.lifecycleHook.onCatch("simpleLongPathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongPathParam", e); + this.lifecycleHook.onCatch("simpleLongPathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongPathParam"); } } - public float simpleFloatPathParam(float pathFloat) { + public Result simpleFloatPathParam(float pathFloat) { var $path = "%s/api/pathparametertype/float/%s".formatted( this.baseURI(), BaseUtils.encodeURIComponent(Objects.toString(pathFloat))); @@ -219,28 +208,25 @@ public float simpleFloatPathParam(float pathFloat) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapFloat($response); this.lifecycleHook.onSuccess("simpleFloatPathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatPathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatPathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatPathParam", e); - this.lifecycleHook.onCatch("simpleFloatPathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatPathParam", e); + this.lifecycleHook.onCatch("simpleFloatPathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatPathParam"); } } - public double simpleDoublePathParam(double pathDouble) { + public Result simpleDoublePathParam(double pathDouble) { var $path = "%s/api/pathparametertype/double/%s".formatted( this.baseURI(), BaseUtils.encodeURIComponent(Objects.toString(pathDouble))); @@ -258,28 +244,25 @@ public double simpleDoublePathParam(double pathDouble) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapDouble($response); this.lifecycleHook.onSuccess("simpleDoublePathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoublePathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoublePathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoublePathParam", e); - this.lifecycleHook.onCatch("simpleDoublePathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoublePathParam", e); + this.lifecycleHook.onCatch("simpleDoublePathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoublePathParam"); } } - public String simpleStringPathParam(String pathString) { + public Result simpleStringPathParam(String pathString) { Objects.requireNonNull(pathString, "pathString must not be null"); var $path = "%s/api/pathparametertype/string/%s".formatted( @@ -299,28 +282,25 @@ public String simpleStringPathParam(String pathString) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("simpleStringPathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringPathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringPathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringPathParam", e); - this.lifecycleHook.onCatch("simpleStringPathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringPathParam", e); + this.lifecycleHook.onCatch("simpleStringPathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringPathParam"); } } - public LocalDate simpleLocalDatePathParam(LocalDate pathLocalDate) { + public Result simpleLocalDatePathParam(LocalDate pathLocalDate) { Objects.requireNonNull(pathLocalDate, "pathLocalDate must not be null"); var $path = "%s/api/pathparametertype/localdate/%s".formatted( @@ -340,28 +320,25 @@ public LocalDate simpleLocalDatePathParam(LocalDate pathLocalDate) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDate($response); this.lifecycleHook.onSuccess("simpleLocalDatePathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDatePathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDatePathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDatePathParam", e); - this.lifecycleHook.onCatch("simpleLocalDatePathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDatePathParam", e); + this.lifecycleHook.onCatch("simpleLocalDatePathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDatePathParam"); } } - public LocalDateTime simpleLocalDateTimePathParam(LocalDateTime pathLocalDateTime) { + public Result simpleLocalDateTimePathParam(LocalDateTime pathLocalDateTime) { Objects.requireNonNull(pathLocalDateTime, "pathLocalDateTime must not be null"); var $path = "%s/api/pathparametertype/localdatetime/%s".formatted( @@ -381,28 +358,25 @@ public LocalDateTime simpleLocalDateTimePathParam(LocalDateTime pathLocalDateTim if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDateTime($response); this.lifecycleHook.onSuccess("simpleLocalDateTimePathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimePathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimePathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimePathParam", e); - this.lifecycleHook.onCatch("simpleLocalDateTimePathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimePathParam", e); + this.lifecycleHook.onCatch("simpleLocalDateTimePathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimePathParam"); } } - public LocalTime simpleLocalTimePathParam(LocalTime pathLocalTime) { + public Result simpleLocalTimePathParam(LocalTime pathLocalTime) { Objects.requireNonNull(pathLocalTime, "pathLocalTime must not be null"); var $path = "%s/api/pathparametertype/localtime/%s".formatted( @@ -422,28 +396,25 @@ public LocalTime simpleLocalTimePathParam(LocalTime pathLocalTime) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalTime($response); this.lifecycleHook.onSuccess("simpleLocalTimePathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimePathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimePathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimePathParam", e); - this.lifecycleHook.onCatch("simpleLocalTimePathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimePathParam", e); + this.lifecycleHook.onCatch("simpleLocalTimePathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimePathParam"); } } - public OffsetDateTime simpleOffsetDateTimePathParam(OffsetDateTime pathOffsetDateTime) { + public Result simpleOffsetDateTimePathParam(OffsetDateTime pathOffsetDateTime) { Objects.requireNonNull(pathOffsetDateTime, "pathOffsetDateTime must not be null"); var $path = "%s/api/pathparametertype/offsetdatetime/%s".formatted( @@ -463,28 +434,25 @@ public OffsetDateTime simpleOffsetDateTimePathParam(OffsetDateTime pathOffsetDat if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapOffsetDateTime($response); this.lifecycleHook.onSuccess("simpleOffsetDateTimePathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimePathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimePathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimePathParam", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimePathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimePathParam", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimePathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimePathParam"); } } - public ZonedDateTime simpleZonedDateTimePathParam(ZonedDateTime pathZonedDateTime) { + public Result simpleZonedDateTimePathParam(ZonedDateTime pathZonedDateTime) { Objects.requireNonNull(pathZonedDateTime, "pathZonedDateTime must not be null"); var $path = "%s/api/pathparametertype/zoneddatetime/%s".formatted( @@ -504,28 +472,25 @@ public ZonedDateTime simpleZonedDateTimePathParam(ZonedDateTime pathZonedDateTim if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapZonedDateTime($response); this.lifecycleHook.onSuccess("simpleZonedDateTimePathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimePathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimePathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimePathParam", e); - this.lifecycleHook.onCatch("simpleZonedDateTimePathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimePathParam", e); + this.lifecycleHook.onCatch("simpleZonedDateTimePathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimePathParam"); } } - public ZoneId simpleScalarPathParam(ZoneId pathScalar) { + public Result simpleScalarPathParam(ZoneId pathScalar) { Objects.requireNonNull(pathScalar, "pathScalar must not be null"); var $path = "%s/api/pathparametertype/scalar/%s".formatted( @@ -545,28 +510,25 @@ public ZoneId simpleScalarPathParam(ZoneId pathScalar) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, ZoneId::of); this.lifecycleHook.onSuccess("simpleScalarPathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarPathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarPathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarPathParam", e); - this.lifecycleHook.onCatch("simpleScalarPathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarPathParam", e); + this.lifecycleHook.onCatch("simpleScalarPathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarPathParam"); } } - public SampleEnum simpleEnumPathParam(SampleEnum pathEnum) { + public Result simpleEnumPathParam(SampleEnum pathEnum) { Objects.requireNonNull(pathEnum, "pathEnum must not be null"); var $path = "%s/api/pathparametertype/enum/%s".formatted( @@ -586,28 +548,25 @@ public SampleEnum simpleEnumPathParam(SampleEnum pathEnum) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, SampleEnum::valueOf); this.lifecycleHook.onSuccess("simpleEnumPathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumPathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumPathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumPathParam", e); - this.lifecycleHook.onCatch("simpleEnumPathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumPathParam", e); + this.lifecycleHook.onCatch("simpleEnumPathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumPathParam"); } } - public String multiPathParam(String valueA, int valueB) { + public Result multiPathParam(String valueA, int valueB) { Objects.requireNonNull(valueA, "valueA must not be null"); var $path = "%s/api/pathparametertype/multipathparam/%s/%s".formatted( @@ -628,22 +587,19 @@ public String multiPathParam(String valueA, int valueB) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiPathParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiPathParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiPathParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiPathParam", e); - this.lifecycleHook.onCatch("multiPathParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiPathParam", e); + this.lifecycleHook.onCatch("multiPathParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiPathParam"); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/QueryParameterTypesServiceImpl.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/QueryParameterTypesServiceImpl.java index 9815c97b..339d758f 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/QueryParameterTypesServiceImpl.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/QueryParameterTypesServiceImpl.java @@ -19,7 +19,8 @@ import dev.rsdlang.sample.client.model.SimpleRecord; import dev.rsdlang.sample.client.model.ZoneId; import dev.rsdlang.sample.client.QueryParameterTypesService; -import dev.rsdlang.sample.client.RSDException; +import dev.rsdlang.sample.client.Result; +import dev.rsdlang.sample.client.RSDError; import dev.rsdlang.sample.client.SpecSamplesClient; public class QueryParameterTypesServiceImpl implements QueryParameterTypesService { @@ -48,7 +49,7 @@ private String contentType() { return this.client.contentTypeEncoding().contentType; } - public boolean simpleBooleanQueryParam(boolean queryValue) { + public Result simpleBooleanQueryParam(boolean queryValue) { var $path = "%s/api/queryparametertypes/simpleBooleanQueryParam".formatted( this.baseURI()); @@ -68,28 +69,25 @@ public boolean simpleBooleanQueryParam(boolean queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapBoolean($response); this.lifecycleHook.onSuccess("simpleBooleanQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanQueryParam", e); - this.lifecycleHook.onCatch("simpleBooleanQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanQueryParam", e); + this.lifecycleHook.onCatch("simpleBooleanQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanQueryParam"); } } - public NilResult simpleBooleanQueryParamOpt() { + public Result simpleBooleanQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleBooleanQueryParamOpt".formatted( this.baseURI()); @@ -106,28 +104,25 @@ public NilResult simpleBooleanQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleBooleanQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleBooleanQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleBooleanQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanQueryParamOpt"); } } - public NilResult simpleBooleanQueryParamOpt(Boolean queryValue) { + public Result simpleBooleanQueryParamOpt(Boolean queryValue) { var $path = "%s/api/queryparametertypes/simpleBooleanQueryParamOpt".formatted( this.baseURI()); @@ -149,28 +144,25 @@ public NilResult simpleBooleanQueryParamOpt(Boolean queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleBooleanQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleBooleanQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleBooleanQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleBooleanQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleBooleanQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleBooleanQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleBooleanQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleBooleanQueryParamOpt"); } } - public short simpleShortQueryParam(short queryValue) { + public Result simpleShortQueryParam(short queryValue) { var $path = "%s/api/queryparametertypes/simpleShortQueryParam".formatted( this.baseURI()); @@ -190,28 +182,25 @@ public short simpleShortQueryParam(short queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapShort($response); this.lifecycleHook.onSuccess("simpleShortQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortQueryParam", e); - this.lifecycleHook.onCatch("simpleShortQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortQueryParam", e); + this.lifecycleHook.onCatch("simpleShortQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortQueryParam"); } } - public NilResult simpleShortQueryParamOpt() { + public Result simpleShortQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleShortQueryParamOpt".formatted( this.baseURI()); @@ -228,28 +217,25 @@ public NilResult simpleShortQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleShortQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleShortQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleShortQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortQueryParamOpt"); } } - public NilResult simpleShortQueryParamOpt(Short queryValue) { + public Result simpleShortQueryParamOpt(Short queryValue) { var $path = "%s/api/queryparametertypes/simpleShortQueryParamOpt".formatted( this.baseURI()); @@ -271,28 +257,25 @@ public NilResult simpleShortQueryParamOpt(Short queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleShortQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleShortQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleShortQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleShortQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleShortQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleShortQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleShortQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleShortQueryParamOpt"); } } - public int simpleIntQueryParam(int queryValue) { + public Result simpleIntQueryParam(int queryValue) { var $path = "%s/api/queryparametertypes/simpleIntQueryParam".formatted( this.baseURI()); @@ -312,28 +295,25 @@ public int simpleIntQueryParam(int queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("simpleIntQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntQueryParam", e); - this.lifecycleHook.onCatch("simpleIntQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntQueryParam", e); + this.lifecycleHook.onCatch("simpleIntQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntQueryParam"); } } - public NilResult simpleIntQueryParamOpt() { + public Result simpleIntQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleIntQueryParamOpt".formatted( this.baseURI()); @@ -350,28 +330,25 @@ public NilResult simpleIntQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleIntQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleIntQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleIntQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntQueryParamOpt"); } } - public NilResult simpleIntQueryParamOpt(Integer queryValue) { + public Result simpleIntQueryParamOpt(Integer queryValue) { var $path = "%s/api/queryparametertypes/simpleIntQueryParamOpt".formatted( this.baseURI()); @@ -393,28 +370,25 @@ public NilResult simpleIntQueryParamOpt(Integer queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleIntQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleIntQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleIntQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleIntQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleIntQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleIntQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleIntQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleIntQueryParamOpt"); } } - public long simpleLongQueryParam(long queryValue) { + public Result simpleLongQueryParam(long queryValue) { var $path = "%s/api/queryparametertypes/simpleLongQueryParam".formatted( this.baseURI()); @@ -434,28 +408,25 @@ public long simpleLongQueryParam(long queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLong($response); this.lifecycleHook.onSuccess("simpleLongQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongQueryParam", e); - this.lifecycleHook.onCatch("simpleLongQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongQueryParam", e); + this.lifecycleHook.onCatch("simpleLongQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongQueryParam"); } } - public NilResult simpleLongQueryParamOpt() { + public Result simpleLongQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleLongQueryParamOpt".formatted( this.baseURI()); @@ -472,28 +443,25 @@ public NilResult simpleLongQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLongQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleLongQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleLongQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongQueryParamOpt"); } } - public NilResult simpleLongQueryParamOpt(Long queryValue) { + public Result simpleLongQueryParamOpt(Long queryValue) { var $path = "%s/api/queryparametertypes/simpleLongQueryParamOpt".formatted( this.baseURI()); @@ -515,28 +483,25 @@ public NilResult simpleLongQueryParamOpt(Long queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLongQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLongQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLongQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLongQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleLongQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLongQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleLongQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLongQueryParamOpt"); } } - public float simpleFloatQueryParam(float queryValue) { + public Result simpleFloatQueryParam(float queryValue) { var $path = "%s/api/queryparametertypes/simpleFloatQueryParam".formatted( this.baseURI()); @@ -556,28 +521,25 @@ public float simpleFloatQueryParam(float queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapFloat($response); this.lifecycleHook.onSuccess("simpleFloatQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatQueryParam", e); - this.lifecycleHook.onCatch("simpleFloatQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatQueryParam", e); + this.lifecycleHook.onCatch("simpleFloatQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatQueryParam"); } } - public NilResult simpleFloatQueryParamOpt() { + public Result simpleFloatQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleFloatQueryParamOpt".formatted( this.baseURI()); @@ -594,28 +556,25 @@ public NilResult simpleFloatQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleFloatQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleFloatQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleFloatQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatQueryParamOpt"); } } - public NilResult simpleFloatQueryParamOpt(Float queryValue) { + public Result simpleFloatQueryParamOpt(Float queryValue) { var $path = "%s/api/queryparametertypes/simpleFloatQueryParamOpt".formatted( this.baseURI()); @@ -637,28 +596,25 @@ public NilResult simpleFloatQueryParamOpt(Float queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleFloatQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleFloatQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleFloatQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleFloatQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleFloatQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleFloatQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleFloatQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleFloatQueryParamOpt"); } } - public double simpleDoubleQueryParam(double queryValue) { + public Result simpleDoubleQueryParam(double queryValue) { var $path = "%s/api/queryparametertypes/simpleDoubleQueryParam".formatted( this.baseURI()); @@ -678,28 +634,25 @@ public double simpleDoubleQueryParam(double queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapDouble($response); this.lifecycleHook.onSuccess("simpleDoubleQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleQueryParam", e); - this.lifecycleHook.onCatch("simpleDoubleQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleQueryParam", e); + this.lifecycleHook.onCatch("simpleDoubleQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleQueryParam"); } } - public NilResult simpleDoubleQueryParamOpt() { + public Result simpleDoubleQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleDoubleQueryParamOpt".formatted( this.baseURI()); @@ -716,28 +669,25 @@ public NilResult simpleDoubleQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleDoubleQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleDoubleQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleDoubleQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleQueryParamOpt"); } } - public NilResult simpleDoubleQueryParamOpt(Double queryValue) { + public Result simpleDoubleQueryParamOpt(Double queryValue) { var $path = "%s/api/queryparametertypes/simpleDoubleQueryParamOpt".formatted( this.baseURI()); @@ -759,28 +709,25 @@ public NilResult simpleDoubleQueryParamOpt(Double queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleDoubleQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleDoubleQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleDoubleQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleDoubleQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleDoubleQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleDoubleQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleDoubleQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleDoubleQueryParamOpt"); } } - public String simpleStringQueryParam(String queryValue) { + public Result simpleStringQueryParam(String queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/queryparametertypes/simpleStringQueryParam".formatted( @@ -802,28 +749,25 @@ public String simpleStringQueryParam(String queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("simpleStringQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringQueryParam", e); - this.lifecycleHook.onCatch("simpleStringQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringQueryParam", e); + this.lifecycleHook.onCatch("simpleStringQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringQueryParam"); } } - public NilResult simpleStringQueryParamOpt() { + public Result simpleStringQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleStringQueryParamOpt".formatted( this.baseURI()); @@ -840,28 +784,25 @@ public NilResult simpleStringQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleStringQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleStringQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleStringQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringQueryParamOpt"); } } - public NilResult simpleStringQueryParamOpt(String queryValue) { + public Result simpleStringQueryParamOpt(String queryValue) { var $path = "%s/api/queryparametertypes/simpleStringQueryParamOpt".formatted( this.baseURI()); @@ -883,28 +824,25 @@ public NilResult simpleStringQueryParamOpt(String queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleStringQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleStringQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleStringQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleStringQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleStringQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleStringQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleStringQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleStringQueryParamOpt"); } } - public LocalDate simpleLocalDateQueryParam(LocalDate queryValue) { + public Result simpleLocalDateQueryParam(LocalDate queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/queryparametertypes/simpleLocalDateQueryParam".formatted( @@ -926,28 +864,25 @@ public LocalDate simpleLocalDateQueryParam(LocalDate queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDate($response); this.lifecycleHook.onSuccess("simpleLocalDateQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateQueryParam", e); - this.lifecycleHook.onCatch("simpleLocalDateQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateQueryParam", e); + this.lifecycleHook.onCatch("simpleLocalDateQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateQueryParam"); } } - public NilResult simpleLocalDateQueryParamOpt() { + public Result simpleLocalDateQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleLocalDateQueryParamOpt".formatted( this.baseURI()); @@ -964,28 +899,25 @@ public NilResult simpleLocalDateQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalDateQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalDateQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateQueryParamOpt"); } } - public NilResult simpleLocalDateQueryParamOpt(LocalDate queryValue) { + public Result simpleLocalDateQueryParamOpt(LocalDate queryValue) { var $path = "%s/api/queryparametertypes/simpleLocalDateQueryParamOpt".formatted( this.baseURI()); @@ -1007,28 +939,25 @@ public NilResult simpleLocalDateQueryParamOpt(LocalDate queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalDateQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalDateQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateQueryParamOpt"); } } - public LocalDateTime simpleLocalDateTimeQueryParam(LocalDateTime queryValue) { + public Result simpleLocalDateTimeQueryParam(LocalDateTime queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/queryparametertypes/simpleLocalDateTimeQueryParam".formatted( @@ -1050,28 +979,25 @@ public LocalDateTime simpleLocalDateTimeQueryParam(LocalDateTime queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDateTime($response); this.lifecycleHook.onSuccess("simpleLocalDateTimeQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeQueryParam", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeQueryParam", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeQueryParam"); } } - public NilResult simpleLocalDateTimeQueryParamOpt() { + public Result simpleLocalDateTimeQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleLocalDateTimeQueryParamOpt".formatted( this.baseURI()); @@ -1088,28 +1014,25 @@ public NilResult simpleLocalDateTimeQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateTimeQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeQueryParamOpt"); } } - public NilResult simpleLocalDateTimeQueryParamOpt(LocalDateTime queryValue) { + public Result simpleLocalDateTimeQueryParamOpt(LocalDateTime queryValue) { var $path = "%s/api/queryparametertypes/simpleLocalDateTimeQueryParamOpt".formatted( this.baseURI()); @@ -1131,28 +1054,25 @@ public NilResult simpleLocalDateTimeQueryParamOpt(LocalDateTime queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalDateTimeQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalDateTimeQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalDateTimeQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalDateTimeQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalDateTimeQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalDateTimeQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalDateTimeQueryParamOpt"); } } - public LocalTime simpleLocalTimeQueryParam(LocalTime queryValue) { + public Result simpleLocalTimeQueryParam(LocalTime queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/queryparametertypes/simpleLocalTimeQueryParam".formatted( @@ -1174,28 +1094,25 @@ public LocalTime simpleLocalTimeQueryParam(LocalTime queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalTime($response); this.lifecycleHook.onSuccess("simpleLocalTimeQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeQueryParam", e); - this.lifecycleHook.onCatch("simpleLocalTimeQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeQueryParam", e); + this.lifecycleHook.onCatch("simpleLocalTimeQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeQueryParam"); } } - public NilResult simpleLocalTimeQueryParamOpt() { + public Result simpleLocalTimeQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleLocalTimeQueryParamOpt".formatted( this.baseURI()); @@ -1212,28 +1129,25 @@ public NilResult simpleLocalTimeQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalTimeQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalTimeQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalTimeQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeQueryParamOpt"); } } - public NilResult simpleLocalTimeQueryParamOpt(LocalTime queryValue) { + public Result simpleLocalTimeQueryParamOpt(LocalTime queryValue) { var $path = "%s/api/queryparametertypes/simpleLocalTimeQueryParamOpt".formatted( this.baseURI()); @@ -1255,28 +1169,25 @@ public NilResult simpleLocalTimeQueryParamOpt(LocalTime queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleLocalTimeQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleLocalTimeQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleLocalTimeQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleLocalTimeQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleLocalTimeQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleLocalTimeQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleLocalTimeQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleLocalTimeQueryParamOpt"); } } - public OffsetDateTime simpleOffsetDateTimeQueryParam(OffsetDateTime queryValue) { + public Result simpleOffsetDateTimeQueryParam(OffsetDateTime queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/queryparametertypes/simpleOffsetDateTimeQueryParam".formatted( @@ -1298,28 +1209,25 @@ public OffsetDateTime simpleOffsetDateTimeQueryParam(OffsetDateTime queryValue) if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapOffsetDateTime($response); this.lifecycleHook.onSuccess("simpleOffsetDateTimeQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeQueryParam", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeQueryParam", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeQueryParam"); } } - public NilResult simpleOffsetDateTimeQueryParamOpt() { + public Result simpleOffsetDateTimeQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleOffsetDateTimeQueryParamOpt".formatted( this.baseURI()); @@ -1336,28 +1244,25 @@ public NilResult simpleOffsetDateTimeQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleOffsetDateTimeQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeQueryParamOpt"); } } - public NilResult simpleOffsetDateTimeQueryParamOpt(OffsetDateTime queryValue) { + public Result simpleOffsetDateTimeQueryParamOpt(OffsetDateTime queryValue) { var $path = "%s/api/queryparametertypes/simpleOffsetDateTimeQueryParamOpt".formatted( this.baseURI()); @@ -1379,28 +1284,25 @@ public NilResult simpleOffsetDateTimeQueryParamOpt(OffsetDateTime queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleOffsetDateTimeQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleOffsetDateTimeQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleOffsetDateTimeQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleOffsetDateTimeQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleOffsetDateTimeQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleOffsetDateTimeQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleOffsetDateTimeQueryParamOpt"); } } - public ZonedDateTime simpleZonedDateTimeQueryParam(ZonedDateTime queryValue) { + public Result simpleZonedDateTimeQueryParam(ZonedDateTime queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/queryparametertypes/simpleZonedDateTimeQueryParam".formatted( @@ -1422,28 +1324,25 @@ public ZonedDateTime simpleZonedDateTimeQueryParam(ZonedDateTime queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapZonedDateTime($response); this.lifecycleHook.onSuccess("simpleZonedDateTimeQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeQueryParam", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeQueryParam", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeQueryParam"); } } - public NilResult simpleZonedDateTimeQueryParamOpt() { + public Result simpleZonedDateTimeQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleZonedDateTimeQueryParamOpt".formatted( this.baseURI()); @@ -1460,28 +1359,25 @@ public NilResult simpleZonedDateTimeQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleZonedDateTimeQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeQueryParamOpt"); } } - public NilResult simpleZonedDateTimeQueryParamOpt(ZonedDateTime queryValue) { + public Result simpleZonedDateTimeQueryParamOpt(ZonedDateTime queryValue) { var $path = "%s/api/queryparametertypes/simpleZonedDateTimeQueryParamOpt".formatted( this.baseURI()); @@ -1503,28 +1399,25 @@ public NilResult simpleZonedDateTimeQueryParamOpt(ZonedDateTime queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleZonedDateTimeQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleZonedDateTimeQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleZonedDateTimeQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleZonedDateTimeQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleZonedDateTimeQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleZonedDateTimeQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleZonedDateTimeQueryParamOpt"); } } - public ZoneId simpleScalarQueryParam(ZoneId queryValue) { + public Result simpleScalarQueryParam(ZoneId queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/queryparametertypes/simpleScalarQueryParam".formatted( @@ -1546,28 +1439,25 @@ public ZoneId simpleScalarQueryParam(ZoneId queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, ZoneId::of); this.lifecycleHook.onSuccess("simpleScalarQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarQueryParam", e); - this.lifecycleHook.onCatch("simpleScalarQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarQueryParam", e); + this.lifecycleHook.onCatch("simpleScalarQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarQueryParam"); } } - public NilResult simpleScalarQueryParamOpt() { + public Result simpleScalarQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleScalarQueryParamOpt".formatted( this.baseURI()); @@ -1584,28 +1474,25 @@ public NilResult simpleScalarQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleScalarQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleScalarQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleScalarQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarQueryParamOpt"); } } - public NilResult simpleScalarQueryParamOpt(ZoneId queryValue) { + public Result simpleScalarQueryParamOpt(ZoneId queryValue) { var $path = "%s/api/queryparametertypes/simpleScalarQueryParamOpt".formatted( this.baseURI()); @@ -1627,28 +1514,25 @@ public NilResult simpleScalarQueryParamOpt(ZoneId queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleScalarQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleScalarQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleScalarQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleScalarQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleScalarQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleScalarQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleScalarQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleScalarQueryParamOpt"); } } - public SampleEnum simpleEnumQueryParam(SampleEnum queryValue) { + public Result simpleEnumQueryParam(SampleEnum queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/queryparametertypes/simpleEnumQueryParam".formatted( @@ -1670,28 +1554,25 @@ public SampleEnum simpleEnumQueryParam(SampleEnum queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, SampleEnum::valueOf); this.lifecycleHook.onSuccess("simpleEnumQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumQueryParam", e); - this.lifecycleHook.onCatch("simpleEnumQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumQueryParam", e); + this.lifecycleHook.onCatch("simpleEnumQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumQueryParam"); } } - public NilResult simpleEnumQueryParamOpt() { + public Result simpleEnumQueryParamOpt() { var $path = "%s/api/queryparametertypes/simpleEnumQueryParamOpt".formatted( this.baseURI()); @@ -1708,28 +1589,25 @@ public NilResult simpleEnumQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleEnumQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleEnumQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleEnumQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumQueryParamOpt"); } } - public NilResult simpleEnumQueryParamOpt(SampleEnum queryValue) { + public Result simpleEnumQueryParamOpt(SampleEnum queryValue) { var $path = "%s/api/queryparametertypes/simpleEnumQueryParamOpt".formatted( this.baseURI()); @@ -1751,28 +1629,25 @@ public NilResult simpleEnumQueryParamOpt(SampleEnum queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("simpleEnumQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("simpleEnumQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("simpleEnumQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation simpleEnumQueryParamOpt", e); - this.lifecycleHook.onCatch("simpleEnumQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation simpleEnumQueryParamOpt", e); + this.lifecycleHook.onCatch("simpleEnumQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("simpleEnumQueryParamOpt"); } } - public String multiQueryParam(String valueA, int valueB) { + public Result multiQueryParam(String valueA, int valueB) { Objects.requireNonNull(valueA, "valueA must not be null"); var $path = "%s/api/queryparametertypes/multiQueryParam".formatted( @@ -1795,28 +1670,25 @@ public String multiQueryParam(String valueA, int valueB) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiQueryParam", e); - this.lifecycleHook.onCatch("multiQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiQueryParam", e); + this.lifecycleHook.onCatch("multiQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiQueryParam"); } } - public String multiQueryParamOpt() { + public Result multiQueryParamOpt() { var $path = "%s/api/queryparametertypes/multiQueryParamOpt".formatted( this.baseURI()); @@ -1833,28 +1705,25 @@ public String multiQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiQueryParamOpt", e); - this.lifecycleHook.onCatch("multiQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiQueryParamOpt", e); + this.lifecycleHook.onCatch("multiQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiQueryParamOpt"); } } - public String multiQueryParamOpt(String valueA) { + public Result multiQueryParamOpt(String valueA) { var $path = "%s/api/queryparametertypes/multiQueryParamOpt".formatted( this.baseURI()); @@ -1876,28 +1745,25 @@ public String multiQueryParamOpt(String valueA) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiQueryParamOpt", e); - this.lifecycleHook.onCatch("multiQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiQueryParamOpt", e); + this.lifecycleHook.onCatch("multiQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiQueryParamOpt"); } } - public String multiQueryParamOpt(String valueA, Integer valueB) { + public Result multiQueryParamOpt(String valueA, Integer valueB) { var $path = "%s/api/queryparametertypes/multiQueryParamOpt".formatted( this.baseURI()); @@ -1922,28 +1788,25 @@ public String multiQueryParamOpt(String valueA, Integer valueB) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("multiQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiQueryParamOpt", e); - this.lifecycleHook.onCatch("multiQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiQueryParamOpt", e); + this.lifecycleHook.onCatch("multiQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiQueryParamOpt"); } } - public SimpleRecord.Data recordQueryParam(SimpleRecord.Data queryValue) { + public Result recordQueryParam(SimpleRecord.Data queryValue) { Objects.requireNonNull(queryValue, "queryValue must not be null"); var $path = "%s/api/queryparametertypes/recordQueryParam".formatted( @@ -1966,28 +1829,25 @@ public SimpleRecord.Data recordQueryParam(SimpleRecord.Data queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, SimpleRecordDataImpl::of, SimpleRecord.Data.class); this.lifecycleHook.onSuccess("recordQueryParam", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordQueryParam", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordQueryParam", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordQueryParam", e); - this.lifecycleHook.onCatch("recordQueryParam", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordQueryParam", e); + this.lifecycleHook.onCatch("recordQueryParam", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordQueryParam"); } } - public NilResult recordQueryParamOpt() { + public Result recordQueryParamOpt() { var $path = "%s/api/queryparametertypes/recordQueryParamOpt".formatted( this.baseURI()); @@ -2004,28 +1864,25 @@ public NilResult recordQueryParamOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("recordQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordQueryParamOpt", e); - this.lifecycleHook.onCatch("recordQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordQueryParamOpt", e); + this.lifecycleHook.onCatch("recordQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordQueryParamOpt"); } } - public NilResult recordQueryParamOpt(SimpleRecord.Data queryValue) { + public Result recordQueryParamOpt(SimpleRecord.Data queryValue) { var $path = "%s/api/queryparametertypes/recordQueryParamOpt".formatted( this.baseURI()); @@ -2048,22 +1905,19 @@ public NilResult recordQueryParamOpt(SimpleRecord.Data queryValue) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("recordQueryParamOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("recordQueryParamOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("recordQueryParamOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation recordQueryParamOpt", e); - this.lifecycleHook.onCatch("recordQueryParamOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation recordQueryParamOpt", e); + this.lifecycleHook.onCatch("recordQueryParamOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("recordQueryParamOpt"); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/SampleServiceServiceImpl.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/SampleServiceServiceImpl.java index 1c8a4963..f9e58d1d 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/SampleServiceServiceImpl.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/SampleServiceServiceImpl.java @@ -21,15 +21,16 @@ import dev.rsdlang.sample.client.model.SimpleRecord; import dev.rsdlang.sample.client.model.Union; import dev.rsdlang.sample.client.model.ZoneId; -import dev.rsdlang.sample.client.RSDException; -import dev.rsdlang.sample.client.SampleError2Exception; -import dev.rsdlang.sample.client.SampleErrorBooleanException; -import dev.rsdlang.sample.client.SampleErrorEnumException; -import dev.rsdlang.sample.client.SampleErrorException; -import dev.rsdlang.sample.client.SampleErrorIntException; -import dev.rsdlang.sample.client.SampleErrorScalarException; -import dev.rsdlang.sample.client.SampleErrorUnionException; -import dev.rsdlang.sample.client.SampleErrorWithValueException; +import dev.rsdlang.sample.client.Result; +import dev.rsdlang.sample.client.RSDError; +import dev.rsdlang.sample.client.SampleError; +import dev.rsdlang.sample.client.SampleError2; +import dev.rsdlang.sample.client.SampleErrorBoolean; +import dev.rsdlang.sample.client.SampleErrorEnum; +import dev.rsdlang.sample.client.SampleErrorInt; +import dev.rsdlang.sample.client.SampleErrorScalar; +import dev.rsdlang.sample.client.SampleErrorUnion; +import dev.rsdlang.sample.client.SampleErrorWithValue; import dev.rsdlang.sample.client.SampleServiceService; import dev.rsdlang.sample.client.SpecSamplesClient; @@ -59,7 +60,7 @@ private String contentType() { return this.client.contentTypeEncoding().contentType; } - public boolean getBoolean() { + public Result getBoolean() { var $path = "%s/api/samplerecords/boolean".formatted( this.baseURI()); @@ -76,28 +77,25 @@ public boolean getBoolean() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapBoolean($response); this.lifecycleHook.onSuccess("getBoolean", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getBoolean", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getBoolean", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getBoolean", e); - this.lifecycleHook.onCatch("getBoolean", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getBoolean", e); + this.lifecycleHook.onCatch("getBoolean", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getBoolean"); } } - public short getShort() { + public Result getShort() { var $path = "%s/api/samplerecords/short".formatted( this.baseURI()); @@ -114,28 +112,25 @@ public short getShort() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapShort($response); this.lifecycleHook.onSuccess("getShort", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getShort", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getShort", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getShort", e); - this.lifecycleHook.onCatch("getShort", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getShort", e); + this.lifecycleHook.onCatch("getShort", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getShort"); } } - public int getInt() { + public Result getInt() { var $path = "%s/api/samplerecords/int".formatted( this.baseURI()); @@ -152,28 +147,25 @@ public int getInt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapInt($response); this.lifecycleHook.onSuccess("getInt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getInt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getInt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getInt", e); - this.lifecycleHook.onCatch("getInt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getInt", e); + this.lifecycleHook.onCatch("getInt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getInt"); } } - public long getLong() { + public Result getLong() { var $path = "%s/api/samplerecords/long".formatted( this.baseURI()); @@ -190,28 +182,25 @@ public long getLong() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLong($response); this.lifecycleHook.onSuccess("getLong", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getLong", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getLong", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getLong", e); - this.lifecycleHook.onCatch("getLong", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getLong", e); + this.lifecycleHook.onCatch("getLong", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getLong"); } } - public float getFloat() { + public Result getFloat() { var $path = "%s/api/samplerecords/float".formatted( this.baseURI()); @@ -228,28 +217,25 @@ public float getFloat() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapFloat($response); this.lifecycleHook.onSuccess("getFloat", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getFloat", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getFloat", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getFloat", e); - this.lifecycleHook.onCatch("getFloat", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getFloat", e); + this.lifecycleHook.onCatch("getFloat", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getFloat"); } } - public double getDouble() { + public Result getDouble() { var $path = "%s/api/samplerecords/double".formatted( this.baseURI()); @@ -266,28 +252,25 @@ public double getDouble() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapDouble($response); this.lifecycleHook.onSuccess("getDouble", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getDouble", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getDouble", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getDouble", e); - this.lifecycleHook.onCatch("getDouble", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getDouble", e); + this.lifecycleHook.onCatch("getDouble", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getDouble"); } } - public String getString() { + public Result getString() { var $path = "%s/api/samplerecords/string".formatted( this.baseURI()); @@ -304,28 +287,25 @@ public String getString() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapString($response); this.lifecycleHook.onSuccess("getString", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getString", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getString", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getString", e); - this.lifecycleHook.onCatch("getString", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getString", e); + this.lifecycleHook.onCatch("getString", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getString"); } } - public LocalDate getLocalDate() { + public Result getLocalDate() { var $path = "%s/api/samplerecords/localdate".formatted( this.baseURI()); @@ -342,28 +322,25 @@ public LocalDate getLocalDate() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDate($response); this.lifecycleHook.onSuccess("getLocalDate", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getLocalDate", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getLocalDate", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getLocalDate", e); - this.lifecycleHook.onCatch("getLocalDate", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getLocalDate", e); + this.lifecycleHook.onCatch("getLocalDate", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getLocalDate"); } } - public LocalDateTime getLocalDateTime() { + public Result getLocalDateTime() { var $path = "%s/api/samplerecords/localdatetime".formatted( this.baseURI()); @@ -380,28 +357,25 @@ public LocalDateTime getLocalDateTime() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalDateTime($response); this.lifecycleHook.onSuccess("getLocalDateTime", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getLocalDateTime", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getLocalDateTime", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getLocalDateTime", e); - this.lifecycleHook.onCatch("getLocalDateTime", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getLocalDateTime", e); + this.lifecycleHook.onCatch("getLocalDateTime", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getLocalDateTime"); } } - public LocalTime getLocalTime() { + public Result getLocalTime() { var $path = "%s/api/samplerecords/localtime".formatted( this.baseURI()); @@ -418,28 +392,25 @@ public LocalTime getLocalTime() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLocalTime($response); this.lifecycleHook.onSuccess("getLocalTime", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getLocalTime", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getLocalTime", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getLocalTime", e); - this.lifecycleHook.onCatch("getLocalTime", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getLocalTime", e); + this.lifecycleHook.onCatch("getLocalTime", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getLocalTime"); } } - public OffsetDateTime getOffsetDateTime() { + public Result getOffsetDateTime() { var $path = "%s/api/samplerecords/offsetdatetime".formatted( this.baseURI()); @@ -456,28 +427,25 @@ public OffsetDateTime getOffsetDateTime() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapOffsetDateTime($response); this.lifecycleHook.onSuccess("getOffsetDateTime", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getOffsetDateTime", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getOffsetDateTime", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getOffsetDateTime", e); - this.lifecycleHook.onCatch("getOffsetDateTime", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getOffsetDateTime", e); + this.lifecycleHook.onCatch("getOffsetDateTime", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getOffsetDateTime"); } } - public ZonedDateTime getZonedDateTime() { + public Result getZonedDateTime() { var $path = "%s/api/samplerecords/zoneddatetime".formatted( this.baseURI()); @@ -494,28 +462,25 @@ public ZonedDateTime getZonedDateTime() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapZonedDateTime($response); this.lifecycleHook.onSuccess("getZonedDateTime", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getZonedDateTime", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getZonedDateTime", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getZonedDateTime", e); - this.lifecycleHook.onCatch("getZonedDateTime", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getZonedDateTime", e); + this.lifecycleHook.onCatch("getZonedDateTime", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getZonedDateTime"); } } - public ZoneId getScalar() { + public Result getScalar() { var $path = "%s/api/samplerecords/scalar".formatted( this.baseURI()); @@ -532,28 +497,25 @@ public ZoneId getScalar() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, ZoneId::of); this.lifecycleHook.onSuccess("getScalar", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getScalar", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getScalar", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getScalar", e); - this.lifecycleHook.onCatch("getScalar", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getScalar", e); + this.lifecycleHook.onCatch("getScalar", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getScalar"); } } - public SampleEnum getEnum() { + public Result getEnum() { var $path = "%s/api/samplerecords/enum".formatted( this.baseURI()); @@ -570,28 +532,25 @@ public SampleEnum getEnum() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, SampleEnum::valueOf); this.lifecycleHook.onSuccess("getEnum", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getEnum", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getEnum", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getEnum", e); - this.lifecycleHook.onCatch("getEnum", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getEnum", e); + this.lifecycleHook.onCatch("getEnum", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getEnum"); } } - public void voidOperation() { + public Result voidOperation() { var $path = "%s/api/samplerecords/voidoperation".formatted( this.baseURI()); @@ -607,29 +566,25 @@ public void voidOperation() { var $response = this.httpClient().send($request, BodyHandlers.ofInputStream()); if ($response.statusCode() == 204) { this.lifecycleHook.onSuccess("voidOperation", null, this.client.createResponseAdaptable($response)); - return; + return Result.ok(null); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("voidOperation", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("voidOperation", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation voidOperation", e); - this.lifecycleHook.onCatch("voidOperation", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation voidOperation", e); + this.lifecycleHook.onCatch("voidOperation", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("voidOperation"); } } - public void errorOperation() - throws SampleErrorException { + public Result errorOperation() { var $path = "%s/api/samplerecords/erroroperation".formatted( this.baseURI()); @@ -645,34 +600,29 @@ public void errorOperation() var $response = this.httpClient().send($request, BodyHandlers.ofInputStream()); if ($response.statusCode() == 200) { this.lifecycleHook.onSuccess("errorOperation", null, this.client.createResponseAdaptable($response)); - return; + return Result.ok(null); } else if ($response.statusCode() == 400) { - var exception = new SampleErrorException(JDKHttpClientResponseUtils.toString($response)); - this.lifecycleHook.onError("errorOperation", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleError(JDKHttpClientResponseUtils.toString($response)); + this.lifecycleHook.onError("errorOperation", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("errorOperation", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("errorOperation", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation errorOperation", e); - this.lifecycleHook.onCatch("errorOperation", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation errorOperation", e); + this.lifecycleHook.onCatch("errorOperation", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("errorOperation"); } } - public void multiErrorOperation() - throws SampleErrorException, - SampleError2Exception { + public Result multiErrorOperation() { var $path = "%s/api/samplerecords/multierroroperation".formatted( this.baseURI()); @@ -688,36 +638,33 @@ public void multiErrorOperation() var $response = this.httpClient().send($request, BodyHandlers.ofInputStream()); if ($response.statusCode() == 200) { this.lifecycleHook.onSuccess("multiErrorOperation", null, this.client.createResponseAdaptable($response)); - return; + return Result.ok(null); } else if ($response.statusCode() == 400) { - var exception = new SampleErrorException(JDKHttpClientResponseUtils.toString($response)); - this.lifecycleHook.onError("multiErrorOperation", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleError(JDKHttpClientResponseUtils.toString($response)); + this.lifecycleHook.onError("multiErrorOperation", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } else if ($response.statusCode() == 401) { - var exception = new SampleError2Exception(JDKHttpClientResponseUtils.toString($response)); - this.lifecycleHook.onError("multiErrorOperation", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleError2(JDKHttpClientResponseUtils.toString($response)); + this.lifecycleHook.onError("multiErrorOperation", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("multiErrorOperation", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("multiErrorOperation", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation multiErrorOperation", e); - this.lifecycleHook.onCatch("multiErrorOperation", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation multiErrorOperation", e); + this.lifecycleHook.onCatch("multiErrorOperation", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("multiErrorOperation"); } } - public SimpleRecord.Data getSimpleRecord(String key) { + public Result getSimpleRecord(String key) { Objects.requireNonNull(key, "key must not be null"); var $path = "%s/api/samplerecords/simplerecord/%s".formatted( @@ -737,29 +684,25 @@ public SimpleRecord.Data getSimpleRecord(String key) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, SimpleRecordDataImpl::of, SimpleRecord.Data.class); this.lifecycleHook.onSuccess("getSimpleRecord", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getSimpleRecord", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getSimpleRecord", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getSimpleRecord", e); - this.lifecycleHook.onCatch("getSimpleRecord", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getSimpleRecord", e); + this.lifecycleHook.onCatch("getSimpleRecord", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getSimpleRecord"); } } - public SimpleRecord.Data getSimpleRecordWithError(String key) - throws SampleErrorException { + public Result getSimpleRecordWithError(String key) { Objects.requireNonNull(key, "key must not be null"); var $path = "%s/api/samplerecords/simplerecordwitherror/%s".formatted( @@ -779,33 +722,29 @@ public SimpleRecord.Data getSimpleRecordWithError(String key) if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapObject($response, SimpleRecordDataImpl::of, SimpleRecord.Data.class); this.lifecycleHook.onSuccess("getSimpleRecordWithError", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } else if ($response.statusCode() == 400) { - var exception = new SampleErrorException(JDKHttpClientResponseUtils.toString($response)); - this.lifecycleHook.onError("getSimpleRecordWithError", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleError(JDKHttpClientResponseUtils.toString($response)); + this.lifecycleHook.onError("getSimpleRecordWithError", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getSimpleRecordWithError", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getSimpleRecordWithError", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getSimpleRecordWithError", e); - this.lifecycleHook.onCatch("getSimpleRecordWithError", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getSimpleRecordWithError", e); + this.lifecycleHook.onCatch("getSimpleRecordWithError", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getSimpleRecordWithError"); } } - public void getSimpleErrorWithValue() - throws SampleErrorWithValueException { + public Result getSimpleErrorWithValue() { var $path = "%s/api/samplerecords/simpleerrorwithvalue".formatted( this.baseURI()); @@ -821,35 +760,31 @@ public void getSimpleErrorWithValue() var $response = this.httpClient().send($request, BodyHandlers.ofInputStream()); if ($response.statusCode() == 204) { this.lifecycleHook.onSuccess("getSimpleErrorWithValue", null, this.client.createResponseAdaptable($response)); - return; + return Result.ok(null); } else if ($response.statusCode() == 400) { var $errorData = JDKHttpClientResponseUtils.mapObject($response, ErrorDataDataImpl::of, ErrorData.Data.class); var $message = $response.headers().firstValue("X-RSD-Error-Message").orElse("Invocation of getSimpleErrorWithValue failed"); - var exception = new SampleErrorWithValueException($message, $errorData); - this.lifecycleHook.onError("getSimpleErrorWithValue", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleErrorWithValue($message, $errorData); + this.lifecycleHook.onError("getSimpleErrorWithValue", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getSimpleErrorWithValue", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getSimpleErrorWithValue", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getSimpleErrorWithValue", e); - this.lifecycleHook.onCatch("getSimpleErrorWithValue", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getSimpleErrorWithValue", e); + this.lifecycleHook.onCatch("getSimpleErrorWithValue", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getSimpleErrorWithValue"); } } - public void getSimpleErrorInt() - throws SampleErrorIntException { + public Result getSimpleErrorInt() { var $path = "%s/api/samplerecords/simpleerrorint".formatted( this.baseURI()); @@ -865,35 +800,31 @@ public void getSimpleErrorInt() var $response = this.httpClient().send($request, BodyHandlers.ofInputStream()); if ($response.statusCode() == 204) { this.lifecycleHook.onSuccess("getSimpleErrorInt", null, this.client.createResponseAdaptable($response)); - return; + return Result.ok(null); } else if ($response.statusCode() == 400) { var $errorData = JDKHttpClientResponseUtils.mapInt($response); var $message = $response.headers().firstValue("X-RSD-Error-Message").orElse("Invocation of getSimpleErrorInt failed"); - var exception = new SampleErrorIntException($message, $errorData); - this.lifecycleHook.onError("getSimpleErrorInt", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleErrorInt($message, $errorData); + this.lifecycleHook.onError("getSimpleErrorInt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getSimpleErrorInt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getSimpleErrorInt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getSimpleErrorInt", e); - this.lifecycleHook.onCatch("getSimpleErrorInt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getSimpleErrorInt", e); + this.lifecycleHook.onCatch("getSimpleErrorInt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getSimpleErrorInt"); } } - public void getSimpleErrorBoolean() - throws SampleErrorBooleanException { + public Result getSimpleErrorBoolean() { var $path = "%s/api/samplerecords/simpleerrorboolean".formatted( this.baseURI()); @@ -909,35 +840,31 @@ public void getSimpleErrorBoolean() var $response = this.httpClient().send($request, BodyHandlers.ofInputStream()); if ($response.statusCode() == 204) { this.lifecycleHook.onSuccess("getSimpleErrorBoolean", null, this.client.createResponseAdaptable($response)); - return; + return Result.ok(null); } else if ($response.statusCode() == 400) { var $errorData = JDKHttpClientResponseUtils.mapBoolean($response); var $message = $response.headers().firstValue("X-RSD-Error-Message").orElse("Invocation of getSimpleErrorBoolean failed"); - var exception = new SampleErrorBooleanException($message, $errorData); - this.lifecycleHook.onError("getSimpleErrorBoolean", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleErrorBoolean($message, $errorData); + this.lifecycleHook.onError("getSimpleErrorBoolean", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getSimpleErrorBoolean", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getSimpleErrorBoolean", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getSimpleErrorBoolean", e); - this.lifecycleHook.onCatch("getSimpleErrorBoolean", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getSimpleErrorBoolean", e); + this.lifecycleHook.onCatch("getSimpleErrorBoolean", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getSimpleErrorBoolean"); } } - public void getSimpleErrorEnum() - throws SampleErrorEnumException { + public Result getSimpleErrorEnum() { var $path = "%s/api/samplerecords/simpleerrorenum".formatted( this.baseURI()); @@ -953,35 +880,31 @@ public void getSimpleErrorEnum() var $response = this.httpClient().send($request, BodyHandlers.ofInputStream()); if ($response.statusCode() == 204) { this.lifecycleHook.onSuccess("getSimpleErrorEnum", null, this.client.createResponseAdaptable($response)); - return; + return Result.ok(null); } else if ($response.statusCode() == 400) { var $errorData = JDKHttpClientResponseUtils.mapLiteral($response, SampleEnum::valueOf); var $message = $response.headers().firstValue("X-RSD-Error-Message").orElse("Invocation of getSimpleErrorEnum failed"); - var exception = new SampleErrorEnumException($message, $errorData); - this.lifecycleHook.onError("getSimpleErrorEnum", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleErrorEnum($message, $errorData); + this.lifecycleHook.onError("getSimpleErrorEnum", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getSimpleErrorEnum", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getSimpleErrorEnum", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getSimpleErrorEnum", e); - this.lifecycleHook.onCatch("getSimpleErrorEnum", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getSimpleErrorEnum", e); + this.lifecycleHook.onCatch("getSimpleErrorEnum", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getSimpleErrorEnum"); } } - public void getSimpleErrorScalar() - throws SampleErrorScalarException { + public Result getSimpleErrorScalar() { var $path = "%s/api/samplerecords/simpleerrorscalar".formatted( this.baseURI()); @@ -997,35 +920,31 @@ public void getSimpleErrorScalar() var $response = this.httpClient().send($request, BodyHandlers.ofInputStream()); if ($response.statusCode() == 204) { this.lifecycleHook.onSuccess("getSimpleErrorScalar", null, this.client.createResponseAdaptable($response)); - return; + return Result.ok(null); } else if ($response.statusCode() == 400) { var $errorData = JDKHttpClientResponseUtils.mapLiteral($response, ZoneId::of); var $message = $response.headers().firstValue("X-RSD-Error-Message").orElse("Invocation of getSimpleErrorScalar failed"); - var exception = new SampleErrorScalarException($message, $errorData); - this.lifecycleHook.onError("getSimpleErrorScalar", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleErrorScalar($message, $errorData); + this.lifecycleHook.onError("getSimpleErrorScalar", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getSimpleErrorScalar", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getSimpleErrorScalar", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getSimpleErrorScalar", e); - this.lifecycleHook.onCatch("getSimpleErrorScalar", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getSimpleErrorScalar", e); + this.lifecycleHook.onCatch("getSimpleErrorScalar", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getSimpleErrorScalar"); } } - public void getSimpleErrorUnion() - throws SampleErrorUnionException { + public Result getSimpleErrorUnion() { var $path = "%s/api/samplerecords/simpleerrorunion".formatted( this.baseURI()); @@ -1041,28 +960,25 @@ public void getSimpleErrorUnion() var $response = this.httpClient().send($request, BodyHandlers.ofInputStream()); if ($response.statusCode() == 204) { this.lifecycleHook.onSuccess("getSimpleErrorUnion", null, this.client.createResponseAdaptable($response)); - return; + return Result.ok(null); } else if ($response.statusCode() == 400) { var $errorData = JDKHttpClientResponseUtils.mapObject($response, UnionDataImpl::of, Union.Data.class); var $message = $response.headers().firstValue("X-RSD-Error-Message").orElse("Invocation of getSimpleErrorUnion failed"); - var exception = new SampleErrorUnionException($message, $errorData); - this.lifecycleHook.onError("getSimpleErrorUnion", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleErrorUnion($message, $errorData); + this.lifecycleHook.onError("getSimpleErrorUnion", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("getSimpleErrorUnion", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("getSimpleErrorUnion", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation getSimpleErrorUnion", e); - this.lifecycleHook.onCatch("getSimpleErrorUnion", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation getSimpleErrorUnion", e); + this.lifecycleHook.onCatch("getSimpleErrorUnion", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("getSimpleErrorUnion"); } diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ScalarSubstition_ServiceServiceImpl.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ScalarSubstition_ServiceServiceImpl.java index 7710bb16..57e563b4 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ScalarSubstition_ServiceServiceImpl.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/jdkhttp/impl/ScalarSubstition_ServiceServiceImpl.java @@ -14,8 +14,9 @@ import dev.rsdlang.sample.client.model.impl.json._JsonUtils; import dev.rsdlang.sample.client.model.NilResult; import dev.rsdlang.sample.client.MyRange; -import dev.rsdlang.sample.client.RSDException; -import dev.rsdlang.sample.client.SampleErrorScalarSubException; +import dev.rsdlang.sample.client.Result; +import dev.rsdlang.sample.client.RSDError; +import dev.rsdlang.sample.client.SampleErrorScalarSub; import dev.rsdlang.sample.client.ScalarSubstition_ServiceService; import dev.rsdlang.sample.client.SpecSamplesClient; @@ -45,7 +46,7 @@ private String contentType() { return this.client.contentTypeEncoding().contentType; } - public MyRange get() { + public Result get() { var $path = "%s/api/scalarsubstitution/get".formatted( this.baseURI()); @@ -62,28 +63,25 @@ public MyRange get() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, MyRange::of); this.lifecycleHook.onSuccess("get", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("get", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("get", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation get", e); - this.lifecycleHook.onCatch("get", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation get", e); + this.lifecycleHook.onCatch("get", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("get"); } } - public List list() { + public Result, RSDError.$GenericError> list() { var $path = "%s/api/scalarsubstitution/list".formatted( this.baseURI()); @@ -100,28 +98,25 @@ public List list() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, MyRange::of); this.lifecycleHook.onSuccess("list", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("list", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("list", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation list", e); - this.lifecycleHook.onCatch("list", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation list", e); + this.lifecycleHook.onCatch("list", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("list"); } } - public MyRange post(MyRange range) { + public Result post(MyRange range) { Objects.requireNonNull(range, "range must not be null"); var $path = "%s/api/scalarsubstitution/post".formatted( @@ -144,28 +139,25 @@ public MyRange post(MyRange range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, MyRange::of); this.lifecycleHook.onSuccess("post", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("post", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("post", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation post", e); - this.lifecycleHook.onCatch("post", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation post", e); + this.lifecycleHook.onCatch("post", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("post"); } } - public NilResult postOpt() { + public Result postOpt() { var $path = "%s/api/scalarsubstitution/postOpt".formatted( this.baseURI()); @@ -186,28 +178,25 @@ public NilResult postOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("postOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("postOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("postOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation postOpt", e); - this.lifecycleHook.onCatch("postOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation postOpt", e); + this.lifecycleHook.onCatch("postOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("postOpt"); } } - public NilResult postOpt(MyRange range) { + public Result postOpt(MyRange range) { var $path = "%s/api/scalarsubstitution/postOpt".formatted( this.baseURI()); @@ -228,28 +217,25 @@ public NilResult postOpt(MyRange range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("postOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("postOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("postOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation postOpt", e); - this.lifecycleHook.onCatch("postOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation postOpt", e); + this.lifecycleHook.onCatch("postOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("postOpt"); } } - public NilResult postNull(MyRange range) { + public Result postNull(MyRange range) { var $path = "%s/api/scalarsubstitution/postNull".formatted( this.baseURI()); @@ -270,28 +256,25 @@ public NilResult postNull(MyRange range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("postNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("postNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("postNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation postNull", e); - this.lifecycleHook.onCatch("postNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation postNull", e); + this.lifecycleHook.onCatch("postNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("postNull"); } } - public NilResult postOptNull() { + public Result postOptNull() { var $path = "%s/api/scalarsubstitution/postOptNull".formatted( this.baseURI()); @@ -312,28 +295,25 @@ public NilResult postOptNull() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("postOptNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("postOptNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("postOptNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation postOptNull", e); - this.lifecycleHook.onCatch("postOptNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation postOptNull", e); + this.lifecycleHook.onCatch("postOptNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("postOptNull"); } } - public NilResult postOptNull(MyRange range) { + public Result postOptNull(MyRange range) { var $path = "%s/api/scalarsubstitution/postOptNull".formatted( this.baseURI()); @@ -354,28 +334,25 @@ public NilResult postOptNull(MyRange range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("postOptNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("postOptNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("postOptNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation postOptNull", e); - this.lifecycleHook.onCatch("postOptNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation postOptNull", e); + this.lifecycleHook.onCatch("postOptNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("postOptNull"); } } - public List postList(List range) { + public Result, RSDError.$GenericError> postList(List range) { Objects.requireNonNull(range, "range must not be null"); var $path = "%s/api/scalarsubstitution/postList".formatted( @@ -398,28 +375,25 @@ public List postList(List range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, MyRange::of); this.lifecycleHook.onSuccess("postList", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("postList", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("postList", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation postList", e); - this.lifecycleHook.onCatch("postList", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation postList", e); + this.lifecycleHook.onCatch("postList", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("postList"); } } - public NilResult postListOpt() { + public Result postListOpt() { var $path = "%s/api/scalarsubstitution/postListOpt".formatted( this.baseURI()); @@ -440,28 +414,25 @@ public NilResult postListOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("postListOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("postListOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("postListOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation postListOpt", e); - this.lifecycleHook.onCatch("postListOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation postListOpt", e); + this.lifecycleHook.onCatch("postListOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("postListOpt"); } } - public NilResult postListOpt(List range) { + public Result postListOpt(List range) { var $path = "%s/api/scalarsubstitution/postListOpt".formatted( this.baseURI()); @@ -482,28 +453,25 @@ public NilResult postListOpt(List range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("postListOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("postListOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("postListOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation postListOpt", e); - this.lifecycleHook.onCatch("postListOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation postListOpt", e); + this.lifecycleHook.onCatch("postListOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("postListOpt"); } } - public NilResult postListNull(List range) { + public Result postListNull(List range) { var $path = "%s/api/scalarsubstitution/postListNull".formatted( this.baseURI()); @@ -524,28 +492,25 @@ public NilResult postListNull(List range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("postListNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("postListNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("postListNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation postListNull", e); - this.lifecycleHook.onCatch("postListNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation postListNull", e); + this.lifecycleHook.onCatch("postListNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("postListNull"); } } - public NilResult postListOptNull() { + public Result postListOptNull() { var $path = "%s/api/scalarsubstitution/postListOptNull".formatted( this.baseURI()); @@ -566,28 +531,25 @@ public NilResult postListOptNull() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("postListOptNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("postListOptNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("postListOptNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation postListOptNull", e); - this.lifecycleHook.onCatch("postListOptNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation postListOptNull", e); + this.lifecycleHook.onCatch("postListOptNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("postListOptNull"); } } - public NilResult postListOptNull(List range) { + public Result postListOptNull(List range) { var $path = "%s/api/scalarsubstitution/postListOptNull".formatted( this.baseURI()); @@ -608,28 +570,25 @@ public NilResult postListOptNull(List range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("postListOptNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("postListOptNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("postListOptNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation postListOptNull", e); - this.lifecycleHook.onCatch("postListOptNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation postListOptNull", e); + this.lifecycleHook.onCatch("postListOptNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("postListOptNull"); } } - public MyRange query(MyRange range) { + public Result query(MyRange range) { Objects.requireNonNull(range, "range must not be null"); var $path = "%s/api/scalarsubstitution/query".formatted( @@ -651,28 +610,25 @@ public MyRange query(MyRange range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, MyRange::of); this.lifecycleHook.onSuccess("query", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("query", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("query", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation query", e); - this.lifecycleHook.onCatch("query", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation query", e); + this.lifecycleHook.onCatch("query", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("query"); } } - public NilResult queryOpt() { + public Result queryOpt() { var $path = "%s/api/scalarsubstitution/queryOpt".formatted( this.baseURI()); @@ -689,28 +645,25 @@ public NilResult queryOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("queryOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("queryOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("queryOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation queryOpt", e); - this.lifecycleHook.onCatch("queryOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation queryOpt", e); + this.lifecycleHook.onCatch("queryOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("queryOpt"); } } - public NilResult queryOpt(MyRange range) { + public Result queryOpt(MyRange range) { var $path = "%s/api/scalarsubstitution/queryOpt".formatted( this.baseURI()); @@ -732,28 +685,25 @@ public NilResult queryOpt(MyRange range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("queryOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("queryOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("queryOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation queryOpt", e); - this.lifecycleHook.onCatch("queryOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation queryOpt", e); + this.lifecycleHook.onCatch("queryOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("queryOpt"); } } - public NilResult queryNull(MyRange range) { + public Result queryNull(MyRange range) { var $path = "%s/api/scalarsubstitution/queryNull".formatted( this.baseURI()); @@ -777,28 +727,25 @@ public NilResult queryNull(MyRange range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("queryNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("queryNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("queryNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation queryNull", e); - this.lifecycleHook.onCatch("queryNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation queryNull", e); + this.lifecycleHook.onCatch("queryNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("queryNull"); } } - public NilResult queryOptNull() { + public Result queryOptNull() { var $path = "%s/api/scalarsubstitution/queryOptNull".formatted( this.baseURI()); @@ -815,28 +762,25 @@ public NilResult queryOptNull() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("queryOptNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("queryOptNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("queryOptNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation queryOptNull", e); - this.lifecycleHook.onCatch("queryOptNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation queryOptNull", e); + this.lifecycleHook.onCatch("queryOptNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("queryOptNull"); } } - public NilResult queryOptNull(MyRange range) { + public Result queryOptNull(MyRange range) { var $path = "%s/api/scalarsubstitution/queryOptNull".formatted( this.baseURI()); @@ -860,28 +804,25 @@ public NilResult queryOptNull(MyRange range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("queryOptNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("queryOptNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("queryOptNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation queryOptNull", e); - this.lifecycleHook.onCatch("queryOptNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation queryOptNull", e); + this.lifecycleHook.onCatch("queryOptNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("queryOptNull"); } } - public List queryList(List range) { + public Result, RSDError.$GenericError> queryList(List range) { Objects.requireNonNull(range, "range must not be null"); var $path = "%s/api/scalarsubstitution/queryList".formatted( @@ -905,28 +846,25 @@ public List queryList(List range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, MyRange::of); this.lifecycleHook.onSuccess("queryList", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("queryList", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("queryList", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation queryList", e); - this.lifecycleHook.onCatch("queryList", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation queryList", e); + this.lifecycleHook.onCatch("queryList", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("queryList"); } } - public NilResult queryListOpt() { + public Result queryListOpt() { var $path = "%s/api/scalarsubstitution/queryListOpt".formatted( this.baseURI()); @@ -943,28 +881,25 @@ public NilResult queryListOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("queryListOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("queryListOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("queryListOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation queryListOpt", e); - this.lifecycleHook.onCatch("queryListOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation queryListOpt", e); + this.lifecycleHook.onCatch("queryListOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("queryListOpt"); } } - public NilResult queryListOpt(List range) { + public Result queryListOpt(List range) { var $path = "%s/api/scalarsubstitution/queryListOpt".formatted( this.baseURI()); @@ -988,28 +923,25 @@ public NilResult queryListOpt(List range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("queryListOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("queryListOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("queryListOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation queryListOpt", e); - this.lifecycleHook.onCatch("queryListOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation queryListOpt", e); + this.lifecycleHook.onCatch("queryListOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("queryListOpt"); } } - public NilResult queryListNull(List range) { + public Result queryListNull(List range) { var $path = "%s/api/scalarsubstitution/queryListNull".formatted( this.baseURI()); @@ -1035,28 +967,25 @@ public NilResult queryListNull(List range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("queryListNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("queryListNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("queryListNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation queryListNull", e); - this.lifecycleHook.onCatch("queryListNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation queryListNull", e); + this.lifecycleHook.onCatch("queryListNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("queryListNull"); } } - public NilResult queryListOptNull() { + public Result queryListOptNull() { var $path = "%s/api/scalarsubstitution/queryListOptNull".formatted( this.baseURI()); @@ -1073,28 +1002,25 @@ public NilResult queryListOptNull() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("queryListOptNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("queryListOptNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("queryListOptNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation queryListOptNull", e); - this.lifecycleHook.onCatch("queryListOptNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation queryListOptNull", e); + this.lifecycleHook.onCatch("queryListOptNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("queryListOptNull"); } } - public NilResult queryListOptNull(List range) { + public Result queryListOptNull(List range) { var $path = "%s/api/scalarsubstitution/queryListOptNull".formatted( this.baseURI()); @@ -1120,28 +1046,25 @@ public NilResult queryListOptNull(List range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("queryListOptNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("queryListOptNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("queryListOptNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation queryListOptNull", e); - this.lifecycleHook.onCatch("queryListOptNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation queryListOptNull", e); + this.lifecycleHook.onCatch("queryListOptNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("queryListOptNull"); } } - public MyRange header(MyRange range) { + public Result header(MyRange range) { Objects.requireNonNull(range, "range must not be null"); var $path = "%s/api/scalarsubstitution/header".formatted( @@ -1167,28 +1090,25 @@ public MyRange header(MyRange range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, MyRange::of); this.lifecycleHook.onSuccess("header", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("header", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("header", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation header", e); - this.lifecycleHook.onCatch("header", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation header", e); + this.lifecycleHook.onCatch("header", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("header"); } } - public NilResult headerOpt() { + public Result headerOpt() { var $path = "%s/api/scalarsubstitution/headerOpt".formatted( this.baseURI()); @@ -1205,28 +1125,25 @@ public NilResult headerOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("headerOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("headerOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("headerOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation headerOpt", e); - this.lifecycleHook.onCatch("headerOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation headerOpt", e); + this.lifecycleHook.onCatch("headerOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("headerOpt"); } } - public NilResult headerOpt(MyRange range) { + public Result headerOpt(MyRange range) { var $path = "%s/api/scalarsubstitution/headerOpt".formatted( this.baseURI()); @@ -1250,28 +1167,25 @@ public NilResult headerOpt(MyRange range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("headerOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("headerOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("headerOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation headerOpt", e); - this.lifecycleHook.onCatch("headerOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation headerOpt", e); + this.lifecycleHook.onCatch("headerOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("headerOpt"); } } - public NilResult headerNull(MyRange range) { + public Result headerNull(MyRange range) { var $path = "%s/api/scalarsubstitution/headerNull".formatted( this.baseURI()); @@ -1295,28 +1209,25 @@ public NilResult headerNull(MyRange range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("headerNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("headerNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("headerNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation headerNull", e); - this.lifecycleHook.onCatch("headerNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation headerNull", e); + this.lifecycleHook.onCatch("headerNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("headerNull"); } } - public NilResult headerOptNull() { + public Result headerOptNull() { var $path = "%s/api/scalarsubstitution/headerOptNull".formatted( this.baseURI()); @@ -1333,28 +1244,25 @@ public NilResult headerOptNull() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("headerOptNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("headerOptNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("headerOptNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation headerOptNull", e); - this.lifecycleHook.onCatch("headerOptNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation headerOptNull", e); + this.lifecycleHook.onCatch("headerOptNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("headerOptNull"); } } - public NilResult headerOptNull(MyRange range) { + public Result headerOptNull(MyRange range) { var $path = "%s/api/scalarsubstitution/headerOptNull".formatted( this.baseURI()); @@ -1378,28 +1286,25 @@ public NilResult headerOptNull(MyRange range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("headerOptNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("headerOptNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("headerOptNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation headerOptNull", e); - this.lifecycleHook.onCatch("headerOptNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation headerOptNull", e); + this.lifecycleHook.onCatch("headerOptNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("headerOptNull"); } } - public List headerList(List range) { + public Result, RSDError.$GenericError> headerList(List range) { Objects.requireNonNull(range, "range must not be null"); var $path = "%s/api/scalarsubstitution/headerList".formatted( @@ -1425,28 +1330,25 @@ public List headerList(List range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiterals($response, MyRange::of); this.lifecycleHook.onSuccess("headerList", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("headerList", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("headerList", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation headerList", e); - this.lifecycleHook.onCatch("headerList", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation headerList", e); + this.lifecycleHook.onCatch("headerList", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("headerList"); } } - public NilResult headerListOpt() { + public Result headerListOpt() { var $path = "%s/api/scalarsubstitution/headerListOpt".formatted( this.baseURI()); @@ -1463,28 +1365,25 @@ public NilResult headerListOpt() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("headerListOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("headerListOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("headerListOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation headerListOpt", e); - this.lifecycleHook.onCatch("headerListOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation headerListOpt", e); + this.lifecycleHook.onCatch("headerListOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("headerListOpt"); } } - public NilResult headerListOpt(List range) { + public Result headerListOpt(List range) { var $path = "%s/api/scalarsubstitution/headerListOpt".formatted( this.baseURI()); @@ -1510,28 +1409,25 @@ public NilResult headerListOpt(List range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("headerListOpt", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("headerListOpt", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("headerListOpt", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation headerListOpt", e); - this.lifecycleHook.onCatch("headerListOpt", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation headerListOpt", e); + this.lifecycleHook.onCatch("headerListOpt", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("headerListOpt"); } } - public NilResult headerListNull(List range) { + public Result headerListNull(List range) { var $path = "%s/api/scalarsubstitution/headerListNull".formatted( this.baseURI()); @@ -1559,28 +1455,25 @@ public NilResult headerListNull(List range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("headerListNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("headerListNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("headerListNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation headerListNull", e); - this.lifecycleHook.onCatch("headerListNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation headerListNull", e); + this.lifecycleHook.onCatch("headerListNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("headerListNull"); } } - public NilResult headerListOptNull() { + public Result headerListOptNull() { var $path = "%s/api/scalarsubstitution/headerListOptNull".formatted( this.baseURI()); @@ -1597,28 +1490,25 @@ public NilResult headerListOptNull() { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("headerListOptNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("headerListOptNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("headerListOptNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation headerListOptNull", e); - this.lifecycleHook.onCatch("headerListOptNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation headerListOptNull", e); + this.lifecycleHook.onCatch("headerListOptNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("headerListOptNull"); } } - public NilResult headerListOptNull(List range) { + public Result headerListOptNull(List range) { var $path = "%s/api/scalarsubstitution/headerListOptNull".formatted( this.baseURI()); @@ -1646,29 +1536,25 @@ public NilResult headerListOptNull(List range) { if ($response.statusCode() == 200) { var $rv = JDKHttpClientResponseUtils.mapLiteral($response, NilResult::valueOf); this.lifecycleHook.onSuccess("headerListOptNull", $rv, this.client.createResponseAdaptable($response)); - return $rv; + return Result.ok($rv); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("headerListOptNull", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("headerListOptNull", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation headerListOptNull", e); - this.lifecycleHook.onCatch("headerListOptNull", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation headerListOptNull", e); + this.lifecycleHook.onCatch("headerListOptNull", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("headerListOptNull"); } } - public void fail() - throws SampleErrorScalarSubException { + public Result fail() { var $path = "%s/api/scalarsubstitution/fail".formatted( this.baseURI()); @@ -1688,28 +1574,25 @@ public void fail() var $response = this.httpClient().send($request, BodyHandlers.ofInputStream()); if ($response.statusCode() == 200) { this.lifecycleHook.onSuccess("fail", null, this.client.createResponseAdaptable($response)); - return; + return Result.ok(null); } else if ($response.statusCode() == 400) { var $errorData = JDKHttpClientResponseUtils.mapLiteral($response, MyRange::of); var $message = $response.headers().firstValue("X-RSD-Error-Message").orElse("Invocation of fail failed"); - var exception = new SampleErrorScalarSubException($message, $errorData); - this.lifecycleHook.onError("fail", exception, this.client.createResponseAdaptable($response)); - throw exception; + var $error = new SampleErrorScalarSub($message, $errorData); + this.lifecycleHook.onError("fail", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } - var $exception = new RSDException(RSDException.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response))); - this.lifecycleHook.onError("fail", $exception, this.client.createResponseAdaptable($response)); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null); + this.lifecycleHook.onError("fail", $error, this.client.createResponseAdaptable($response)); + return Result.err($error); } catch (Exception e) { - if (e instanceof RSDException rsdEx) { - throw rsdEx; - } if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } - var $exception = new RSDException(RSDException.Type._Native, "Unexpected error while executing operation fail", e); - this.lifecycleHook.onCatch("fail", $exception); - throw $exception; + var $error = new RSDError.$GenericError(RSDError.Type._Native, "Unexpected error while executing operation fail", e); + this.lifecycleHook.onCatch("fail", $error); + return Result.err($error); } finally { this.lifecycleHook.onFinally("fail"); } diff --git a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/BinaryTypesServiceTest.java b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/BinaryTypesServiceTest.java index 4d2df1b3..c5a12223 100644 --- a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/BinaryTypesServiceTest.java +++ b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/BinaryTypesServiceTest.java @@ -62,49 +62,49 @@ private static RSDBlob blob(BinaryTypesService service, String content) throws I @ParameterizedTest @MethodSource("serviceProvider") public void uploadFile(BinaryTypesService service) throws IOException { - assertEquals(5, service.uploadFile(file(service, "Hello"))); + assertEquals(5, service.uploadFile(file(service, "Hello")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileOpt_undefined(BinaryTypesService service) { - assertEquals(0, service.uploadFileOpt()); + assertEquals(0, service.uploadFileOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileOpt_defined(BinaryTypesService service) throws IOException { - assertEquals(5, service.uploadFileOpt(file(service, "Hello"))); + assertEquals(5, service.uploadFileOpt(file(service, "Hello")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileNil_null(BinaryTypesService service) { - assertEquals(-1, service.uploadFileNil(null)); + assertEquals(-1, service.uploadFileNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileNil_defined(BinaryTypesService service) throws IOException { - assertEquals(5, service.uploadFileNil(file(service, "Hello"))); + assertEquals(5, service.uploadFileNil(file(service, "Hello")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileOptNil_undefined(BinaryTypesService service) { - assertEquals(0, service.uploadFileOptNil()); + assertEquals(0, service.uploadFileOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileOptNil_null(BinaryTypesService service) { - assertEquals(-1, service.uploadFileOptNil((RSDFile) null)); + assertEquals(-1, service.uploadFileOptNil((RSDFile) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileOptNil_defined(BinaryTypesService service) throws IOException { - assertEquals(5, service.uploadFileOptNil(file(service, "Hello"))); + assertEquals(5, service.uploadFileOptNil(file(service, "Hello")).orThrow()); } // --- Upload Blob --- @@ -112,49 +112,49 @@ public void uploadFileOptNil_defined(BinaryTypesService service) throws IOExcept @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlob(BinaryTypesService service) throws IOException { - assertEquals(5, service.uploadBlob(blob(service, "Hello"))); + assertEquals(5, service.uploadBlob(blob(service, "Hello")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobOpt_undefined(BinaryTypesService service) { - assertEquals(0, service.uploadBlobOpt()); + assertEquals(0, service.uploadBlobOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobOpt_defined(BinaryTypesService service) throws IOException { - assertEquals(5, service.uploadBlobOpt(blob(service, "Hello"))); + assertEquals(5, service.uploadBlobOpt(blob(service, "Hello")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobNil_null(BinaryTypesService service) { - assertEquals(-1, service.uploadBlobNil(null)); + assertEquals(-1, service.uploadBlobNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobNil_defined(BinaryTypesService service) throws IOException { - assertEquals(5, service.uploadBlobNil(blob(service, "Hello"))); + assertEquals(5, service.uploadBlobNil(blob(service, "Hello")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobOptNil_undefined(BinaryTypesService service) { - assertEquals(0, service.uploadBlobOptNil()); + assertEquals(0, service.uploadBlobOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobOptNil_null(BinaryTypesService service) { - assertEquals(-1, service.uploadBlobOptNil((RSDBlob) null)); + assertEquals(-1, service.uploadBlobOptNil((RSDBlob) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobOptNil_defined(BinaryTypesService service) throws IOException { - assertEquals(5, service.uploadBlobOptNil(blob(service, "Hello"))); + assertEquals(5, service.uploadBlobOptNil(blob(service, "Hello")).orThrow()); } // --- Upload File List --- @@ -162,49 +162,50 @@ public void uploadBlobOptNil_defined(BinaryTypesService service) throws IOExcept @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileList(BinaryTypesService service) throws IOException { - assertEquals(10, service.uploadFileList(List.of(file(service, "Hello"), file(service, "World")))); + assertEquals(10, service.uploadFileList(List.of(file(service, "Hello"), file(service, "World"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileListOpt_undefined(BinaryTypesService service) { - assertEquals(0, service.uploadFileListOpt()); + assertEquals(0, service.uploadFileListOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileListOpt_defined(BinaryTypesService service) throws IOException { - assertEquals(10, service.uploadFileListOpt(List.of(file(service, "Hello"), file(service, "World")))); + assertEquals(10, service.uploadFileListOpt(List.of(file(service, "Hello"), file(service, "World"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileListNil_null(BinaryTypesService service) { - assertEquals(-1, service.uploadFileListNil(null)); + assertEquals(-1, service.uploadFileListNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileListNil_defined(BinaryTypesService service) throws IOException { - assertEquals(10, service.uploadFileListNil(List.of(file(service, "Hello"), file(service, "World")))); + assertEquals(10, service.uploadFileListNil(List.of(file(service, "Hello"), file(service, "World"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileListOptNil_undefined(BinaryTypesService service) { - assertEquals(0, service.uploadFileListOptNil()); + assertEquals(0, service.uploadFileListOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileListOptNil_null(BinaryTypesService service) { - assertEquals(-1, service.uploadFileListOptNil((List) null)); + assertEquals(-1, service.uploadFileListOptNil((List) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadFileListOptNil_defined(BinaryTypesService service) throws IOException { - assertEquals(10, service.uploadFileListOptNil(List.of(file(service, "Hello"), file(service, "World")))); + assertEquals(10, + service.uploadFileListOptNil(List.of(file(service, "Hello"), file(service, "World"))).orThrow()); } // --- Upload Blob List --- @@ -212,49 +213,50 @@ public void uploadFileListOptNil_defined(BinaryTypesService service) throws IOEx @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobList(BinaryTypesService service) throws IOException { - assertEquals(10, service.uploadBlobList(List.of(blob(service, "Hello"), blob(service, "World")))); + assertEquals(10, service.uploadBlobList(List.of(blob(service, "Hello"), blob(service, "World"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobListOpt_undefined(BinaryTypesService service) { - assertEquals(0, service.uploadBlobListOpt()); + assertEquals(0, service.uploadBlobListOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobListOpt_defined(BinaryTypesService service) throws IOException { - assertEquals(10, service.uploadBlobListOpt(List.of(blob(service, "Hello"), blob(service, "World")))); + assertEquals(10, service.uploadBlobListOpt(List.of(blob(service, "Hello"), blob(service, "World"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobListNil_null(BinaryTypesService service) { - assertEquals(-1, service.uploadBlobListNil(null)); + assertEquals(-1, service.uploadBlobListNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobListNil_defined(BinaryTypesService service) throws IOException { - assertEquals(10, service.uploadBlobListNil(List.of(blob(service, "Hello"), blob(service, "World")))); + assertEquals(10, service.uploadBlobListNil(List.of(blob(service, "Hello"), blob(service, "World"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobListOptNil_undefined(BinaryTypesService service) { - assertEquals(0, service.uploadBlobListOptNil()); + assertEquals(0, service.uploadBlobListOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobListOptNil_null(BinaryTypesService service) { - assertEquals(-1, service.uploadBlobListOptNil((List) null)); + assertEquals(-1, service.uploadBlobListOptNil((List) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void uploadBlobListOptNil_defined(BinaryTypesService service) throws IOException { - assertEquals(10, service.uploadBlobListOptNil(List.of(blob(service, "Hello"), blob(service, "World")))); + assertEquals(10, + service.uploadBlobListOptNil(List.of(blob(service, "Hello"), blob(service, "World"))).orThrow()); } // --- Upload Mixed --- @@ -266,7 +268,8 @@ public void uploadMixed(BinaryTypesService service) throws IOException { var result = service.uploadMixed( "hello", 42, rec, List.of("a", "b"), List.of(1, 2), List.of(rec), - file(service, "FileContent"), blob(service, "BlobContent")); + file(service, "FileContent"), blob(service, "BlobContent")).orThrow(); + assertEquals("hello", result.text().orElse(null)); assertEquals(42, result.number().orElse(null)); assertEquals("k", result.rec().toOptional().map(SimpleRecord.Data::key).orElse("")); @@ -280,7 +283,7 @@ public void uploadMixed(BinaryTypesService service) throws IOException { @ParameterizedTest @MethodSource("serviceProvider") public void uploadMixedOpt_allUndefined(BinaryTypesService service) { - var result = service.uploadMixedOpt(); + var result = service.uploadMixedOpt().orThrow(); assertEquals(true, result.text().isUndefined()); assertEquals(true, result.number().isUndefined()); } @@ -292,7 +295,7 @@ public void uploadMixedOpt_allDefined(BinaryTypesService service) throws IOExcep var result = service.uploadMixedOpt( "hello", 42, rec, List.of("a", "b"), List.of(1, 2), List.of(rec), - file(service, "FileContent"), blob(service, "BlobContent")); + file(service, "FileContent"), blob(service, "BlobContent")).orThrow(); assertEquals("hello", result.text().orElse(null)); assertEquals(42, result.number().orElse(null)); assertEquals("k", result.rec().map(SimpleRecord.Data::key).orElse("")); @@ -306,7 +309,7 @@ public void uploadMixedOpt_allDefined(BinaryTypesService service) throws IOExcep @ParameterizedTest @MethodSource("serviceProvider") public void uploadMixedNil_allNull(BinaryTypesService service) { - var result = service.uploadMixedNil(null, null, null, null, null, null, null, null); + var result = service.uploadMixedNil(null, null, null, null, null, null, null, null).orThrow(); assertEquals(true, result.text().isNull()); assertEquals(true, result.number().isNull()); assertEquals(true, result.rec().isNull()); @@ -324,7 +327,7 @@ public void uploadMixedNil_allDefined(BinaryTypesService service) throws IOExcep var result = service.uploadMixedNil( "hello", 42, rec, List.of("a", "b"), List.of(1, 2), List.of(rec), - file(service, "FileContent"), blob(service, "BlobContent")); + file(service, "FileContent"), blob(service, "BlobContent")).orThrow(); assertEquals("hello", result.text().orElse(null)); assertEquals(42, result.number().orElse(null)); assertEquals("k", result.rec().map(SimpleRecord.Data::key).orElse("")); @@ -340,7 +343,7 @@ public void uploadMixedNil_allDefined(BinaryTypesService service) throws IOExcep @ParameterizedTest @MethodSource("serviceProvider") public void downloadFile(BinaryTypesService service) throws IOException { - var result = service.downloadFile(); + var result = service.downloadFile().orThrow(); assertEquals("Hello, World!", new String(result.stream().readAllBytes(), StandardCharsets.UTF_8)); assertEquals("hello.txt", result.filename()); } @@ -348,21 +351,21 @@ public void downloadFile(BinaryTypesService service) throws IOException { @ParameterizedTest @MethodSource("serviceProvider") public void downloadBlob(BinaryTypesService service) throws IOException { - var result = service.downloadBlob(); + var result = service.downloadBlob().orThrow(); assertEquals("Hello, Blob!", new String(result.stream().readAllBytes(), StandardCharsets.UTF_8)); } @ParameterizedTest @MethodSource("serviceProvider") public void singleBodyAddition(BinaryTypesService service) throws IOException { - var result = service.singleBodyAddition("Hello, ", blob(service, "Blob!")); + var result = service.singleBodyAddition("Hello, ", blob(service, "Blob!")).orThrow(); assertEquals("Hello, Blob!", result); } @ParameterizedTest @MethodSource("serviceProvider") public void twoBinariesAddition(BinaryTypesService service) throws IOException { - var result = service.twoBinariesAddition(blob(service, "Hello, "), file(service, "World!")); + var result = service.twoBinariesAddition(blob(service, "Hello, "), file(service, "World!")).orThrow(); assertEquals(List.of(7, 6), result); } @@ -379,7 +382,7 @@ public void mixed(BinaryTypesService service) throws IOException { "query", 84, rec, - blob(service, "BlobContent")); + blob(service, "BlobContent")).orThrow(); assertEquals("path", result.pathString()); assertEquals(42, result.pathNumber()); diff --git a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/BodyParameterTypesServiceTest.java b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/BodyParameterTypesServiceTest.java index 41c05138..c900ec52 100644 --- a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/BodyParameterTypesServiceTest.java +++ b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/BodyParameterTypesServiceTest.java @@ -58,49 +58,49 @@ static BodyParameterTypesService[] serviceProvider() { @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanBodyParam(BodyParameterTypesService service) { - assertEquals(true, service.simpleBooleanBodyParam(true)); + assertEquals(true, service.simpleBooleanBodyParam(true).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleBooleanBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleBooleanBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanBodyParamOpt_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleBooleanBodyParamOpt(true)); + assertEquals(NilResult.DEFINED, service.simpleBooleanBodyParamOpt(true).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleBooleanBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleBooleanBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanBodyParamNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleBooleanBodyParamNil(true)); + assertEquals(NilResult.DEFINED, service.simpleBooleanBodyParamNil(true).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleBooleanBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleBooleanBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleBooleanBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleBooleanBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanBodyParamOptNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleBooleanBodyParamOptNil(true)); + assertEquals(NilResult.DEFINED, service.simpleBooleanBodyParamOptNil(true).orThrow()); } // --- Short --- @@ -108,49 +108,49 @@ public void simpleBooleanBodyParamOptNil_defined(BodyParameterTypesService servi @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortBodyParam(BodyParameterTypesService service) { - assertEquals((short) 42, service.simpleShortBodyParam((short) 42)); + assertEquals((short) 42, service.simpleShortBodyParam((short) 42).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleShortBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleShortBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortBodyParamOpt_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleShortBodyParamOpt((short) 42)); + assertEquals(NilResult.DEFINED, service.simpleShortBodyParamOpt((short) 42).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleShortBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleShortBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortBodyParamNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleShortBodyParamNil((short) 42)); + assertEquals(NilResult.DEFINED, service.simpleShortBodyParamNil((short) 42).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleShortBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleShortBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleShortBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleShortBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortBodyParamOptNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleShortBodyParamOptNil((short) 42)); + assertEquals(NilResult.DEFINED, service.simpleShortBodyParamOptNil((short) 42).orThrow()); } // --- Int --- @@ -158,49 +158,49 @@ public void simpleShortBodyParamOptNil_defined(BodyParameterTypesService service @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntBodyParam(BodyParameterTypesService service) { - assertEquals(123456, service.simpleIntBodyParam(123456)); + assertEquals(123456, service.simpleIntBodyParam(123456).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleIntBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleIntBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntBodyParamOpt_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleIntBodyParamOpt(123456)); + assertEquals(NilResult.DEFINED, service.simpleIntBodyParamOpt(123456).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleIntBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleIntBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntBodyParamNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleIntBodyParamNil(123456)); + assertEquals(NilResult.DEFINED, service.simpleIntBodyParamNil(123456).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleIntBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleIntBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleIntBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleIntBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntBodyParamOptNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleIntBodyParamOptNil(123456)); + assertEquals(NilResult.DEFINED, service.simpleIntBodyParamOptNil(123456).orThrow()); } // --- Long --- @@ -208,49 +208,49 @@ public void simpleIntBodyParamOptNil_defined(BodyParameterTypesService service) @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongBodyParam(BodyParameterTypesService service) { - assertEquals(1234567890123L, service.simpleLongBodyParam(1234567890123L)); + assertEquals(1234567890123L, service.simpleLongBodyParam(1234567890123L).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLongBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleLongBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongBodyParamOpt_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLongBodyParamOpt(1234567890123L)); + assertEquals(NilResult.DEFINED, service.simpleLongBodyParamOpt(1234567890123L).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLongBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleLongBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongBodyParamNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLongBodyParamNil(1234567890123L)); + assertEquals(NilResult.DEFINED, service.simpleLongBodyParamNil(1234567890123L).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLongBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleLongBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLongBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleLongBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongBodyParamOptNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLongBodyParamOptNil(1234567890123L)); + assertEquals(NilResult.DEFINED, service.simpleLongBodyParamOptNil(1234567890123L).orThrow()); } // --- Float --- @@ -258,49 +258,49 @@ public void simpleLongBodyParamOptNil_defined(BodyParameterTypesService service) @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatBodyParam(BodyParameterTypesService service) { - assertEquals(123.45f, service.simpleFloatBodyParam(123.45f)); + assertEquals(123.45f, service.simpleFloatBodyParam(123.45f).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleFloatBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleFloatBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatBodyParamOpt_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleFloatBodyParamOpt(123.45f)); + assertEquals(NilResult.DEFINED, service.simpleFloatBodyParamOpt(123.45f).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleFloatBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleFloatBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatBodyParamNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleFloatBodyParamNil(123.45f)); + assertEquals(NilResult.DEFINED, service.simpleFloatBodyParamNil(123.45f).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleFloatBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleFloatBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleFloatBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleFloatBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatBodyParamOptNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleFloatBodyParamOptNil(123.45f)); + assertEquals(NilResult.DEFINED, service.simpleFloatBodyParamOptNil(123.45f).orThrow()); } // --- Double --- @@ -308,49 +308,49 @@ public void simpleFloatBodyParamOptNil_defined(BodyParameterTypesService service @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleBodyParam(BodyParameterTypesService service) { - assertEquals(123.456789, service.simpleDoubleBodyParam(123.456789)); + assertEquals(123.456789, service.simpleDoubleBodyParam(123.456789).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleDoubleBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleDoubleBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleBodyParamOpt_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleDoubleBodyParamOpt(123.456789)); + assertEquals(NilResult.DEFINED, service.simpleDoubleBodyParamOpt(123.456789).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleDoubleBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleDoubleBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleBodyParamNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleDoubleBodyParamNil(123.456789)); + assertEquals(NilResult.DEFINED, service.simpleDoubleBodyParamNil(123.456789).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleDoubleBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleDoubleBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleDoubleBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleDoubleBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleBodyParamOptNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleDoubleBodyParamOptNil(123.456789)); + assertEquals(NilResult.DEFINED, service.simpleDoubleBodyParamOptNil(123.456789).orThrow()); } // --- String --- @@ -358,49 +358,49 @@ public void simpleDoubleBodyParamOptNil_defined(BodyParameterTypesService servic @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringBodyParam(BodyParameterTypesService service) { - assertEquals("hello world", service.simpleStringBodyParam("hello world")); + assertEquals("hello world", service.simpleStringBodyParam("hello world").orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleStringBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleStringBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringBodyParamOpt_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleStringBodyParamOpt("hello world")); + assertEquals(NilResult.DEFINED, service.simpleStringBodyParamOpt("hello world").orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleStringBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleStringBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringBodyParamNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleStringBodyParamNil("hello world")); + assertEquals(NilResult.DEFINED, service.simpleStringBodyParamNil("hello world").orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleStringBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleStringBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleStringBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleStringBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringBodyParamOptNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleStringBodyParamOptNil("hello world")); + assertEquals(NilResult.DEFINED, service.simpleStringBodyParamOptNil("hello world").orThrow()); } // --- LocalDate --- @@ -409,49 +409,50 @@ public void simpleStringBodyParamOptNil_defined(BodyParameterTypesService servic @MethodSource("serviceProvider") public void simpleLocalDateBodyParam(BodyParameterTypesService service) { var date = LocalDate.parse("2020-01-01"); - assertEquals(date, service.simpleLocalDateBodyParam(date)); + assertEquals(date, service.simpleLocalDateBodyParam(date).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalDateBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalDateBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateBodyParamOpt_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalDateBodyParamOpt(LocalDate.parse("2020-01-01"))); + assertEquals(NilResult.DEFINED, service.simpleLocalDateBodyParamOpt(LocalDate.parse("2020-01-01")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLocalDateBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleLocalDateBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateBodyParamNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalDateBodyParamNil(LocalDate.parse("2020-01-01"))); + assertEquals(NilResult.DEFINED, service.simpleLocalDateBodyParamNil(LocalDate.parse("2020-01-01")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalDateBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalDateBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLocalDateBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleLocalDateBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateBodyParamOptNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalDateBodyParamOptNil(LocalDate.parse("2020-01-01"))); + assertEquals(NilResult.DEFINED, + service.simpleLocalDateBodyParamOptNil(LocalDate.parse("2020-01-01")).orThrow()); } // --- LocalDateTime --- @@ -460,52 +461,52 @@ public void simpleLocalDateBodyParamOptNil_defined(BodyParameterTypesService ser @MethodSource("serviceProvider") public void simpleLocalDateTimeBodyParam(BodyParameterTypesService service) { var dt = LocalDateTime.parse("2020-01-01T10:00"); - assertEquals(dt, service.simpleLocalDateTimeBodyParam(dt)); + assertEquals(dt, service.simpleLocalDateTimeBodyParam(dt).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalDateTimeBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalDateTimeBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeBodyParamOpt_defined(BodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleLocalDateTimeBodyParamOpt(LocalDateTime.parse("2020-01-01T10:00"))); + service.simpleLocalDateTimeBodyParamOpt(LocalDateTime.parse("2020-01-01T10:00")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLocalDateTimeBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleLocalDateTimeBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeBodyParamNil_defined(BodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleLocalDateTimeBodyParamNil(LocalDateTime.parse("2020-01-01T10:00"))); + service.simpleLocalDateTimeBodyParamNil(LocalDateTime.parse("2020-01-01T10:00")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalDateTimeBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalDateTimeBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLocalDateTimeBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleLocalDateTimeBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeBodyParamOptNil_defined(BodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleLocalDateTimeBodyParamOptNil(LocalDateTime.parse("2020-01-01T10:00"))); + service.simpleLocalDateTimeBodyParamOptNil(LocalDateTime.parse("2020-01-01T10:00")).orThrow()); } // --- LocalTime --- @@ -514,49 +515,49 @@ public void simpleLocalDateTimeBodyParamOptNil_defined(BodyParameterTypesService @MethodSource("serviceProvider") public void simpleLocalTimeBodyParam(BodyParameterTypesService service) { var t = LocalTime.parse("10:00:00"); - assertEquals(t, service.simpleLocalTimeBodyParam(t)); + assertEquals(t, service.simpleLocalTimeBodyParam(t).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalTimeBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalTimeBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeBodyParamOpt_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalTimeBodyParamOpt(LocalTime.parse("10:00:00"))); + assertEquals(NilResult.DEFINED, service.simpleLocalTimeBodyParamOpt(LocalTime.parse("10:00:00")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLocalTimeBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleLocalTimeBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeBodyParamNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalTimeBodyParamNil(LocalTime.parse("10:00:00"))); + assertEquals(NilResult.DEFINED, service.simpleLocalTimeBodyParamNil(LocalTime.parse("10:00:00")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalTimeBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalTimeBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLocalTimeBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleLocalTimeBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeBodyParamOptNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalTimeBodyParamOptNil(LocalTime.parse("10:00:00"))); + assertEquals(NilResult.DEFINED, service.simpleLocalTimeBodyParamOptNil(LocalTime.parse("10:00:00")).orThrow()); } // --- OffsetDateTime --- @@ -564,52 +565,53 @@ public void simpleLocalTimeBodyParamOptNil_defined(BodyParameterTypesService ser @MethodSource("serviceProvider") public void simpleOffsetDateTimeBodyParam(BodyParameterTypesService service) { var odt = OffsetDateTime.parse("2025-01-01T10:00:00+01:00"); - assertEquals(odt, service.simpleOffsetDateTimeBodyParam(odt)); + assertEquals(odt, service.simpleOffsetDateTimeBodyParam(odt).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleOffsetDateTimeBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleOffsetDateTimeBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeBodyParamOpt_defined(BodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleOffsetDateTimeBodyParamOpt(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))); + service.simpleOffsetDateTimeBodyParamOpt(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleOffsetDateTimeBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleOffsetDateTimeBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeBodyParamNil_defined(BodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleOffsetDateTimeBodyParamNil(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))); + service.simpleOffsetDateTimeBodyParamNil(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleOffsetDateTimeBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleOffsetDateTimeBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleOffsetDateTimeBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleOffsetDateTimeBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeBodyParamOptNil_defined(BodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleOffsetDateTimeBodyParamOptNil(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))); + service.simpleOffsetDateTimeBodyParamOptNil(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")) + .orThrow()); } // --- ZonedDateTime --- @@ -618,52 +620,52 @@ public void simpleOffsetDateTimeBodyParamOptNil_defined(BodyParameterTypesServic @MethodSource("serviceProvider") public void simpleZonedDateTimeBodyParam(BodyParameterTypesService service) { var zdt = ZonedDateTime.parse("2025-01-01T10:00:00Z"); - assertEquals(zdt, service.simpleZonedDateTimeBodyParam(zdt)); + assertEquals(zdt, service.simpleZonedDateTimeBodyParam(zdt).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleZonedDateTimeBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleZonedDateTimeBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeBodyParamOpt_defined(BodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleZonedDateTimeBodyParamOpt(ZonedDateTime.parse("2025-01-01T10:00:00Z"))); + service.simpleZonedDateTimeBodyParamOpt(ZonedDateTime.parse("2025-01-01T10:00:00Z")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleZonedDateTimeBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleZonedDateTimeBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeBodyParamNil_defined(BodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleZonedDateTimeBodyParamNil(ZonedDateTime.parse("2025-01-01T10:00:00Z"))); + service.simpleZonedDateTimeBodyParamNil(ZonedDateTime.parse("2025-01-01T10:00:00Z")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleZonedDateTimeBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleZonedDateTimeBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleZonedDateTimeBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleZonedDateTimeBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeBodyParamOptNil_defined(BodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleZonedDateTimeBodyParamOptNil(ZonedDateTime.parse("2025-01-01T10:00:00Z"))); + service.simpleZonedDateTimeBodyParamOptNil(ZonedDateTime.parse("2025-01-01T10:00:00Z")).orThrow()); } // --- Scalar (ZoneId) --- @@ -672,49 +674,49 @@ public void simpleZonedDateTimeBodyParamOptNil_defined(BodyParameterTypesService @MethodSource("serviceProvider") public void simpleScalarBodyParam(BodyParameterTypesService service) { var zoneId = ZoneId.of("Europe/Vienna"); - assertEquals(zoneId, service.simpleScalarBodyParam(zoneId)); + assertEquals(zoneId, service.simpleScalarBodyParam(zoneId).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleScalarBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleScalarBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarBodyParamOpt_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleScalarBodyParamOpt(ZoneId.of("Europe/Vienna"))); + assertEquals(NilResult.DEFINED, service.simpleScalarBodyParamOpt(ZoneId.of("Europe/Vienna")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleScalarBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleScalarBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarBodyParamNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleScalarBodyParamNil(ZoneId.of("Europe/Vienna"))); + assertEquals(NilResult.DEFINED, service.simpleScalarBodyParamNil(ZoneId.of("Europe/Vienna")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleScalarBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleScalarBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleScalarBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleScalarBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarBodyParamOptNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleScalarBodyParamOptNil(ZoneId.of("Europe/Vienna"))); + assertEquals(NilResult.DEFINED, service.simpleScalarBodyParamOptNil(ZoneId.of("Europe/Vienna")).orThrow()); } // --- Enum --- @@ -722,49 +724,49 @@ public void simpleScalarBodyParamOptNil_defined(BodyParameterTypesService servic @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumBodyParam(BodyParameterTypesService service) { - assertEquals(SampleEnum.A, service.simpleEnumBodyParam(SampleEnum.A)); + assertEquals(SampleEnum.A, service.simpleEnumBodyParam(SampleEnum.A).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleEnumBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleEnumBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumBodyParamOpt_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleEnumBodyParamOpt(SampleEnum.B)); + assertEquals(NilResult.DEFINED, service.simpleEnumBodyParamOpt(SampleEnum.B).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleEnumBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleEnumBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumBodyParamNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleEnumBodyParamNil(SampleEnum.A)); + assertEquals(NilResult.DEFINED, service.simpleEnumBodyParamNil(SampleEnum.A).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleEnumBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleEnumBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleEnumBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleEnumBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumBodyParamOptNil_defined(BodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleEnumBodyParamOptNil(SampleEnum.B)); + assertEquals(NilResult.DEFINED, service.simpleEnumBodyParamOptNil(SampleEnum.B).orThrow()); } // --- Inline Enum --- @@ -773,52 +775,52 @@ public void simpleEnumBodyParamOptNil_defined(BodyParameterTypesService service) @MethodSource("serviceProvider") public void simpleInlineEnumBodyParam(BodyParameterTypesService service) { assertEquals(SimpleInlineEnumBodyParam_Result$.A, - service.simpleInlineEnumBodyParam(SimpleInlineEnumBodyParam_BodyEnum_Param$.A)); + service.simpleInlineEnumBodyParam(SimpleInlineEnumBodyParam_BodyEnum_Param$.A).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleInlineEnumBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleInlineEnumBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumBodyParamOpt_defined(BodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleInlineEnumBodyParamOpt(SimpleInlineEnumBodyParamOpt_BodyEnum_Param$.A)); + service.simpleInlineEnumBodyParamOpt(SimpleInlineEnumBodyParamOpt_BodyEnum_Param$.A).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleInlineEnumBodyParamNil(null)); + assertEquals(NilResult.NULL, service.simpleInlineEnumBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumBodyParamNil_defined(BodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleInlineEnumBodyParamNil(SimpleInlineEnumBodyParamNil_BodyEnum_Param$.C)); + service.simpleInlineEnumBodyParamNil(SimpleInlineEnumBodyParamNil_BodyEnum_Param$.C).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleInlineEnumBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleInlineEnumBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleInlineEnumBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleInlineEnumBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumBodyParamOptNil_defined(BodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleInlineEnumBodyParamOptNil(SimpleInlineEnumBodyParamOptNil_BodyEnum_Param$.D)); + service.simpleInlineEnumBodyParamOptNil(SimpleInlineEnumBodyParamOptNil_BodyEnum_Param$.D).orThrow()); } // --- Multi Body Param --- @@ -827,78 +829,78 @@ public void simpleInlineEnumBodyParamOptNil_defined(BodyParameterTypesService se @MethodSource("serviceProvider") public void multiBodyParam(BodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals("hello-42-k", service.multiBodyParam("hello", 42, record)); + assertEquals("hello-42-k", service.multiBodyParam("hello", 42, record).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiBodyParamOpt_allUndefined(BodyParameterTypesService service) { - assertEquals("undefined-undefined-undefined", service.multiBodyParamOpt()); + assertEquals("undefined-undefined-undefined", service.multiBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiBodyParamOpt_valueAOnly(BodyParameterTypesService service) { - assertEquals("hello-undefined-undefined", service.multiBodyParamOpt("hello")); + assertEquals("hello-undefined-undefined", service.multiBodyParamOpt("hello").orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiBodyParamOpt_valueAAndB(BodyParameterTypesService service) { - assertEquals("hello-42-undefined", service.multiBodyParamOpt("hello", 42)); + assertEquals("hello-42-undefined", service.multiBodyParamOpt("hello", 42).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiBodyParamOpt_allDefined(BodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals("hello-42-k", service.multiBodyParamOpt("hello", 42, record)); + assertEquals("hello-42-k", service.multiBodyParamOpt("hello", 42, record).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiBodyParamNil_allNull(BodyParameterTypesService service) { - assertEquals("null-null-null", service.multiBodyParamNil(null, null, null)); + assertEquals("null-null-null", service.multiBodyParamNil(null, null, null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiBodyParamNil_allDefined(BodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals("hello-42-k", service.multiBodyParamNil("hello", 42, record)); + assertEquals("hello-42-k", service.multiBodyParamNil("hello", 42, record).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiBodyParamOptNil_allUndefined(BodyParameterTypesService service) { - assertEquals("undefined-undefined-undefined", service.multiBodyParamOptNil()); + assertEquals("undefined-undefined-undefined", service.multiBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiBodyParamOptNil_valueANull(BodyParameterTypesService service) { - assertEquals("null-undefined-undefined", service.multiBodyParamOptNil((String) null)); + assertEquals("null-undefined-undefined", service.multiBodyParamOptNil((String) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiBodyParamOptNil_allNull(BodyParameterTypesService service) { assertEquals("null-null-null", - service.multiBodyParamOptNil((String) null, (Integer) null, (SimpleRecord.Data) null)); + service.multiBodyParamOptNil((String) null, (Integer) null, (SimpleRecord.Data) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiBodyParamOptNil_allDefined(BodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals("hello-42-k", service.multiBodyParamOptNil("hello", 42, record)); + assertEquals("hello-42-k", service.multiBodyParamOptNil("hello", 42, record).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiBodyParamFirst_allDefined(BodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals("hello-42-k", service.multiBodyParamFirst("hello", 42, record)); + assertEquals("hello-42-k", service.multiBodyParamFirst("hello", 42, record).orThrow()); } // --- Record Body Param --- @@ -907,7 +909,7 @@ var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").v @MethodSource("serviceProvider") public void recordBodyParam(BodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - var result = service.recordBodyParam(record); + var result = service.recordBodyParam(record).orThrow(); assertEquals("k", result.key()); assertEquals("1", result.version()); assertEquals("v", result.value()); @@ -916,46 +918,46 @@ var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").v @ParameterizedTest @MethodSource("serviceProvider") public void recordBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.recordBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.recordBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordBodyParamOpt_defined(BodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.recordBodyParamOpt(record)); + assertEquals(NilResult.DEFINED, service.recordBodyParamOpt(record).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.recordBodyParamNil(null)); + assertEquals(NilResult.NULL, service.recordBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordBodyParamNil_defined(BodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.recordBodyParamNil(record)); + assertEquals(NilResult.DEFINED, service.recordBodyParamNil(record).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.recordBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.recordBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.recordBodyParamOptNil((SimpleRecord.Data) null)); + assertEquals(NilResult.NULL, service.recordBodyParamOptNil((SimpleRecord.Data) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordBodyParamOptNil_defined(BodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.recordBodyParamOptNil(record)); + assertEquals(NilResult.DEFINED, service.recordBodyParamOptNil(record).orThrow()); } // --- Union Body Param --- @@ -964,53 +966,53 @@ var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").v @MethodSource("serviceProvider") public void unionBodyParam(BodyParameterTypesService service) { var union = service.client().builder(UnionA.DataBuilder.class).shared("shared").valueA("valueA").build(); - var result = service.unionBodyParam(union); + var result = service.unionBodyParam(union).orThrow(); assertEquals("shared", result.shared()); } @ParameterizedTest @MethodSource("serviceProvider") public void unionBodyParamOpt_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.unionBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.unionBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void unionBodyParamOpt_defined(BodyParameterTypesService service) { var union = service.client().builder(UnionA.DataBuilder.class).shared("shared").valueA("valueA").build(); - assertEquals(NilResult.DEFINED, service.unionBodyParamOpt(union)); + assertEquals(NilResult.DEFINED, service.unionBodyParamOpt(union).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void unionBodyParamNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.unionBodyParamNil(null)); + assertEquals(NilResult.NULL, service.unionBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void unionBodyParamNil_defined(BodyParameterTypesService service) { var union = service.client().builder(UnionA.DataBuilder.class).shared("shared").valueA("valueA").build(); - assertEquals(NilResult.DEFINED, service.unionBodyParamNil(union)); + assertEquals(NilResult.DEFINED, service.unionBodyParamNil(union).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void unionBodyParamOptNil_undefined(BodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.unionBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.unionBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void unionBodyParamOptNil_null(BodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.unionBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.unionBodyParamOptNil((UnionA.Data) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void unionBodyParamOptNil_defined(BodyParameterTypesService service) { var union = service.client().builder(UnionA.DataBuilder.class).shared("shared").valueA("valueA").build(); - assertEquals(NilResult.DEFINED, service.unionBodyParamOptNil(union)); + assertEquals(NilResult.DEFINED, service.unionBodyParamOptNil(union).orThrow()); } // --- Patchable Record Body Param --- @@ -1020,7 +1022,7 @@ public void unionBodyParamOptNil_defined(BodyParameterTypesService service) { public void patchableRecordBodyParam(BodyParameterTypesService service) { var patch = service.client().builder(PatchableRecord.PatchBuilder.class).key("k").version("1").value("v") .build(); - var result = service.patchableRecordBodyParam(patch); + var result = service.patchableRecordBodyParam(patch).orThrow(); assertEquals("k", result.key()); assertEquals("1", result.version()); assertEquals("v", result.value()); @@ -1029,7 +1031,7 @@ public void patchableRecordBodyParam(BodyParameterTypesService service) { @ParameterizedTest @MethodSource("serviceProvider") public void patchableRecordBodyParamOpt_undefined(BodyParameterTypesService service) { - var result = service.patchableRecordBodyParamOpt(); + var result = service.patchableRecordBodyParamOpt().orThrow(); assertEquals("undefined", result.key()); assertEquals("undefined", result.value()); } @@ -1039,7 +1041,7 @@ public void patchableRecordBodyParamOpt_undefined(BodyParameterTypesService serv public void patchableRecordBodyParamOpt_defined(BodyParameterTypesService service) { var patch = service.client().builder(PatchableRecord.PatchBuilder.class).key("k").version("1").value("v") .build(); - var result = service.patchableRecordBodyParamOpt(patch); + var result = service.patchableRecordBodyParamOpt(patch).orThrow(); assertEquals("k", result.key()); assertEquals("v", result.value()); } @@ -1047,7 +1049,7 @@ public void patchableRecordBodyParamOpt_defined(BodyParameterTypesService servic @ParameterizedTest @MethodSource("serviceProvider") public void patchableRecordBodyParamNil_null(BodyParameterTypesService service) { - var result = service.patchableRecordBodyParamNil(null); + var result = service.patchableRecordBodyParamNil(null).orThrow(); assertEquals("null", result.key()); assertEquals("null", result.value()); } @@ -1057,7 +1059,7 @@ public void patchableRecordBodyParamNil_null(BodyParameterTypesService service) public void patchableRecordBodyParamNil_defined(BodyParameterTypesService service) { var patch = service.client().builder(PatchableRecord.PatchBuilder.class).key("k").version("1").value("v") .build(); - var result = service.patchableRecordBodyParamNil(patch); + var result = service.patchableRecordBodyParamNil(patch).orThrow(); assertEquals("k", result.key()); assertEquals("v", result.value()); } @@ -1065,7 +1067,7 @@ public void patchableRecordBodyParamNil_defined(BodyParameterTypesService servic @ParameterizedTest @MethodSource("serviceProvider") public void patchableRecordBodyParamOptNil_undefined(BodyParameterTypesService service) { - var result = service.patchableRecordBodyParamOptNil(); + var result = service.patchableRecordBodyParamOptNil().orThrow(); assertEquals("undefined", result.key()); assertEquals("undefined", result.value()); } @@ -1073,7 +1075,7 @@ public void patchableRecordBodyParamOptNil_undefined(BodyParameterTypesService s @ParameterizedTest @MethodSource("serviceProvider") public void patchableRecordBodyParamOptNil_null(BodyParameterTypesService service) { - var result = service.patchableRecordBodyParamOptNil((PatchableRecord.Patch) null); + var result = service.patchableRecordBodyParamOptNil((PatchableRecord.Patch) null).orThrow(); assertEquals("null", result.key()); assertEquals("null", result.value()); } @@ -1083,7 +1085,7 @@ public void patchableRecordBodyParamOptNil_null(BodyParameterTypesService servic public void patchableRecordBodyParamOptNil_defined(BodyParameterTypesService service) { var patch = service.client().builder(PatchableRecord.PatchBuilder.class).key("k").version("1").value("v") .build(); - var result = service.patchableRecordBodyParamOptNil(patch); + var result = service.patchableRecordBodyParamOptNil(patch).orThrow(); assertEquals("k", result.key()); assertEquals("v", result.value()); } diff --git a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/HeaderParameterTypesServiceTest.java b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/HeaderParameterTypesServiceTest.java index c70136a0..16033775 100644 --- a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/HeaderParameterTypesServiceTest.java +++ b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/HeaderParameterTypesServiceTest.java @@ -56,49 +56,49 @@ static HeaderParameterTypesService[] serviceProvider() { @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanHeaderParam(HeaderParameterTypesService service) { - assertEquals(true, service.simpleBooleanHeaderParam(true)); + assertEquals(true, service.simpleBooleanHeaderParam(true).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleBooleanHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleBooleanHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanHeaderParamOpt_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleBooleanHeaderParamOpt(true)); + assertEquals(NilResult.DEFINED, service.simpleBooleanHeaderParamOpt(true).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleBooleanHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleBooleanHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanHeaderParamNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleBooleanHeaderParamNil(true)); + assertEquals(NilResult.DEFINED, service.simpleBooleanHeaderParamNil(true).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleBooleanHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleBooleanHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleBooleanHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleBooleanHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanHeaderParamOptNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleBooleanHeaderParamOptNil(true)); + assertEquals(NilResult.DEFINED, service.simpleBooleanHeaderParamOptNil(true).orThrow()); } // --- Short --- @@ -106,49 +106,49 @@ public void simpleBooleanHeaderParamOptNil_defined(HeaderParameterTypesService s @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortHeaderParam(HeaderParameterTypesService service) { - assertEquals((short) 42, service.simpleShortHeaderParam((short) 42)); + assertEquals((short) 42, service.simpleShortHeaderParam((short) 42).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleShortHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleShortHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortHeaderParamOpt_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleShortHeaderParamOpt((short) 42)); + assertEquals(NilResult.DEFINED, service.simpleShortHeaderParamOpt((short) 42).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleShortHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleShortHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortHeaderParamNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleShortHeaderParamNil((short) 42)); + assertEquals(NilResult.DEFINED, service.simpleShortHeaderParamNil((short) 42).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleShortHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleShortHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleShortHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleShortHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortHeaderParamOptNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleShortHeaderParamOptNil((short) 42)); + assertEquals(NilResult.DEFINED, service.simpleShortHeaderParamOptNil((short) 42).orThrow()); } // --- Int --- @@ -156,49 +156,49 @@ public void simpleShortHeaderParamOptNil_defined(HeaderParameterTypesService ser @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntHeaderParam(HeaderParameterTypesService service) { - assertEquals(123456, service.simpleIntHeaderParam(123456)); + assertEquals(123456, service.simpleIntHeaderParam(123456).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleIntHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleIntHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntHeaderParamOpt_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleIntHeaderParamOpt(123456)); + assertEquals(NilResult.DEFINED, service.simpleIntHeaderParamOpt(123456).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleIntHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleIntHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntHeaderParamNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleIntHeaderParamNil(123456)); + assertEquals(NilResult.DEFINED, service.simpleIntHeaderParamNil(123456).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleIntHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleIntHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleIntHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleIntHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntHeaderParamOptNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleIntHeaderParamOptNil(123456)); + assertEquals(NilResult.DEFINED, service.simpleIntHeaderParamOptNil(123456).orThrow()); } // --- Long --- @@ -206,49 +206,49 @@ public void simpleIntHeaderParamOptNil_defined(HeaderParameterTypesService servi @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongHeaderParam(HeaderParameterTypesService service) { - assertEquals(1234567890123L, service.simpleLongHeaderParam(1234567890123L)); + assertEquals(1234567890123L, service.simpleLongHeaderParam(1234567890123L).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLongHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleLongHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongHeaderParamOpt_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLongHeaderParamOpt(1234567890123L)); + assertEquals(NilResult.DEFINED, service.simpleLongHeaderParamOpt(1234567890123L).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLongHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleLongHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongHeaderParamNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLongHeaderParamNil(1234567890123L)); + assertEquals(NilResult.DEFINED, service.simpleLongHeaderParamNil(1234567890123L).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLongHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleLongHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLongHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleLongHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongHeaderParamOptNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLongHeaderParamOptNil(1234567890123L)); + assertEquals(NilResult.DEFINED, service.simpleLongHeaderParamOptNil(1234567890123L).orThrow()); } // --- Float --- @@ -256,49 +256,49 @@ public void simpleLongHeaderParamOptNil_defined(HeaderParameterTypesService serv @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatHeaderParam(HeaderParameterTypesService service) { - assertEquals(123.45f, service.simpleFloatHeaderParam(123.45f)); + assertEquals(123.45f, service.simpleFloatHeaderParam(123.45f).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleFloatHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleFloatHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatHeaderParamOpt_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleFloatHeaderParamOpt(123.45f)); + assertEquals(NilResult.DEFINED, service.simpleFloatHeaderParamOpt(123.45f).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleFloatHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleFloatHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatHeaderParamNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleFloatHeaderParamNil(123.45f)); + assertEquals(NilResult.DEFINED, service.simpleFloatHeaderParamNil(123.45f).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleFloatHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleFloatHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleFloatHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleFloatHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatHeaderParamOptNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleFloatHeaderParamOptNil(123.45f)); + assertEquals(NilResult.DEFINED, service.simpleFloatHeaderParamOptNil(123.45f).orThrow()); } // --- Double --- @@ -306,49 +306,49 @@ public void simpleFloatHeaderParamOptNil_defined(HeaderParameterTypesService ser @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleHeaderParam(HeaderParameterTypesService service) { - assertEquals(123.456789, service.simpleDoubleHeaderParam(123.456789)); + assertEquals(123.456789, service.simpleDoubleHeaderParam(123.456789).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleDoubleHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleDoubleHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleHeaderParamOpt_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleDoubleHeaderParamOpt(123.456789)); + assertEquals(NilResult.DEFINED, service.simpleDoubleHeaderParamOpt(123.456789).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleDoubleHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleDoubleHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleHeaderParamNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleDoubleHeaderParamNil(123.456789)); + assertEquals(NilResult.DEFINED, service.simpleDoubleHeaderParamNil(123.456789).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleDoubleHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleDoubleHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleDoubleHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleDoubleHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleHeaderParamOptNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleDoubleHeaderParamOptNil(123.456789)); + assertEquals(NilResult.DEFINED, service.simpleDoubleHeaderParamOptNil(123.456789).orThrow()); } // --- String --- @@ -356,53 +356,53 @@ public void simpleDoubleHeaderParamOptNil_defined(HeaderParameterTypesService se @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringHeaderParam(HeaderParameterTypesService service) { - assertEquals("hello world", service.simpleStringHeaderParam("hello world")); - assertEquals("a Ā 𐀀 文 🦄", service.simpleStringHeaderParam("a Ā 𐀀 文 🦄")); - assertEquals("line1\nline2\nline3", service.simpleStringHeaderParam("line1\nline2\nline3")); - assertEquals("pre-\\uffff-post", service.simpleStringHeaderParam("pre-\\uffff-post")); - assertEquals(" Hello, World! ", service.simpleStringHeaderParam(" Hello, World! ")); + assertEquals("hello world", service.simpleStringHeaderParam("hello world").orThrow()); + assertEquals("a Ā 𐀀 文 🦄", service.simpleStringHeaderParam("a Ā 𐀀 文 🦄").orThrow()); + assertEquals("line1\nline2\nline3", service.simpleStringHeaderParam("line1\nline2\nline3").orThrow()); + assertEquals("pre-\\uffff-post", service.simpleStringHeaderParam("pre-\\uffff-post").orThrow()); + assertEquals(" Hello, World! ", service.simpleStringHeaderParam(" Hello, World! ").orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleStringHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleStringHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringHeaderParamOpt_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleStringHeaderParamOpt("hello world")); + assertEquals(NilResult.DEFINED, service.simpleStringHeaderParamOpt("hello world").orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleStringHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleStringHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringHeaderParamNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleStringHeaderParamNil("hello world")); + assertEquals(NilResult.DEFINED, service.simpleStringHeaderParamNil("hello world").orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleStringHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleStringHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleStringHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleStringHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringHeaderParamOptNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleStringHeaderParamOptNil("hello world")); + assertEquals(NilResult.DEFINED, service.simpleStringHeaderParamOptNil("hello world").orThrow()); } // --- LocalDate --- @@ -411,49 +411,50 @@ public void simpleStringHeaderParamOptNil_defined(HeaderParameterTypesService se @MethodSource("serviceProvider") public void simpleLocalDateHeaderParam(HeaderParameterTypesService service) { var date = LocalDate.parse("2020-01-01"); - assertEquals(date, service.simpleLocalDateHeaderParam(date)); + assertEquals(date, service.simpleLocalDateHeaderParam(date).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalDateHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalDateHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateHeaderParamOpt_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalDateHeaderParamOpt(LocalDate.parse("2020-01-01"))); + assertEquals(NilResult.DEFINED, service.simpleLocalDateHeaderParamOpt(LocalDate.parse("2020-01-01")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLocalDateHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleLocalDateHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateHeaderParamNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalDateHeaderParamNil(LocalDate.parse("2020-01-01"))); + assertEquals(NilResult.DEFINED, service.simpleLocalDateHeaderParamNil(LocalDate.parse("2020-01-01")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalDateHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalDateHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLocalDateHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleLocalDateHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateHeaderParamOptNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalDateHeaderParamOptNil(LocalDate.parse("2020-01-01"))); + assertEquals(NilResult.DEFINED, + service.simpleLocalDateHeaderParamOptNil(LocalDate.parse("2020-01-01")).orThrow()); } // --- LocalDateTime --- @@ -462,52 +463,52 @@ public void simpleLocalDateHeaderParamOptNil_defined(HeaderParameterTypesService @MethodSource("serviceProvider") public void simpleLocalDateTimeHeaderParam(HeaderParameterTypesService service) { var dt = LocalDateTime.parse("2020-01-01T10:00"); - assertEquals(dt, service.simpleLocalDateTimeHeaderParam(dt)); + assertEquals(dt, service.simpleLocalDateTimeHeaderParam(dt).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalDateTimeHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalDateTimeHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeHeaderParamOpt_defined(HeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleLocalDateTimeHeaderParamOpt(LocalDateTime.parse("2020-01-01T10:00"))); + service.simpleLocalDateTimeHeaderParamOpt(LocalDateTime.parse("2020-01-01T10:00")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLocalDateTimeHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleLocalDateTimeHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeHeaderParamNil_defined(HeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleLocalDateTimeHeaderParamNil(LocalDateTime.parse("2020-01-01T10:00"))); + service.simpleLocalDateTimeHeaderParamNil(LocalDateTime.parse("2020-01-01T10:00")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalDateTimeHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalDateTimeHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLocalDateTimeHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleLocalDateTimeHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeHeaderParamOptNil_defined(HeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleLocalDateTimeHeaderParamOptNil(LocalDateTime.parse("2020-01-01T10:00"))); + service.simpleLocalDateTimeHeaderParamOptNil(LocalDateTime.parse("2020-01-01T10:00")).orThrow()); } // --- LocalTime --- @@ -516,49 +517,50 @@ public void simpleLocalDateTimeHeaderParamOptNil_defined(HeaderParameterTypesSer @MethodSource("serviceProvider") public void simpleLocalTimeHeaderParam(HeaderParameterTypesService service) { var t = LocalTime.parse("10:00:00"); - assertEquals(t, service.simpleLocalTimeHeaderParam(t)); + assertEquals(t, service.simpleLocalTimeHeaderParam(t).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalTimeHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalTimeHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeHeaderParamOpt_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalTimeHeaderParamOpt(LocalTime.parse("10:00:00"))); + assertEquals(NilResult.DEFINED, service.simpleLocalTimeHeaderParamOpt(LocalTime.parse("10:00:00")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLocalTimeHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleLocalTimeHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeHeaderParamNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalTimeHeaderParamNil(LocalTime.parse("10:00:00"))); + assertEquals(NilResult.DEFINED, service.simpleLocalTimeHeaderParamNil(LocalTime.parse("10:00:00")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalTimeHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalTimeHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleLocalTimeHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleLocalTimeHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeHeaderParamOptNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalTimeHeaderParamOptNil(LocalTime.parse("10:00:00"))); + assertEquals(NilResult.DEFINED, + service.simpleLocalTimeHeaderParamOptNil(LocalTime.parse("10:00:00")).orThrow()); } // --- OffsetDateTime --- @@ -566,52 +568,55 @@ public void simpleLocalTimeHeaderParamOptNil_defined(HeaderParameterTypesService @MethodSource("serviceProvider") public void simpleOffsetDateTimeHeaderParam(HeaderParameterTypesService service) { var odt = OffsetDateTime.parse("2025-01-01T10:00:00+01:00"); - assertEquals(odt, service.simpleOffsetDateTimeHeaderParam(odt)); + assertEquals(odt, service.simpleOffsetDateTimeHeaderParam(odt).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleOffsetDateTimeHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleOffsetDateTimeHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeHeaderParamOpt_defined(HeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleOffsetDateTimeHeaderParamOpt(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))); + service.simpleOffsetDateTimeHeaderParamOpt(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")) + .orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleOffsetDateTimeHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleOffsetDateTimeHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeHeaderParamNil_defined(HeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleOffsetDateTimeHeaderParamNil(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))); + service.simpleOffsetDateTimeHeaderParamNil(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")) + .orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleOffsetDateTimeHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleOffsetDateTimeHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleOffsetDateTimeHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleOffsetDateTimeHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeHeaderParamOptNil_defined(HeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleOffsetDateTimeHeaderParamOptNil(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))); + service.simpleOffsetDateTimeHeaderParamOptNil(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")) + .orThrow()); } // --- ZonedDateTime --- @@ -620,52 +625,52 @@ public void simpleOffsetDateTimeHeaderParamOptNil_defined(HeaderParameterTypesSe @MethodSource("serviceProvider") public void simpleZonedDateTimeHeaderParam(HeaderParameterTypesService service) { var zdt = ZonedDateTime.parse("2025-01-01T10:00:00Z"); - assertEquals(zdt, service.simpleZonedDateTimeHeaderParam(zdt)); + assertEquals(zdt, service.simpleZonedDateTimeHeaderParam(zdt).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleZonedDateTimeHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleZonedDateTimeHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeHeaderParamOpt_defined(HeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleZonedDateTimeHeaderParamOpt(ZonedDateTime.parse("2025-01-01T10:00:00Z"))); + service.simpleZonedDateTimeHeaderParamOpt(ZonedDateTime.parse("2025-01-01T10:00:00Z")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleZonedDateTimeHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleZonedDateTimeHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeHeaderParamNil_defined(HeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleZonedDateTimeHeaderParamNil(ZonedDateTime.parse("2025-01-01T10:00:00Z"))); + service.simpleZonedDateTimeHeaderParamNil(ZonedDateTime.parse("2025-01-01T10:00:00Z")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleZonedDateTimeHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleZonedDateTimeHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleZonedDateTimeHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleZonedDateTimeHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeHeaderParamOptNil_defined(HeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleZonedDateTimeHeaderParamOptNil(ZonedDateTime.parse("2025-01-01T10:00:00Z"))); + service.simpleZonedDateTimeHeaderParamOptNil(ZonedDateTime.parse("2025-01-01T10:00:00Z")).orThrow()); } // --- Scalar (ZoneId) --- @@ -674,49 +679,49 @@ public void simpleZonedDateTimeHeaderParamOptNil_defined(HeaderParameterTypesSer @MethodSource("serviceProvider") public void simpleScalarHeaderParam(HeaderParameterTypesService service) { var zoneId = ZoneId.of("Europe/Vienna"); - assertEquals(zoneId, service.simpleScalarHeaderParam(zoneId)); + assertEquals(zoneId, service.simpleScalarHeaderParam(zoneId).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleScalarHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleScalarHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarHeaderParamOpt_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleScalarHeaderParamOpt(ZoneId.of("Europe/Vienna"))); + assertEquals(NilResult.DEFINED, service.simpleScalarHeaderParamOpt(ZoneId.of("Europe/Vienna")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleScalarHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleScalarHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarHeaderParamNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleScalarHeaderParamNil(ZoneId.of("Europe/Vienna"))); + assertEquals(NilResult.DEFINED, service.simpleScalarHeaderParamNil(ZoneId.of("Europe/Vienna")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleScalarHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleScalarHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleScalarHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleScalarHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarHeaderParamOptNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleScalarHeaderParamOptNil(ZoneId.of("Europe/Vienna"))); + assertEquals(NilResult.DEFINED, service.simpleScalarHeaderParamOptNil(ZoneId.of("Europe/Vienna")).orThrow()); } // --- Enum --- @@ -724,49 +729,49 @@ public void simpleScalarHeaderParamOptNil_defined(HeaderParameterTypesService se @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumHeaderParam(HeaderParameterTypesService service) { - assertEquals(SampleEnum.A, service.simpleEnumHeaderParam(SampleEnum.A)); + assertEquals(SampleEnum.A, service.simpleEnumHeaderParam(SampleEnum.A).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleEnumHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleEnumHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumHeaderParamOpt_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleEnumHeaderParamOpt(SampleEnum.B)); + assertEquals(NilResult.DEFINED, service.simpleEnumHeaderParamOpt(SampleEnum.B).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleEnumHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleEnumHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumHeaderParamNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleEnumHeaderParamNil(SampleEnum.A)); + assertEquals(NilResult.DEFINED, service.simpleEnumHeaderParamNil(SampleEnum.A).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleEnumHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleEnumHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleEnumHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleEnumHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumHeaderParamOptNil_defined(HeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleEnumHeaderParamOptNil(SampleEnum.B)); + assertEquals(NilResult.DEFINED, service.simpleEnumHeaderParamOptNil(SampleEnum.B).orThrow()); } // --- Inline Enum --- @@ -775,52 +780,53 @@ public void simpleEnumHeaderParamOptNil_defined(HeaderParameterTypesService serv @MethodSource("serviceProvider") public void simpleInlineEnumHeaderParam(HeaderParameterTypesService service) { assertEquals(SimpleInlineEnumHeaderParam_Result$.A, - service.simpleInlineEnumHeaderParam(SimpleInlineEnumHeaderParam_HeaderValue_Param$.A)); + service.simpleInlineEnumHeaderParam(SimpleInlineEnumHeaderParam_HeaderValue_Param$.A).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleInlineEnumHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleInlineEnumHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumHeaderParamOpt_defined(HeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleInlineEnumHeaderParamOpt(SimpleInlineEnumHeaderParamOpt_HeaderValue_Param$.A)); + service.simpleInlineEnumHeaderParamOpt(SimpleInlineEnumHeaderParamOpt_HeaderValue_Param$.A).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleInlineEnumHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.simpleInlineEnumHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumHeaderParamNil_defined(HeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleInlineEnumHeaderParamNil(SimpleInlineEnumHeaderParamNil_HeaderValue_Param$.C)); + service.simpleInlineEnumHeaderParamNil(SimpleInlineEnumHeaderParamNil_HeaderValue_Param$.C).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleInlineEnumHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.simpleInlineEnumHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.simpleInlineEnumHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.simpleInlineEnumHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleInlineEnumHeaderParamOptNil_defined(HeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleInlineEnumHeaderParamOptNil(SimpleInlineEnumHeaderParamOptNil_HeaderValue_Param$.D)); + service.simpleInlineEnumHeaderParamOptNil(SimpleInlineEnumHeaderParamOptNil_HeaderValue_Param$.D) + .orThrow()); } // --- Multi Header Param --- @@ -828,64 +834,64 @@ public void simpleInlineEnumHeaderParamOptNil_defined(HeaderParameterTypesServic @ParameterizedTest @MethodSource("serviceProvider") public void multiHeaderParam(HeaderParameterTypesService service) { - assertEquals("hello-42", service.multiHeaderParam("hello", 42)); + assertEquals("hello-42", service.multiHeaderParam("hello", 42).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiHeaderParamOpt_allUndefined(HeaderParameterTypesService service) { - assertEquals(List.of(NilResult.UNDEFINED, NilResult.UNDEFINED), service.multiHeaderParamOpt()); + assertEquals(List.of(NilResult.UNDEFINED, NilResult.UNDEFINED), service.multiHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiHeaderParamOpt_valueAOnly(HeaderParameterTypesService service) { - assertEquals(List.of(NilResult.DEFINED, NilResult.UNDEFINED), service.multiHeaderParamOpt("hello")); + assertEquals(List.of(NilResult.DEFINED, NilResult.UNDEFINED), service.multiHeaderParamOpt("hello").orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiHeaderParamOpt_allDefined(HeaderParameterTypesService service) { - assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED), service.multiHeaderParamOpt("hello", 42)); + assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED), service.multiHeaderParamOpt("hello", 42).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiHeaderParamNil_allNull(HeaderParameterTypesService service) { - assertEquals(List.of(NilResult.NULL, NilResult.NULL), service.multiHeaderParamNil(null, null)); + assertEquals(List.of(NilResult.NULL, NilResult.NULL), service.multiHeaderParamNil(null, null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiHeaderParamNil_allDefined(HeaderParameterTypesService service) { - assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED), service.multiHeaderParamNil("hello", 42)); + assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED), service.multiHeaderParamNil("hello", 42).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiHeaderParamOptNil_allUndefined(HeaderParameterTypesService service) { - assertEquals(List.of(NilResult.UNDEFINED, NilResult.UNDEFINED), service.multiHeaderParamOptNil()); + assertEquals(List.of(NilResult.UNDEFINED, NilResult.UNDEFINED), service.multiHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiHeaderParamOptNil_valueANull(HeaderParameterTypesService service) { assertEquals(List.of(NilResult.NULL, NilResult.UNDEFINED), - service.multiHeaderParamOptNil((String) null)); + service.multiHeaderParamOptNil((String) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiHeaderParamOptNil_allNull(HeaderParameterTypesService service) { assertEquals(List.of(NilResult.NULL, NilResult.NULL), - service.multiHeaderParamOptNil((String) null, (Integer) null)); + service.multiHeaderParamOptNil((String) null, (Integer) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiHeaderParamOptNil_allDefined(HeaderParameterTypesService service) { assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED), - service.multiHeaderParamOptNil("hello", 42)); + service.multiHeaderParamOptNil("hello", 42).orThrow()); } // --- Record Header Param --- @@ -894,7 +900,7 @@ public void multiHeaderParamOptNil_allDefined(HeaderParameterTypesService servic @MethodSource("serviceProvider") public void recordHeaderParam(HeaderParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - var result = service.recordHeaderParam(record); + var result = service.recordHeaderParam(record).orThrow(); assertEquals("k", result.key()); assertEquals("1", result.version()); assertEquals("v", result.value()); @@ -903,46 +909,46 @@ var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").v @ParameterizedTest @MethodSource("serviceProvider") public void recordHeaderParamOpt_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.recordHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.recordHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordHeaderParamOpt_defined(HeaderParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.recordHeaderParamOpt(record)); + assertEquals(NilResult.DEFINED, service.recordHeaderParamOpt(record).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordHeaderParamNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.recordHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.recordHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordHeaderParamNil_defined(HeaderParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.recordHeaderParamNil(record)); + assertEquals(NilResult.DEFINED, service.recordHeaderParamNil(record).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordHeaderParamOptNil_undefined(HeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.recordHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.recordHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordHeaderParamOptNil_null(HeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.recordHeaderParamOptNil((SimpleRecord.Data) null)); + assertEquals(NilResult.NULL, service.recordHeaderParamOptNil((SimpleRecord.Data) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordHeaderParamOptNil_defined(HeaderParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.recordHeaderParamOptNil(record)); + assertEquals(NilResult.DEFINED, service.recordHeaderParamOptNil(record).orThrow()); } } diff --git a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListBodyParameterTypesServiceTest.java b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListBodyParameterTypesServiceTest.java index 203ce995..a3adc4c4 100644 --- a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListBodyParameterTypesServiceTest.java +++ b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListBodyParameterTypesServiceTest.java @@ -56,49 +56,49 @@ static ListBodyParameterTypesService[] serviceProvider() { @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanBodyParam(ListBodyParameterTypesService service) { - assertEquals(List.of(true, false), service.listBooleanBodyParam(List.of(true, false))); + assertEquals(List.of(true, false), service.listBooleanBodyParam(List.of(true, false)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listBooleanBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listBooleanBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanBodyParamOpt_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listBooleanBodyParamOpt(List.of(true))); + assertEquals(NilResult.DEFINED, service.listBooleanBodyParamOpt(List.of(true)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listBooleanBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listBooleanBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanBodyParamNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listBooleanBodyParamNil(List.of(true))); + assertEquals(NilResult.DEFINED, service.listBooleanBodyParamNil(List.of(true)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listBooleanBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listBooleanBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listBooleanBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listBooleanBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanBodyParamOptNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listBooleanBodyParamOptNil(List.of(true))); + assertEquals(NilResult.DEFINED, service.listBooleanBodyParamOptNil(List.of(true)).orThrow()); } // --- Short --- @@ -106,49 +106,50 @@ public void listBooleanBodyParamOptNil_defined(ListBodyParameterTypesService ser @ParameterizedTest @MethodSource("serviceProvider") public void listShortBodyParam(ListBodyParameterTypesService service) { - assertEquals(List.of((short) 42, (short) 7), service.listShortBodyParam(List.of((short) 42, (short) 7))); + assertEquals(List.of((short) 42, (short) 7), + service.listShortBodyParam(List.of((short) 42, (short) 7)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listShortBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listShortBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortBodyParamOpt_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listShortBodyParamOpt(List.of((short) 42))); + assertEquals(NilResult.DEFINED, service.listShortBodyParamOpt(List.of((short) 42)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listShortBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listShortBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortBodyParamNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listShortBodyParamNil(List.of((short) 42))); + assertEquals(NilResult.DEFINED, service.listShortBodyParamNil(List.of((short) 42)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listShortBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listShortBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listShortBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listShortBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortBodyParamOptNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listShortBodyParamOptNil(List.of((short) 42))); + assertEquals(NilResult.DEFINED, service.listShortBodyParamOptNil(List.of((short) 42)).orThrow()); } // --- Int --- @@ -156,49 +157,49 @@ public void listShortBodyParamOptNil_defined(ListBodyParameterTypesService servi @ParameterizedTest @MethodSource("serviceProvider") public void listIntBodyParam(ListBodyParameterTypesService service) { - assertEquals(List.of(123456, 789), service.listIntBodyParam(List.of(123456, 789))); + assertEquals(List.of(123456, 789), service.listIntBodyParam(List.of(123456, 789)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listIntBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listIntBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntBodyParamOpt_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listIntBodyParamOpt(List.of(123456))); + assertEquals(NilResult.DEFINED, service.listIntBodyParamOpt(List.of(123456)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listIntBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listIntBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntBodyParamNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listIntBodyParamNil(List.of(123456))); + assertEquals(NilResult.DEFINED, service.listIntBodyParamNil(List.of(123456)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listIntBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listIntBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listIntBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listIntBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntBodyParamOptNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listIntBodyParamOptNil(List.of(123456))); + assertEquals(NilResult.DEFINED, service.listIntBodyParamOptNil(List.of(123456)).orThrow()); } // --- Long --- @@ -206,49 +207,49 @@ public void listIntBodyParamOptNil_defined(ListBodyParameterTypesService service @ParameterizedTest @MethodSource("serviceProvider") public void listLongBodyParam(ListBodyParameterTypesService service) { - assertEquals(List.of(1234567890123L, 456L), service.listLongBodyParam(List.of(1234567890123L, 456L))); + assertEquals(List.of(1234567890123L, 456L), service.listLongBodyParam(List.of(1234567890123L, 456L)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLongBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listLongBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongBodyParamOpt_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLongBodyParamOpt(List.of(1234567890123L))); + assertEquals(NilResult.DEFINED, service.listLongBodyParamOpt(List.of(1234567890123L)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLongBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listLongBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongBodyParamNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLongBodyParamNil(List.of(1234567890123L))); + assertEquals(NilResult.DEFINED, service.listLongBodyParamNil(List.of(1234567890123L)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLongBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listLongBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLongBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listLongBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongBodyParamOptNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLongBodyParamOptNil(List.of(1234567890123L))); + assertEquals(NilResult.DEFINED, service.listLongBodyParamOptNil(List.of(1234567890123L)).orThrow()); } // --- Float --- @@ -256,49 +257,49 @@ public void listLongBodyParamOptNil_defined(ListBodyParameterTypesService servic @ParameterizedTest @MethodSource("serviceProvider") public void listFloatBodyParam(ListBodyParameterTypesService service) { - assertEquals(List.of(123.45f, 6.78f), service.listFloatBodyParam(List.of(123.45f, 6.78f))); + assertEquals(List.of(123.45f, 6.78f), service.listFloatBodyParam(List.of(123.45f, 6.78f)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listFloatBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listFloatBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatBodyParamOpt_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listFloatBodyParamOpt(List.of(123.45f))); + assertEquals(NilResult.DEFINED, service.listFloatBodyParamOpt(List.of(123.45f)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listFloatBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listFloatBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatBodyParamNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listFloatBodyParamNil(List.of(123.45f))); + assertEquals(NilResult.DEFINED, service.listFloatBodyParamNil(List.of(123.45f)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listFloatBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listFloatBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listFloatBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listFloatBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatBodyParamOptNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listFloatBodyParamOptNil(List.of(123.45f))); + assertEquals(NilResult.DEFINED, service.listFloatBodyParamOptNil(List.of(123.45f)).orThrow()); } // --- Double --- @@ -306,49 +307,49 @@ public void listFloatBodyParamOptNil_defined(ListBodyParameterTypesService servi @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleBodyParam(ListBodyParameterTypesService service) { - assertEquals(List.of(123.456789, 9.87), service.listDoubleBodyParam(List.of(123.456789, 9.87))); + assertEquals(List.of(123.456789, 9.87), service.listDoubleBodyParam(List.of(123.456789, 9.87)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listDoubleBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listDoubleBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleBodyParamOpt_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listDoubleBodyParamOpt(List.of(123.456789))); + assertEquals(NilResult.DEFINED, service.listDoubleBodyParamOpt(List.of(123.456789)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listDoubleBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listDoubleBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleBodyParamNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listDoubleBodyParamNil(List.of(123.456789))); + assertEquals(NilResult.DEFINED, service.listDoubleBodyParamNil(List.of(123.456789)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listDoubleBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listDoubleBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listDoubleBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listDoubleBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleBodyParamOptNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listDoubleBodyParamOptNil(List.of(123.456789))); + assertEquals(NilResult.DEFINED, service.listDoubleBodyParamOptNil(List.of(123.456789)).orThrow()); } // --- String --- @@ -356,49 +357,49 @@ public void listDoubleBodyParamOptNil_defined(ListBodyParameterTypesService serv @ParameterizedTest @MethodSource("serviceProvider") public void listStringBodyParam(ListBodyParameterTypesService service) { - assertEquals(List.of("hello", "world"), service.listStringBodyParam(List.of("hello", "world"))); + assertEquals(List.of("hello", "world"), service.listStringBodyParam(List.of("hello", "world")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listStringBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listStringBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringBodyParamOpt_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listStringBodyParamOpt(List.of("hello"))); + assertEquals(NilResult.DEFINED, service.listStringBodyParamOpt(List.of("hello")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listStringBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listStringBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringBodyParamNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listStringBodyParamNil(List.of("hello"))); + assertEquals(NilResult.DEFINED, service.listStringBodyParamNil(List.of("hello")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listStringBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listStringBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listStringBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listStringBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringBodyParamOptNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listStringBodyParamOptNil(List.of("hello"))); + assertEquals(NilResult.DEFINED, service.listStringBodyParamOptNil(List.of("hello")).orThrow()); } // --- LocalDate --- @@ -407,49 +408,52 @@ public void listStringBodyParamOptNil_defined(ListBodyParameterTypesService serv @MethodSource("serviceProvider") public void listLocalDateBodyParam(ListBodyParameterTypesService service) { var dates = List.of(LocalDate.parse("2020-01-01"), LocalDate.parse("2021-06-15")); - assertEquals(dates, service.listLocalDateBodyParam(dates)); + assertEquals(dates, service.listLocalDateBodyParam(dates).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLocalDateBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listLocalDateBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateBodyParamOpt_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLocalDateBodyParamOpt(List.of(LocalDate.parse("2020-01-01")))); + assertEquals(NilResult.DEFINED, + service.listLocalDateBodyParamOpt(List.of(LocalDate.parse("2020-01-01"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLocalDateBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listLocalDateBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateBodyParamNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLocalDateBodyParamNil(List.of(LocalDate.parse("2020-01-01")))); + assertEquals(NilResult.DEFINED, + service.listLocalDateBodyParamNil(List.of(LocalDate.parse("2020-01-01"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLocalDateBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listLocalDateBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLocalDateBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listLocalDateBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateBodyParamOptNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLocalDateBodyParamOptNil(List.of(LocalDate.parse("2020-01-01")))); + assertEquals(NilResult.DEFINED, + service.listLocalDateBodyParamOptNil(List.of(LocalDate.parse("2020-01-01"))).orThrow()); } // --- LocalDateTime --- @@ -458,52 +462,52 @@ public void listLocalDateBodyParamOptNil_defined(ListBodyParameterTypesService s @MethodSource("serviceProvider") public void listLocalDateTimeBodyParam(ListBodyParameterTypesService service) { var dts = List.of(LocalDateTime.parse("2020-01-01T10:00"), LocalDateTime.parse("2021-06-15T12:30")); - assertEquals(dts, service.listLocalDateTimeBodyParam(dts)); + assertEquals(dts, service.listLocalDateTimeBodyParam(dts).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLocalDateTimeBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listLocalDateTimeBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeBodyParamOpt_defined(ListBodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listLocalDateTimeBodyParamOpt(List.of(LocalDateTime.parse("2020-01-01T10:00")))); + service.listLocalDateTimeBodyParamOpt(List.of(LocalDateTime.parse("2020-01-01T10:00"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLocalDateTimeBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listLocalDateTimeBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeBodyParamNil_defined(ListBodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listLocalDateTimeBodyParamNil(List.of(LocalDateTime.parse("2020-01-01T10:00")))); + service.listLocalDateTimeBodyParamNil(List.of(LocalDateTime.parse("2020-01-01T10:00"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLocalDateTimeBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listLocalDateTimeBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLocalDateTimeBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listLocalDateTimeBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeBodyParamOptNil_defined(ListBodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listLocalDateTimeBodyParamOptNil(List.of(LocalDateTime.parse("2020-01-01T10:00")))); + service.listLocalDateTimeBodyParamOptNil(List.of(LocalDateTime.parse("2020-01-01T10:00"))).orThrow()); } // --- LocalTime --- @@ -512,49 +516,52 @@ public void listLocalDateTimeBodyParamOptNil_defined(ListBodyParameterTypesServi @MethodSource("serviceProvider") public void listLocalTimeBodyParam(ListBodyParameterTypesService service) { var times = List.of(LocalTime.parse("10:00:00"), LocalTime.parse("11:30:00")); - assertEquals(times, service.listLocalTimeBodyParam(times)); + assertEquals(times, service.listLocalTimeBodyParam(times).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLocalTimeBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listLocalTimeBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeBodyParamOpt_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLocalTimeBodyParamOpt(List.of(LocalTime.parse("10:00:00")))); + assertEquals(NilResult.DEFINED, + service.listLocalTimeBodyParamOpt(List.of(LocalTime.parse("10:00:00"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLocalTimeBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listLocalTimeBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeBodyParamNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLocalTimeBodyParamNil(List.of(LocalTime.parse("10:00:00")))); + assertEquals(NilResult.DEFINED, + service.listLocalTimeBodyParamNil(List.of(LocalTime.parse("10:00:00"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLocalTimeBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listLocalTimeBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLocalTimeBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listLocalTimeBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeBodyParamOptNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLocalTimeBodyParamOptNil(List.of(LocalTime.parse("10:00:00")))); + assertEquals(NilResult.DEFINED, + service.listLocalTimeBodyParamOptNil(List.of(LocalTime.parse("10:00:00"))).orThrow()); } // --- OffsetDateTime --- @@ -563,52 +570,55 @@ public void listLocalTimeBodyParamOptNil_defined(ListBodyParameterTypesService s public void listOffsetDateTimeBodyParam(ListBodyParameterTypesService service) { var times = List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"), OffsetDateTime.parse("2021-02-02T11:30:00+01:00")); - assertEquals(times, service.listOffsetDateTimeBodyParam(times)); + assertEquals(times, service.listOffsetDateTimeBodyParam(times).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listOffsetDateTimeBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listOffsetDateTimeBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeBodyParamOpt_defined(ListBodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listOffsetDateTimeBodyParamOpt(List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")))); + service.listOffsetDateTimeBodyParamOpt(List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))) + .orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listOffsetDateTimeBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listOffsetDateTimeBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeBodyParamNil_defined(ListBodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listOffsetDateTimeBodyParamNil(List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")))); + service.listOffsetDateTimeBodyParamNil(List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))) + .orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listOffsetDateTimeBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listOffsetDateTimeBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listOffsetDateTimeBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listOffsetDateTimeBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeBodyParamOptNil_defined(ListBodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listOffsetDateTimeBodyParamOptNil(List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")))); + service.listOffsetDateTimeBodyParamOptNil(List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))) + .orThrow()); } // --- ZonedDateTime --- @@ -617,52 +627,53 @@ public void listOffsetDateTimeBodyParamOptNil_defined(ListBodyParameterTypesServ @MethodSource("serviceProvider") public void listZonedDateTimeBodyParam(ListBodyParameterTypesService service) { var zdts = List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z"), ZonedDateTime.parse("2025-06-15T12:00:00Z")); - assertEquals(zdts, service.listZonedDateTimeBodyParam(zdts)); + assertEquals(zdts, service.listZonedDateTimeBodyParam(zdts).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listZonedDateTimeBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listZonedDateTimeBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeBodyParamOpt_defined(ListBodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listZonedDateTimeBodyParamOpt(List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z")))); + service.listZonedDateTimeBodyParamOpt(List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listZonedDateTimeBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listZonedDateTimeBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeBodyParamNil_defined(ListBodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listZonedDateTimeBodyParamNil(List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z")))); + service.listZonedDateTimeBodyParamNil(List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listZonedDateTimeBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listZonedDateTimeBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listZonedDateTimeBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listZonedDateTimeBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeBodyParamOptNil_defined(ListBodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listZonedDateTimeBodyParamOptNil(List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z")))); + service.listZonedDateTimeBodyParamOptNil(List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z"))) + .orThrow()); } // --- Scalar (ZoneId) --- @@ -671,49 +682,50 @@ public void listZonedDateTimeBodyParamOptNil_defined(ListBodyParameterTypesServi @MethodSource("serviceProvider") public void listScalarBodyParam(ListBodyParameterTypesService service) { var zoneIds = List.of(ZoneId.of("Europe/Vienna"), ZoneId.of("UTC")); - assertEquals(zoneIds, service.listScalarBodyParam(zoneIds)); + assertEquals(zoneIds, service.listScalarBodyParam(zoneIds).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listScalarBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listScalarBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarBodyParamOpt_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listScalarBodyParamOpt(List.of(ZoneId.of("Europe/Vienna")))); + assertEquals(NilResult.DEFINED, service.listScalarBodyParamOpt(List.of(ZoneId.of("Europe/Vienna"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listScalarBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listScalarBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarBodyParamNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listScalarBodyParamNil(List.of(ZoneId.of("Europe/Vienna")))); + assertEquals(NilResult.DEFINED, service.listScalarBodyParamNil(List.of(ZoneId.of("Europe/Vienna"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listScalarBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listScalarBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listScalarBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listScalarBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarBodyParamOptNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listScalarBodyParamOptNil(List.of(ZoneId.of("Europe/Vienna")))); + assertEquals(NilResult.DEFINED, + service.listScalarBodyParamOptNil(List.of(ZoneId.of("Europe/Vienna"))).orThrow()); } // --- Enum --- @@ -722,49 +734,49 @@ public void listScalarBodyParamOptNil_defined(ListBodyParameterTypesService serv @MethodSource("serviceProvider") public void listEnumBodyParam(ListBodyParameterTypesService service) { assertEquals(List.of(SampleEnum.A, SampleEnum.B), - service.listEnumBodyParam(List.of(SampleEnum.A, SampleEnum.B))); + service.listEnumBodyParam(List.of(SampleEnum.A, SampleEnum.B)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listEnumBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listEnumBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumBodyParamOpt_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listEnumBodyParamOpt(List.of(SampleEnum.B))); + assertEquals(NilResult.DEFINED, service.listEnumBodyParamOpt(List.of(SampleEnum.B)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listEnumBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listEnumBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumBodyParamNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listEnumBodyParamNil(List.of(SampleEnum.A))); + assertEquals(NilResult.DEFINED, service.listEnumBodyParamNil(List.of(SampleEnum.A)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listEnumBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listEnumBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listEnumBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listEnumBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumBodyParamOptNil_defined(ListBodyParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listEnumBodyParamOptNil(List.of(SampleEnum.B))); + assertEquals(NilResult.DEFINED, service.listEnumBodyParamOptNil(List.of(SampleEnum.B)).orThrow()); } // --- Inline Enum --- @@ -773,52 +785,53 @@ public void listEnumBodyParamOptNil_defined(ListBodyParameterTypesService servic @MethodSource("serviceProvider") public void listInlineEnumBodyParam(ListBodyParameterTypesService service) { assertEquals(List.of(ListInlineEnumBodyParam_Result$.A), - service.listInlineEnumBodyParam(List.of(ListInlineEnumBodyParam_BodyEnum_Param$.A))); + service.listInlineEnumBodyParam(List.of(ListInlineEnumBodyParam_BodyEnum_Param$.A)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listInlineEnumBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listInlineEnumBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumBodyParamOpt_defined(ListBodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listInlineEnumBodyParamOpt(List.of(ListInlineEnumBodyParamOpt_BodyEnum_Param$.A))); + service.listInlineEnumBodyParamOpt(List.of(ListInlineEnumBodyParamOpt_BodyEnum_Param$.A)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listInlineEnumBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listInlineEnumBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumBodyParamNil_defined(ListBodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listInlineEnumBodyParamNil(List.of(ListInlineEnumBodyParamNil_BodyEnum_Param$.C))); + service.listInlineEnumBodyParamNil(List.of(ListInlineEnumBodyParamNil_BodyEnum_Param$.C)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listInlineEnumBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listInlineEnumBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listInlineEnumBodyParamOptNil(null)); + assertEquals(NilResult.NULL, service.listInlineEnumBodyParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumBodyParamOptNil_defined(ListBodyParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listInlineEnumBodyParamOptNil(List.of(ListInlineEnumBodyParamOptNil_BodyEnum_Param$.D))); + service.listInlineEnumBodyParamOptNil(List.of(ListInlineEnumBodyParamOptNil_BodyEnum_Param$.D)) + .orThrow()); } // --- List Multi Body Param --- @@ -827,28 +840,29 @@ public void listInlineEnumBodyParamOptNil_defined(ListBodyParameterTypesService @MethodSource("serviceProvider") public void listMultiBodyParam(ListBodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals("hello-42-k", service.listMultiBodyParam(List.of("hello"), List.of(42), List.of(record))); + assertEquals("hello-42-k", + service.listMultiBodyParam(List.of("hello"), List.of(42), List.of(record)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiBodyParamOpt_allUndefined(ListBodyParameterTypesService service) { assertEquals(List.of(NilResult.UNDEFINED, NilResult.UNDEFINED, NilResult.UNDEFINED), - service.listMultiBodyParamOpt()); + service.listMultiBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiBodyParamOpt_valueAOnly(ListBodyParameterTypesService service) { assertEquals(List.of(NilResult.DEFINED, NilResult.UNDEFINED, NilResult.UNDEFINED), - service.listMultiBodyParamOpt(List.of("hello"))); + service.listMultiBodyParamOpt(List.of("hello")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiBodyParamOpt_valueAAndB(ListBodyParameterTypesService service) { assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED, NilResult.UNDEFINED), - service.listMultiBodyParamOpt(List.of("hello"), List.of(42))); + service.listMultiBodyParamOpt(List.of("hello"), List.of(42)).orThrow()); } @ParameterizedTest @@ -856,14 +870,14 @@ public void listMultiBodyParamOpt_valueAAndB(ListBodyParameterTypesService servi public void listMultiBodyParamOpt_allDefined(ListBodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED, NilResult.DEFINED), - service.listMultiBodyParamOpt(List.of("hello"), List.of(42), List.of(record))); + service.listMultiBodyParamOpt(List.of("hello"), List.of(42), List.of(record)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiBodyParamNil_allNull(ListBodyParameterTypesService service) { assertEquals(List.of(NilResult.NULL, NilResult.NULL, NilResult.NULL), - service.listMultiBodyParamNil(null, null, null)); + service.listMultiBodyParamNil(null, null, null).orThrow()); } @ParameterizedTest @@ -871,21 +885,21 @@ public void listMultiBodyParamNil_allNull(ListBodyParameterTypesService service) public void listMultiBodyParamNil_allDefined(ListBodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED, NilResult.DEFINED), - service.listMultiBodyParamNil(List.of("hello"), List.of(42), List.of(record))); + service.listMultiBodyParamNil(List.of("hello"), List.of(42), List.of(record)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiBodyParamOptNil_allUndefined(ListBodyParameterTypesService service) { assertEquals(List.of(NilResult.UNDEFINED, NilResult.UNDEFINED, NilResult.UNDEFINED), - service.listMultiBodyParamOptNil()); + service.listMultiBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiBodyParamOptNil_valueANull(ListBodyParameterTypesService service) { assertEquals(List.of(NilResult.NULL, NilResult.UNDEFINED, NilResult.UNDEFINED), - service.listMultiBodyParamOptNil((List) null)); + service.listMultiBodyParamOptNil((List) null).orThrow()); } @ParameterizedTest @@ -893,7 +907,7 @@ public void listMultiBodyParamOptNil_valueANull(ListBodyParameterTypesService se public void listMultiBodyParamOptNil_allNull(ListBodyParameterTypesService service) { assertEquals(List.of(NilResult.NULL, NilResult.NULL, NilResult.NULL), service.listMultiBodyParamOptNil((List) null, (List) null, - (List) null)); + (List) null).orThrow()); } @ParameterizedTest @@ -901,7 +915,7 @@ public void listMultiBodyParamOptNil_allNull(ListBodyParameterTypesService servi public void listMultiBodyParamOptNil_allDefined(ListBodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED, NilResult.DEFINED), - service.listMultiBodyParamOptNil(List.of("hello"), List.of(42), List.of(record))); + service.listMultiBodyParamOptNil(List.of("hello"), List.of(42), List.of(record)).orThrow()); } // --- List Record Body Param --- @@ -910,7 +924,7 @@ var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").v @MethodSource("serviceProvider") public void listRecordBodyParam(ListBodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - var result = service.listRecordBodyParam(List.of(record)); + var result = service.listRecordBodyParam(List.of(record)).orThrow(); assertEquals(1, result.size()); assertEquals("k", result.get(0).key()); assertEquals("1", result.get(0).version()); @@ -920,46 +934,46 @@ var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").v @ParameterizedTest @MethodSource("serviceProvider") public void listRecordBodyParamOpt_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listRecordBodyParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listRecordBodyParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listRecordBodyParamOpt_defined(ListBodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.listRecordBodyParamOpt(List.of(record))); + assertEquals(NilResult.DEFINED, service.listRecordBodyParamOpt(List.of(record)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listRecordBodyParamNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listRecordBodyParamNil(null)); + assertEquals(NilResult.NULL, service.listRecordBodyParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listRecordBodyParamNil_defined(ListBodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.listRecordBodyParamNil(List.of(record))); + assertEquals(NilResult.DEFINED, service.listRecordBodyParamNil(List.of(record)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listRecordBodyParamOptNil_undefined(ListBodyParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listRecordBodyParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listRecordBodyParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listRecordBodyParamOptNil_null(ListBodyParameterTypesService service) { - assertEquals(NilResult.NULL, service.listRecordBodyParamOptNil((List) null)); + assertEquals(NilResult.NULL, service.listRecordBodyParamOptNil((List) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listRecordBodyParamOptNil_defined(ListBodyParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.listRecordBodyParamOptNil(List.of(record))); + assertEquals(NilResult.DEFINED, service.listRecordBodyParamOptNil(List.of(record)).orThrow()); } } diff --git a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListHeaderParameterTypesServiceTest.java b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListHeaderParameterTypesServiceTest.java index b4ec118d..40f8c896 100644 --- a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListHeaderParameterTypesServiceTest.java +++ b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListHeaderParameterTypesServiceTest.java @@ -56,49 +56,49 @@ static ListHeaderParameterTypesService[] serviceProvider() { @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanHeaderParam(ListHeaderParameterTypesService service) { - assertEquals(List.of(true, false, true), service.listBooleanHeaderParam(List.of(true, false, true))); + assertEquals(List.of(true, false, true), service.listBooleanHeaderParam(List.of(true, false, true)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listBooleanHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listBooleanHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanHeaderParamOpt_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listBooleanHeaderParamOpt(List.of(true, false))); + assertEquals(NilResult.DEFINED, service.listBooleanHeaderParamOpt(List.of(true, false)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listBooleanHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listBooleanHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanHeaderParamNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listBooleanHeaderParamNil(List.of(true, false))); + assertEquals(NilResult.DEFINED, service.listBooleanHeaderParamNil(List.of(true, false)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listBooleanHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listBooleanHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listBooleanHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listBooleanHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listBooleanHeaderParamOptNil(List.of(true, false))); + assertEquals(NilResult.DEFINED, service.listBooleanHeaderParamOptNil(List.of(true, false)).orThrow()); } // --- Short --- @@ -107,49 +107,49 @@ public void listBooleanHeaderParamOptNil_defined(ListHeaderParameterTypesService @MethodSource("serviceProvider") public void listShortHeaderParam(ListHeaderParameterTypesService service) { assertEquals(List.of((short) 1, (short) 2, (short) 42), - service.listShortHeaderParam(List.of((short) 1, (short) 2, (short) 42))); + service.listShortHeaderParam(List.of((short) 1, (short) 2, (short) 42)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listShortHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listShortHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortHeaderParamOpt_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listShortHeaderParamOpt(List.of((short) 1, (short) 42))); + assertEquals(NilResult.DEFINED, service.listShortHeaderParamOpt(List.of((short) 1, (short) 42)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listShortHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listShortHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortHeaderParamNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listShortHeaderParamNil(List.of((short) 1, (short) 42))); + assertEquals(NilResult.DEFINED, service.listShortHeaderParamNil(List.of((short) 1, (short) 42)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listShortHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listShortHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listShortHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listShortHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShortHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listShortHeaderParamOptNil(List.of((short) 1, (short) 42))); + assertEquals(NilResult.DEFINED, service.listShortHeaderParamOptNil(List.of((short) 1, (short) 42)).orThrow()); } // --- Int --- @@ -157,49 +157,49 @@ public void listShortHeaderParamOptNil_defined(ListHeaderParameterTypesService s @ParameterizedTest @MethodSource("serviceProvider") public void listIntHeaderParam(ListHeaderParameterTypesService service) { - assertEquals(List.of(1, 2, 123456), service.listIntHeaderParam(List.of(1, 2, 123456))); + assertEquals(List.of(1, 2, 123456), service.listIntHeaderParam(List.of(1, 2, 123456)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listIntHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listIntHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntHeaderParamOpt_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listIntHeaderParamOpt(List.of(1, 123456))); + assertEquals(NilResult.DEFINED, service.listIntHeaderParamOpt(List.of(1, 123456)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listIntHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listIntHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntHeaderParamNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listIntHeaderParamNil(List.of(1, 123456))); + assertEquals(NilResult.DEFINED, service.listIntHeaderParamNil(List.of(1, 123456)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listIntHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listIntHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listIntHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listIntHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listIntHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listIntHeaderParamOptNil(List.of(1, 123456))); + assertEquals(NilResult.DEFINED, service.listIntHeaderParamOptNil(List.of(1, 123456)).orThrow()); } // --- Long --- @@ -207,49 +207,50 @@ public void listIntHeaderParamOptNil_defined(ListHeaderParameterTypesService ser @ParameterizedTest @MethodSource("serviceProvider") public void listLongHeaderParam(ListHeaderParameterTypesService service) { - assertEquals(List.of(1L, 2L, 1234567890123L), service.listLongHeaderParam(List.of(1L, 2L, 1234567890123L))); + assertEquals(List.of(1L, 2L, 1234567890123L), + service.listLongHeaderParam(List.of(1L, 2L, 1234567890123L)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLongHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listLongHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongHeaderParamOpt_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLongHeaderParamOpt(List.of(1L, 1234567890123L))); + assertEquals(NilResult.DEFINED, service.listLongHeaderParamOpt(List.of(1L, 1234567890123L)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLongHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listLongHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongHeaderParamNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLongHeaderParamNil(List.of(1L, 1234567890123L))); + assertEquals(NilResult.DEFINED, service.listLongHeaderParamNil(List.of(1L, 1234567890123L)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLongHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listLongHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLongHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listLongHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLongHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLongHeaderParamOptNil(List.of(1L, 1234567890123L))); + assertEquals(NilResult.DEFINED, service.listLongHeaderParamOptNil(List.of(1L, 1234567890123L)).orThrow()); } // --- Float --- @@ -257,49 +258,50 @@ public void listLongHeaderParamOptNil_defined(ListHeaderParameterTypesService se @ParameterizedTest @MethodSource("serviceProvider") public void listFloatHeaderParam(ListHeaderParameterTypesService service) { - assertEquals(List.of(1.1f, 2.2f, 123.45f), service.listFloatHeaderParam(List.of(1.1f, 2.2f, 123.45f))); + assertEquals(List.of(1.1f, 2.2f, 123.45f), + service.listFloatHeaderParam(List.of(1.1f, 2.2f, 123.45f)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listFloatHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listFloatHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatHeaderParamOpt_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listFloatHeaderParamOpt(List.of(1.1f, 123.45f))); + assertEquals(NilResult.DEFINED, service.listFloatHeaderParamOpt(List.of(1.1f, 123.45f)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listFloatHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listFloatHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatHeaderParamNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listFloatHeaderParamNil(List.of(1.1f, 123.45f))); + assertEquals(NilResult.DEFINED, service.listFloatHeaderParamNil(List.of(1.1f, 123.45f)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listFloatHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listFloatHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listFloatHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listFloatHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloatHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listFloatHeaderParamOptNil(List.of(1.1f, 123.45f))); + assertEquals(NilResult.DEFINED, service.listFloatHeaderParamOptNil(List.of(1.1f, 123.45f)).orThrow()); } // --- Double --- @@ -307,49 +309,50 @@ public void listFloatHeaderParamOptNil_defined(ListHeaderParameterTypesService s @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleHeaderParam(ListHeaderParameterTypesService service) { - assertEquals(List.of(1.1, 2.2, 123.456789), service.listDoubleHeaderParam(List.of(1.1, 2.2, 123.456789))); + assertEquals(List.of(1.1, 2.2, 123.456789), + service.listDoubleHeaderParam(List.of(1.1, 2.2, 123.456789)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listDoubleHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listDoubleHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleHeaderParamOpt_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listDoubleHeaderParamOpt(List.of(1.1, 123.456789))); + assertEquals(NilResult.DEFINED, service.listDoubleHeaderParamOpt(List.of(1.1, 123.456789)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listDoubleHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listDoubleHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleHeaderParamNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listDoubleHeaderParamNil(List.of(1.1, 123.456789))); + assertEquals(NilResult.DEFINED, service.listDoubleHeaderParamNil(List.of(1.1, 123.456789)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listDoubleHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listDoubleHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listDoubleHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listDoubleHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listDoubleHeaderParamOptNil(List.of(1.1, 123.456789))); + assertEquals(NilResult.DEFINED, service.listDoubleHeaderParamOptNil(List.of(1.1, 123.456789)).orThrow()); } // --- String --- @@ -357,49 +360,49 @@ public void listDoubleHeaderParamOptNil_defined(ListHeaderParameterTypesService @ParameterizedTest @MethodSource("serviceProvider") public void listStringHeaderParam(ListHeaderParameterTypesService service) { - assertEquals(List.of("hello", "world"), service.listStringHeaderParam(List.of("hello", "world"))); + assertEquals(List.of("hello", "world"), service.listStringHeaderParam(List.of("hello", "world")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listStringHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listStringHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringHeaderParamOpt_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listStringHeaderParamOpt(List.of("hello", "world"))); + assertEquals(NilResult.DEFINED, service.listStringHeaderParamOpt(List.of("hello", "world")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listStringHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listStringHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringHeaderParamNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listStringHeaderParamNil(List.of("hello", "world"))); + assertEquals(NilResult.DEFINED, service.listStringHeaderParamNil(List.of("hello", "world")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listStringHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listStringHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listStringHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listStringHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listStringHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listStringHeaderParamOptNil(List.of("hello", "world"))); + assertEquals(NilResult.DEFINED, service.listStringHeaderParamOptNil(List.of("hello", "world")).orThrow()); } // --- LocalDate --- @@ -408,49 +411,52 @@ public void listStringHeaderParamOptNil_defined(ListHeaderParameterTypesService @MethodSource("serviceProvider") public void listLocalDateHeaderParam(ListHeaderParameterTypesService service) { var dates = List.of(LocalDate.parse("2020-01-01"), LocalDate.parse("2021-06-15")); - assertEquals(dates, service.listLocalDateHeaderParam(dates)); + assertEquals(dates, service.listLocalDateHeaderParam(dates).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLocalDateHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listLocalDateHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateHeaderParamOpt_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLocalDateHeaderParamOpt(List.of(LocalDate.parse("2020-01-01")))); + assertEquals(NilResult.DEFINED, + service.listLocalDateHeaderParamOpt(List.of(LocalDate.parse("2020-01-01"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLocalDateHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listLocalDateHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateHeaderParamNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLocalDateHeaderParamNil(List.of(LocalDate.parse("2020-01-01")))); + assertEquals(NilResult.DEFINED, + service.listLocalDateHeaderParamNil(List.of(LocalDate.parse("2020-01-01"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLocalDateHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listLocalDateHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLocalDateHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listLocalDateHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLocalDateHeaderParamOptNil(List.of(LocalDate.parse("2020-01-01")))); + assertEquals(NilResult.DEFINED, + service.listLocalDateHeaderParamOptNil(List.of(LocalDate.parse("2020-01-01"))).orThrow()); } // --- LocalDateTime --- @@ -459,52 +465,52 @@ public void listLocalDateHeaderParamOptNil_defined(ListHeaderParameterTypesServi @MethodSource("serviceProvider") public void listLocalDateTimeHeaderParam(ListHeaderParameterTypesService service) { var dateTimes = List.of(LocalDateTime.parse("2020-01-01T10:00"), LocalDateTime.parse("2021-06-15T12:30")); - assertEquals(dateTimes, service.listLocalDateTimeHeaderParam(dateTimes)); + assertEquals(dateTimes, service.listLocalDateTimeHeaderParam(dateTimes).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLocalDateTimeHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listLocalDateTimeHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeHeaderParamOpt_defined(ListHeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listLocalDateTimeHeaderParamOpt(List.of(LocalDateTime.parse("2020-01-01T10:00")))); + service.listLocalDateTimeHeaderParamOpt(List.of(LocalDateTime.parse("2020-01-01T10:00"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLocalDateTimeHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listLocalDateTimeHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeHeaderParamNil_defined(ListHeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listLocalDateTimeHeaderParamNil(List.of(LocalDateTime.parse("2020-01-01T10:00")))); + service.listLocalDateTimeHeaderParamNil(List.of(LocalDateTime.parse("2020-01-01T10:00"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLocalDateTimeHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listLocalDateTimeHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLocalDateTimeHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listLocalDateTimeHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalDateTimeHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listLocalDateTimeHeaderParamOptNil(List.of(LocalDateTime.parse("2020-01-01T10:00")))); + service.listLocalDateTimeHeaderParamOptNil(List.of(LocalDateTime.parse("2020-01-01T10:00"))).orThrow()); } // --- LocalTime --- @@ -513,49 +519,52 @@ public void listLocalDateTimeHeaderParamOptNil_defined(ListHeaderParameterTypesS @MethodSource("serviceProvider") public void listLocalTimeHeaderParam(ListHeaderParameterTypesService service) { var times = List.of(LocalTime.parse("10:00:00"), LocalTime.parse("11:30:00")); - assertEquals(times, service.listLocalTimeHeaderParam(times)); + assertEquals(times, service.listLocalTimeHeaderParam(times).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLocalTimeHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listLocalTimeHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeHeaderParamOpt_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLocalTimeHeaderParamOpt(List.of(LocalTime.parse("10:00:00")))); + assertEquals(NilResult.DEFINED, + service.listLocalTimeHeaderParamOpt(List.of(LocalTime.parse("10:00:00"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLocalTimeHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listLocalTimeHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeHeaderParamNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLocalTimeHeaderParamNil(List.of(LocalTime.parse("10:00:00")))); + assertEquals(NilResult.DEFINED, + service.listLocalTimeHeaderParamNil(List.of(LocalTime.parse("10:00:00"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listLocalTimeHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listLocalTimeHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listLocalTimeHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listLocalTimeHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLocalTimeHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listLocalTimeHeaderParamOptNil(List.of(LocalTime.parse("10:00:00")))); + assertEquals(NilResult.DEFINED, + service.listLocalTimeHeaderParamOptNil(List.of(LocalTime.parse("10:00:00"))).orThrow()); } // --- OffsetDateTime --- @@ -564,52 +573,55 @@ public void listLocalTimeHeaderParamOptNil_defined(ListHeaderParameterTypesServi public void listOffsetDateTimeHeaderParam(ListHeaderParameterTypesService service) { var times = List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"), OffsetDateTime.parse("2021-02-02T11:30:00+01:00")); - assertEquals(times, service.listOffsetDateTimeHeaderParam(times)); + assertEquals(times, service.listOffsetDateTimeHeaderParam(times).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listOffsetDateTimeHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listOffsetDateTimeHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeHeaderParamOpt_defined(ListHeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listOffsetDateTimeHeaderParamOpt(List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")))); + service.listOffsetDateTimeHeaderParamOpt(List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))) + .orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listOffsetDateTimeHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listOffsetDateTimeHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeHeaderParamNil_defined(ListHeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listOffsetDateTimeHeaderParamNil(List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")))); + service.listOffsetDateTimeHeaderParamNil(List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))) + .orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listOffsetDateTimeHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listOffsetDateTimeHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listOffsetDateTimeHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listOffsetDateTimeHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listOffsetDateTimeHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, service - .listOffsetDateTimeHeaderParamOptNil(List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")))); + .listOffsetDateTimeHeaderParamOptNil(List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))) + .orThrow()); } // --- ZonedDateTime --- @@ -618,52 +630,55 @@ public void listOffsetDateTimeHeaderParamOptNil_defined(ListHeaderParameterTypes @MethodSource("serviceProvider") public void listZonedDateTimeHeaderParam(ListHeaderParameterTypesService service) { var zdts = List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z"), ZonedDateTime.parse("2025-06-15T12:00:00Z")); - assertEquals(zdts, service.listZonedDateTimeHeaderParam(zdts)); + assertEquals(zdts, service.listZonedDateTimeHeaderParam(zdts).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listZonedDateTimeHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listZonedDateTimeHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeHeaderParamOpt_defined(ListHeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listZonedDateTimeHeaderParamOpt(List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z")))); + service.listZonedDateTimeHeaderParamOpt(List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z"))) + .orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listZonedDateTimeHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listZonedDateTimeHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeHeaderParamNil_defined(ListHeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listZonedDateTimeHeaderParamNil(List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z")))); + service.listZonedDateTimeHeaderParamNil(List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z"))) + .orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listZonedDateTimeHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listZonedDateTimeHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listZonedDateTimeHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listZonedDateTimeHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listZonedDateTimeHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listZonedDateTimeHeaderParamOptNil(List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z")))); + service.listZonedDateTimeHeaderParamOptNil(List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z"))) + .orThrow()); } // --- Scalar (ZoneId) --- @@ -672,49 +687,52 @@ public void listZonedDateTimeHeaderParamOptNil_defined(ListHeaderParameterTypesS @MethodSource("serviceProvider") public void listScalarHeaderParam(ListHeaderParameterTypesService service) { var zoneIds = List.of(ZoneId.of("Europe/Vienna"), ZoneId.of("UTC")); - assertEquals(zoneIds, service.listScalarHeaderParam(zoneIds)); + assertEquals(zoneIds, service.listScalarHeaderParam(zoneIds).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listScalarHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listScalarHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarHeaderParamOpt_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listScalarHeaderParamOpt(List.of(ZoneId.of("Europe/Vienna")))); + assertEquals(NilResult.DEFINED, + service.listScalarHeaderParamOpt(List.of(ZoneId.of("Europe/Vienna"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listScalarHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listScalarHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarHeaderParamNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listScalarHeaderParamNil(List.of(ZoneId.of("Europe/Vienna")))); + assertEquals(NilResult.DEFINED, + service.listScalarHeaderParamNil(List.of(ZoneId.of("Europe/Vienna"))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listScalarHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listScalarHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listScalarHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listScalarHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listScalarHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listScalarHeaderParamOptNil(List.of(ZoneId.of("Europe/Vienna")))); + assertEquals(NilResult.DEFINED, + service.listScalarHeaderParamOptNil(List.of(ZoneId.of("Europe/Vienna"))).orThrow()); } // --- Enum --- @@ -723,49 +741,49 @@ public void listScalarHeaderParamOptNil_defined(ListHeaderParameterTypesService @MethodSource("serviceProvider") public void listEnumHeaderParam(ListHeaderParameterTypesService service) { assertEquals(List.of(SampleEnum.A, SampleEnum.B), - service.listEnumHeaderParam(List.of(SampleEnum.A, SampleEnum.B))); + service.listEnumHeaderParam(List.of(SampleEnum.A, SampleEnum.B)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listEnumHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listEnumHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumHeaderParamOpt_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listEnumHeaderParamOpt(List.of(SampleEnum.A))); + assertEquals(NilResult.DEFINED, service.listEnumHeaderParamOpt(List.of(SampleEnum.A)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listEnumHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listEnumHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumHeaderParamNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listEnumHeaderParamNil(List.of(SampleEnum.B))); + assertEquals(NilResult.DEFINED, service.listEnumHeaderParamNil(List.of(SampleEnum.B)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listEnumHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listEnumHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listEnumHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listEnumHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnumHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.listEnumHeaderParamOptNil(List.of(SampleEnum.A))); + assertEquals(NilResult.DEFINED, service.listEnumHeaderParamOptNil(List.of(SampleEnum.A)).orThrow()); } // --- Inline Enum --- @@ -774,52 +792,55 @@ public void listEnumHeaderParamOptNil_defined(ListHeaderParameterTypesService se @MethodSource("serviceProvider") public void listInlineEnumHeaderParam(ListHeaderParameterTypesService service) { assertEquals(List.of(ListInlineEnumHeaderParam_Result$.A), - service.listInlineEnumHeaderParam(List.of(ListInlineEnumHeaderParam_HeaderValue_Param$.A))); + service.listInlineEnumHeaderParam(List.of(ListInlineEnumHeaderParam_HeaderValue_Param$.A)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listInlineEnumHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listInlineEnumHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumHeaderParamOpt_defined(ListHeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listInlineEnumHeaderParamOpt(List.of(ListInlineEnumHeaderParamOpt_HeaderValue_Param$.A))); + service.listInlineEnumHeaderParamOpt(List.of(ListInlineEnumHeaderParamOpt_HeaderValue_Param$.A)) + .orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listInlineEnumHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listInlineEnumHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumHeaderParamNil_defined(ListHeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listInlineEnumHeaderParamNil(List.of(ListInlineEnumHeaderParamNil_HeaderValue_Param$.C))); + service.listInlineEnumHeaderParamNil(List.of(ListInlineEnumHeaderParamNil_HeaderValue_Param$.C)) + .orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listInlineEnumHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listInlineEnumHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listInlineEnumHeaderParamOptNil(null)); + assertEquals(NilResult.NULL, service.listInlineEnumHeaderParamOptNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInlineEnumHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.listInlineEnumHeaderParamOptNil(List.of(ListInlineEnumHeaderParamOptNil_HeaderValue_Param$.D))); + service.listInlineEnumHeaderParamOptNil(List.of(ListInlineEnumHeaderParamOptNil_HeaderValue_Param$.D)) + .orThrow()); } // --- Multi List Header Param --- @@ -828,28 +849,29 @@ public void listInlineEnumHeaderParamOptNil_defined(ListHeaderParameterTypesServ @MethodSource("serviceProvider") public void listMultiHeaderParam(ListHeaderParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals("hello-42-k", service.listMultiHeaderParam(List.of("hello"), List.of(42), List.of(record))); + assertEquals("hello-42-k", + service.listMultiHeaderParam(List.of("hello"), List.of(42), List.of(record)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiHeaderParamOpt_allUndefined(ListHeaderParameterTypesService service) { assertEquals(List.of(NilResult.UNDEFINED, NilResult.UNDEFINED, NilResult.UNDEFINED), - service.listMultiHeaderParamOpt()); + service.listMultiHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiHeaderParamOpt_valueAOnly(ListHeaderParameterTypesService service) { assertEquals(List.of(NilResult.DEFINED, NilResult.UNDEFINED, NilResult.UNDEFINED), - service.listMultiHeaderParamOpt(List.of("hello"))); + service.listMultiHeaderParamOpt(List.of("hello")).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiHeaderParamOpt_valueAAndB(ListHeaderParameterTypesService service) { assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED, NilResult.UNDEFINED), - service.listMultiHeaderParamOpt(List.of("hello"), List.of(42))); + service.listMultiHeaderParamOpt(List.of("hello"), List.of(42)).orThrow()); } @ParameterizedTest @@ -857,7 +879,7 @@ public void listMultiHeaderParamOpt_valueAAndB(ListHeaderParameterTypesService s public void listMultiHeaderParamOpt_allDefined(ListHeaderParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED, NilResult.DEFINED), - service.listMultiHeaderParamOpt(List.of("hello"), List.of(42), List.of(record))); + service.listMultiHeaderParamOpt(List.of("hello"), List.of(42), List.of(record)).orThrow()); } @ParameterizedTest @@ -865,35 +887,35 @@ var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").v public void listMultiHeaderParamNil_allDefined(ListHeaderParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED, NilResult.DEFINED), - service.listMultiHeaderParamNil(List.of("hello"), List.of(42), List.of(record))); + service.listMultiHeaderParamNil(List.of("hello"), List.of(42), List.of(record)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiHeaderParamNil_allNull(ListHeaderParameterTypesService service) { assertEquals(List.of(NilResult.NULL, NilResult.NULL, NilResult.NULL), - service.listMultiHeaderParamNil(null, null, null)); + service.listMultiHeaderParamNil(null, null, null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiHeaderParamOptNil_allUndefined(ListHeaderParameterTypesService service) { assertEquals(List.of(NilResult.UNDEFINED, NilResult.UNDEFINED, NilResult.UNDEFINED), - service.listMultiHeaderParamOptNil()); + service.listMultiHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiHeaderParamOptNil_valueANull(ListHeaderParameterTypesService service) { assertEquals(List.of(NilResult.NULL, NilResult.UNDEFINED, NilResult.UNDEFINED), - service.listMultiHeaderParamOptNil((List) null)); + service.listMultiHeaderParamOptNil((List) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listMultiHeaderParamOptNil_valueAAndBNull(ListHeaderParameterTypesService service) { assertEquals(List.of(NilResult.NULL, NilResult.NULL, NilResult.UNDEFINED), - service.listMultiHeaderParamOptNil((List) null, (List) null)); + service.listMultiHeaderParamOptNil((List) null, (List) null).orThrow()); } @ParameterizedTest @@ -901,7 +923,7 @@ public void listMultiHeaderParamOptNil_valueAAndBNull(ListHeaderParameterTypesSe public void listMultiHeaderParamOptNil_allDefined(ListHeaderParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); assertEquals(List.of(NilResult.DEFINED, NilResult.DEFINED, NilResult.DEFINED), - service.listMultiHeaderParamOptNil(List.of("hello"), List.of(42), List.of(record))); + service.listMultiHeaderParamOptNil(List.of("hello"), List.of(42), List.of(record)).orThrow()); } // --- Record List Header Param --- @@ -910,7 +932,7 @@ var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").v @MethodSource("serviceProvider") public void listRecordHeaderParam(ListHeaderParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - var result = service.listRecordHeaderParam(List.of(record)); + var result = service.listRecordHeaderParam(List.of(record)).orThrow(); assertEquals(1, result.size()); assertEquals("k", result.get(0).key()); assertEquals("1", result.get(0).version()); @@ -920,46 +942,46 @@ var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").v @ParameterizedTest @MethodSource("serviceProvider") public void listRecordHeaderParamOpt_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listRecordHeaderParamOpt()); + assertEquals(NilResult.UNDEFINED, service.listRecordHeaderParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listRecordHeaderParamOpt_defined(ListHeaderParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.listRecordHeaderParamOpt(List.of(record))); + assertEquals(NilResult.DEFINED, service.listRecordHeaderParamOpt(List.of(record)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listRecordHeaderParamNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listRecordHeaderParamNil(null)); + assertEquals(NilResult.NULL, service.listRecordHeaderParamNil(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listRecordHeaderParamNil_defined(ListHeaderParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.listRecordHeaderParamNil(List.of(record))); + assertEquals(NilResult.DEFINED, service.listRecordHeaderParamNil(List.of(record)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listRecordHeaderParamOptNil_undefined(ListHeaderParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.listRecordHeaderParamOptNil()); + assertEquals(NilResult.UNDEFINED, service.listRecordHeaderParamOptNil().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listRecordHeaderParamOptNil_null(ListHeaderParameterTypesService service) { - assertEquals(NilResult.NULL, service.listRecordHeaderParamOptNil((List) null)); + assertEquals(NilResult.NULL, service.listRecordHeaderParamOptNil((List) null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listRecordHeaderParamOptNil_defined(ListHeaderParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.listRecordHeaderParamOptNil(List.of(record))); + assertEquals(NilResult.DEFINED, service.listRecordHeaderParamOptNil(List.of(record)).orThrow()); } } diff --git a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListQueryParameterTypesServiceTest.java b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListQueryParameterTypesServiceTest.java index 4a839d39..cc1d57b3 100644 --- a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListQueryParameterTypesServiceTest.java +++ b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListQueryParameterTypesServiceTest.java @@ -52,7 +52,7 @@ static ListQueryParameterTypesService[] serviceProvider() { @ParameterizedTest @MethodSource("serviceProvider") public void listBooleanQueryParam(ListQueryParameterTypesService service) { - assertEquals(List.of(true, false, true), service.listBooleanQueryParam(List.of(true, false, true))); + assertEquals(List.of(true, false, true), service.listBooleanQueryParam(List.of(true, false, true)).orThrow()); } // --- Short --- @@ -61,7 +61,7 @@ public void listBooleanQueryParam(ListQueryParameterTypesService service) { @MethodSource("serviceProvider") public void listShortQueryParam(ListQueryParameterTypesService service) { assertEquals(List.of((short) 1, (short) 2, (short) 42), - service.listShortQueryParam(List.of((short) 1, (short) 2, (short) 42))); + service.listShortQueryParam(List.of((short) 1, (short) 2, (short) 42)).orThrow()); } // --- Int --- @@ -69,7 +69,7 @@ public void listShortQueryParam(ListQueryParameterTypesService service) { @ParameterizedTest @MethodSource("serviceProvider") public void listIntQueryParam(ListQueryParameterTypesService service) { - assertEquals(List.of(1, 2, 123456), service.listIntQueryParam(List.of(1, 2, 123456))); + assertEquals(List.of(1, 2, 123456), service.listIntQueryParam(List.of(1, 2, 123456)).orThrow()); } // --- Long --- @@ -77,7 +77,8 @@ public void listIntQueryParam(ListQueryParameterTypesService service) { @ParameterizedTest @MethodSource("serviceProvider") public void listLongQueryParam(ListQueryParameterTypesService service) { - assertEquals(List.of(1L, 2L, 1234567890123L), service.listLongQueryParam(List.of(1L, 2L, 1234567890123L))); + assertEquals(List.of(1L, 2L, 1234567890123L), + service.listLongQueryParam(List.of(1L, 2L, 1234567890123L)).orThrow()); } // --- Float --- @@ -85,7 +86,7 @@ public void listLongQueryParam(ListQueryParameterTypesService service) { @ParameterizedTest @MethodSource("serviceProvider") public void listFloatQueryParam(ListQueryParameterTypesService service) { - assertEquals(List.of(1.1f, 2.2f, 123.45f), service.listFloatQueryParam(List.of(1.1f, 2.2f, 123.45f))); + assertEquals(List.of(1.1f, 2.2f, 123.45f), service.listFloatQueryParam(List.of(1.1f, 2.2f, 123.45f)).orThrow()); } // --- Double --- @@ -93,7 +94,8 @@ public void listFloatQueryParam(ListQueryParameterTypesService service) { @ParameterizedTest @MethodSource("serviceProvider") public void listDoubleQueryParam(ListQueryParameterTypesService service) { - assertEquals(List.of(1.1, 2.2, 123.456789), service.listDoubleQueryParam(List.of(1.1, 2.2, 123.456789))); + assertEquals(List.of(1.1, 2.2, 123.456789), + service.listDoubleQueryParam(List.of(1.1, 2.2, 123.456789)).orThrow()); } // --- String --- @@ -101,7 +103,7 @@ public void listDoubleQueryParam(ListQueryParameterTypesService service) { @ParameterizedTest @MethodSource("serviceProvider") public void listStringQueryParam(ListQueryParameterTypesService service) { - assertEquals(List.of("hello", "world"), service.listStringQueryParam(List.of("hello", "world"))); + assertEquals(List.of("hello", "world"), service.listStringQueryParam(List.of("hello", "world")).orThrow()); } // --- LocalDate --- @@ -110,7 +112,7 @@ public void listStringQueryParam(ListQueryParameterTypesService service) { @MethodSource("serviceProvider") public void listLocalDateQueryParam(ListQueryParameterTypesService service) { var dates = List.of(LocalDate.parse("2020-01-01"), LocalDate.parse("2021-06-15")); - assertEquals(dates, service.listLocalDateQueryParam(dates)); + assertEquals(dates, service.listLocalDateQueryParam(dates).orThrow()); } // --- LocalDateTime --- @@ -119,7 +121,7 @@ public void listLocalDateQueryParam(ListQueryParameterTypesService service) { @MethodSource("serviceProvider") public void listLocalDateTimeQueryParam(ListQueryParameterTypesService service) { var dateTimes = List.of(LocalDateTime.parse("2020-01-01T10:00"), LocalDateTime.parse("2021-06-15T12:30")); - assertEquals(dateTimes, service.listLocalDateTimeQueryParam(dateTimes)); + assertEquals(dateTimes, service.listLocalDateTimeQueryParam(dateTimes).orThrow()); } // --- LocalTime --- @@ -128,7 +130,7 @@ public void listLocalDateTimeQueryParam(ListQueryParameterTypesService service) @MethodSource("serviceProvider") public void listLocalTimeQueryParam(ListQueryParameterTypesService service) { var times = List.of(LocalTime.parse("10:00:00"), LocalTime.parse("11:30:00")); - assertEquals(times, service.listLocalTimeQueryParam(times)); + assertEquals(times, service.listLocalTimeQueryParam(times).orThrow()); } // --- OffsetDateTime --- @@ -137,7 +139,7 @@ public void listLocalTimeQueryParam(ListQueryParameterTypesService service) { public void listOffsetDateTimeQueryParam(ListQueryParameterTypesService service) { var times = List.of(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"), OffsetDateTime.parse("2021-02-02T11:30:00+01:00")); - assertEquals(times, service.listOffsetDateTimeQueryParam(times)); + assertEquals(times, service.listOffsetDateTimeQueryParam(times).orThrow()); } // --- ZonedDateTime --- @@ -146,7 +148,7 @@ public void listOffsetDateTimeQueryParam(ListQueryParameterTypesService service) @MethodSource("serviceProvider") public void listZonedDateTimeQueryParam(ListQueryParameterTypesService service) { var zdts = List.of(ZonedDateTime.parse("2025-01-01T10:00:00Z"), ZonedDateTime.parse("2025-06-15T12:00:00Z")); - assertEquals(zdts, service.listZonedDateTimeQueryParam(zdts)); + assertEquals(zdts, service.listZonedDateTimeQueryParam(zdts).orThrow()); } // --- Scalar (ZoneId) --- @@ -155,7 +157,7 @@ public void listZonedDateTimeQueryParam(ListQueryParameterTypesService service) @MethodSource("serviceProvider") public void listScalarQueryParam(ListQueryParameterTypesService service) { var zoneIds = List.of(ZoneId.of("Europe/Vienna"), ZoneId.of("UTC")); - assertEquals(zoneIds, service.listScalarQueryParam(zoneIds)); + assertEquals(zoneIds, service.listScalarQueryParam(zoneIds).orThrow()); } // --- Enum --- @@ -164,7 +166,7 @@ public void listScalarQueryParam(ListQueryParameterTypesService service) { @MethodSource("serviceProvider") public void listEnumQueryParam(ListQueryParameterTypesService service) { assertEquals(List.of(SampleEnum.A, SampleEnum.B), - service.listEnumQueryParam(List.of(SampleEnum.A, SampleEnum.B))); + service.listEnumQueryParam(List.of(SampleEnum.A, SampleEnum.B)).orThrow()); } // --- Inline Enum --- @@ -173,7 +175,7 @@ public void listEnumQueryParam(ListQueryParameterTypesService service) { @MethodSource("serviceProvider") public void listInlineEnumQueryParam(ListQueryParameterTypesService service) { assertEquals(List.of(ListInlineEnumQueryParam_Result$.A), - service.listInlineEnumQueryParam(List.of(ListInlineEnumQueryParam_QueryValue_Param$.A))); + service.listInlineEnumQueryParam(List.of(ListInlineEnumQueryParam_QueryValue_Param$.A)).orThrow()); } // --- Multi List Query Param --- @@ -182,7 +184,8 @@ public void listInlineEnumQueryParam(ListQueryParameterTypesService service) { @MethodSource("serviceProvider") public void listMultiQueryParam(ListQueryParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals("hello-42-k", service.listMultiQueryParam(List.of("hello"), List.of(42), List.of(record))); + assertEquals("hello-42-k", + service.listMultiQueryParam(List.of("hello"), List.of(42), List.of(record)).orThrow()); } // --- Record List Query Param --- @@ -191,7 +194,7 @@ var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").v @MethodSource("serviceProvider") public void listRecordQueryParam(ListQueryParameterTypesService service) { var record = service.client().builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - var result = service.listRecordQueryParam(List.of(record)); + var result = service.listRecordQueryParam(List.of(record)).orThrow(); assertEquals(1, result.size()); assertEquals("k", result.get(0).key()); assertEquals("1", result.get(0).version()); diff --git a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListSampleServiceServiceTest.java b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListSampleServiceServiceTest.java index 3899eca3..eb3f9576 100644 --- a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListSampleServiceServiceTest.java +++ b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ListSampleServiceServiceTest.java @@ -48,43 +48,43 @@ static ListSampleServiceService[] serviceProvider() { @ParameterizedTest @MethodSource("serviceProvider") public void listBoolean(ListSampleServiceService service) { - assertEquals(List.of(true, false, true), service.listBoolean()); + assertEquals(List.of(true, false, true), service.listBoolean().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listShort(ListSampleServiceService service) { - assertEquals(List.of((short) 123, (short) 456, (short) 789), service.listShort()); + assertEquals(List.of((short) 123, (short) 456, (short) 789), service.listShort().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listInt(ListSampleServiceService service) { - assertEquals(List.of(123456, 789012, 345678), service.listInt()); + assertEquals(List.of(123456, 789012, 345678), service.listInt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listLong(ListSampleServiceService service) { - assertEquals(List.of(1234567890123L, 2345678901234L, 3456789012345L), service.listLong()); + assertEquals(List.of(1234567890123L, 2345678901234L, 3456789012345L), service.listLong().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listFloat(ListSampleServiceService service) { - assertEquals(List.of(12.34f, 56.78f, 90.12f), service.listFloat()); + assertEquals(List.of(12.34f, 56.78f, 90.12f), service.listFloat().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listDouble(ListSampleServiceService service) { - assertEquals(List.of(12.3456789, 98.7654321, 54.3210987), service.listDouble()); + assertEquals(List.of(12.3456789, 98.7654321, 54.3210987), service.listDouble().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listString(ListSampleServiceService service) { - assertEquals(List.of("first", "second", "third"), service.listString()); + assertEquals(List.of("first", "second", "third"), service.listString().orThrow()); } @ParameterizedTest @@ -92,7 +92,7 @@ public void listString(ListSampleServiceService service) { public void listLocalDate(ListSampleServiceService service) { assertEquals( List.of(LocalDate.parse("2020-01-01"), LocalDate.parse("2021-02-02"), LocalDate.parse("2022-03-03")), - service.listLocalDate()); + service.listLocalDate().orThrow()); } @ParameterizedTest @@ -101,7 +101,7 @@ public void listLocalDateTime(ListSampleServiceService service) { assertEquals( List.of(LocalDateTime.parse("2020-01-01T10:00:00"), LocalDateTime.parse("2021-02-02T11:30:00"), LocalDateTime.parse("2022-03-03T12:45:00")), - service.listLocalDateTime()); + service.listLocalDateTime().orThrow()); } @ParameterizedTest @@ -109,7 +109,7 @@ public void listLocalDateTime(ListSampleServiceService service) { public void listLocalTime(ListSampleServiceService service) { assertEquals( List.of(LocalTime.parse("10:00:00"), LocalTime.parse("11:30:00"), LocalTime.parse("12:45:00")), - service.listLocalTime()); + service.listLocalTime().orThrow()); } @ParameterizedTest @@ -119,7 +119,7 @@ public void listOffsetDateTime(ListSampleServiceService service) { List.of(OffsetDateTime.parse("2020-01-01T10:00:00+01:00"), OffsetDateTime.parse("2021-02-02T11:30:00+01:00"), OffsetDateTime.parse("2022-03-03T12:45:00+01:00")), - service.listOffsetDateTime()); + service.listOffsetDateTime().orThrow()); } @ParameterizedTest @@ -128,7 +128,7 @@ public void listZonedDateTime(ListSampleServiceService service) { assertEquals( List.of(ZonedDateTime.parse("2020-01-01T10:00:00Z"), ZonedDateTime.parse("2021-02-02T11:30:00Z"), ZonedDateTime.parse("2022-03-03T12:45:00Z")), - service.listZonedDateTime()); + service.listZonedDateTime().orThrow()); } @ParameterizedTest @@ -136,19 +136,19 @@ public void listZonedDateTime(ListSampleServiceService service) { public void listScalar(ListSampleServiceService service) { assertEquals( List.of(ZoneId.of("Europe/Vienna"), ZoneId.of("America/New_York"), ZoneId.of("Asia/Tokyo")), - service.listScalar()); + service.listScalar().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listEnum(ListSampleServiceService service) { - assertEquals(List.of(SampleEnum.A, SampleEnum.B), service.listEnum()); + assertEquals(List.of(SampleEnum.A, SampleEnum.B), service.listEnum().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void listSimpleRecord(ListSampleServiceService service) { - var result = service.listSimpleRecord(); + var result = service.listSimpleRecord().orThrow(); assertEquals(1, result.size()); assertEquals("123", result.get(0).key()); assertEquals("1", result.get(0).version()); @@ -158,11 +158,11 @@ public void listSimpleRecord(ListSampleServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void listSimpleRecordWithError(ListSampleServiceService service) { - try { - service.listSimpleRecordWithError(); - fail("Expected SampleErrorException to be thrown"); - } catch (SampleErrorException e) { - assertEquals("My error", e.getMessage()); + var result = service.listSimpleRecordWithError(); + switch (result) { + case Result.OK(var value) -> fail("Expected SampleError to be thrown"); + case Result.ERR(SampleError err) -> assertEquals("My error", err.message()); + default -> fail("Unexpected result: " + result); } } diff --git a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/PathParameterTypeServiceServiceTest.java b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/PathParameterTypeServiceServiceTest.java index c194aa5f..7d0b68b0 100644 --- a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/PathParameterTypeServiceServiceTest.java +++ b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/PathParameterTypeServiceServiceTest.java @@ -49,8 +49,8 @@ static PathParameterTypeServiceService[] serviceProvider() { @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanPathParam(PathParameterTypeServiceService service) { - assertEquals(true, service.simpleBooleanPathParam(true)); - assertEquals(false, service.simpleBooleanPathParam(false)); + assertEquals(true, service.simpleBooleanPathParam(true).orThrow()); + assertEquals(false, service.simpleBooleanPathParam(false).orThrow()); } // --- Short --- @@ -58,7 +58,7 @@ public void simpleBooleanPathParam(PathParameterTypeServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortPathParam(PathParameterTypeServiceService service) { - assertEquals((short) 42, service.simpleShortPathParam((short) 42)); + assertEquals((short) 42, service.simpleShortPathParam((short) 42).orThrow()); } // --- Int --- @@ -66,7 +66,7 @@ public void simpleShortPathParam(PathParameterTypeServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntPathParam(PathParameterTypeServiceService service) { - assertEquals(123456, service.simpleIntPathParam(123456)); + assertEquals(123456, service.simpleIntPathParam(123456).orThrow()); } // --- Long --- @@ -74,7 +74,7 @@ public void simpleIntPathParam(PathParameterTypeServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongPathParam(PathParameterTypeServiceService service) { - assertEquals(1234567890123L, service.simpleLongPathParam(1234567890123L)); + assertEquals(1234567890123L, service.simpleLongPathParam(1234567890123L).orThrow()); } // --- Float --- @@ -82,7 +82,7 @@ public void simpleLongPathParam(PathParameterTypeServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatPathParam(PathParameterTypeServiceService service) { - assertEquals(123.45f, service.simpleFloatPathParam(123.45f)); + assertEquals(123.45f, service.simpleFloatPathParam(123.45f).orThrow()); } // --- Double --- @@ -90,7 +90,7 @@ public void simpleFloatPathParam(PathParameterTypeServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoublePathParam(PathParameterTypeServiceService service) { - assertEquals(123.456789, service.simpleDoublePathParam(123.456789)); + assertEquals(123.456789, service.simpleDoublePathParam(123.456789).orThrow()); } // --- String --- @@ -98,8 +98,8 @@ public void simpleDoublePathParam(PathParameterTypeServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringPathParam(PathParameterTypeServiceService service) { - assertEquals("hello world", service.simpleStringPathParam("hello world")); - assertEquals("a Ā 𐀀 文 🦄", service.simpleStringPathParam("a Ā 𐀀 文 🦄")); + assertEquals("hello world", service.simpleStringPathParam("hello world").orThrow()); + assertEquals("a Ā 𐀀 文 🦄", service.simpleStringPathParam("a Ā 𐀀 文 🦄").orThrow()); } // --- LocalDate --- @@ -108,7 +108,7 @@ public void simpleStringPathParam(PathParameterTypeServiceService service) { @MethodSource("serviceProvider") public void simpleLocalDatePathParam(PathParameterTypeServiceService service) { var date = LocalDate.parse("2020-01-01"); - assertEquals(date, service.simpleLocalDatePathParam(date)); + assertEquals(date, service.simpleLocalDatePathParam(date).orThrow()); } // --- LocalDateTime --- @@ -117,7 +117,7 @@ public void simpleLocalDatePathParam(PathParameterTypeServiceService service) { @MethodSource("serviceProvider") public void simpleLocalDateTimePathParam(PathParameterTypeServiceService service) { var dt = LocalDateTime.parse("2020-01-01T10:00"); - assertEquals(dt, service.simpleLocalDateTimePathParam(dt)); + assertEquals(dt, service.simpleLocalDateTimePathParam(dt).orThrow()); } // --- LocalTime --- @@ -126,7 +126,7 @@ public void simpleLocalDateTimePathParam(PathParameterTypeServiceService service @MethodSource("serviceProvider") public void simpleLocalTimePathParam(PathParameterTypeServiceService service) { var t = LocalTime.parse("10:00:00"); - assertEquals(t, service.simpleLocalTimePathParam(t)); + assertEquals(t, service.simpleLocalTimePathParam(t).orThrow()); } // --- OffsetDateTime --- @@ -134,7 +134,7 @@ public void simpleLocalTimePathParam(PathParameterTypeServiceService service) { @MethodSource("serviceProvider") public void simpleOffsetDateTimePathParam(PathParameterTypeServiceService service) { var odt = OffsetDateTime.parse("2025-01-01T10:00:00+01:00"); - assertEquals(odt, service.simpleOffsetDateTimePathParam(odt)); + assertEquals(odt, service.simpleOffsetDateTimePathParam(odt).orThrow()); } // --- ZonedDateTime --- @@ -143,7 +143,7 @@ public void simpleOffsetDateTimePathParam(PathParameterTypeServiceService servic @MethodSource("serviceProvider") public void simpleZonedDateTimePathParam(PathParameterTypeServiceService service) { var zdt = ZonedDateTime.parse("2025-01-01T10:00:00Z"); - assertEquals(zdt, service.simpleZonedDateTimePathParam(zdt)); + assertEquals(zdt, service.simpleZonedDateTimePathParam(zdt).orThrow()); } // --- Scalar (ZoneId) --- @@ -152,7 +152,7 @@ public void simpleZonedDateTimePathParam(PathParameterTypeServiceService service @MethodSource("serviceProvider") public void simpleScalarPathParam(PathParameterTypeServiceService service) { var zoneId = ZoneId.of("Europe/Vienna"); - assertEquals(zoneId, service.simpleScalarPathParam(zoneId)); + assertEquals(zoneId, service.simpleScalarPathParam(zoneId).orThrow()); } // --- Enum --- @@ -160,8 +160,8 @@ public void simpleScalarPathParam(PathParameterTypeServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumPathParam(PathParameterTypeServiceService service) { - assertEquals(SampleEnum.A, service.simpleEnumPathParam(SampleEnum.A)); - assertEquals(SampleEnum.B, service.simpleEnumPathParam(SampleEnum.B)); + assertEquals(SampleEnum.A, service.simpleEnumPathParam(SampleEnum.A).orThrow()); + assertEquals(SampleEnum.B, service.simpleEnumPathParam(SampleEnum.B).orThrow()); } // --- Multi Path Param --- @@ -169,7 +169,7 @@ public void simpleEnumPathParam(PathParameterTypeServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void multiPathParam(PathParameterTypeServiceService service) { - assertEquals("hello-42", service.multiPathParam("hello", 42)); + assertEquals("hello-42", service.multiPathParam("hello", 42).orThrow()); } } diff --git a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/QueryParameterTypesServiceTest.java b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/QueryParameterTypesServiceTest.java index b7c9e49f..e5fb046c 100644 --- a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/QueryParameterTypesServiceTest.java +++ b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/QueryParameterTypesServiceTest.java @@ -51,19 +51,19 @@ static QueryParameterTypesService[] serviceProvider() { @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanQueryParam(QueryParameterTypesService service) { - assertEquals(true, service.simpleBooleanQueryParam(true)); + assertEquals(true, service.simpleBooleanQueryParam(true).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleBooleanQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleBooleanQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleBooleanQueryParamOpt_defined(QueryParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleBooleanQueryParamOpt(true)); + assertEquals(NilResult.DEFINED, service.simpleBooleanQueryParamOpt(true).orThrow()); } // --- Short --- @@ -71,19 +71,19 @@ public void simpleBooleanQueryParamOpt_defined(QueryParameterTypesService servic @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortQueryParam(QueryParameterTypesService service) { - assertEquals((short) 42, service.simpleShortQueryParam((short) 42)); + assertEquals((short) 42, service.simpleShortQueryParam((short) 42).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleShortQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleShortQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleShortQueryParamOpt_defined(QueryParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleShortQueryParamOpt((short) 42)); + assertEquals(NilResult.DEFINED, service.simpleShortQueryParamOpt((short) 42).orThrow()); } // --- Int --- @@ -91,19 +91,19 @@ public void simpleShortQueryParamOpt_defined(QueryParameterTypesService service) @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntQueryParam(QueryParameterTypesService service) { - assertEquals(123456, service.simpleIntQueryParam(123456)); + assertEquals(123456, service.simpleIntQueryParam(123456).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleIntQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleIntQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleIntQueryParamOpt_defined(QueryParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleIntQueryParamOpt(123456)); + assertEquals(NilResult.DEFINED, service.simpleIntQueryParamOpt(123456).orThrow()); } // --- Long --- @@ -111,19 +111,19 @@ public void simpleIntQueryParamOpt_defined(QueryParameterTypesService service) { @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongQueryParam(QueryParameterTypesService service) { - assertEquals(1234567890123L, service.simpleLongQueryParam(1234567890123L)); + assertEquals(1234567890123L, service.simpleLongQueryParam(1234567890123L).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLongQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleLongQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLongQueryParamOpt_defined(QueryParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLongQueryParamOpt(1234567890123L)); + assertEquals(NilResult.DEFINED, service.simpleLongQueryParamOpt(1234567890123L).orThrow()); } // --- Float --- @@ -131,19 +131,19 @@ public void simpleLongQueryParamOpt_defined(QueryParameterTypesService service) @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatQueryParam(QueryParameterTypesService service) { - assertEquals(123.45f, service.simpleFloatQueryParam(123.45f)); + assertEquals(123.45f, service.simpleFloatQueryParam(123.45f).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleFloatQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleFloatQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleFloatQueryParamOpt_defined(QueryParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleFloatQueryParamOpt(123.45f)); + assertEquals(NilResult.DEFINED, service.simpleFloatQueryParamOpt(123.45f).orThrow()); } // --- Double --- @@ -151,19 +151,19 @@ public void simpleFloatQueryParamOpt_defined(QueryParameterTypesService service) @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleQueryParam(QueryParameterTypesService service) { - assertEquals(123.456789, service.simpleDoubleQueryParam(123.456789)); + assertEquals(123.456789, service.simpleDoubleQueryParam(123.456789).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleDoubleQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleDoubleQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleDoubleQueryParamOpt_defined(QueryParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleDoubleQueryParamOpt(123.456789)); + assertEquals(NilResult.DEFINED, service.simpleDoubleQueryParamOpt(123.456789).orThrow()); } // --- String --- @@ -171,30 +171,30 @@ public void simpleDoubleQueryParamOpt_defined(QueryParameterTypesService service @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringQueryParam(QueryParameterTypesService service) { - assertEquals("hello world", service.simpleStringQueryParam("hello world")); - assertEquals("a Ā 𐀀 文 🦄", service.simpleStringQueryParam("a Ā 𐀀 文 🦄")); - assertEquals("line1\nline2\nline3", service.simpleStringQueryParam("line1\nline2\nline3")); - assertEquals("pre-\\uffff-post", service.simpleStringQueryParam("pre-\\uffff-post")); - assertEquals(" Hello, World! ", service.simpleStringQueryParam(" Hello, World! ")); + assertEquals("hello world", service.simpleStringQueryParam("hello world").orThrow()); + assertEquals("a Ā 𐀀 文 🦄", service.simpleStringQueryParam("a Ā 𐀀 文 🦄").orThrow()); + assertEquals("line1\nline2\nline3", service.simpleStringQueryParam("line1\nline2\nline3").orThrow()); + assertEquals("pre-\\uffff-post", service.simpleStringQueryParam("pre-\\uffff-post").orThrow()); + assertEquals(" Hello, World! ", service.simpleStringQueryParam(" Hello, World! ").orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleStringQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleStringQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringQueryParamOpt_defined(QueryParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleStringQueryParamOpt("hello world")); - assertEquals(NilResult.UNDEFINED, service.simpleStringQueryParamOpt(null)); + assertEquals(NilResult.DEFINED, service.simpleStringQueryParamOpt("hello world").orThrow()); + assertEquals(NilResult.UNDEFINED, service.simpleStringQueryParamOpt(null).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleStringQueryParamOpt_null(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleStringQueryParamOpt(null)); + assertEquals(NilResult.UNDEFINED, service.simpleStringQueryParamOpt(null).orThrow()); } // --- LocalDate --- @@ -203,19 +203,19 @@ public void simpleStringQueryParamOpt_null(QueryParameterTypesService service) { @MethodSource("serviceProvider") public void simpleLocalDateQueryParam(QueryParameterTypesService service) { var date = LocalDate.parse("2020-01-01"); - assertEquals(date, service.simpleLocalDateQueryParam(date)); + assertEquals(date, service.simpleLocalDateQueryParam(date).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalDateQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalDateQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateQueryParamOpt_defined(QueryParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalDateQueryParamOpt(LocalDate.parse("2020-01-01"))); + assertEquals(NilResult.DEFINED, service.simpleLocalDateQueryParamOpt(LocalDate.parse("2020-01-01")).orThrow()); } // --- LocalDateTime --- @@ -224,20 +224,20 @@ public void simpleLocalDateQueryParamOpt_defined(QueryParameterTypesService serv @MethodSource("serviceProvider") public void simpleLocalDateTimeQueryParam(QueryParameterTypesService service) { var dt = LocalDateTime.parse("2020-01-01T10:00"); - assertEquals(dt, service.simpleLocalDateTimeQueryParam(dt)); + assertEquals(dt, service.simpleLocalDateTimeQueryParam(dt).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalDateTimeQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalDateTimeQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalDateTimeQueryParamOpt_defined(QueryParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleLocalDateTimeQueryParamOpt(LocalDateTime.parse("2020-01-01T10:00"))); + service.simpleLocalDateTimeQueryParamOpt(LocalDateTime.parse("2020-01-01T10:00")).orThrow()); } // --- LocalTime --- @@ -246,19 +246,19 @@ public void simpleLocalDateTimeQueryParamOpt_defined(QueryParameterTypesService @MethodSource("serviceProvider") public void simpleLocalTimeQueryParam(QueryParameterTypesService service) { var t = LocalTime.parse("10:00:00"); - assertEquals(t, service.simpleLocalTimeQueryParam(t)); + assertEquals(t, service.simpleLocalTimeQueryParam(t).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleLocalTimeQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleLocalTimeQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleLocalTimeQueryParamOpt_defined(QueryParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleLocalTimeQueryParamOpt(LocalTime.parse("10:00:00"))); + assertEquals(NilResult.DEFINED, service.simpleLocalTimeQueryParamOpt(LocalTime.parse("10:00:00")).orThrow()); } // --- OffsetDateTime --- @@ -266,20 +266,20 @@ public void simpleLocalTimeQueryParamOpt_defined(QueryParameterTypesService serv @MethodSource("serviceProvider") public void simpleOffsetDateTimeQueryParam(QueryParameterTypesService service) { var odt = OffsetDateTime.parse("2025-01-01T10:00:00+01:00"); - assertEquals(odt, service.simpleOffsetDateTimeQueryParam(odt)); + assertEquals(odt, service.simpleOffsetDateTimeQueryParam(odt).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleOffsetDateTimeQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleOffsetDateTimeQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleOffsetDateTimeQueryParamOpt_defined(QueryParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleOffsetDateTimeQueryParamOpt(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"))); + service.simpleOffsetDateTimeQueryParamOpt(OffsetDateTime.parse("2025-01-01T10:00:00+01:00")).orThrow()); } // --- ZonedDateTime --- @@ -288,20 +288,20 @@ public void simpleOffsetDateTimeQueryParamOpt_defined(QueryParameterTypesService @MethodSource("serviceProvider") public void simpleZonedDateTimeQueryParam(QueryParameterTypesService service) { var zdt = ZonedDateTime.parse("2025-01-01T10:00:00Z"); - assertEquals(zdt, service.simpleZonedDateTimeQueryParam(zdt)); + assertEquals(zdt, service.simpleZonedDateTimeQueryParam(zdt).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleZonedDateTimeQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleZonedDateTimeQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleZonedDateTimeQueryParamOpt_defined(QueryParameterTypesService service) { assertEquals(NilResult.DEFINED, - service.simpleZonedDateTimeQueryParamOpt(ZonedDateTime.parse("2025-01-01T10:00:00Z"))); + service.simpleZonedDateTimeQueryParamOpt(ZonedDateTime.parse("2025-01-01T10:00:00Z")).orThrow()); } // --- Scalar (ZoneId) --- @@ -310,19 +310,19 @@ public void simpleZonedDateTimeQueryParamOpt_defined(QueryParameterTypesService @MethodSource("serviceProvider") public void simpleScalarQueryParam(QueryParameterTypesService service) { var zoneId = ZoneId.of("Europe/Vienna"); - assertEquals(zoneId, service.simpleScalarQueryParam(zoneId)); + assertEquals(zoneId, service.simpleScalarQueryParam(zoneId).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleScalarQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleScalarQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleScalarQueryParamOpt_defined(QueryParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleScalarQueryParamOpt(ZoneId.of("Europe/Vienna"))); + assertEquals(NilResult.DEFINED, service.simpleScalarQueryParamOpt(ZoneId.of("Europe/Vienna")).orThrow()); } // --- Enum --- @@ -330,19 +330,19 @@ public void simpleScalarQueryParamOpt_defined(QueryParameterTypesService service @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumQueryParam(QueryParameterTypesService service) { - assertEquals(SampleEnum.A, service.simpleEnumQueryParam(SampleEnum.A)); + assertEquals(SampleEnum.A, service.simpleEnumQueryParam(SampleEnum.A).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.simpleEnumQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.simpleEnumQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void simpleEnumQueryParamOpt_defined(QueryParameterTypesService service) { - assertEquals(NilResult.DEFINED, service.simpleEnumQueryParamOpt(SampleEnum.B)); + assertEquals(NilResult.DEFINED, service.simpleEnumQueryParamOpt(SampleEnum.B).orThrow()); } // --- Multi Query Param --- @@ -350,25 +350,25 @@ public void simpleEnumQueryParamOpt_defined(QueryParameterTypesService service) @ParameterizedTest @MethodSource("serviceProvider") public void multiQueryParam(QueryParameterTypesService service) { - assertEquals("hello-42", service.multiQueryParam("hello", 42)); + assertEquals("hello-42", service.multiQueryParam("hello", 42).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiQueryParamOpt_allUndefined(QueryParameterTypesService service) { - assertEquals("undefined-undefined", service.multiQueryParamOpt()); + assertEquals("undefined-undefined", service.multiQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiQueryParamOpt_valueAOnly(QueryParameterTypesService service) { - assertEquals("hello-undefined", service.multiQueryParamOpt("hello")); + assertEquals("hello-undefined", service.multiQueryParamOpt("hello").orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void multiQueryParamOpt_allDefined(QueryParameterTypesService service) { - assertEquals("hello-42", service.multiQueryParamOpt("hello", 42)); + assertEquals("hello-42", service.multiQueryParamOpt("hello", 42).orThrow()); } // --- Record Query Param --- @@ -377,7 +377,7 @@ public void multiQueryParamOpt_allDefined(QueryParameterTypesService service) { @MethodSource("serviceProvider") public void recordQueryParam(QueryParameterTypesService service) { var record = JSON.builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - var result = service.recordQueryParam(record); + var result = service.recordQueryParam(record).orThrow(); assertEquals("k", result.key()); assertEquals("1", result.version()); assertEquals("v", result.value()); @@ -386,14 +386,14 @@ var record = JSON.builder(SimpleRecord.DataBuilder.class).key("k").version("1"). @ParameterizedTest @MethodSource("serviceProvider") public void recordQueryParamOpt_undefined(QueryParameterTypesService service) { - assertEquals(NilResult.UNDEFINED, service.recordQueryParamOpt()); + assertEquals(NilResult.UNDEFINED, service.recordQueryParamOpt().orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void recordQueryParamOpt_defined(QueryParameterTypesService service) { var record = JSON.builder(SimpleRecord.DataBuilder.class).key("k").version("1").value("v").build(); - assertEquals(NilResult.DEFINED, service.recordQueryParamOpt(record)); + assertEquals(NilResult.DEFINED, service.recordQueryParamOpt(record).orThrow()); } } diff --git a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/SampleServiceServiceTest.java b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/SampleServiceServiceTest.java index 99cdf657..80ea2baf 100644 --- a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/SampleServiceServiceTest.java +++ b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/SampleServiceServiceTest.java @@ -48,98 +48,98 @@ static SampleServiceService[] serviceProvider() { @ParameterizedTest @MethodSource("serviceProvider") public void getBoolean(SampleServiceService service) { - boolean result = service.getBoolean(); + boolean result = service.getBoolean().orThrow(); assertTrue(result); } @ParameterizedTest @MethodSource("serviceProvider") public void getShort(SampleServiceService service) { - short result = service.getShort(); + short result = service.getShort().orThrow(); assertEquals(123, result); } @ParameterizedTest @MethodSource("serviceProvider") public void getInt(SampleServiceService service) { - int result = service.getInt(); + int result = service.getInt().orThrow(); assertEquals(123456, result); } @ParameterizedTest @MethodSource("serviceProvider") public void getLong(SampleServiceService service) { - long result = service.getLong(); + long result = service.getLong().orThrow(); assertEquals(1234567890123L, result); } @ParameterizedTest @MethodSource("serviceProvider") public void getFloat(SampleServiceService service) { - float result = service.getFloat(); + float result = service.getFloat().orThrow(); assertEquals(123.45f, result); } @ParameterizedTest @MethodSource("serviceProvider") public void getDouble(SampleServiceService service) { - double result = service.getDouble(); + double result = service.getDouble().orThrow(); assertEquals(123.456789, result); } @ParameterizedTest @MethodSource("serviceProvider") public void getString(SampleServiceService service) { - String result = service.getString(); + String result = service.getString().orThrow(); assertEquals("sample string", result); } @ParameterizedTest @MethodSource("serviceProvider") public void getLocalDate(SampleServiceService service) { - var result = service.getLocalDate(); + var result = service.getLocalDate().orThrow(); assertEquals(LocalDate.parse("2020-01-01"), result); } @ParameterizedTest @MethodSource("serviceProvider") public void getLocalDateTime(SampleServiceService service) { - var result = service.getLocalDateTime(); + var result = service.getLocalDateTime().orThrow(); assertEquals(LocalDateTime.parse("2020-01-01T10:00"), result); } @ParameterizedTest @MethodSource("serviceProvider") public void getLocalTime(SampleServiceService service) { - var result = service.getLocalTime(); + var result = service.getLocalTime().orThrow(); assertEquals(LocalTime.parse("10:00:00"), result); } @ParameterizedTest @MethodSource("serviceProvider") public void getOffsetDateTime(SampleServiceService service) { - var result = service.getOffsetDateTime(); + var result = service.getOffsetDateTime().orThrow(); assertEquals(OffsetDateTime.parse("2025-01-01T10:00:00+01:00"), result); } @ParameterizedTest @MethodSource("serviceProvider") public void getZonedDateTime(SampleServiceService service) { - var result = service.getZonedDateTime(); + var result = service.getZonedDateTime().orThrow(); assertEquals(ZonedDateTime.parse("2025-01-01T10:00:00Z"), result); } @ParameterizedTest @MethodSource("serviceProvider") public void getScalar(SampleServiceService service) { - var result = service.getScalar(); + var result = service.getScalar().orThrow(); assertEquals(ZoneId.of("Europe/Vienna"), result); } @ParameterizedTest @MethodSource("serviceProvider") public void getEnum(SampleServiceService service) { - var result = service.getEnum(); + var result = service.getEnum().orThrow(); assertEquals(SampleEnum.A, result); } @@ -152,29 +152,34 @@ public void voidOperation(SampleServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void errorOperation(SampleServiceService service) { - try { - service.errorOperation(); - } catch (SampleErrorException e) { - assertEquals("This is a sample error from the server", e.getMessage()); + var result = service.errorOperation(); + switch (result) { + case Result.OK(var value) -> fail("Expected SampleErrorException to be thrown"); + case Result.ERR(SampleError error) -> + assertEquals("This is a sample error from the server", error.message()); + default -> fail("Unexpected result type: " + result.getClass().getName()); } + } @ParameterizedTest @MethodSource("serviceProvider") public void multiErrorOperation(SampleServiceService service) { - try { - service.multiErrorOperation(); - fail("Expected SampleErrorException to be thrown"); - } catch (SampleErrorException e) { - assertEquals("This is a sample error from the server", e.getMessage()); + var result = service.multiErrorOperation(); + switch (result) { + case Result.OK(var value) -> fail("Expected SampleErrorException to be thrown"); + case Result.ERR(SampleError error) -> + assertEquals("This is a sample error from the server", error.message()); + default -> fail("Unexpected result type: " + result.getClass().getName()); } + // FIXME Need to test error2 } @ParameterizedTest @MethodSource("serviceProvider") public void getSimpleRecord(SampleServiceService service) { - var result = service.getSimpleRecord("123"); + var result = service.getSimpleRecord("123").orThrow(); assertEquals("123", result.key()); assertEquals("1", result.version()); assertEquals("Sample Name", result.value()); @@ -184,82 +189,96 @@ public void getSimpleRecord(SampleServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void getSimpleRecordWithError(SampleServiceService service) { - try { - service.getSimpleRecordWithError("123"); - fail("Expected SampleErrorException to be thrown"); - } catch (SampleErrorException e) { - assertEquals("This is a sample error from the server", e.getMessage()); + var result = service.getSimpleRecordWithError("123"); + switch (result) { + case Result.OK(var value) -> fail("Expected SampleErrorException to be thrown"); + case Result.ERR(SampleError error) -> + assertEquals("This is a sample error from the server", error.message()); + default -> fail("Unexpected result type: " + result.getClass().getName()); } } @ParameterizedTest @MethodSource("serviceProvider") public void getSimpleErrorWithValue(SampleServiceService service) { - try { - service.getSimpleErrorWithValue(); - fail("Expected SampleErrorWithValueException to be thrown"); - } catch (SampleErrorWithValueException e) { - assertEquals("This is a sample error with value from the server", e.getMessage()); - assertEquals("An error message", e.data().message()); + var result = service.getSimpleErrorWithValue(); + switch (result) { + case Result.OK(var value) -> fail("Expected SampleErrorWithValueException to be thrown"); + case Result.ERR(SampleErrorWithValue error) -> { + assertEquals("This is a sample error with value from the server", error.message()); + assertEquals("An error message", error.data().message()); + } + default -> fail("Unexpected result type: " + result.getClass().getName()); } + } @ParameterizedTest @MethodSource("serviceProvider") public void getSimpleErrorInt(SampleServiceService service) { - try { - service.getSimpleErrorInt(); - fail("Expected SampleErrorIntException to be thrown"); - } catch (SampleErrorIntException e) { - assertEquals("This is a sample int error from the server", e.getMessage()); - assertEquals(123, e.data()); + var result = service.getSimpleErrorInt(); + switch (result) { + case Result.OK(var value) -> fail("Expected SampleErrorIntException to be thrown"); + case Result.ERR(SampleErrorInt error) -> { + assertEquals("This is a sample int error from the server", error.message()); + assertEquals(123, error.data()); + } + default -> fail("Unexpected result type: " + result.getClass().getName()); } } @ParameterizedTest @MethodSource("serviceProvider") public void getSimpleErrorBoolean(SampleServiceService service) { - try { - service.getSimpleErrorBoolean(); - fail("Expected SampleErrorBooleanException to be thrown"); - } catch (SampleErrorBooleanException e) { - assertEquals("This is a sample boolean error from the server", e.getMessage()); - assertTrue(e.data()); + var result = service.getSimpleErrorBoolean(); + switch (result) { + case Result.OK(var value) -> fail("Expected SampleErrorBooleanException to be thrown"); + case Result.ERR(SampleErrorBoolean error) -> { + assertEquals("This is a sample boolean error from the server", error.message()); + assertTrue(error.data()); + } + default -> fail("Unexpected result type: " + result.getClass().getName()); } } @ParameterizedTest @MethodSource("serviceProvider") public void getSimpleErrorEnum(SampleServiceService service) { - try { - service.getSimpleErrorEnum(); - fail("Expected SampleErrorEnumException to be thrown"); - } catch (SampleErrorEnumException e) { - assertEquals("This is a sample enum error from the server", e.getMessage()); - assertEquals(SampleEnum.A, e.data()); + var result = service.getSimpleErrorEnum(); + switch (result) { + case Result.OK(var value) -> fail("Expected SampleErrorEnumException to be thrown"); + case Result.ERR(SampleErrorEnum error) -> { + assertEquals("This is a sample enum error from the server", error.message()); + assertEquals(SampleEnum.A, error.data()); + } + default -> fail("Unexpected result type: " + result.getClass().getName()); } } @ParameterizedTest @MethodSource("serviceProvider") public void getSimpleErrorScalar(SampleServiceService service) { - try { - service.getSimpleErrorScalar(); - fail("Expected SampleErrorScalarException to be thrown"); - } catch (SampleErrorScalarException e) { - assertEquals("This is a sample scalar error from the server", e.getMessage()); - assertEquals(ZoneId.of("America/New_York"), e.data()); + var result = service.getSimpleErrorScalar(); + switch (result) { + case Result.OK(var value) -> fail("Expected SampleErrorScalarException to be thrown"); + case Result.ERR(SampleErrorScalar error) -> { + assertEquals("This is a sample scalar error from the server", error.message()); + assertEquals(ZoneId.of("America/New_York"), error.data()); + } + default -> fail("Unexpected result type: " + result.getClass().getName()); } } @ParameterizedTest @MethodSource("serviceProvider") public void getSimpleErrorUnion(SampleServiceService service) { - try { - service.getSimpleErrorUnion(); - fail("Expected SampleErrorUnionException to be thrown"); - } catch (SampleErrorUnionException e) { - assertEquals("This is a sample union error from the server", e.getMessage()); + var result = service.getSimpleErrorUnion(); + switch (result) { + case Result.OK(var value) -> fail("Expected SampleErrorUnionException to be thrown"); + case Result.ERR(SampleErrorUnion error) -> { + assertEquals("This is a sample union error from the server", error.message()); + } + default -> fail("Unexpected result type: " + result.getClass().getName()); } } } diff --git a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ScalarSubstition_ServiceServiceTest.java b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ScalarSubstition_ServiceServiceTest.java index ed15ec17..131d4c4b 100644 --- a/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ScalarSubstition_ServiceServiceTest.java +++ b/dsl/java-test/java-client/src/test/java/dev/rsdlang/sample/client/ScalarSubstition_ServiceServiceTest.java @@ -7,6 +7,7 @@ import java.net.URI; import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -42,14 +43,14 @@ static ScalarSubstition_ServiceService[] serviceProvider() { @ParameterizedTest @MethodSource("serviceProvider") public void get(ScalarSubstition_ServiceService service) { - var result = service.get(); + var result = service.get().orThrow(); assertEquals("[0,0]", result.toString()); } @ParameterizedTest @MethodSource("serviceProvider") public void list(ScalarSubstition_ServiceService service) { - var result = service.list(); + var result = service.list().orThrow(); assertEquals(1, result.size()); assertEquals("[0,0]", result.get(0).toString()); } @@ -57,36 +58,36 @@ public void list(ScalarSubstition_ServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void post(ScalarSubstition_ServiceService service) { - var result = service.post(new MyRange(1, 1)); + var result = service.post(new MyRange(1, 1)).orThrow(); assertEquals("[1,1]", result.toString()); } @ParameterizedTest @MethodSource("serviceProvider") public void postOpt(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.UNDEFINED, service.postOpt()); - assertEquals(NilResult.DEFINED, service.postOpt(new MyRange(1, 1))); + assertEquals(NilResult.UNDEFINED, service.postOpt().orThrow()); + assertEquals(NilResult.DEFINED, service.postOpt(new MyRange(1, 1)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void postNull(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.NULL, service.postNull(null)); - assertEquals(NilResult.DEFINED, service.postNull(new MyRange(1, 1))); + assertEquals(NilResult.NULL, service.postNull(null).orThrow()); + assertEquals(NilResult.DEFINED, service.postNull(new MyRange(1, 1)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void postOptNull(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.UNDEFINED, service.postOptNull()); - assertEquals(NilResult.NULL, service.postOptNull(null)); - assertEquals(NilResult.DEFINED, service.postOptNull(new MyRange(1, 1))); + assertEquals(NilResult.UNDEFINED, service.postOptNull().orThrow()); + assertEquals(NilResult.NULL, service.postOptNull(null).orThrow()); + assertEquals(NilResult.DEFINED, service.postOptNull(new MyRange(1, 1)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void postList(ScalarSubstition_ServiceService service) { - var result = service.postList(List.of(new MyRange(1, 1))); + var result = service.postList(List.of(new MyRange(1, 1))).orThrow(); assertEquals(1, result.size()); assertEquals("[1,1]", result.get(0).toString()); } @@ -94,58 +95,58 @@ public void postList(ScalarSubstition_ServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void postListOpt(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.UNDEFINED, service.postListOpt()); - assertEquals(NilResult.DEFINED, service.postListOpt(List.of(new MyRange(1, 1)))); + assertEquals(NilResult.UNDEFINED, service.postListOpt().orThrow()); + assertEquals(NilResult.DEFINED, service.postListOpt(List.of(new MyRange(1, 1))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void postListNull(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.NULL, service.postListNull(null)); - assertEquals(NilResult.DEFINED, service.postListNull(List.of(new MyRange(0, 0)))); + assertEquals(NilResult.NULL, service.postListNull(null).orThrow()); + assertEquals(NilResult.DEFINED, service.postListNull(List.of(new MyRange(0, 0))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void postListOptNull(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.UNDEFINED, service.postListOptNull()); - assertEquals(NilResult.NULL, service.postListOptNull(null)); - assertEquals(NilResult.DEFINED, service.postListOptNull(List.of(new MyRange(0, 0)))); + assertEquals(NilResult.UNDEFINED, service.postListOptNull().orThrow()); + assertEquals(NilResult.NULL, service.postListOptNull(null).orThrow()); + assertEquals(NilResult.DEFINED, service.postListOptNull(List.of(new MyRange(0, 0))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void query(ScalarSubstition_ServiceService service) { - var result = service.query(new MyRange(1, 1)); + var result = service.query(new MyRange(1, 1)).orThrow(); assertEquals("[1,1]", result.toString()); } @ParameterizedTest @MethodSource("serviceProvider") public void queryOpt(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.UNDEFINED, service.queryOpt()); - assertEquals(NilResult.DEFINED, service.queryOpt(new MyRange(1, 1))); + assertEquals(NilResult.UNDEFINED, service.queryOpt().orThrow()); + assertEquals(NilResult.DEFINED, service.queryOpt(new MyRange(1, 1)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void queryNull(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.NULL, service.queryNull(null)); - assertEquals(NilResult.DEFINED, service.queryNull(new MyRange(1, 1))); + assertEquals(NilResult.NULL, service.queryNull(null).orThrow()); + assertEquals(NilResult.DEFINED, service.queryNull(new MyRange(1, 1)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void queryOptNull(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.UNDEFINED, service.queryOptNull()); - assertEquals(NilResult.NULL, service.queryOptNull(null)); - assertEquals(NilResult.DEFINED, service.queryOptNull(new MyRange(1, 1))); + assertEquals(NilResult.UNDEFINED, service.queryOptNull().orThrow()); + assertEquals(NilResult.NULL, service.queryOptNull(null).orThrow()); + assertEquals(NilResult.DEFINED, service.queryOptNull(new MyRange(1, 1)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void queryList(ScalarSubstition_ServiceService service) { - var result = service.queryList(List.of(new MyRange(1, 1))); + var result = service.queryList(List.of(new MyRange(1, 1))).orThrow(); assertEquals(1, result.size()); assertEquals("[1,1]", result.get(0).toString()); } @@ -155,14 +156,14 @@ public void queryList(ScalarSubstition_ServiceService service) { public void queryListOpt(ScalarSubstition_ServiceService service) { // assertEquals(NilResult.UNDEFINED, service.queryListOpt()); assertEquals(NilResult.DEFINED, service.queryListOpt(List.of(new MyRange(1, - 1)))); + 1))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void queryListNull(ScalarSubstition_ServiceService service) { // assertEquals(NilResult.NULL, service.queryListNull(null)); - assertEquals(NilResult.DEFINED, service.queryListNull(List.of(new MyRange(1, 1)))); + assertEquals(NilResult.DEFINED, service.queryListNull(List.of(new MyRange(1, 1))).orThrow()); } @ParameterizedTest @@ -170,42 +171,42 @@ public void queryListNull(ScalarSubstition_ServiceService service) { public void queryListOptNull(ScalarSubstition_ServiceService service) { // assertEquals(NilResult.UNDEFINED, service.queryListOptNull()); // assertEquals(NilResult.NULL, service.queryListOptNull(null)); - assertEquals(NilResult.DEFINED, service.queryListOptNull(List.of(new MyRange(1, 1)))); + assertEquals(NilResult.DEFINED, service.queryListOptNull(List.of(new MyRange(1, 1))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void header(ScalarSubstition_ServiceService service) { - var result = service.header(new MyRange(1, 1)); + var result = service.header(new MyRange(1, 1)).orThrow(); assertEquals("[1,1]", result.toString()); } @ParameterizedTest @MethodSource("serviceProvider") public void headerOpt(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.UNDEFINED, service.headerOpt()); - assertEquals(NilResult.DEFINED, service.headerOpt(new MyRange(1, 1))); + assertEquals(NilResult.UNDEFINED, service.headerOpt().orThrow()); + assertEquals(NilResult.DEFINED, service.headerOpt(new MyRange(1, 1)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void headerNull(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.NULL, service.headerNull(null)); - assertEquals(NilResult.DEFINED, service.headerNull(new MyRange(1, 1))); + assertEquals(NilResult.NULL, service.headerNull(null).orThrow()); + assertEquals(NilResult.DEFINED, service.headerNull(new MyRange(1, 1)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void headerOptNull(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.UNDEFINED, service.headerOptNull()); - assertEquals(NilResult.NULL, service.headerOptNull(null)); - assertEquals(NilResult.DEFINED, service.headerOptNull(new MyRange(1, 1))); + assertEquals(NilResult.UNDEFINED, service.headerOptNull().orThrow()); + assertEquals(NilResult.NULL, service.headerOptNull(null).orThrow()); + assertEquals(NilResult.DEFINED, service.headerOptNull(new MyRange(1, 1)).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void headerList(ScalarSubstition_ServiceService service) { - var result = service.headerList(List.of(new MyRange(0, 0))); + var result = service.headerList(List.of(new MyRange(0, 0))).orThrow(); assertEquals(1, result.size()); assertEquals("[0,0]", result.get(0).toString()); } @@ -213,33 +214,36 @@ public void headerList(ScalarSubstition_ServiceService service) { @ParameterizedTest @MethodSource("serviceProvider") public void headerListOpt(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.UNDEFINED, service.headerListOpt()); - assertEquals(NilResult.DEFINED, service.headerListOpt(List.of(new MyRange(0, 0)))); + assertEquals(NilResult.UNDEFINED, service.headerListOpt().orThrow()); + assertEquals(NilResult.DEFINED, service.headerListOpt(List.of(new MyRange(0, 0))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void headerListNull(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.NULL, service.headerListNull(null)); - assertEquals(NilResult.DEFINED, service.headerListNull(List.of(new MyRange(0, 0)))); + assertEquals(NilResult.NULL, service.headerListNull(null).orThrow()); + assertEquals(NilResult.DEFINED, service.headerListNull(List.of(new MyRange(0, 0))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void headerListOptNull(ScalarSubstition_ServiceService service) { - assertEquals(NilResult.UNDEFINED, service.headerListOptNull()); - assertEquals(NilResult.NULL, service.headerListOptNull(null)); - assertEquals(NilResult.DEFINED, service.headerListOptNull(List.of(new MyRange(0, 0)))); + assertEquals(NilResult.UNDEFINED, service.headerListOptNull().orThrow()); + assertEquals(NilResult.NULL, service.headerListOptNull(null).orThrow()); + assertEquals(NilResult.DEFINED, service.headerListOptNull(List.of(new MyRange(0, 0))).orThrow()); } @ParameterizedTest @MethodSource("serviceProvider") public void fail(ScalarSubstition_ServiceService service) { - try { - service.fail(); - } catch (SampleErrorScalarSubException e) { - assertEquals("This is a sample error from the server", e.getMessage()); - assertEquals("[0,0]", e.data().toString()); + var result = service.fail(); + switch (result) { + case Result.OK(var value) -> Assertions.fail("Expected SampleErrorScalarSubException to be thrown"); + case Result.ERR(SampleErrorScalarSub error) -> { + assertEquals("This is a sample error from the server", error.message()); + assertEquals("[0,0]", error.data().toString()); + } + default -> Assertions.fail("Unexpected result type: " + result.getClass().getName()); } } } diff --git a/dsl/packages/cli/src/java-client-api/client.ts b/dsl/packages/cli/src/java-client-api/client.ts index c9ee2f4d..d41dcc3f 100644 --- a/dsl/packages/cli/src/java-client-api/client.ts +++ b/dsl/packages/cli/src/java-client-api/client.ts @@ -237,7 +237,7 @@ public interface ${Type} { * eg. HttpResponse for JDK HttpClient, Response for * OkHttp, etc. */ - void onError(String method, RSDException error, Adaptable responseAdapter); + void onError(String method, RSDError error, Adaptable responseAdapter); /** * Called if an exception was thrown during the request (e.g. network error) @@ -246,7 +246,7 @@ public interface ${Type} { * (e.g. "getUser", "createUser", etc.) * @param error the exception that was thrown during the request */ - void onCatch(String method, RSDException error); + void onCatch(String method, RSDError error); /** * Called after the request was completed, regardless of the outcome. It can be diff --git a/dsl/packages/cli/src/java-client-api/error.ts b/dsl/packages/cli/src/java-client-api/error.ts index 35f861f2..fbedad13 100644 --- a/dsl/packages/cli/src/java-client-api/error.ts +++ b/dsl/packages/cli/src/java-client-api/error.ts @@ -1,4 +1,4 @@ -import { CompositeGeneratorNode, NL, toString } from 'langium/generate'; +import { CompositeGeneratorNode, toString } from 'langium/generate'; import { Artifact } from '../artifact-generator.js'; import { generateCompilationUnit, @@ -7,22 +7,25 @@ import { toAPIType, toPath, } from '../java-gen-utils.js'; -import { MResolvedError } from '../model.js'; +import { MResolvedError, MResolvedService } from '../model.js'; +import { computeServiceErrorCombination } from './service-errors.js'; +import { toNodeTree } from '../util.js'; export function generateError( t: MResolvedError, + services: readonly MResolvedService[], artifactConfig: JavaClientAPIGeneratorConfig, packageName: string, ): Artifact { const importCollector = new JavaImportsCollector(packageName); return { - name: `${t.name}Exception.java`, + name: `${t.name}.java`, content: toString( generateCompilationUnit( packageName, importCollector, - generateSource(t, artifactConfig, importCollector.importType.bind(importCollector)), + generateSource(t, services, artifactConfig, importCollector.importType.bind(importCollector)), ), '\t', ), @@ -32,10 +35,14 @@ export function generateError( function generateSource( t: MResolvedError, + services: readonly MResolvedService[], artifactConfig: JavaClientAPIGeneratorConfig, fqn: (type: string) => string, ): CompositeGeneratorNode { - const node = new CompositeGeneratorNode(); + const combinations = [...computeServiceErrorCombination(services).values()] + .filter(c => c.errorNames.includes(t.name)) + .map(c => `RSDError.${c.interfaceName}`) + .join(', '); if (t.resolvedContentType) { const type = toAPIType( @@ -44,40 +51,22 @@ function generateSource( artifactConfig.rootPackageName + '.model', fqn, ); - const objectType = toAPIType( - t.resolvedContentType, - artifactConfig.nativeTypeSubstitues, - artifactConfig.rootPackageName + '.model', - fqn, - { objectType: true }, - ); - node.append(`public class ${t.name}Exception extends RSDException.RSDStructuredDataException {`, NL); - node.indent(body => { - body.append(`private final ${type} data;`, NL, NL); - body.append(`public ${t.name}Exception(String message, ${type} data) {`, NL); - body.indent(method => { - method.append(`super(Type.${t.name}, message);`, NL); - method.append(`this.data = data;`, NL); - }); - body.append('}', NL); - body.append(`public ${objectType} data() {`, NL); - body.indent(method => { - method.append(`return this.data;`, NL); - }); - body.append('}', NL); - }); - node.append('}', NL); + return toNodeTree(` +public record ${t.name}(String message, ${type} data) implements RSDError, ${combinations} { + @Override + public Type type() { + return Type.${t.name}; + } +} +`); } else { - node.append(`public class ${t.name}Exception extends RSDException {`, NL); - node.indent(body => { - body.append(`public ${t.name}Exception(String message) {`, NL); - body.indent(method => { - method.append(`super(Type.${t.name}, message);`, NL); - }); - body.append('}', NL); - }); - node.append('}', NL); + return toNodeTree(` +public record ${t.name}(String message) implements RSDError, ${combinations} { + @Override + public Type type() { + return Type.${t.name}; + } +} +`); } - - return node; } diff --git a/dsl/packages/cli/src/java-client-api/generator.ts b/dsl/packages/cli/src/java-client-api/generator.ts index 50a89a6d..f63222c7 100644 --- a/dsl/packages/cli/src/java-client-api/generator.ts +++ b/dsl/packages/cli/src/java-client-api/generator.ts @@ -23,9 +23,10 @@ import { generateUnion } from './union.js'; import { generateService } from './service.js'; import { generateError } from './error.js'; import { generateMixin } from './mixin.js'; -import { generateRSDException } from './rsd-exception.js'; import { generateStreamDTO } from './stream-dto.js'; import { generateScalar } from './scalar.js'; +import { generateResult } from './result.js'; +import { generateServiceErrors } from './service-errors.js'; function generate( model: MResolvedRSDModel, @@ -40,14 +41,17 @@ function generate( } const result = model.elements.map(e => generateType(e, artifactConfig)).filter(isDefined); - result.push(...generateRSDException(model.errors, artifactConfig, artifactConfig.rootPackageName)); - result.push(...model.errors.map(e => generateError(e, artifactConfig, artifactConfig.rootPackageName))); + result.push(generateResult(artifactConfig)); + result.push(generateServiceErrors(artifactConfig, model.services, model.errors)); + result.push( + ...model.errors.map(e => generateError(e, model.services, artifactConfig, artifactConfig.rootPackageName)), + ); result.push(generateBase(artifactConfig)); result.push(generateBaseService(generatorConfig, artifactConfig)); result.push(generateClient(generatorConfig, artifactConfig, model)); result.push(generateFactory(generatorConfig, artifactConfig)); - result.push(...model.services.map(s => generateService(s, artifactConfig)).filter(isDefined)); + result.push(...model.services.map(s => generateService(s, model.services, artifactConfig)).filter(isDefined)); result.push(...generateStreamDTO(artifactConfig, model)); return result; diff --git a/dsl/packages/cli/src/java-client-api/result.ts b/dsl/packages/cli/src/java-client-api/result.ts new file mode 100644 index 00000000..35428ba9 --- /dev/null +++ b/dsl/packages/cli/src/java-client-api/result.ts @@ -0,0 +1,116 @@ +import { toString } from 'langium/generate'; + +import { Artifact } from '../artifact-generator.js'; +import { JavaClientAPIGeneratorConfig, toPath } from '../java-gen-utils.js'; +import { toNodeTree } from '../util.js'; + +export function generateResult(artifactConfig: JavaClientAPIGeneratorConfig): Artifact { + const packageName = artifactConfig.rootPackageName; + + const node = toNodeTree(` +// Generated by RSD - Do not modify +package ${packageName}; + +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; + +public sealed interface Result { + public boolean isOk(); + + public boolean isErr(); + + public Result onOk(Consumer consumer); + + public Result onErr(Consumer consumer); + + public Result or(Supplier> supplier); + + public default T orThrow() throws IllegalStateException { + return orThrow(e -> new IllegalStateException(String.valueOf(e))); + } + + public T orThrow(Function exceptionProvider) throws X; + + public record OK(T value) implements Result { + @Override + public boolean isOk() { + return true; + } + + @Override + public boolean isErr() { + return false; + } + + @Override + public Result onOk(Consumer consumer) { + consumer.accept(value); + return this; + } + + @Override + public Result onErr(Consumer consumer) { + return this; + } + + @Override + public Result or(Supplier> supplier) { + return this; + } + + @Override + public T orThrow(Function exceptionProvider) { + return value; + } + } + + public record ERR(E error) implements Result { + @Override + public boolean isOk() { + return false; + } + + @Override + public boolean isErr() { + return true; + } + + @Override + public Result onOk(Consumer consumer) { + return this; + } + + @Override + public Result onErr(Consumer consumer) { + consumer.accept(error); + return this; + } + + @Override + public Result or(Supplier> supplier) { + return supplier.get(); + } + + @Override + public T orThrow(Function exceptionProvider) throws X { + throw exceptionProvider.apply(error); + } + } + + public static Result ok(T value) { + return new OK<>(value); + } + + public static Result err(E error) { + return new ERR<>(error); + } +} +`); + + return { + name: 'Result.java', + content: toString(node, '\t'), + path: toPath(artifactConfig.targetFolder, packageName), + }; +} diff --git a/dsl/packages/cli/src/java-client-api/service-errors.ts b/dsl/packages/cli/src/java-client-api/service-errors.ts new file mode 100644 index 00000000..65391f8b --- /dev/null +++ b/dsl/packages/cli/src/java-client-api/service-errors.ts @@ -0,0 +1,91 @@ +import { CompositeGeneratorNode, NL, toString } from 'langium/generate'; + +import { Artifact } from '../artifact-generator.js'; +import { JavaClientAPIGeneratorConfig, toPath } from '../java-gen-utils.js'; +import { MResolvedError, MResolvedService } from '../model.js'; + +export type ServiceErrorCombination = { + interfaceName: string; + errorNames: readonly string[]; +}; + +export function computeServiceErrorCombination( + services: readonly MResolvedService[], +): Map { + const errorNames = new Map(); + services + .flatMap(s => s.operations) + .forEach(op => { + if (op.operationErrors.length > 0) { + const key = op.operationErrors + .map(e => e.error) + .toSorted((e1, e2) => e1.localeCompare(e2)) + .join(','); + if (!errorNames.has(key)) { + errorNames.set(key, { + interfaceName: `E${(errorNames.size + 1).toFixed()}`, + errorNames: op.operationErrors.map(e => e.error), + }); + } + } + }); + return errorNames; +} + +function generateTypeContent(errors: readonly MResolvedError[]) { + const node = new CompositeGeneratorNode(); + node.append('public enum Type {', NL); + node.indent(classBody => { + classBody.append('_Native,', NL); + if (errors.length > 0) { + classBody.append('_UnknownResponse,', NL); + } else { + classBody.append('_UnknownResponse;', NL); + } + errors + .map(e => e.name) + .toSorted((e1, e2) => e1.localeCompare(e2)) + .forEach((name, idx, arr) => { + classBody.append(name, idx + 1 < arr.length ? ',' : ';', NL); + }); + }); + node.append('}', NL, NL); + return node; +} + +export function generateServiceErrors( + artifactConfig: JavaClientAPIGeneratorConfig, + services: readonly MResolvedService[], + errors: readonly MResolvedError[], +): Artifact { + const packageName = artifactConfig.rootPackageName; + + const node = new CompositeGeneratorNode(); + node.append(`// Generated by RSD - Do not modify`, NL); + node.append(`package ${packageName};`, NL, NL); + node.append(`public interface RSDError {`, NL); + node.indent(body => { + body.append(generateTypeContent(errors)); + body.append('public Type type();', NL, NL); + const errorNames = [...computeServiceErrorCombination(services).values()]; + errorNames.forEach(({ interfaceName, errorNames }) => { + const errorList = errorNames.slice(); + body.append(`public sealed interface ${interfaceName} permits $GenericError, ${errorList.join(', ')} {`, NL); + body.append('}', NL, NL); + }); + body.append( + `public record $GenericError(Type type, String message, Throwable error) implements RSDError, ${ + errorNames.length > 0 ? errorNames.map(({ interfaceName }) => interfaceName).join(', ') : '' + } {`, + NL, + ); + body.append('}', NL); + }); + node.append('}', NL); + + return { + name: 'RSDError.java', + content: toString(node, '\t'), + path: toPath(artifactConfig.targetFolder, packageName), + }; +} diff --git a/dsl/packages/cli/src/java-client-api/service.ts b/dsl/packages/cli/src/java-client-api/service.ts index a69fb301..676426ba 100644 --- a/dsl/packages/cli/src/java-client-api/service.ts +++ b/dsl/packages/cli/src/java-client-api/service.ts @@ -9,10 +9,15 @@ import { toPath, computeParameterAPIType, } from '../java-gen-utils.js'; -import { MOperation, MParameter, MReturnType, MService } from '../model.js'; +import { MOperation, MOperationError, MParameter, MResolvedService, MReturnType, MService } from '../model.js'; import { toFirstUpper, toNode } from '../util.js'; +import { computeServiceErrorCombination } from './service-errors.js'; -export function generateService(s: MService, artifactConfig: JavaClientAPIGeneratorConfig): Artifact { +export function generateService( + s: MService, + services: readonly MResolvedService[], + artifactConfig: JavaClientAPIGeneratorConfig, +): Artifact { const packageName = artifactConfig.rootPackageName; const importCollector = new JavaImportsCollector(packageName); @@ -55,12 +60,12 @@ export function generateService(s: MService, artifactConfig: JavaClientAPIGenera s.operations.forEach(o => { let idx = o.parameters.findIndex(p => p.optional); if (idx === -1) { - toMethod(child, o, o.parameters, artifactConfig, fqn); + toMethod(child, o, services, o.parameters, artifactConfig, fqn); } else { for (idx; idx <= o.parameters.length; idx++) { const params = [...o.parameters]; params.length = idx; - toMethod(child, o, params, artifactConfig, fqn); + toMethod(child, o, services, params, artifactConfig, fqn); } } }); @@ -77,6 +82,7 @@ export function generateService(s: MService, artifactConfig: JavaClientAPIGenera function toMethod( child: IndentNode, o: MOperation, + services: readonly MResolvedService[], allParameters: readonly MParameter[], artifactConfig: JavaClientAPIGeneratorConfig, fqn: (type: string) => string, @@ -85,26 +91,22 @@ function toMethod( if (parameters.length <= 1) { child.append( toNode( - [`public ${toResultType(o.resultType, artifactConfig, fqn, o.name)} ${o.name}(${parameters.join(', ')})`], + [ + `public ${toResultType(o.resultType, o.operationErrors, services, artifactConfig, fqn, o.name)} ${o.name}(${parameters.join(', ')})`, + ], false, ), ); } else { child.append( toNode([ - `public ${toResultType(o.resultType, artifactConfig, fqn, o.name)} ${o.name}(`, + `public ${toResultType(o.resultType, o.operationErrors, services, artifactConfig, fqn, o.name)} ${o.name}(`, [parameters.filter((_, idx, arr) => idx + 1 < arr.length).map(p => p + ', ')], ]), ); child.indent(i1 => i1.indent(i2 => i2.append(parameters[parameters.length - 1] + ')'))); } - if (o.operationErrors.length > 0) { - child.append( - ' throws ' + - o.operationErrors.map((e, idx, arr) => fqn(`${artifactConfig.rootPackageName}.${e.error}Exception`)).join(', '), - ); - } child.append(';', NL); child.appendNewLine(); } @@ -128,13 +130,18 @@ function toParameter( function toResultType( type: MReturnType | undefined, + errors: readonly MOperationError[], + services: readonly MResolvedService[], artifactConfig: JavaClientAPIGeneratorConfig, fqn: (type: string) => string, methodName: string, ) { + const Result = fqn(`${artifactConfig.rootPackageName}.Result`); + const error = computeErrorType(errors, services, artifactConfig, fqn); + const dtoPkg = `${artifactConfig.rootPackageName}.model`; if (type === undefined) { - return 'void'; + return `${Result}`; } let rvType: string; @@ -157,12 +164,35 @@ function toResultType( rvType = fqn(`${dtoPkg}.${type.type}`); } } else { - rvType = resolveType(type.type, artifactConfig.nativeTypeSubstitues, fqn, type.array); + rvType = resolveType(type.type, artifactConfig.nativeTypeSubstitues, fqn, true); } if (type.array) { rvType = `${fqn('java.util.List')}<${rvType}>`; } - return rvType; + return `${Result}<${rvType}, ${error}>`; +} + +function computeErrorType( + errors: readonly MOperationError[], + services: readonly MResolvedService[], + artifactConfig: JavaClientAPIGeneratorConfig, + fqn: (type: string) => string, +) { + if (errors.length === 0) { + return fqn(`${artifactConfig.rootPackageName}.RSDError`) + '.$GenericError'; + } else { + const combinations = computeServiceErrorCombination(services); + const errorNames = errors + .map(e => e.error) + .sort() + .join(','); + const errorCombination = combinations.get(errorNames); + if (errorCombination) { + return fqn(`${artifactConfig.rootPackageName}.RSDError`) + `.${errorCombination.interfaceName}`; + } else { + return fqn(`${artifactConfig.rootPackageName}.RSDError`) + '.$GenericError'; + } + } } diff --git a/dsl/packages/cli/src/java-rest-client-jdk/client.ts b/dsl/packages/cli/src/java-rest-client-jdk/client.ts index c5694f4b..e90db1f2 100644 --- a/dsl/packages/cli/src/java-rest-client-jdk/client.ts +++ b/dsl/packages/cli/src/java-rest-client-jdk/client.ts @@ -33,7 +33,7 @@ export function generateClient( const HttpClient = fqn('java.net.http.HttpClient'); const Base = fqn(`${basePackage}.model._Base`); const BaseService = fqn(`${basePackage}.BaseService`); - const RSDException = fqn(`${basePackage}.RSDException`); + const RSDError = fqn(`${basePackage}.RSDError`); const HttpRequest = fqn('java.net.http.HttpRequest'); const HttpResponse = fqn('java.net.http.HttpResponse'); const Optional = fqn('java.util.Optional'); @@ -124,12 +124,12 @@ export function generateClient( } @Override - public void onError(String method, ${RSDException} error, Adaptable responseAdapter) { + public void onError(String method, ${RSDError} error, Adaptable responseAdapter) { // no-op } @Override - public void onCatch(String method, ${RSDException} error) { + public void onCatch(String method, ${RSDError} error) { // no-op } diff --git a/dsl/packages/cli/src/java-rest-client-jdk/generator.ts b/dsl/packages/cli/src/java-rest-client-jdk/generator.ts index b7a13178..b39fdd56 100644 --- a/dsl/packages/cli/src/java-rest-client-jdk/generator.ts +++ b/dsl/packages/cli/src/java-rest-client-jdk/generator.ts @@ -35,7 +35,7 @@ export function generate( result.push(generateJsonUtils(artifactConfig)); result.push(generateJDKHttpClientResponseUtils(artifactConfig, model)); result.push(...model.elements.flatMap(e => generateType(e, model, artifactConfig)).filter(isDefined)); - result.push(...model.services.flatMap(e => generateService(e, generatorConfig, artifactConfig))); + result.push(...model.services.flatMap(e => generateService(e, model.services, generatorConfig, artifactConfig))); result.push(...generateStreamImpls(artifactConfig, model)); result.push(...generateChangeSupport(artifactConfig)); result.push(...generateFormDataPublisherBuilder(artifactConfig, model)); diff --git a/dsl/packages/cli/src/java-rest-client-jdk/service.ts b/dsl/packages/cli/src/java-rest-client-jdk/service.ts index 99cfa268..064ae3bf 100644 --- a/dsl/packages/cli/src/java-rest-client-jdk/service.ts +++ b/dsl/packages/cli/src/java-rest-client-jdk/service.ts @@ -19,6 +19,7 @@ import { isMScalarType, MBuiltinType, MOperation, + MOperationError, MParameter, MResolvedOperation, MResolvedService, @@ -32,9 +33,11 @@ import { } from '../java-model-json/shared.js'; import { computePath } from '../rest-utils.js'; import { toCamelCaseIdentifier, toFirstUpper, toNodeTree } from '../util.js'; +import { computeServiceErrorCombination } from '../java-client-api/service-errors.js'; export function generateService( s: MResolvedService, + services: readonly MResolvedService[], generatorConfig: ArtifactGenerationConfig, artifactConfig: JavaRestClientJDKGeneratorConfig, ): Artifact[] { @@ -91,7 +94,7 @@ export function generateService( s.operations.forEach(o => { classBody.appendNewLine(); - generateOperation(classBody, s, o, artifactConfig, fqn, s.meta?.rest?.path ?? s.name.toLowerCase()); + generateOperation(classBody, s, o, services, artifactConfig, fqn, s.meta?.rest?.path ?? s.name.toLowerCase()); }); }); node.append('}', NL); @@ -144,33 +147,15 @@ function appendWithNullGuard( function appendMethodSignature( node: IndentNode, o: MResolvedOperation, + services: readonly MResolvedService[], allParameters: readonly MParameter[], artifactConfig: JavaRestClientJDKGeneratorConfig, fqn: (type: string) => string, ) { const parameters = allParameters.map(p => toParameter(p, artifactConfig, fqn, o.name)); - node.append(`public ${toResultType(o.resultType, artifactConfig, fqn, o.name)} ${o.name}(${parameters.join(', ')})`); - if (o.operationErrors.length > 0) { - node.appendNewLine(); - node.indent(throwBody => { - throwBody.indent(other => { - other.append( - 'throws ', - fqn(`${artifactConfig.rootPackageName}.${o.operationErrors[0].error}Exception`), - o.operationErrors.length > 1 ? ',' : '', - ); - if (o.operationErrors.length > 1) { - other.appendNewLine(); - } - o.operationErrors.slice(1).forEach((e, idx, arr) => { - other.append(fqn(`${artifactConfig.rootPackageName}.${e.error}Exception`), arr.length !== idx + 1 ? ',' : ''); - if (arr.length !== idx + 1) { - other.appendNewLine(); - } - }); - }); - }); - } + node.append( + `public ${toAPIResultType(o.resultType, o.operationErrors, services, artifactConfig, fqn, o.name)} ${o.name}(${parameters.join(', ')})`, + ); node.append(' {', NL); } @@ -363,6 +348,7 @@ function generateOperationMethod( node: IndentNode, s: MResolvedService, o: MResolvedOperation, + services: readonly MResolvedService[], allParameters: readonly MParameter[], artifactConfig: JavaRestClientJDKGeneratorConfig, fqn: (type: string) => string, @@ -371,7 +357,7 @@ function generateOperationMethod( ) { const URI = fqn('java.net.URI'); - appendMethodSignature(node, o, allParameters, artifactConfig, fqn); + appendMethodSignature(node, o, services, allParameters, artifactConfig, fqn); node.indent(methodBody => { const processedPath = computePath(`${path.replace(/^\//, '')}/${o.meta?.rest?.path ?? ''}`); const endpoint = processedPath.path ? `%s/${processedPath.path}` : '%s'; @@ -404,23 +390,19 @@ function generateOperationMethod( }); methodBody.append(`} catch (Exception e) {`, NL); methodBody.indent(catchBlock => { - const RSException = fqn(`${artifactConfig.rootPackageName}.RSDException`); - catchBlock.append(`if (e instanceof ${RSException} rsdEx) {`, NL); - catchBlock.indent(ifBlock => { - ifBlock.append('throw rsdEx;', NL); - }); - catchBlock.append('}', NL); catchBlock.append('if (e instanceof InterruptedException) {', NL); catchBlock.indent(interruptBlock => { interruptBlock.append('Thread.currentThread().interrupt();', NL); }); catchBlock.append('}', NL, NL); + const RSDError = fqn(`${artifactConfig.rootPackageName}.RSDError`); catchBlock.append( - `var $exception = new ${RSException}(${RSException}.Type._Native, "Unexpected error while executing operation ${o.name}", e);`, + `var $error = new ${RSDError}.$GenericError(${RSDError}.Type._Native, "Unexpected error while executing operation ${o.name}", e);`, NL, ); - catchBlock.append(`this.lifecycleHook.onCatch("${o.name}", $exception);`, NL); - catchBlock.append('throw $exception;', NL); + catchBlock.append(`this.lifecycleHook.onCatch("${o.name}", $error);`, NL); + const Result = fqn(`${artifactConfig.rootPackageName}.Result`); + catchBlock.append(`return ${Result}.err($error);`, NL); }); methodBody.append('} finally {', NL); methodBody.indent(finallyBlock => { @@ -768,22 +750,24 @@ function generateResponseDispatch( methodBody.append('}', NL); } - const RSDException = fqn(`${artifactConfig.rootPackageName}.RSDException`); + const RSDError = fqn(`${artifactConfig.rootPackageName}.RSDError`); methodBody.append( - `var $exception = new ${RSDException}(${RSDException}.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)));`, + `var $error = new ${RSDError}.$GenericError(${RSDError}.Type._UnknownResponse, String.format("Unsupported Http-Status '%s':\\n%s", $response.statusCode(), JDKHttpClientResponseUtils.toString($response)), null);`, NL, ); methodBody.append( - `this.lifecycleHook.onError("${o.name}", $exception, this.client.createResponseAdaptable($response));`, + `this.lifecycleHook.onError("${o.name}", $error, this.client.createResponseAdaptable($response));`, NL, ); - methodBody.append('throw $exception;', NL); + const Result = fqn(`${artifactConfig.rootPackageName}.Result`); + methodBody.append(`return ${Result}.err($error);`, NL); } function generateOperation( node: IndentNode, s: MResolvedService, o: MResolvedOperation, + services: readonly MResolvedService[], artifactConfig: JavaRestClientJDKGeneratorConfig, fqn: (type: string) => string, path: string, @@ -791,7 +775,7 @@ function generateOperation( const firstOptional = o.parameters.findIndex(p => p.optional); if (firstOptional === -1) { - generateOperationMethod(node, s, o, o.parameters, artifactConfig, fqn, path, false); + generateOperationMethod(node, s, o, services, o.parameters, artifactConfig, fqn, path, false); } else { const hasMultipleParams = o.parameters.filter(p => p.meta?.rest?.source === undefined).length > 1; for (let i = firstOptional; i <= o.parameters.length; i++) { @@ -799,7 +783,7 @@ function generateOperation( node.appendNewLine(); } const params = o.parameters.slice(0, i); - generateOperationMethod(node, s, o, params, artifactConfig, fqn, path, hasMultipleParams); + generateOperationMethod(node, s, o, services, params, artifactConfig, fqn, path, hasMultipleParams); } } } @@ -814,7 +798,8 @@ function handleOkResult( if (type === undefined) { node.append(`this.lifecycleHook.onSuccess("${o.name}", null, this.client.createResponseAdaptable($response));`, NL); - node.append('return;', NL); + const Result = fqn(`${artifactConfig.rootPackageName}.Result`); + node.append(`return ${Result}.ok(null);`, NL); return; } if (type.variant === 'stream') { @@ -869,7 +854,8 @@ function handleOkResult( } } node.append(`this.lifecycleHook.onSuccess("${o.name}", $rv, this.client.createResponseAdaptable($response));`, NL); - node.append('return $rv;', NL); + const Result = fqn(`${artifactConfig.rootPackageName}.Result`); + node.append(`return ${Result}.ok($rv);`, NL); } function builtinMapExpression(type: MBuiltinType, array: boolean): string { @@ -938,21 +924,15 @@ function handleErrorResult( `var $message = $response.headers().firstValue("X-RSD-Error-Message").orElse("Invocation of ${o.name} failed");`, NL, ); - node.append( - `var exception = new ${fqn(`${artifactConfig.rootPackageName}.${error}Exception`)}($message, $errorData);`, - NL, - ); + node.append(`var $error = new ${fqn(`${artifactConfig.rootPackageName}.${error}`)}($message, $errorData);`, NL); } else { node.append( - `var exception = new ${fqn(`${artifactConfig.rootPackageName}.${error}Exception`)}(JDKHttpClientResponseUtils.toString($response));`, + `var $error = new ${fqn(`${artifactConfig.rootPackageName}.${error}`)}(JDKHttpClientResponseUtils.toString($response));`, NL, ); } - node.append( - `this.lifecycleHook.onError("${o.name}", exception, this.client.createResponseAdaptable($response));`, - NL, - ); - node.append(`throw exception;`, NL); + node.append(`this.lifecycleHook.onError("${o.name}", $error, this.client.createResponseAdaptable($response));`, NL); + node.append(`return ${fqn(`${artifactConfig.rootPackageName}.Result`)}.err($error);`, NL); } function toParameter( @@ -1026,6 +1006,75 @@ function toResultType( return rvType; } +function toAPIResultType( + type: MReturnType | undefined, + errors: readonly MOperationError[], + services: readonly MResolvedService[], + artifactConfig: JavaRestClientJDKGeneratorConfig, + fqn: (type: string) => string, + methodName: string, +) { + const Result = fqn(`${artifactConfig.rootPackageName}.Result`); + const error = computeErrorType(errors, services, artifactConfig, fqn); + + const dtoPkg = `${artifactConfig.rootPackageName}.model`; + if (type === undefined) { + return `${Result}`; + } + + let rvType: string; + if (type.variant === 'stream') { + if (type.type === 'file') { + rvType = fqn(`${dtoPkg}.RSDFile`); + } else { + rvType = fqn(`${dtoPkg}.RSDBlob`); + } + } else if (type.variant === 'union' || type.variant === 'record') { + rvType = fqn(`${dtoPkg}.${type.type}`) + '.Data'; + } else if (type.variant === 'enum') { + rvType = fqn(`${dtoPkg}.${type.type}`); + } else if (type.variant === 'inline-enum') { + rvType = toFirstUpper(methodName) + '_Result$'; + } else if (type.variant === 'scalar') { + if (artifactConfig.nativeTypeSubstitues !== undefined && type.type in artifactConfig.nativeTypeSubstitues) { + rvType = fqn(artifactConfig.nativeTypeSubstitues[type.type]); + } else { + rvType = fqn(`${dtoPkg}.${type.type}`); + } + } else { + rvType = resolveType(type.type, artifactConfig.nativeTypeSubstitues, fqn, true); + } + + if (type.array) { + rvType = `${fqn('java.util.List')}<${rvType}>`; + } + + return `${Result}<${rvType}, ${error}>`; +} + +function computeErrorType( + errors: readonly MOperationError[], + services: readonly MResolvedService[], + artifactConfig: JavaRestClientJDKGeneratorConfig, + fqn: (type: string) => string, +) { + if (errors.length === 0) { + return fqn(`${artifactConfig.rootPackageName}.RSDError`) + '.$GenericError'; + } else { + const combinations = computeServiceErrorCombination(services); + const errorNames = errors + .map(e => e.error) + .sort() + .join(','); + const errorCombination = combinations.get(errorNames); + if (errorCombination) { + return fqn(`${artifactConfig.rootPackageName}.RSDError`) + `.${errorCombination.interfaceName}`; + } else { + return fqn(`${artifactConfig.rootPackageName}.RSDError`) + '.$GenericError'; + } + } +} + function generateServiceData( s: MResolvedService, o: MResolvedOperation, diff --git a/dsl/packages/cli/src/java-server/error.ts b/dsl/packages/cli/src/java-server/error.ts new file mode 100644 index 00000000..53dc40d6 --- /dev/null +++ b/dsl/packages/cli/src/java-server/error.ts @@ -0,0 +1,83 @@ +import { CompositeGeneratorNode, NL, toString } from 'langium/generate'; +import { Artifact } from '../artifact-generator.js'; +import { + generateCompilationUnit, + JavaImportsCollector, + JavaServerGeneratorConfig, + toAPIType, + toPath, +} from '../java-gen-utils.js'; +import { MResolvedError } from '../model.js'; + +export function generateError( + t: MResolvedError, + artifactConfig: JavaServerGeneratorConfig, + packageName: string, +): Artifact { + const importCollector = new JavaImportsCollector(packageName); + + return { + name: `${t.name}Exception.java`, + content: toString( + generateCompilationUnit( + packageName, + importCollector, + generateSource(t, artifactConfig, importCollector.importType.bind(importCollector)), + ), + '\t', + ), + path: toPath(artifactConfig.targetFolder, packageName), + }; +} + +function generateSource( + t: MResolvedError, + artifactConfig: JavaServerGeneratorConfig, + fqn: (type: string) => string, +): CompositeGeneratorNode { + const node = new CompositeGeneratorNode(); + + if (t.resolvedContentType) { + const type = toAPIType( + t.resolvedContentType, + artifactConfig.nativeTypeSubstitues, + artifactConfig.rootPackageName + '.model', + fqn, + ); + const objectType = toAPIType( + t.resolvedContentType, + artifactConfig.nativeTypeSubstitues, + artifactConfig.rootPackageName + '.model', + fqn, + { objectType: true }, + ); + node.append(`public class ${t.name}Exception extends RSDException.RSDStructuredDataException {`, NL); + node.indent(body => { + body.append(`private final ${type} data;`, NL, NL); + body.append(`public ${t.name}Exception(String message, ${type} data) {`, NL); + body.indent(method => { + method.append(`super(Type.${t.name}, message);`, NL); + method.append(`this.data = data;`, NL); + }); + body.append('}', NL); + body.append(`public ${objectType} data() {`, NL); + body.indent(method => { + method.append(`return this.data;`, NL); + }); + body.append('}', NL); + }); + node.append('}', NL); + } else { + node.append(`public class ${t.name}Exception extends RSDException {`, NL); + node.indent(body => { + body.append(`public ${t.name}Exception(String message) {`, NL); + body.indent(method => { + method.append(`super(Type.${t.name}, message);`, NL); + }); + body.append('}', NL); + }); + node.append('}', NL); + } + + return node; +} diff --git a/dsl/packages/cli/src/java-server/generator.ts b/dsl/packages/cli/src/java-server/generator.ts index 8776d58e..560d8546 100644 --- a/dsl/packages/cli/src/java-server/generator.ts +++ b/dsl/packages/cli/src/java-server/generator.ts @@ -16,13 +16,13 @@ import { generateBaseDTO } from './base-dto.js'; import { generateUnion } from './union.js'; import { generateDTOBuilderFactory } from './builder-factory.js'; import { generateMixin } from './mixin.js'; -import { generateRSDException } from '../java-client-api/rsd-exception.js'; -import { generateError } from '../java-client-api/error.js'; import { generateService } from './service.js'; import { generateServiceImpl } from './service-impl.js'; import { generateStreamDTO } from './stream-dto.js'; import { generateEnum } from './enum.js'; import { generateScalar } from './scalar.js'; +import { generateRSDException } from './rsd-exception.js'; +import { generateError } from './error.js'; export function generate( model: MResolvedRSDModel, diff --git a/dsl/packages/cli/src/java-client-api/rsd-exception.ts b/dsl/packages/cli/src/java-server/rsd-exception.ts similarity index 93% rename from dsl/packages/cli/src/java-client-api/rsd-exception.ts rename to dsl/packages/cli/src/java-server/rsd-exception.ts index 50c6ba52..efb8b667 100644 --- a/dsl/packages/cli/src/java-client-api/rsd-exception.ts +++ b/dsl/packages/cli/src/java-server/rsd-exception.ts @@ -1,16 +1,11 @@ import { CompositeGeneratorNode, NL, toString } from 'langium/generate'; import { Artifact } from '../artifact-generator.js'; -import { - generateCompilationUnit, - JavaClientAPIGeneratorConfig, - JavaImportsCollector, - toPath, -} from '../java-gen-utils.js'; +import { generateCompilationUnit, JavaServerGeneratorConfig, JavaImportsCollector, toPath } from '../java-gen-utils.js'; import { MError } from '../model.js'; export function generateRSDException( errors: readonly MError[], - artifactConfig: JavaClientAPIGeneratorConfig, + artifactConfig: JavaServerGeneratorConfig, packageName: string, ): Artifact[] { const importCollector = new JavaImportsCollector(packageName); From 7d56ffe52074fcaa491b5798b3acd7fa9f454b63 Mon Sep 17 00:00:00 2001 From: Tom Schindl Date: Thu, 25 Jun 2026 01:57:06 +0200 Subject: [PATCH 2/4] 25 - make sure we don't generate invalid java code --- dsl/packages/cli/src/java-client-api/error.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dsl/packages/cli/src/java-client-api/error.ts b/dsl/packages/cli/src/java-client-api/error.ts index fbedad13..9ada16cc 100644 --- a/dsl/packages/cli/src/java-client-api/error.ts +++ b/dsl/packages/cli/src/java-client-api/error.ts @@ -41,8 +41,8 @@ function generateSource( ): CompositeGeneratorNode { const combinations = [...computeServiceErrorCombination(services).values()] .filter(c => c.errorNames.includes(t.name)) - .map(c => `RSDError.${c.interfaceName}`) - .join(', '); + .map(c => `RSDError.${c.interfaceName}`); + combinations.unshift('RSDError'); if (t.resolvedContentType) { const type = toAPIType( @@ -52,7 +52,7 @@ function generateSource( fqn, ); return toNodeTree(` -public record ${t.name}(String message, ${type} data) implements RSDError, ${combinations} { +public record ${t.name}(String message, ${type} data) implements ${combinations.join(', ')} { @Override public Type type() { return Type.${t.name}; @@ -61,7 +61,7 @@ public record ${t.name}(String message, ${type} data) implements RSDError, ${com `); } else { return toNodeTree(` -public record ${t.name}(String message) implements RSDError, ${combinations} { +public record ${t.name}(String message) implements ${combinations.join(', ')} { @Override public Type type() { return Type.${t.name}; From 1ad1edd80a762516aca5a7e3123292369bffc05b Mon Sep 17 00:00:00 2001 From: Tom Schindl Date: Thu, 25 Jun 2026 02:03:47 +0200 Subject: [PATCH 3/4] 25 - make rsderror and sealed interface --- .../src/main/java/dev/rsdlang/sample/client/RSDError.java | 2 +- dsl/packages/cli/src/java-client-api/service-errors.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/RSDError.java b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/RSDError.java index d7a66faf..fafdb3ef 100644 --- a/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/RSDError.java +++ b/dsl/java-test/java-client/src/main/java/dev/rsdlang/sample/client/RSDError.java @@ -1,7 +1,7 @@ // Generated by RSD - Do not modify package dev.rsdlang.sample.client; -public interface RSDError { +public sealed interface RSDError permits RSDError.$GenericError, SampleError, SampleError2, SampleErrorBoolean, SampleErrorEnum, SampleErrorInt, SampleErrorScalar, SampleErrorScalarSub, SampleErrorUnion, SampleErrorWithValue { public enum Type { _Native, _UnknownResponse, diff --git a/dsl/packages/cli/src/java-client-api/service-errors.ts b/dsl/packages/cli/src/java-client-api/service-errors.ts index 65391f8b..53b6ee7f 100644 --- a/dsl/packages/cli/src/java-client-api/service-errors.ts +++ b/dsl/packages/cli/src/java-client-api/service-errors.ts @@ -60,10 +60,13 @@ export function generateServiceErrors( ): Artifact { const packageName = artifactConfig.rootPackageName; + const errs = errors.map(e => e.name).toSorted((e1, e2) => e1.localeCompare(e2)); + errs.unshift('RSDError.$GenericError'); + const node = new CompositeGeneratorNode(); node.append(`// Generated by RSD - Do not modify`, NL); node.append(`package ${packageName};`, NL, NL); - node.append(`public interface RSDError {`, NL); + node.append(`public sealed interface RSDError permits ${errs.join(', ')} {`, NL); node.indent(body => { body.append(generateTypeContent(errors)); body.append('public Type type();', NL, NL); From 8efca693e2b16d9a1fec71d7d378f829d465cc93 Mon Sep 17 00:00:00 2001 From: Tom Schindl Date: Thu, 25 Jun 2026 02:08:41 +0200 Subject: [PATCH 4/4] 25 - fix potential uncompilable java code --- dsl/packages/cli/src/java-client-api/service-errors.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsl/packages/cli/src/java-client-api/service-errors.ts b/dsl/packages/cli/src/java-client-api/service-errors.ts index 53b6ee7f..c331e728 100644 --- a/dsl/packages/cli/src/java-client-api/service-errors.ts +++ b/dsl/packages/cli/src/java-client-api/service-errors.ts @@ -77,8 +77,8 @@ export function generateServiceErrors( body.append('}', NL, NL); }); body.append( - `public record $GenericError(Type type, String message, Throwable error) implements RSDError, ${ - errorNames.length > 0 ? errorNames.map(({ interfaceName }) => interfaceName).join(', ') : '' + `public record $GenericError(Type type, String message, Throwable error) implements RSDError${ + errorNames.length > 0 ? ', ' + errorNames.map(({ interfaceName }) => interfaceName).join(', ') : '' } {`, NL, );