net.finmath.smartcontract.api.SettlementApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of finmath-smart-derivative-contract Show documentation
Show all versions of finmath-smart-derivative-contract Show documentation
Project to support the implementation a of smart derivative contract.
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.4.0).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package net.finmath.smartcontract.api;
import net.finmath.smartcontract.model.Error;
import net.finmath.smartcontract.model.InitialSettlementRequest;
import net.finmath.smartcontract.model.InitialSettlementResult;
import net.finmath.smartcontract.model.RegularSettlementRequest;
import net.finmath.smartcontract.model.RegularSettlementResult;
import io.swagger.v3.oas.annotations.ExternalDocumentation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import jakarta.annotation.Generated;
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-05T10:54:28.421239+01:00[Europe/Berlin]")
@Validated
@Tag(name = "settlement", description = "the settlement API")
public interface SettlementApi {
default Optional getRequest() {
return Optional.empty();
}
/**
* POST /settlement/generate-initial-settlement : generate an initial settlement xml based on given product xml
*
* @param initialSettlementRequest (optional)
* @return initial settlement xml was created (status code 200)
* or unexpected error (status code 200)
*/
@Operation(
operationId = "generateInitialSettlementResult",
summary = "generate an initial settlement xml based on given product xml",
responses = {
@ApiResponse(responseCode = "200", description = "initial settlement xml was created", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = InitialSettlementResult.class))
}),
@ApiResponse(responseCode = "default", description = "unexpected error", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
})
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/settlement/generate-initial-settlement",
produces = { "application/json" },
consumes = { "application/json" }
)
default ResponseEntity _generateInitialSettlementResult(
@Parameter(name = "InitialSettlementRequest", description = "") @Valid @RequestBody(required = false) InitialSettlementRequest initialSettlementRequest
) {
return generateInitialSettlementResult(initialSettlementRequest);
}
// Override this method
default ResponseEntity generateInitialSettlementResult(InitialSettlementRequest initialSettlementRequest) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"marginValue\" : 0.8008281904610115, \"valuationDate\" : \"valuationDate\", \"currency\" : \"currency\", \"generatedInitialSettlement\" : \"generatedInitialSettlement\" }";
ApiUtil.setExampleResponse(request, "application/json", exampleString);
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
/**
* POST /settlement/generate-regular-settlement : generate a regular settlement xml based on given settlement and product xml
*
* @param regularSettlementRequest (optional)
* @return regular settlement xml was created (status code 200)
* or unexpected error (status code 200)
*/
@Operation(
operationId = "generateRegularSettlementResult",
summary = "generate a regular settlement xml based on given settlement and product xml",
responses = {
@ApiResponse(responseCode = "200", description = "regular settlement xml was created", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = RegularSettlementResult.class))
}),
@ApiResponse(responseCode = "default", description = "unexpected error", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
})
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/settlement/generate-regular-settlement",
produces = { "application/json" },
consumes = { "application/json" }
)
default ResponseEntity _generateRegularSettlementResult(
@Parameter(name = "RegularSettlementRequest", description = "") @Valid @RequestBody(required = false) RegularSettlementRequest regularSettlementRequest
) {
return generateRegularSettlementResult(regularSettlementRequest);
}
// Override this method
default ResponseEntity generateRegularSettlementResult(RegularSettlementRequest regularSettlementRequest) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"marginValue\" : 0.8008281904610115, \"valuationDate\" : \"valuationDate\", \"currency\" : \"currency\", \"generatedRegularSettlement\" : \"generatedRegularSettlement\" }";
ApiUtil.setExampleResponse(request, "application/json", exampleString);
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy