net.finmath.smartcontract.api.ValuationApi 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.MarginRequest;
import net.finmath.smartcontract.model.MarginResult;
import net.finmath.smartcontract.model.ValueRequest;
import net.finmath.smartcontract.model.ValueResult;
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 = "valuation", description = "the valuation API")
public interface ValuationApi {
default Optional getRequest() {
return Optional.empty();
}
/**
* POST /valuation/legacy/margin : Request mapping for the margin
*
* @param marginRequest (optional)
* @return Margin was calculated (status code 200)
* or unexpected error (status code 200)
*/
@Operation(
operationId = "legacyMargin",
summary = "Request mapping for the margin",
responses = {
@ApiResponse(responseCode = "200", description = "Margin was calculated", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = MarginResult.class))
}),
@ApiResponse(responseCode = "default", description = "unexpected error", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
})
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/valuation/legacy/margin",
produces = { "application/json" },
consumes = { "application/json" }
)
default ResponseEntity _legacyMargin(
@Parameter(name = "MarginRequest", description = "") @Valid @RequestBody(required = false) MarginRequest marginRequest
) {
return legacyMargin(marginRequest);
}
// Override this method
default ResponseEntity legacyMargin(MarginRequest marginRequest) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"valuationDate\" : \"valuationDate\", \"currency\" : \"currency\", \"value\" : 0.8008281904610115 }";
ApiUtil.setExampleResponse(request, "application/json", exampleString);
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
/**
* POST /valuation/margin : Request mapping for the value
*
* @param marginRequest (optional)
* @return Margin was calculated (status code 200)
* or unexpected error (status code 200)
*/
@Operation(
operationId = "margin",
summary = "Request mapping for the value",
responses = {
@ApiResponse(responseCode = "200", description = "Margin was calculated", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = MarginResult.class))
}),
@ApiResponse(responseCode = "default", description = "unexpected error", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
})
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/valuation/margin",
produces = { "application/json" },
consumes = { "application/json" }
)
default ResponseEntity _margin(
@Parameter(name = "MarginRequest", description = "") @Valid @RequestBody(required = false) MarginRequest marginRequest
) {
return margin(marginRequest);
}
// Override this method
default ResponseEntity margin(MarginRequest marginRequest) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"valuationDate\" : \"valuationDate\", \"currency\" : \"currency\", \"value\" : 0.8008281904610115 }";
ApiUtil.setExampleResponse(request, "application/json", exampleString);
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
/**
* POST /valuation/legacy/test/product : Request mapping for the value of a product (using fixed market data)
*
* @param tradeData (required)
* @return Value was calculated (status code 200)
* or unexpected error (status code 200)
*/
@Operation(
operationId = "testProductValue",
summary = "Request mapping for the value of a product (using fixed market data)",
responses = {
@ApiResponse(responseCode = "200", description = "Value was calculated", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = ValueResult.class))
}),
@ApiResponse(responseCode = "default", description = "unexpected error", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
})
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/valuation/legacy/test/product",
produces = { "application/json" },
consumes = { "multipart/form-data" }
)
default ResponseEntity _testProductValue(
@Parameter(name = "tradeData", description = "", required = true) @RequestPart(value = "tradeData", required = true) MultipartFile tradeData
) {
return testProductValue(tradeData);
}
// Override this method
default ResponseEntity testProductValue(MultipartFile tradeData) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"valuationDate\" : \"valuationDate\", \"currency\" : \"currency\", \"value\" : 0.8008281904610115 }";
ApiUtil.setExampleResponse(request, "application/json", exampleString);
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
/**
* POST /valuation/value : Request mapping for the value
*
* @param valueRequest (optional)
* @return Value was calculated (status code 200)
* or unexpected error (status code 200)
*/
@Operation(
operationId = "value",
summary = "Request mapping for the value",
responses = {
@ApiResponse(responseCode = "200", description = "Value was calculated", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = ValueResult.class))
}),
@ApiResponse(responseCode = "default", description = "unexpected error", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
})
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/valuation/value",
produces = { "application/json" },
consumes = { "application/json" }
)
default ResponseEntity _value(
@Parameter(name = "ValueRequest", description = "") @Valid @RequestBody(required = false) ValueRequest valueRequest
) {
return value(valueRequest);
}
// Override this method
default ResponseEntity value(ValueRequest valueRequest) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"valuationDate\" : \"valuationDate\", \"currency\" : \"currency\", \"value\" : 0.8008281904610115 }";
ApiUtil.setExampleResponse(request, "application/json", exampleString);
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
/**
* POST /valuation/valueAtTime : Request mapping for the value at specific evaluationTime
*
* @param valueRequest (optional)
* @return Value was calculated (status code 200)
* or unexpected error (status code 200)
*/
@Operation(
operationId = "valueAtTime",
summary = "Request mapping for the value at specific evaluationTime",
responses = {
@ApiResponse(responseCode = "200", description = "Value was calculated", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = ValueResult.class))
}),
@ApiResponse(responseCode = "default", description = "unexpected error", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = Error.class))
})
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/valuation/valueAtTime",
produces = { "application/json" },
consumes = { "application/json" }
)
default ResponseEntity _valueAtTime(
@Parameter(name = "ValueRequest", description = "") @Valid @RequestBody(required = false) ValueRequest valueRequest
) {
return valueAtTime(valueRequest);
}
// Override this method
default ResponseEntity valueAtTime(ValueRequest valueRequest) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"valuationDate\" : \"valuationDate\", \"currency\" : \"currency\", \"value\" : 0.8008281904610115 }";
ApiUtil.setExampleResponse(request, "application/json", exampleString);
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy